diff --git a/jslib b/jslib index 9df96a3288..b21cb789da 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 9df96a3288510a5b92837d93513d9981336d0229 +Subproject commit b21cb789da2f93a36908cdfb0dba6e701102b87d diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 5a4776c529..08ae31222e 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -1053,5 +1053,13 @@ }, "default": { "message": "Default" + }, + "dateUpdated": { + "message": "Updated", + "description": "ex. Date this item was updated" + }, + "datePasswordUpdated": { + "message": "Password Updated", + "description": "ex. Date this password was updated" } } diff --git a/src/popup/app-routing.animations.ts b/src/popup/app-routing.animations.ts index d0407e7145..07fa15d5c0 100644 --- a/src/popup/app-routing.animations.ts +++ b/src/popup/app-routing.animations.ts @@ -108,8 +108,8 @@ export const routerTransition = trigger('routerTransition', [ transition('tabs => view-cipher, ciphers => view-cipher', inSlideUp), transition('view-cipher => tabs, view-cipher => ciphers', outSlideDown), - transition('view-cipher => edit-cipher', inSlideUp), - transition('edit-cipher => view-cipher, edit-cipher => tabs', outSlideDown), + transition('view-cipher => edit-cipher, view-cipher => cipher-password-history', inSlideUp), + transition('edit-cipher => view-cipher, cipher-password-history => view-cipher, edit-cipher => tabs', outSlideDown), transition('tabs => add-cipher, ciphers => add-cipher', inSlideUp), transition('add-cipher => tabs, add-cipher => ciphers', outSlideDown), diff --git a/src/popup/app-routing.module.ts b/src/popup/app-routing.module.ts index d09db52783..eb432645e8 100644 --- a/src/popup/app-routing.module.ts +++ b/src/popup/app-routing.module.ts @@ -32,6 +32,7 @@ import { AttachmentsComponent } from './vault/attachments.component'; import { CiphersComponent } from './vault/ciphers.component'; import { CurrentTabComponent } from './vault/current-tab.component'; import { GroupingsComponent } from './vault/groupings.component'; +import { PasswordHistoryComponent } from './vault/password-history.component'; import { ViewComponent } from './vault/view.component'; const routes: Routes = [ @@ -104,6 +105,12 @@ const routes: Routes = [ canActivate: [AuthGuardService], data: { state: 'view-cipher' }, }, + { + path: 'cipher-password-history', + component: PasswordHistoryComponent, + canActivate: [AuthGuardService], + data: { state: 'cipher-password-history' }, + }, { path: 'add-cipher', component: AddEditComponent, diff --git a/src/popup/app.module.ts b/src/popup/app.module.ts index 202beb7963..8a3c4fddad 100644 --- a/src/popup/app.module.ts +++ b/src/popup/app.module.ts @@ -39,6 +39,7 @@ import { AttachmentsComponent } from './vault/attachments.component'; import { CiphersComponent } from './vault/ciphers.component'; import { CurrentTabComponent } from './vault/current-tab.component'; import { GroupingsComponent } from './vault/groupings.component'; +import { PasswordHistoryComponent } from './vault/password-history.component'; import { ViewComponent } from './vault/view.component'; import { ApiActionDirective } from 'jslib/angular/directives/api-action.directive'; @@ -103,6 +104,7 @@ import { IconComponent } from 'jslib/angular/components/icon.component'; OptionsComponent, PasswordGeneratorComponent, PasswordGeneratorHistoryComponent, + PasswordHistoryComponent, PopOutComponent, PremiumComponent, PrivateModeComponent, diff --git a/src/popup/generator/password-generator.component.ts b/src/popup/generator/password-generator.component.ts index 431f0a30ee..6085265dca 100644 --- a/src/popup/generator/password-generator.component.ts +++ b/src/popup/generator/password-generator.component.ts @@ -3,7 +3,6 @@ import { Angulartics2 } from 'angulartics2'; import { Location } from '@angular/common'; import { Component } from '@angular/core'; -import { Router } from '@angular/router'; import { I18nService } from 'jslib/abstractions/i18n.service'; import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service'; @@ -26,7 +25,7 @@ export class PasswordGeneratorComponent extends BasePasswordGeneratorComponent { constructor(passwordGenerationService: PasswordGenerationService, analytics: Angulartics2, platformUtilsService: PlatformUtilsService, i18nService: I18nService, toasterService: ToasterService, private stateService: StateService, - private router: Router, private location: Location) { + private location: Location) { super(passwordGenerationService, analytics, platformUtilsService, i18nService, toasterService, window); } diff --git a/src/popup/vault/password-history.component.html b/src/popup/vault/password-history.component.html new file mode 100644 index 0000000000..0ff4422bd0 --- /dev/null +++ b/src/popup/vault/password-history.component.html @@ -0,0 +1,34 @@ +
+
+ +
+
+ {{'passwordHistory' | i18n}} +
+
+
+ +
+
+
+
+
+ + {{h.password}} + + {{h.lastUsedDate | date:'medium'}} +
+
+
+ + + +
+
+
+
+
+

{{'noPasswordsInList' | i18n}}

+
+
diff --git a/src/popup/vault/password-history.component.ts b/src/popup/vault/password-history.component.ts new file mode 100644 index 0000000000..b33af3f5e3 --- /dev/null +++ b/src/popup/vault/password-history.component.ts @@ -0,0 +1,43 @@ +import { ToasterService } from 'angular2-toaster'; +import { Angulartics2 } from 'angulartics2'; + +import { Location } from '@angular/common'; +import { Component } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +import { CipherService } from 'jslib/abstractions/cipher.service'; +import { I18nService } from 'jslib/abstractions/i18n.service'; +import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; + +import { + PasswordHistoryComponent as BasePasswordHistoryComponent, +} from 'jslib/angular/components/password-history.component'; + +@Component({ + selector: 'app-password-history', + templateUrl: 'password-history.component.html', +}) +export class PasswordHistoryComponent extends BasePasswordHistoryComponent { + constructor(cipherService: CipherService, analytics: Angulartics2, + platformUtilsService: PlatformUtilsService, i18nService: I18nService, + toasterService: ToasterService, private location: Location, + private route: ActivatedRoute) { + super(cipherService, analytics, platformUtilsService, i18nService, toasterService, window); + } + + async ngOnInit() { + this.route.queryParams.subscribe(async (params) => { + if (params.cipherId) { + this.cipherId = params.cipherId; + } else { + this.close(); + } + + await super.ngOnInit(); + }); + } + + close() { + this.location.back(); + } +} diff --git a/src/popup/vault/view.component.html b/src/popup/vault/view.component.html index 4352cdffc9..e512938f3b 100644 --- a/src/popup/vault/view.component.html +++ b/src/popup/vault/view.component.html @@ -255,4 +255,27 @@ +
+
+ {{'other' | i18n}} +
+
+
+ {{'dateUpdated' | i18n}} + {{cipher.revisionDate | date:'medium'}} +
+
+
+ {{'datePasswordUpdated' | i18n}} + {{cipher.passwordRevisionDisplayDate | date:'medium'}} +
+
+ + + +
+
+
+