mirror of
https://github.com/bitwarden/web
synced 2025-12-10 21:33:16 +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 { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
|
|
||||||
import { PolicyType } from "jslib-common/enums/policyType";
|
import { PolicyType } from "jslib-common/enums/policyType";
|
||||||
|
import { ImportType } from "jslib-common/services/import.service";
|
||||||
|
|
||||||
import Swal, { SweetAlertIcon } from "sweetalert2";
|
import Swal, { SweetAlertIcon } from "sweetalert2";
|
||||||
|
|
||||||
@@ -18,7 +19,7 @@ import Swal, { SweetAlertIcon } from "sweetalert2";
|
|||||||
export class ImportComponent implements OnInit {
|
export class ImportComponent implements OnInit {
|
||||||
featuredImportOptions: ImportOption[];
|
featuredImportOptions: ImportOption[];
|
||||||
importOptions: ImportOption[];
|
importOptions: ImportOption[];
|
||||||
format: string = null;
|
format: ImportType = null;
|
||||||
fileContents: string;
|
fileContents: string;
|
||||||
formPromise: Promise<Error>;
|
formPromise: Promise<Error>;
|
||||||
loading: boolean = false;
|
loading: boolean = false;
|
||||||
@@ -38,21 +39,6 @@ export class ImportComponent implements OnInit {
|
|||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.setImportOptions();
|
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(
|
this.importBlockedByPolicy = await this.policyService.policyAppliesToUser(
|
||||||
PolicyType.PersonalOwnership
|
PolicyType.PersonalOwnership
|
||||||
@@ -158,7 +144,21 @@ export class ImportComponent implements OnInit {
|
|||||||
},
|
},
|
||||||
...this.importService.featuredImportOptions,
|
...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) {
|
private async error(error: Error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user