1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00

[AC-2483] Added new Add Access UI to the collection dialog for AC (#9090)

* added new Add Access UI to the collection dialog for AC
This commit is contained in:
Jason Ng
2024-05-15 14:27:15 -04:00
committed by GitHub
parent 25f55e1368
commit db2f60b684
4 changed files with 33 additions and 1 deletions

View File

@@ -59,6 +59,7 @@ export interface CollectionDialogParams {
*/
limitNestedCollections?: boolean;
readonly?: boolean;
isAddAccessCollection?: boolean;
}
export interface CollectionDialogResult {
@@ -100,6 +101,7 @@ export class CollectionDialogComponent implements OnInit, OnDestroy {
});
protected PermissionMode = PermissionMode;
protected showDeleteButton = false;
protected showAddAccessWarning = false;
constructor(
@Inject(DIALOG_DATA) private params: CollectionDialogParams,
@@ -251,6 +253,7 @@ export class CollectionDialogComponent implements OnInit, OnDestroy {
this.handleFormGroupReadonly(this.dialogReadonly);
this.loading = false;
this.showAddAccessWarning = this.handleAddAccessWarning(flexibleCollectionsV1);
},
);
}
@@ -362,6 +365,18 @@ export class CollectionDialogComponent implements OnInit, OnDestroy {
this.destroy$.complete();
}
private handleAddAccessWarning(flexibleCollectionsV1: boolean): boolean {
if (
flexibleCollectionsV1 &&
!this.organization?.allowAdminAccessToAllCollectionItems &&
this.params.isAddAccessCollection
) {
return true;
}
return false;
}
private handleFormGroupReadonly(readonly: boolean) {
if (readonly) {
this.formGroup.controls.name.disable();