From 0c291bf79b1b4007bd3a5a2204cf3679b848395e Mon Sep 17 00:00:00 2001 From: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com> Date: Mon, 8 Apr 2024 13:24:27 -0500 Subject: [PATCH] [AC-2086] Limit admin access - Collection Modal (#8335) * feat: add view collection string, update button text, refs AC-2086 * feat: remove canEdit from Restricted Collection Access component, refs AC-2086 * feat: add view collection clicked flow, refs AC-2086 * fix: revert accidental svg icon changes, refs AC-2086 * feat: add input for access selector to hide multi select, refs AC-2086 * feat: apply readonly/disabled changes to access dialog, refs AC-2086 * fix: messages file conflict, refs AC-2086 * feat: apply disabled state to access selector, refs AC-2086 * fix: formatting, refs AC-2086 * fix: permission mode read only relocate, refs AC-2086 * fix: conform readonly casing, refs AC-2086 --- .../access-selector.component.html | 6 +- .../access-selector.component.ts | 8 ++ .../collection-dialog.component.html | 39 +++++--- .../collection-dialog.component.ts | 93 +++++++++++++++++-- .../collection-access-restricted.component.ts | 11 +-- .../app/vault/org-vault/vault.component.html | 6 +- .../app/vault/org-vault/vault.component.ts | 13 ++- apps/web/src/locales/en/messages.json | 6 ++ 8 files changed, 145 insertions(+), 37 deletions(-) diff --git a/apps/web/src/app/admin-console/organizations/shared/components/access-selector/access-selector.component.html b/apps/web/src/app/admin-console/organizations/shared/components/access-selector/access-selector.component.html index 16a24781df..f4c9c840ef 100644 --- a/apps/web/src/app/admin-console/organizations/shared/components/access-selector/access-selector.component.html +++ b/apps/web/src/app/admin-console/organizations/shared/components/access-selector/access-selector.component.html @@ -22,7 +22,7 @@ - + {{ selectorLabelText }}
@@ -139,7 +139,7 @@ `, }) export class CollectionAccessRestrictedComponent { protected icon = icon; - @Input() canEdit = false; - - @Output() editInfoClicked = new EventEmitter(); + @Output() viewCollectionClicked = new EventEmitter(); } diff --git a/apps/web/src/app/vault/org-vault/vault.component.html b/apps/web/src/app/vault/org-vault/vault.component.html index 391f412f1e..bcbd56630c 100644 --- a/apps/web/src/app/vault/org-vault/vault.component.html +++ b/apps/web/src/app/vault/org-vault/vault.component.html @@ -99,11 +99,9 @@ diff --git a/apps/web/src/app/vault/org-vault/vault.component.ts b/apps/web/src/app/vault/org-vault/vault.component.ts index d7cc70c583..cb01951fcc 100644 --- a/apps/web/src/app/vault/org-vault/vault.component.ts +++ b/apps/web/src/app/vault/org-vault/vault.component.ts @@ -1058,9 +1058,18 @@ export class VaultComponent implements OnInit, OnDestroy { } } - async editCollection(c: CollectionView, tab: CollectionDialogTabType): Promise { + async editCollection( + c: CollectionView, + tab: CollectionDialogTabType, + readonly: boolean = false, + ): Promise { const dialog = openCollectionDialog(this.dialogService, { - data: { collectionId: c?.id, organizationId: this.organization?.id, initialTab: tab }, + data: { + collectionId: c?.id, + organizationId: this.organization?.id, + initialTab: tab, + readonly: readonly, + }, }); const result = await lastValueFrom(dialog.closed); diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index 1604057f70..307c5be70c 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -7501,6 +7501,9 @@ "collectionAccessRestricted": { "message": "Collection access is restricted" }, + "readOnlyCollectionAccess": { + "message": "You do not have access to manage this collection." + }, "grantCollectionAccess": { "message": "Grant groups or members access to this collection." }, @@ -7603,6 +7606,9 @@ "providerPortal": { "message": "Provider Portal" }, + "viewCollection": { + "message": "View collection" + }, "restrictedGroupAccess": { "message": "You cannot add yourself to groups." },