Skip to content

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

Fix failing spec

Benjamin Bädorf3e52f8dda16f
diff --git a/app/views/members/_member_form.html.erb b/app/views/members/_member_form.html.erb
index 2ed13339a08..bbcb556fdfc 100644
--- a/app/views/members/_member_form.html.erb
+++ b/app/views/members/_member_form.html.erb
@@ -47,7 +47,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= hidden_field_tag "member[user_ids][]", nil %>
<%= angular_component_tag 'members-autocompleter',
inputs: {
- updateInput: "member[user_ids][]",
+ updateInputSelector: "member[user_ids][]",
url: autocomplete_for_member_project_members_path + '.json',
appendTo: "body",
multiple: true
diff --git a/frontend/src/app/shared/components/autocompleter/user-autocompleter/user-autocompleter.component.ts b/frontend/src/app/shared/components/autocompleter/user-autocompleter/user-autocompleter.component.ts
index 66abb30adbf..c97ddaf883c 100644
--- a/frontend/src/app/shared/components/autocompleter/user-autocompleter/user-autocompleter.component.ts
+++ b/frontend/src/app/shared/components/autocompleter/user-autocompleter/user-autocompleter.component.ts
@@ -78,10 +78,12 @@ export class UserAutocompleterComponent implements OnInit {
@Input() public initialSelection:number|null = null;
- @Input() public additionalFilters:{ selector:string; operator:FilterOperator, values:string[] }[];
+ @Input() public additionalFilters:{ selector:string; operator:FilterOperator, values:string[] }[] = [];
public inputFilters:ApiV3FilterBuilder = new ApiV3FilterBuilder();
+ @Input() public updateInputSelector:string;
+
// Update an input field after changing, used when externally loaded
private updateInputField:HTMLInputElement|undefined;
@@ -104,10 +106,8 @@ export class UserAutocompleterComponent implements OnInit {
}
ngOnInit() {
- const input = this.elementRef.nativeElement.dataset.updateInput;
-
- if (input) {
- this.updateInputField = document.getElementsByName(input)[0] as HTMLInputElement|undefined;
+ if (this.updateInputSelector) {
+ this.updateInputField = document.getElementsByName(this.updateInputSelector)[0] as HTMLInputElement|undefined;
this.setInitialSelection();
}