1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

export vault

This commit is contained in:
Kyle Spearrin
2018-08-01 23:21:32 -04:00
parent 696bc780ba
commit b032bc2f33
10 changed files with 117 additions and 4 deletions

View File

@@ -26,6 +26,7 @@ import { ModalComponent } from 'jslib/angular/components/modal.component';
import { AddEditComponent } from './add-edit.component';
import { AttachmentsComponent } from './attachments.component';
import { CiphersComponent } from './ciphers.component';
import { ExportComponent } from './export.component';
import { FolderAddEditComponent } from './folder-add-edit.component';
import { GroupingsComponent } from './groupings.component';
import { PasswordGeneratorComponent } from './password-generator.component';
@@ -56,6 +57,7 @@ export class VaultComponent implements OnInit, OnDestroy {
@ViewChild('attachments', { read: ViewContainerRef }) attachmentsModalRef: ViewContainerRef;
@ViewChild('folderAddEdit', { read: ViewContainerRef }) folderAddEditModalRef: ViewContainerRef;
@ViewChild('passwordHistory', { read: ViewContainerRef }) passwordHistoryModalRef: ViewContainerRef;
@ViewChild('exportVault', { read: ViewContainerRef }) exportVaultModalRef: ViewContainerRef;
action: string;
cipherId: string = null;
@@ -102,6 +104,9 @@ export class VaultComponent implements OnInit, OnDestroy {
case 'openPasswordGenerator':
await this.openPasswordGenerator(false);
break;
case 'exportVault':
await this.openExportVault();
break;
case 'syncVault':
try {
await this.syncService.fullSync(true);
@@ -434,6 +439,24 @@ export class VaultComponent implements OnInit, OnDestroy {
});
}
async openExportVault() {
if (this.modal != null) {
this.modal.close();
}
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
this.modal = this.exportVaultModalRef.createComponent(factory).instance;
const childComponent = this.modal.show<ExportComponent>(ExportComponent, this.exportVaultModalRef);
childComponent.onSaved.subscribe(() => {
this.modal.close();
});
this.modal.onClosed.subscribe(() => {
this.modal = null;
});
}
async addFolder() {
if (this.modal != null) {
this.modal.close();