bitwarden-estensione-browser/apps/desktop/src/app/vault/export.component.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

81 lines
2.8 KiB
TypeScript
Raw Normal View History

2022-02-24 20:50:19 +01:00
import * as os from "os";
2020-11-04 18:09:21 +01:00
import { Component, OnInit } from "@angular/core";
import { FormBuilder } from "@angular/forms";
2018-08-02 05:21:32 +02:00
2022-06-14 17:10:53 +02:00
import { ExportComponent as BaseExportComponent } from "@bitwarden/angular/components/export.component";
import { BroadcasterService } from "@bitwarden/common/abstractions/broadcaster.service";
import { CryptoService } from "@bitwarden/common/abstractions/crypto.service";
import { EventService } from "@bitwarden/common/abstractions/event.service";
import { ExportService } from "@bitwarden/common/abstractions/export.service";
import { FileDownloadService } from "@bitwarden/common/abstractions/fileDownload/fileDownload.service";
2022-06-14 17:10:53 +02:00
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/abstractions/log.service";
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
import { PolicyService } from "@bitwarden/common/abstractions/policy.service";
import { UserVerificationService } from "@bitwarden/common/abstractions/userVerification.service";
2018-08-02 05:21:32 +02:00
2020-11-04 18:09:21 +01:00
const BroadcasterSubscriptionId = "ExportComponent";
2018-08-02 05:21:32 +02:00
@Component({
selector: "app-export",
templateUrl: "export.component.html",
})
2020-11-04 18:09:21 +01:00
export class ExportComponent extends BaseExportComponent implements OnInit {
constructor(
cryptoService: CryptoService,
i18nService: I18nService,
2019-07-12 23:11:39 +02:00
platformUtilsService: PlatformUtilsService,
exportService: ExportService,
eventService: EventService,
policyService: PolicyService,
userVerificationService: UserVerificationService,
2021-12-31 16:52:28 +01:00
formBuilder: FormBuilder,
private broadcasterService: BroadcasterService,
logService: LogService,
fileDownloadService: FileDownloadService
) {
super(
cryptoService,
i18nService,
platformUtilsService,
exportService,
eventService,
policyService,
window,
logService,
userVerificationService,
formBuilder,
fileDownloadService
);
2020-11-04 18:09:21 +01:00
}
ngOnDestroy() {
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
}
2021-03-04 22:53:35 +01:00
async warningDialog() {
if (this.encryptedFormat) {
return await this.platformUtilsService.showDialog(
this.i18nService.t("encExportKeyWarningDesc") +
os.EOL +
os.EOL +
this.i18nService.t("encExportAccountWarningDesc"),
this.i18nService.t("confirmVaultExport"),
this.i18nService.t("exportVault"),
this.i18nService.t("cancel"),
"warning",
true
);
} else {
return await this.platformUtilsService.showDialog(
this.i18nService.t("exportWarningDesc"),
this.i18nService.t("confirmVaultExport"),
this.i18nService.t("exportVault"),
this.i18nService.t("cancel"),
"warning"
);
}
2021-12-20 15:47:17 +01:00
}
2018-08-02 05:21:32 +02:00
}