From a48773ae4f34bbeb617393119aa2f63ec04e0ab7 Mon Sep 17 00:00:00 2001 From: SmithThe4th Date: Fri, 6 Sep 2024 12:55:26 -0400 Subject: [PATCH] [PM-11692] [PM-11693] [PM-11694] Fixed defects with browser refresh trash component (#10911) * Added animation when viewing item in trash * Fixed A11y to announce delete forever * Route to vault page after restore or delete action is performed --- apps/browser/src/popup/app-routing.animations.ts | 3 +++ .../components/vault-v2/view-v2/view-v2.component.html | 2 +- .../trash-list-items-container.component.ts | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/browser/src/popup/app-routing.animations.ts b/apps/browser/src/popup/app-routing.animations.ts index 3da6fdef19..90990ea832 100644 --- a/apps/browser/src/popup/app-routing.animations.ts +++ b/apps/browser/src/popup/app-routing.animations.ts @@ -202,6 +202,9 @@ export const routerTransition = trigger("routerTransition", [ transition("vault-settings => trash", inSlideLeft), transition("trash => vault-settings", outSlideRight), + transition("trash => view-cipher", inSlideLeft), + transition("view-cipher => trash", outSlideRight), + // Appearance settings transition("tabs => appearance", inSlideLeft), transition("appearance => tabs", outSlideRight), diff --git a/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.html b/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.html index 2595a6459c..a778d6aaea 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.html +++ b/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.html @@ -33,7 +33,7 @@ type="button" buttonType="danger" bitIconButton="bwi-trash" - [appA11yTitle]="'delete' | i18n" + [appA11yTitle]="(cipher.isDeleted ? 'deleteForever' : 'delete') | i18n" > diff --git a/apps/browser/src/vault/popup/settings/trash-list-items-container/trash-list-items-container.component.ts b/apps/browser/src/vault/popup/settings/trash-list-items-container/trash-list-items-container.component.ts index c5fea3c2b8..6d3bfc2483 100644 --- a/apps/browser/src/vault/popup/settings/trash-list-items-container/trash-list-items-container.component.ts +++ b/apps/browser/src/vault/popup/settings/trash-list-items-container/trash-list-items-container.component.ts @@ -57,6 +57,8 @@ export class TrashListItemsContainerComponent { async restore(cipher: CipherView) { try { await this.cipherService.restoreWithServer(cipher.id); + + await this.router.navigate(["/vault"]); this.toastService.showToast({ variant: "success", title: null, @@ -86,10 +88,12 @@ export class TrashListItemsContainerComponent { try { await this.cipherService.deleteWithServer(cipher.id); + + await this.router.navigate(["/vault"]); this.toastService.showToast({ variant: "success", title: null, - message: this.i18nService.t("deletedItem"), + message: this.i18nService.t("permanentlyDeletedItem"), }); } catch (e) { this.logService.error(e);