diff --git a/jslib b/jslib index 22f0f97cda0..45ba6293711 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 22f0f97cda0286859ceb889b9c80b9b5bb88affa +Subproject commit 45ba62937114689ff981818d384b391195d62ec6 diff --git a/src/popup2/app-routing.module.ts b/src/popup2/app-routing.module.ts index 66dd4892f8e..548d3a7302b 100644 --- a/src/popup2/app-routing.module.ts +++ b/src/popup2/app-routing.module.ts @@ -18,6 +18,7 @@ import { TabsComponent } from './tabs.component'; import { CiphersComponent } from './vault/ciphers.component'; import { CurrentTabComponent } from './vault/current-tab.component'; import { GroupingsComponent } from './vault/groupings.component'; +import { ViewComponent } from './vault/view.component'; const routes: Routes = [ { path: '', redirectTo: '/tabs/current', pathMatch: 'full' }, @@ -31,6 +32,7 @@ const routes: Routes = [ { path: 'hint', component: HintComponent }, { path: 'environment', component: EnvironmentComponent }, { path: 'ciphers', component: CiphersComponent }, + { path: 'view-cipher', component: ViewComponent }, { path: 'tabs', component: TabsComponent, children: [ diff --git a/src/popup2/app.module.ts b/src/popup2/app.module.ts index 4e5f67c8198..ac7132f3f09 100644 --- a/src/popup2/app.module.ts +++ b/src/popup2/app.module.ts @@ -27,6 +27,7 @@ import { TabsComponent } from './tabs.component'; import { CiphersComponent } from './vault/ciphers.component'; import { CurrentTabComponent } from './vault/current-tab.component'; import { GroupingsComponent } from './vault/groupings.component'; +import { ViewComponent } from './vault/view.component'; import { ApiActionDirective } from 'jslib/angular/directives/api-action.directive'; import { AutofocusDirective } from 'jslib/angular/directives/autofocus.directive'; @@ -85,7 +86,8 @@ import { IconComponent } from 'jslib/angular/components/icon.component'; StopPropDirective, TabsComponent, TwoFactorOptionsComponent, - TwoFactorComponent + TwoFactorComponent, + ViewComponent, ], entryComponents: [ diff --git a/src/popup2/vault/ciphers.component.html b/src/popup2/vault/ciphers.component.html index f4c6a4c2db9..691e5dcea4a 100644 --- a/src/popup2/vault/ciphers.component.html +++ b/src/popup2/vault/ciphers.component.html @@ -21,7 +21,8 @@ Some name here
- +
diff --git a/src/popup2/vault/ciphers.component.ts b/src/popup2/vault/ciphers.component.ts index 243986d887d..7705165d783 100644 --- a/src/popup2/vault/ciphers.component.ts +++ b/src/popup2/vault/ciphers.component.ts @@ -20,7 +20,8 @@ import { CiphersComponent as BaseCiphersComponent } from 'jslib/angular/componen template: template, }) export class CiphersComponent extends BaseCiphersComponent implements OnInit { - constructor(cipherService: CipherService, private route: ActivatedRoute) { + constructor(cipherService: CipherService, private route: ActivatedRoute, + private router: Router) { super(cipherService); } @@ -41,5 +42,6 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit { selectCipher(cipher: CipherView) { super.selectCipher(cipher); + this.router.navigate(['/view-cipher'], { queryParams: { cipherId: cipher.id } }); } } diff --git a/src/popup2/vault/view.component.html b/src/popup2/vault/view.component.html new file mode 100644 index 00000000000..79e1c22020f --- /dev/null +++ b/src/popup2/vault/view.component.html @@ -0,0 +1,252 @@ +
+
+ +
+
+ {{'viewItem' | i18n}} +
+
+ +
+
+ +
+
+ {{'itemInformation' | i18n}} +
+
+
+ {{'name' | i18n}} + {{cipher.name}} +
+ +
+
+
+ {{'username' | i18n}} + {{cipher.login.username}} +
+
+ + + +
+
+
+
+ {{'password' | i18n}} + {{cipher.login.maskedPassword}} + {{cipher.login.password}} +
+
+ + + + + + + +
+
+
+
+ {{'verificationCodeTotp' | i18n}} + {{totpCodeFormatted}} +
+ + {{totpSec}} + + + + + + + +
+ + + +
+
+
+ +
+
+ {{'cardholderName' | i18n}} + {{cipher.card.cardholderName}} +
+
+
+ {{'number' | i18n}} + {{cipher.card.number}} +
+
+ + + +
+
+
+ {{'brand' | i18n}} + {{cipher.card.brand}} +
+
+ {{'expiration' | i18n}} + {{cipher.card.expiration}} +
+
+
+ {{'securityCode' | i18n}} + {{cipher.card.code}} +
+
+ + + +
+
+
+ +
+
+ {{'identityName' | i18n}} + {{cipher.identity.fullName}} +
+
+ {{'username' | i18n}} + {{cipher.identity.username}} +
+
+ {{'company' | i18n}} + {{cipher.identity.company}} +
+
+ {{'ssn' | i18n}} + {{cipher.identity.ssn}} +
+
+ {{'passportNumber' | i18n}} + {{cipher.identity.passportNumber}} +
+
+ {{'licenseNumber' | i18n}} + {{cipher.identity.licenseNumber}} +
+
+ {{'email' | i18n}} + {{cipher.identity.email}} +
+
+ {{'phone' | i18n}} + {{cipher.identity.phone}} +
+
+ {{'address' | i18n}} +
{{cipher.identity.address1}}
+
{{cipher.identity.address2}}
+
{{cipher.identity.address3}}
+
+ {{cipher.identity.city || '-'}}, + {{cipher.identity.state || '-'}}, + {{cipher.identity.postalCode || '-'}} +
+
{{cipher.identity.country}}
+
+
+
+
+
+
+
+
+ {{'uri' | i18n}} + {{'website' | i18n}} + {{u.domainOrUri}} +
+ +
+
+
+
+
+ {{'notes' | i18n}} +
+
+
{{cipher.notes}}
+
+
+
+
+ {{'customFields' | i18n}} +
+
+
+
+ {{field.name}} +
+ {{field.value || ' '}} +
+
+ {{field.value}} + {{field.maskedValue}} +
+
+ + +
+
+ +
+
+
+ +
diff --git a/src/popup2/vault/view.component.ts b/src/popup2/vault/view.component.ts new file mode 100644 index 00000000000..dd69b0e348d --- /dev/null +++ b/src/popup2/vault/view.component.ts @@ -0,0 +1,61 @@ +import * as template from './view.component.html'; + +import { Location } from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; + +import { ToasterService } from 'angular2-toaster'; +import { Angulartics2 } from 'angulartics2'; + +import { AuditService } from 'jslib/abstractions/audit.service'; +import { CipherService } from 'jslib/abstractions/cipher.service'; +import { CryptoService } from 'jslib/abstractions/crypto.service'; +import { I18nService } from 'jslib/abstractions/i18n.service'; +import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; +import { TokenService } from 'jslib/abstractions/token.service'; +import { TotpService } from 'jslib/abstractions/totp.service'; + +import { ViewComponent as BaseViewComponent } from 'jslib/angular/components/view.component'; + +@Component({ + selector: 'app-vault-view', + template: template, +}) +export class ViewComponent extends BaseViewComponent implements OnInit { + constructor(cipherService: CipherService, totpService: TotpService, + tokenService: TokenService, toasterService: ToasterService, + cryptoService: CryptoService, platformUtilsService: PlatformUtilsService, + i18nService: I18nService, analytics: Angulartics2, + auditService: AuditService, private route: ActivatedRoute, + private router: Router, private location: Location) { + super(cipherService, totpService, tokenService, toasterService, cryptoService, platformUtilsService, + i18nService, analytics, auditService); + } + + ngOnInit() { + this.route.queryParams.subscribe(async (params) => { + if (params.cipherId) { + this.cipherId = params.cipherId; + } else { + this.close(); + } + + await this.load(); + }); + } + + edit() { + super.edit(); + this.router.navigate(['/edit-cipher'], { queryParams: { cipherId: this.cipher.id } }); + } + + close() { + this.location.back(); + } +}