OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#61466] show hover cards in WP multi select CFs
Tobias Dillmannce6248b69c40
diff --git a/frontend/src/app/shared/components/fields/edit/field-types/multi-select-edit-field.component.html b/frontend/src/app/shared/components/fields/edit/field-types/multi-select-edit-field.component.htmlindex 975542bd651..fb876a5777b 100644--- a/frontend/src/app/shared/components/fields/edit/field-types/multi-select-edit-field.component.html+++ b/frontend/src/app/shared/components/fields/edit/field-types/multi-select-edit-field.component.html@@ -21,6 +21,8 @@<ng-template ng-option-tmp let-item="item"><spanclass="ng-option-label ellipsis"+ [attr.data-hover-card-trigger-target]="getHoverCardTriggerTarget()"+ [attr.data-hover-card-url]="getHoverCardUrl(item)"[textContent]="item.name"[ngStyle]="{'padding-left.px': item.depth * 16}"></span>diff --git a/frontend/src/app/shared/components/fields/edit/field-types/multi-select-edit-field.component.ts b/frontend/src/app/shared/components/fields/edit/field-types/multi-select-edit-field.component.tsindex d718bfc7e75..1f1c9f5b48f 100644--- a/frontend/src/app/shared/components/fields/edit/field-types/multi-select-edit-field.component.ts+++ b/frontend/src/app/shared/components/fields/edit/field-types/multi-select-edit-field.component.ts@@ -34,6 +34,7 @@ import { EditFieldComponent } from 'core-app/shared/components/fields/edit/edit-import { ValueOption } from 'core-app/shared/components/fields/edit/field-types/select-edit-field/select-edit-field.component';import { NgSelectComponent } from '@ng-select/ng-select';import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';+import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';@Component({templateUrl: './multi-select-edit-field.component.html',@@ -43,6 +44,8 @@ export class MultiSelectEditFieldComponent extends EditFieldComponent implements@InjectField() I18n!:I18nService;+ @InjectField() pathHelperService:PathHelperService;+public availableOptions:any[] = [];public text = {@@ -223,4 +226,30 @@ export class MultiSelectEditFieldComponent extends EditFieldComponent implementsthis.currentValueInvalid = !!this.schema.required;}}++ /**+ * For multi-select fields that are of type User, we want to show a hover card when hovering over users in the+ * dropdown. For this to happen we must register a trigger target.+ */+ protected getHoverCardTriggerTarget() {+ if (this.schema?.type === '[]User') {+ return 'trigger';+ } else {+ return '';+ }+ }++ /**+ * For multi-select fields that are of type User, we want to show a hover card when hovering over users in the+ * dropdown. For this to happen we must define a URL for the hover card.+ */+ protected getHoverCardUrl(item:any) {+ if (item && item.id) {+ return this.pathHelperService.userHoverCardPath(item.id);+ }++ return '';+ }++ protected readonly getComputedStyle = getComputedStyle;}