From 1060775cadd07b30e20a5a236cbd9a55f4aa1c9d Mon Sep 17 00:00:00 2001 From: Shawn Beachy Date: Fri, 26 Apr 2019 09:07:57 -0400 Subject: [PATCH] Add a "launch site" button directly to the list of ciphers (#384) * Add a button to launch the primary uri for a site straight from the list. * Take cues from the add-edit component on properly checking if we can launch. * Move the launch button to the dropdown menu. * Take LoginView as launch parameter instead of LoginUriView. --- src/app/vault/ciphers.component.html | 7 ++++++- src/app/vault/ciphers.component.ts | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/app/vault/ciphers.component.html b/src/app/vault/ciphers.component.html index 297ca38496..1154d7e357 100644 --- a/src/app/vault/ciphers.component.html +++ b/src/app/vault/ciphers.component.html @@ -34,6 +34,11 @@ {{'copyPassword' | i18n}} + + + {{'launch' | i18n}} + {{'attachments' | i18n}} @@ -71,4 +76,4 @@ {{'addItem' | i18n}} - + \ No newline at end of file diff --git a/src/app/vault/ciphers.component.ts b/src/app/vault/ciphers.component.ts index 5bba338ace..b36468365d 100644 --- a/src/app/vault/ciphers.component.ts +++ b/src/app/vault/ciphers.component.ts @@ -19,6 +19,7 @@ import { CiphersComponent as BaseCiphersComponent } from 'jslib/angular/componen import { CipherType } from 'jslib/enums/cipherType'; import { CipherView } from 'jslib/models/view/cipherView'; +import { LoginView } from 'jslib/models/view/loginView'; const MaxCheckedCount = 500; @@ -50,6 +51,15 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy (c as any).checked = select == null ? !(c as any).checked : select; } + launch(view: LoginView) { + if (!view.canLaunch) { + return; + } + + this.platformUtilsService.eventTrack('Launched Login URI'); + this.platformUtilsService.launchUri(view.launchUri); + } + selectAll(select: boolean) { if (select) { this.selectAll(false);