From 97bf4594244bef036469520045cec8a017624c51 Mon Sep 17 00:00:00 2001
From: Nick Krantz <125900171+nick-livefront@users.noreply.github.com>
Date: Fri, 18 Oct 2024 14:57:08 -0500
Subject: [PATCH 1/8] [PM-13251] Password History (#11618)
* add password history view component in vault lib
* integrate PasswordHistoryView into individual vault
* add password history v2 to browser extension
* update color of password history link
* add check for `cipherId` before rendering password history
---
apps/browser/src/popup/app-routing.module.ts | 6 +-
.../vault-password-history-v2.component.html | 8 ++
...ault-password-history-v2.component.spec.ts | 56 +++++++++++
.../vault-password-history-v2.component.ts | 50 ++++++++++
.../password-history.component.html | 29 +-----
.../password-history.component.ts | 79 +++------------
apps/web/src/locales/en/messages.json | 3 +
.../item-history-v2.component.html | 2 +-
.../password-history-view.component.html | 28 ++++++
.../password-history-view.component.spec.ts | 97 +++++++++++++++++++
.../password-history-view.component.ts | 77 +++++++++++++++
libs/vault/src/index.ts | 1 +
12 files changed, 337 insertions(+), 99 deletions(-)
create mode 100644 apps/browser/src/vault/popup/components/vault-v2/vault-password-history-v2/vault-password-history-v2.component.html
create mode 100644 apps/browser/src/vault/popup/components/vault-v2/vault-password-history-v2/vault-password-history-v2.component.spec.ts
create mode 100644 apps/browser/src/vault/popup/components/vault-v2/vault-password-history-v2/vault-password-history-v2.component.ts
create mode 100644 libs/vault/src/components/password-history-view/password-history-view.component.html
create mode 100644 libs/vault/src/components/password-history-view/password-history-view.component.spec.ts
create mode 100644 libs/vault/src/components/password-history-view/password-history-view.component.ts
diff --git a/apps/browser/src/popup/app-routing.module.ts b/apps/browser/src/popup/app-routing.module.ts
index 1a95ad7483..a6d91d0187 100644
--- a/apps/browser/src/popup/app-routing.module.ts
+++ b/apps/browser/src/popup/app-routing.module.ts
@@ -100,6 +100,7 @@ import { ViewComponent } from "../vault/popup/components/vault/view.component";
import { AddEditV2Component } from "../vault/popup/components/vault-v2/add-edit/add-edit-v2.component";
import { AssignCollections } from "../vault/popup/components/vault-v2/assign-collections/assign-collections.component";
import { AttachmentsV2Component } from "../vault/popup/components/vault-v2/attachments/attachments-v2.component";
+import { PasswordHistoryV2Component } from "../vault/popup/components/vault-v2/vault-password-history-v2/vault-password-history-v2.component";
import { ViewV2Component } from "../vault/popup/components/vault-v2/view-v2/view-v2.component";
import { AppearanceV2Component } from "../vault/popup/settings/appearance-v2.component";
import { AppearanceComponent } from "../vault/popup/settings/appearance.component";
@@ -259,12 +260,11 @@ const routes: Routes = [
canActivate: [authGuard],
data: { state: "view-cipher" } satisfies RouteDataProperties,
}),
- {
+ ...extensionRefreshSwap(PasswordHistoryComponent, PasswordHistoryV2Component, {
path: "cipher-password-history",
- component: PasswordHistoryComponent,
canActivate: [authGuard],
data: { state: "cipher-password-history" } satisfies RouteDataProperties,
- },
+ }),
...extensionRefreshSwap(AddEditComponent, AddEditV2Component, {
path: "add-cipher",
canActivate: [authGuard, debounceNavigationGuard()],
diff --git a/apps/browser/src/vault/popup/components/vault-v2/vault-password-history-v2/vault-password-history-v2.component.html b/apps/browser/src/vault/popup/components/vault-v2/vault-password-history-v2/vault-password-history-v2.component.html
new file mode 100644
index 0000000000..d4ff0662fe
--- /dev/null
+++ b/apps/browser/src/vault/popup/components/vault-v2/vault-password-history-v2/vault-password-history-v2.component.html
@@ -0,0 +1,8 @@
+ {{ "noPasswordsInList" | i18n }}
{{ "noPasswordsInList" | i18n }}
+