Skip to content

Commit

Permalink
Update test yaml file, fix unnecessary bulk call, and disable email f…
Browse files Browse the repository at this point in the history
…ield in resource modal
  • Loading branch information
pacna committed Mar 3, 2024
1 parent 8f08396 commit abf9e99
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h2>{{ title }}</h2>
</header>

<form [formGroup]="memberResourceManagementGroup" (ngSubmit)="submit()">
<form [formGroup]="memberResourceManagementGroup">
<mat-form-field appearance="outline">
<mat-label>Email</mat-label>
<input matInput type="email" formControlName="email" />
Expand All @@ -22,6 +22,7 @@ <h2>{{ title }}</h2>
<button
type="submit"
mat-raised-button
(click)="submit()"
[disabled]="!memberResourceManagementGroup.valid"
>
Submit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export class MemberResourceManagementComponent implements OnInit {
private _destroyRef: DestroyRef = inject<DestroyRef>(DestroyRef);
title: string = '';
memberResourceManagementGroup: FormGroup = new FormGroup({
email: new FormControl<string>(null, [Validators.required]),
email: new FormControl<string>({ value: '', disabled: true }, [
Validators.required,
]),
resourceID: new FormControl<string>(null, [Validators.required]),
});
resourcesObs$: Observable<MemberResource[]>;
Expand All @@ -65,9 +67,10 @@ export class MemberResourceManagementComponent implements OnInit {
let resourceService$: Observable<void> = null;

if (this.dialogData.resources) {
resourceService$ = this.resourceService.removeMemberFromResource(
this.memberResourceManagementGroup.value
);
resourceService$ = this.resourceService.removeMemberFromResource({
email: this.memberResourceManagementGroup.get('email').value,
resourceID: this.memberResourceManagementGroup.get('resourceID').value,
});
} else {
resourceService$ = this.resourceService.bulkAddMembersToResource({
emails: [this.memberResourceManagementGroup.get('email').value],
Expand Down

0 comments on commit abf9e99

Please sign in to comment.