Use userAutocompleter component for UserCF in the project settings. Further the projectID needs to be passed through. Otherwise the inviteButton does not know to which project the user should be added.
parent
c61430009e
commit
844d0ef8a7
@ -1,16 +1,13 @@ |
||||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; |
||||
import { |
||||
ChangeDetectionStrategy, |
||||
Component, |
||||
} from '@angular/core'; |
||||
import { FieldType } from '@ngx-formly/core'; |
||||
import idFromLink from 'core-app/features/hal/helpers/id-from-link'; |
||||
|
||||
@Component({ |
||||
selector: 'op-project-input', |
||||
templateUrl: './project-input.component.html', |
||||
changeDetection: ChangeDetectionStrategy.OnPush, |
||||
}) |
||||
export class ProjectInputComponent extends FieldType implements OnInit { |
||||
projectId:string|undefined; |
||||
|
||||
public ngOnInit():void { |
||||
this.projectId = idFromLink(this.model?.project?.href); |
||||
} |
||||
export class ProjectInputComponent extends FieldType { |
||||
} |
||||
|
@ -0,0 +1,9 @@ |
||||
<op-user-autocompleter |
||||
[formControl]="formControl" |
||||
[formlyAttributes]="field" |
||||
[attr.aria-required]="to.required" |
||||
[attr.required]="to.required" |
||||
[url]="to.allowedValuesHref" |
||||
[inviteUserToProject]="projectId" |
||||
> |
||||
</op-user-autocompleter> |
@ -0,0 +1,19 @@ |
||||
import { |
||||
ChangeDetectionStrategy, |
||||
Component, |
||||
OnInit, |
||||
} from '@angular/core'; |
||||
import { FieldType } from '@ngx-formly/core'; |
||||
|
||||
@Component({ |
||||
selector: 'op-user-input', |
||||
templateUrl: './user-input.component.html', |
||||
changeDetection: ChangeDetectionStrategy.OnPush, |
||||
}) |
||||
export class UserInputComponent extends FieldType implements OnInit { |
||||
projectId:string|undefined; |
||||
|
||||
public ngOnInit():void { |
||||
this.projectId = this.model?.id; |
||||
} |
||||
} |
Loading…
Reference in new issue