From 5e4259db38b4515258ffdd6769f91e8d374ecbab Mon Sep 17 00:00:00 2001 From: hinton Date: Sun, 24 May 2020 19:59:49 +0200 Subject: [PATCH 1/3] Add support for hidden password --- src/background/main.background.ts | 2 +- src/popup/components/action-buttons.component.html | 2 +- src/popup/components/action-buttons.component.ts | 4 ++++ src/popup/vault/add-edit.component.html | 12 ++++++++---- src/popup/vault/view.component.html | 8 +++++--- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/background/main.background.ts b/src/background/main.background.ts index 890fea89dc..4b79d337f3 100644 --- a/src/background/main.background.ts +++ b/src/background/main.background.ts @@ -577,7 +577,7 @@ export default class MainBackground { }); } - if (cipher == null || (cipher.login.password && cipher.login.password !== '')) { + if (cipher == null || (cipher.login.password && cipher.login.password !== '' && cipher.viewPassword)) { await this.contextMenusCreate({ type: 'normal', id: 'copy-password_' + idSuffix, diff --git a/src/popup/components/action-buttons.component.html b/src/popup/components/action-buttons.component.html index 276666fb97..54039a3057 100644 --- a/src/popup/components/action-buttons.component.html +++ b/src/popup/components/action-buttons.component.html @@ -13,7 +13,7 @@ + [ngClass]="{disabled: (!cipher.login.password || !cipher.viewPassword)}"> diff --git a/src/popup/components/action-buttons.component.ts b/src/popup/components/action-buttons.component.ts index 0401b41e33..4158564b5e 100644 --- a/src/popup/components/action-buttons.component.ts +++ b/src/popup/components/action-buttons.component.ts @@ -53,6 +53,10 @@ export class ActionButtonsComponent { return; } + if (!cipher.viewPassword) { + return; + } + this.analytics.eventTrack.next({ action: 'Copied ' + aType }); this.platformUtilsService.copyToClipboard(value, { window: window }); this.toasterService.popAsync('info', null, diff --git a/src/popup/vault/add-edit.component.html b/src/popup/vault/add-edit.component.html index bd11fca90e..8f60d108f6 100644 --- a/src/popup/vault/add-edit.component.html +++ b/src/popup/vault/add-edit.component.html @@ -40,24 +40,28 @@
+ name="Login.Password" [(ngModel)]="cipher.login.password" appInputVerbatim + [disabled]="!cipher.viewPassword">
+ appA11yTitle="{{'toggleVisibility' | i18n}}" (click)="togglePassword()" + *ngIf="cipher.viewPassword"> + appA11yTitle="{{'generatePassword' | i18n}}" (click)="generatePassword()" + *ngIf="cipher.viewPassword">
diff --git a/src/popup/vault/view.component.html b/src/popup/vault/view.component.html index 8b989c4c6a..f29c29df69 100644 --- a/src/popup/vault/view.component.html +++ b/src/popup/vault/view.component.html @@ -46,19 +46,21 @@
+ (click)="togglePassword()" *ngIf="cipher.viewPassword"> + (click)="copy(cipher.login.password, 'password', 'Password')" + *ngIf="cipher.viewPassword">
From d88ed609aaf5d306ac8de8b7390e6f99e2ea2fbf Mon Sep 17 00:00:00 2001 From: hinton Date: Wed, 3 Jun 2020 21:25:55 +0200 Subject: [PATCH 2/3] Disable TOTP field, disable edit and show of hidden fields. --- src/popup/vault/add-edit.component.html | 10 ++++++---- src/popup/vault/view.component.html | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/popup/vault/add-edit.component.html b/src/popup/vault/add-edit.component.html index 8f60d108f6..bbe9906ff4 100644 --- a/src/popup/vault/add-edit.component.html +++ b/src/popup/vault/add-edit.component.html @@ -68,8 +68,8 @@
- +
@@ -297,11 +297,13 @@ *ngIf="f.type === fieldType.Text" placeholder="{{'value' | i18n}}" appInputVerbatim> + *ngIf="f.type === fieldType.Hidden" placeholder="{{'value' | i18n}}" + [disabled]="!cipher.viewPassword && !f.newField"> -
+