mirror of
https://github.com/bitwarden/web
synced 2025-12-06 00:03:28 +00:00
Handle password protected import export (#1448)
This updates requirements without implementing any way for the UI to interact with the new feature
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: 9caea70ea2...6c08b40847
@@ -8,6 +8,7 @@ import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.se
|
||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||
|
||||
import { PolicyType } from "jslib-common/enums/policyType";
|
||||
import { ImportType } from "jslib-common/services/import.service";
|
||||
|
||||
import Swal, { SweetAlertIcon } from "sweetalert2";
|
||||
|
||||
@@ -18,7 +19,7 @@ import Swal, { SweetAlertIcon } from "sweetalert2";
|
||||
export class ImportComponent implements OnInit {
|
||||
featuredImportOptions: ImportOption[];
|
||||
importOptions: ImportOption[];
|
||||
format: string = null;
|
||||
format: ImportType = null;
|
||||
fileContents: string;
|
||||
formPromise: Promise<Error>;
|
||||
loading: boolean = false;
|
||||
@@ -38,21 +39,6 @@ export class ImportComponent implements OnInit {
|
||||
|
||||
async ngOnInit() {
|
||||
this.setImportOptions();
|
||||
this.importOptions.sort((a, b) => {
|
||||
if (a.name == null && b.name != null) {
|
||||
return -1;
|
||||
}
|
||||
if (a.name != null && b.name == null) {
|
||||
return 1;
|
||||
}
|
||||
if (a.name == null && b.name == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return this.i18nService.collator
|
||||
? this.i18nService.collator.compare(a.name, b.name)
|
||||
: a.name.localeCompare(b.name);
|
||||
});
|
||||
|
||||
this.importBlockedByPolicy = await this.policyService.policyAppliesToUser(
|
||||
PolicyType.PersonalOwnership
|
||||
@@ -158,7 +144,21 @@ export class ImportComponent implements OnInit {
|
||||
},
|
||||
...this.importService.featuredImportOptions,
|
||||
];
|
||||
this.importOptions = this.importService.regularImportOptions;
|
||||
this.importOptions = [...this.importService.regularImportOptions].sort((a, b) => {
|
||||
if (a.name == null && b.name != null) {
|
||||
return -1;
|
||||
}
|
||||
if (a.name != null && b.name == null) {
|
||||
return 1;
|
||||
}
|
||||
if (a.name == null && b.name == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return this.i18nService.collator
|
||||
? this.i18nService.collator.compare(a.name, b.name)
|
||||
: a.name.localeCompare(b.name);
|
||||
});
|
||||
}
|
||||
|
||||
private async error(error: Error) {
|
||||
|
||||
Reference in New Issue
Block a user