From 9778cd73dfefd07927704945a0129bc5a31b8026 Mon Sep 17 00:00:00 2001 From: SmithThe4th Date: Tue, 26 Sep 2023 16:13:33 -0400 Subject: [PATCH] [PM-3810] Unify Passkeys view (#6335) * Removed standalone fido2key view, update login view to show created date when a fido2key is present, reverted icon component to previous state without fido2key type, removed filters to handle standalone fido2key as login type * Allow duplication * Removed launchable behaviours from fido2 key view * Reworked desktop views from standalone fido2keys to unified fido2keys in the login * Reworked web views from standalone fido2keys to unified fido2keys in the login * Fixed test case to not create standalone fido2keys * Updated views to use fido2key creation date * removed unused locale * moved logic from template to class * Removed fido2key ciphertype * Removed fido2key ciphertype references --- apps/browser/src/_locales/en/messages.json | 6 -- .../components/action-buttons.component.html | 38 --------- .../components/vault/add-edit.component.html | 39 +-------- .../vault/vault-filter.component.html | 6 +- .../vault/vault-filter.component.ts | 15 +--- .../components/vault/vault-items.component.ts | 20 +---- .../components/vault/view.component.html | 59 +------------ apps/desktop/src/locales/en/messages.json | 6 -- .../vault/app/vault/add-edit.component.html | 39 +-------- .../src/vault/app/vault/vault.component.ts | 10 +-- .../src/vault/app/vault/view.component.html | 54 +----------- .../emergency-add-edit.component.ts | 7 +- .../vault-cipher-row.component.html | 13 --- .../vault-items/vault-items.component.ts | 5 +- .../individual-vault/add-edit.component.html | 85 +------------------ .../individual-vault/add-edit.component.ts | 13 ++- .../shared/models/filter-function.spec.ts | 11 --- .../shared/models/filter-function.ts | 7 +- .../shared/models/vault-filter.model.spec.ts | 22 ----- .../shared/models/vault-filter.model.ts | 8 +- .../app/vault/org-vault/add-edit.component.ts | 7 +- apps/web/src/locales/en/messages.json | 6 -- .../angular/src/components/share.component.ts | 32 ------- .../src/vault/components/icon.component.ts | 32 ++++--- .../models/vault-filter.model.spec.ts | 13 --- .../vault-filter/models/vault-filter.model.ts | 8 +- libs/common/src/vault/enums/cipher-type.ts | 1 - .../src/vault/models/view/cipher.view.ts | 2 - .../src/vault/models/view/fido2-key.view.ts | 8 -- .../fido2/fido2-authenticator.service.spec.ts | 8 +- 30 files changed, 64 insertions(+), 516 deletions(-) diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index 4b15ef44e8a..507bdc63257 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -2425,15 +2425,9 @@ "application": { "message": "Application" }, - "passkeyEditInformation": { - "message": "You cannot edit passkey application because it would invalidate the passkey." - }, "duplicatePasskey": { "message": "A passkey with this ID already exists in this organization." }, - "passkeyTwoStepLogin": { - "message": "Available for two-step login" - }, "passkeyNotCopied": { "message": "Passkey will not be copied" }, diff --git a/apps/browser/src/vault/popup/components/action-buttons.component.html b/apps/browser/src/vault/popup/components/action-buttons.component.html index c1afffd508c..f63c1f1ac32 100644 --- a/apps/browser/src/vault/popup/components/action-buttons.component.html +++ b/apps/browser/src/vault/popup/components/action-buttons.component.html @@ -100,41 +100,3 @@ - - - - - diff --git a/apps/browser/src/vault/popup/components/vault/add-edit.component.html b/apps/browser/src/vault/popup/components/vault/add-edit.component.html index 7b4b1204479..b337d4e47b5 100644 --- a/apps/browser/src/vault/popup/components/vault/add-edit.component.html +++ b/apps/browser/src/vault/popup/components/vault/add-edit.component.html @@ -21,9 +21,6 @@

{{ "itemInformation" | i18n }}

-
@@ -138,7 +135,8 @@
{{ "typePasskey" | i18n }} - {{ "passkeyTwoStepLogin" | i18n }} + {{ "dateCreated" | i18n }} + {{ cipher.login.fido2Keys[0].creationDate | date : "short" }}
@@ -475,39 +473,6 @@ />
- -
-
- - -
-
- {{ "typePasskey" | i18n }} - {{ "dateCreated" | i18n }} {{ cipher.creationDate | date : "short" }} -
- -
-
-
- - -
-
-
-
diff --git a/apps/browser/src/vault/popup/components/vault/vault-filter.component.html b/apps/browser/src/vault/popup/components/vault/vault-filter.component.html index 2065181ba25..564cf19f2c4 100644 --- a/apps/browser/src/vault/popup/components/vault/vault-filter.component.html +++ b/apps/browser/src/vault/popup/components/vault/vault-filter.component.html @@ -70,9 +70,9 @@
{{ "typeLogin" | i18n }}
- {{ - getTypeCountsSum(typeCounts, cipherType.Login, cipherType.Fido2Key) - }} + + {{ typeCounts.get(cipherType.Login) || 0 }} + - - - - - -
@@ -619,8 +569,7 @@ *ngIf=" cipher.type !== cipherType.SecureNote && !cipher.isDeleted && - (!this.inPopout || this.loadAction) && - cipher.type != cipherType.Fido2Key + (!this.inPopout || this.loadAction) " >
@@ -649,7 +598,7 @@ class="box-content-row" appStopClick (click)="clone()" - *ngIf="!cipher.organizationId && !cipher.isDeleted && cipher.type != cipherType.Fido2Key" + *ngIf="!cipher.organizationId && !cipher.isDeleted" >
@@ -458,24 +459,6 @@ />
- -
-
- - -
-
- {{ "typePasskey" | i18n }} - {{ "dateCreated" | i18n }} {{ cipher.creationDate | date : "short" }} -
-
@@ -556,24 +539,6 @@
- -
-
-
- - -
-
- -
diff --git a/apps/desktop/src/vault/app/vault/vault.component.ts b/apps/desktop/src/vault/app/vault/vault.component.ts index 08a97a15a61..194cee098f7 100644 --- a/apps/desktop/src/vault/app/vault/vault.component.ts +++ b/apps/desktop/src/vault/app/vault/vault.component.ts @@ -286,7 +286,7 @@ export class VaultComponent implements OnInit, OnDestroy { this.editCipher(cipher); }), }); - if (!cipher.organizationId && !cipher.fido2Key?.rpId) { + if (!cipher.organizationId) { menu.push({ label: this.i18nService.t("clone"), click: () => @@ -357,14 +357,6 @@ export class VaultComponent implements OnInit, OnDestroy { }); } break; - case CipherType.Fido2Key: - if (cipher.fido2Key.canLaunch) { - menu.push({ - label: this.i18nService.t("launch"), - click: () => this.platformUtilsService.launchUri(cipher.fido2Key.launchUri), - }); - } - break; default: break; } diff --git a/apps/desktop/src/vault/app/vault/view.component.html b/apps/desktop/src/vault/app/vault/view.component.html index ad953246aa0..80fcdfff7d6 100644 --- a/apps/desktop/src/vault/app/vault/view.component.html +++ b/apps/desktop/src/vault/app/vault/view.component.html @@ -121,7 +121,7 @@
{{ "typePasskey" | i18n }} - {{ "passkeyTwoStepLogin" | i18n }} + {{ "dateCreated" | i18n }} {{ cipher.login.fido2Keys[0].creationDate | date : "short" }}
{{ cipher.identity.country }}
- -
-
-
- {{ "username" | i18n }} - {{ cipher.fido2Key.userDisplayName }} -
-
-
- {{ "typePasskey" | i18n }} - {{ "dateCreated" | i18n }} {{ cipher.creationDate | date : "short" }} -
-
@@ -483,43 +470,6 @@
{{ cipher.notes }}
-
-
-
-
- - - - -
-
- - -
-
-
-
diff --git a/apps/web/src/app/auth/settings/emergency-access/emergency-add-edit.component.ts b/apps/web/src/app/auth/settings/emergency-access/emergency-add-edit.component.ts index 925ebbf3ea6..9bdca5d793c 100644 --- a/apps/web/src/app/auth/settings/emergency-access/emergency-add-edit.component.ts +++ b/apps/web/src/app/auth/settings/emergency-access/emergency-add-edit.component.ts @@ -1,3 +1,4 @@ +import { DatePipe } from "@angular/common"; import { Component } from "@angular/core"; import { AuditService } from "@bitwarden/common/abstractions/audit.service"; @@ -47,7 +48,8 @@ export class EmergencyAddEditComponent extends BaseAddEditComponent { organizationService: OrganizationService, logService: LogService, sendApiService: SendApiService, - dialogService: DialogService + dialogService: DialogService, + datePipe: DatePipe ) { super( cipherService, @@ -66,7 +68,8 @@ export class EmergencyAddEditComponent extends BaseAddEditComponent { logService, passwordRepromptService, sendApiService, - dialogService + dialogService, + datePipe ); } diff --git a/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.html b/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.html index cccecb0b5af..e19c91d9c09 100644 --- a/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.html +++ b/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.html @@ -99,19 +99,6 @@ {{ "launch" | i18n }} - - - - - {{ "launch" | i18n }} - - - - - - -
- -
- -
-
- - -
-
- -
- -
- - -
-
- {{ "passkeyEditInformation" | i18n }} -
-
-