From 29b370961e1e0284c54e2d923bf84f4a0662f902 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 12 Jun 2020 12:50:39 -0400 Subject: [PATCH] Cleanup current uris selection list (#1294) --- jslib | 2 +- src/_locales/en/messages.json | 8 ++++++++ src/popup/vault/add-edit.component.html | 27 ++++++++++++++----------- src/popup/vault/add-edit.component.ts | 7 ++++--- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/jslib b/jslib index 2b6657a293..28d21ca5df 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 2b6657a293e7be107271ad080c64ccd3f005afb7 +Subproject commit 28d21ca5dfacd1487cd92345d8be9554079fbd96 diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 5ba5ad3f55..64a62017bb 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -1154,6 +1154,14 @@ "toggleOptions": { "message": "Toggle Options" }, + "toggleCurrentUris": { + "message": "Toggle Current URIs", + "description": "Toggle the display of the URIs of the currently open tabs in the browser." + }, + "currentUri": { + "message": "Current URI", + "description": "The URI of one of the current open tabs in the browser." + }, "organization": { "message": "Organization", "description": "An entity of multiple related people (ex. a team or business organization)." diff --git a/src/popup/vault/add-edit.component.html b/src/popup/vault/add-edit.component.html index 5db371ea00..8a4e95c1c5 100644 --- a/src/popup/vault/add-edit.component.html +++ b/src/popup/vault/add-edit.component.html @@ -69,7 +69,8 @@
+ class="monospaced" [(ngModel)]="cipher.login.totp" appInputVerbatim + [disabled]="!cipher.viewPassword">
@@ -218,12 +219,15 @@
- + +
- - + + @@ -393,4 +396,4 @@
- \ No newline at end of file + diff --git a/src/popup/vault/add-edit.component.ts b/src/popup/vault/add-edit.component.ts index 5d9e90c37e..0a37849b52 100644 --- a/src/popup/vault/add-edit.component.ts +++ b/src/popup/vault/add-edit.component.ts @@ -27,7 +27,7 @@ import { AddEditComponent as BaseAddEditComponent } from 'jslib/angular/componen templateUrl: 'add-edit.component.html', }) export class AddEditComponent extends BaseAddEditComponent { - uriOptions: any[]; + currentUris: string[]; showAttachments = true; constructor(cipherService: CipherService, folderService: FolderService, @@ -84,7 +84,8 @@ export class AddEditComponent extends BaseAddEditComponent { if (!this.editMode) { const tabs = await BrowserApi.tabsQuery({ windowType: 'normal' }); - this.uriOptions = tabs.filter((tab) => tab.url); + this.currentUris = tabs == null ? null : + tabs.filter((tab) => tab.url != null && tab.url !== '').map((tab) => tab.url); } window.setTimeout(() => { @@ -158,6 +159,6 @@ export class AddEditComponent extends BaseAddEditComponent { toggleUriInput(uri: LoginUriView) { const u = (uri as any); - u.showUriOptionsInput = !u.showUriOptionsInput; + u.showCurrentUris = !u.showCurrentUris; } }