1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

password history and updated dates on view

This commit is contained in:
Kyle Spearrin
2018-07-30 10:05:36 -04:00
parent 2ecbd4564c
commit a7318e0937
8 changed files with 115 additions and 3 deletions

View File

@@ -29,11 +29,11 @@ import { CiphersComponent } from './ciphers.component';
import { FolderAddEditComponent } from './folder-add-edit.component';
import { GroupingsComponent } from './groupings.component';
import { PasswordGeneratorComponent } from './password-generator.component';
import { PasswordHistoryComponent } from './password-history.component';
import { CipherType } from 'jslib/enums/cipherType';
import { CipherView } from 'jslib/models/view/cipherView';
import { CollectionView } from 'jslib/models/view/collectionView';
import { FolderView } from 'jslib/models/view/folderView';
import { I18nService } from 'jslib/abstractions/i18n.service';
@@ -55,6 +55,7 @@ export class VaultComponent implements OnInit, OnDestroy {
@ViewChild('passwordGenerator', { read: ViewContainerRef }) passwordGeneratorModalRef: ViewContainerRef;
@ViewChild('attachments', { read: ViewContainerRef }) attachmentsModalRef: ViewContainerRef;
@ViewChild('folderAddEdit', { read: ViewContainerRef }) folderAddEditModalRef: ViewContainerRef;
@ViewChild('passwordHistory', { read: ViewContainerRef }) passwordHistoryModalRef: ViewContainerRef;
action: string;
cipherId: string = null;
@@ -347,6 +348,22 @@ export class VaultComponent implements OnInit, OnDestroy {
});
}
viewCipherPasswordHistory(cipher: CipherView) {
if (this.modal != null) {
this.modal.close();
}
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
this.modal = this.passwordHistoryModalRef.createComponent(factory).instance;
const childComponent = this.modal.show<PasswordHistoryComponent>(PasswordHistoryComponent,
this.passwordHistoryModalRef);
childComponent.cipherId = cipher.id;
this.modal.onClosed.subscribe(async () => {
this.modal = null;
});
}
cancelledAddEdit(cipher: CipherView) {
this.cipherId = cipher.id;
this.action = this.cipherId != null ? 'view' : null;