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
Merge remote-tracking branch 'origin/release/11.2' into dev
Oliver Günther744fc0546df6
diff --cc frontend/src/app/helpers/angular/inject-field.decorator.tsindex ac9e0b521e1,83cc9198d12..80637b27427--- a/frontend/src/app/helpers/angular/inject-field.decorator.ts+++ b/frontend/src/app/helpers/angular/inject-field.decorator.ts@@@ -1,6 -1,6 +1,6 @@@import "reflect-metadata";- import { Injector } from "@angular/core";-import {InjectFlags, Injector} from "@angular/core";-import {debugLog} from "core-app/helpers/debug_output";++import { InjectFlags,Injector } from "@angular/core";+import { debugLog } from "core-app/helpers/debug_output";export interface InjectableClass {injector:Injector;diff --cc frontend/src/app/modules/fields/edit/field-types/select-edit-field.component.tsindex ec4205c6f3b,204d507974d..6530047f7f8--- a/frontend/src/app/modules/fields/edit/field-types/select-edit-field.component.ts+++ b/frontend/src/app/modules/fields/edit/field-types/select-edit-field.component.ts@@@ -26,18 -26,19 +26,20 @@@// See docs/COPYRIGHT.rdoc for more details.//++- import { Component, OnInit } from '@angular/core';-import {Component, InjectFlags, OnInit} from "@angular/core";-import {HalResourceSortingService} from "core-app/modules/hal/services/hal-resource-sorting.service";-import {CollectionResource} from "core-app/modules/hal/resources/collection-resource";-import {HalResource} from "core-app/modules/hal/resources/hal-resource";-import {EditFieldComponent} from "../edit-field.component";-import {CreateAutocompleterComponent} from "core-app/modules/common/autocomplete/create-autocompleter.component";-import {SelectAutocompleterRegisterService} from "app/modules/fields/edit/field-types/select-autocompleter-register.service";-import {from} from 'rxjs';-import {map, tap} from 'rxjs/operators';-import {HalResourceNotificationService} from "core-app/modules/hal/services/hal-resource-notification.service";-import {InjectField} from "core-app/helpers/angular/inject-field.decorator";++import { Component, InjectFlags, OnInit } from '@angular/core';+import { HalResourceSortingService } from 'core-app/modules/hal/services/hal-resource-sorting.service';+import { CollectionResource } from 'core-app/modules/hal/resources/collection-resource';+import { HalResource } from 'core-app/modules/hal/resources/hal-resource';+import { EditFieldComponent } from '../edit-field.component';+import { SelectAutocompleterRegisterService } from 'app/modules/fields/edit/field-types/select-autocompleter-register.service';+import { from } from 'rxjs';+import { map, tap } from 'rxjs/operators';+import { HalResourceNotificationService } from 'core-app/modules/hal/services/hal-resource-notification.service';+import { InjectField } from 'core-app/helpers/angular/inject-field.decorator';+import { PermissionsService } from 'core-app/core/services/permissions/permissions.service';+import { CreateAutocompleterComponent } from "core-app/modules/autocompleter/create-autocompleter/create-autocompleter.component";+ import {EditFormComponent} from "core-app/modules/fields/edit/edit-form/edit-form.component";+ import {StateService} from "@uirouter/core";export interface ValueOption {name:string;@@@ -51,7 -52,8 +53,9 @@@ export class SelectEditFieldComponent e@InjectField() selectAutocompleterRegister:SelectAutocompleterRegisterService;@InjectField() halNotification:HalResourceNotificationService;@InjectField() halSorting:HalResourceSortingService;+ @InjectField() permissionsService:PermissionsService;+ @InjectField() $state:StateService;+ @InjectField(EditFormComponent, null, InjectFlags.Optional) editFormComponent:EditFormComponent;public availableOptions:any[];public valueOptions:ValueOption[];@@@ -106,37 -116,24 +110,39 @@@});});+ this._syncUrlParamsOnChangeIfNeeded(this.handler.fieldName, this.editFormComponent?.editMode);- }+- public get selectedOption() {- const href = this.value ? this.value.$href : null;- return _.find(this.valueOptions, o => o.$href === href)!;}- public set selectedOption(val:ValueOption) {- let option = _.find(this.availableOptions, o => o.$href === val.$href);+ protected initialize() {+ this.text = {+ requiredPlaceholder: this.I18n.t('js.placeholders.selection'),+ placeholder: this.I18n.t('js.placeholders.default')+ };- // Special case 'null' value, which angular- // only understands in ng-options as an empty string.- if (option && option.$href === '') {- option.$href = null;+ this.valuesLoadingPromise = this.change.getForm().then(() => {+ return this.initialValueLoading();+ });++ this.initializeShowAddButton();+ }++ initializeShowAddButton() {+ if (this.schema.type === 'User') {+ this.permissionsService+ .canInviteUsersToProject()+ .subscribe(canInviteUsersToProject => this.showAddNewButton = canInviteUsersToProject);}+ }- this.value = option;+ protected initialValueLoading() {+ this.valuesLoaded = false;+ return this.loadValues().toPromise();+ }++ public autocompleterComponent() {+ const type = this.schema.type;+ return this.selectAutocompleterRegister.getAutocompleterOfAttribute(type) || CreateAutocompleterComponent;}private setValues(availableValues:HalResource[]) {