From c2ed6383c68b8fbdaacce61709ea51d45124f45d Mon Sep 17 00:00:00 2001 From: Shane Melton Date: Thu, 8 Feb 2024 09:35:38 -0800 Subject: [PATCH] [AC-2117] Update access selector to update permission list when flexible collections flag is updated (#7847) --- .../access-selector/access-selector.component.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/admin-console/organizations/shared/components/access-selector/access-selector.component.ts b/apps/web/src/app/admin-console/organizations/shared/components/access-selector/access-selector.component.ts index 69f1713186a..5166f66c930 100644 --- a/apps/web/src/app/admin-console/organizations/shared/components/access-selector/access-selector.component.ts +++ b/apps/web/src/app/admin-console/organizations/shared/components/access-selector/access-selector.component.ts @@ -192,7 +192,12 @@ export class AccessSelectorComponent implements ControlValueAccessor, OnInit, On /** * Enable Flexible Collections changes (feature flag) */ - @Input() flexibleCollectionsEnabled: boolean; + @Input() set flexibleCollectionsEnabled(value: boolean) { + this._flexibleCollectionsEnabled = value; + this.permissionList = getPermissionList(value); + } + + private _flexibleCollectionsEnabled: boolean; constructor( private readonly formBuilder: FormBuilder, @@ -257,7 +262,7 @@ export class AccessSelectorComponent implements ControlValueAccessor, OnInit, On } async ngOnInit() { - this.permissionList = getPermissionList(this.flexibleCollectionsEnabled); + this.permissionList = getPermissionList(this._flexibleCollectionsEnabled); // Watch the internal formArray for changes and propagate them this.selectionList.formArray.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((v) => { if (!this.notifyOnChange || this.pauseChangeNotification) {