mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
[PM-20633] rename personal ownership (#15228)
* sensible renames * renames * clean up comments
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
[label]="'myVault' | i18n"
|
||||
value="myVault"
|
||||
icon="bwi-user"
|
||||
*ngIf="!(disablePersonalOwnershipPolicy$ | async)"
|
||||
*ngIf="!(organizationDataOwnershipPolicy$ | async)"
|
||||
/>
|
||||
<bit-option
|
||||
*ngFor="let o of organizations$ | async"
|
||||
|
||||
@@ -153,7 +153,7 @@ export class ExportComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
}
|
||||
|
||||
disablePersonalVaultExportPolicy$: Observable<boolean>;
|
||||
disablePersonalOwnershipPolicy$: Observable<boolean>;
|
||||
organizationDataOwnershipPolicy$: Observable<boolean>;
|
||||
|
||||
exportForm = this.formBuilder.group({
|
||||
vaultSelector: [
|
||||
@@ -209,10 +209,10 @@ export class ExportComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
),
|
||||
);
|
||||
|
||||
this.disablePersonalOwnershipPolicy$ = this.accountService.activeAccount$.pipe(
|
||||
this.organizationDataOwnershipPolicy$ = this.accountService.activeAccount$.pipe(
|
||||
getUserId,
|
||||
switchMap((userId) =>
|
||||
this.policyService.policyAppliesToUser$(PolicyType.PersonalOwnership, userId),
|
||||
this.policyService.policyAppliesToUser$(PolicyType.OrganizationDataOwnership, userId),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -294,21 +294,21 @@ export class ExportComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
|
||||
combineLatest([
|
||||
this.disablePersonalVaultExportPolicy$,
|
||||
this.disablePersonalOwnershipPolicy$,
|
||||
this.organizationDataOwnershipPolicy$,
|
||||
this.organizations$,
|
||||
])
|
||||
.pipe(
|
||||
tap(([disablePersonalVaultExport, disablePersonalOwnership, organizations]) => {
|
||||
tap(([disablePersonalVaultExport, organizationDataOwnership, organizations]) => {
|
||||
this._disabledByPolicy = disablePersonalVaultExport;
|
||||
|
||||
// When personalOwnership is disabled and we have orgs, set the first org as the selected vault
|
||||
if (disablePersonalOwnership && organizations.length > 0) {
|
||||
// When organizationDataOwnership is enabled and we have orgs, set the first org as the selected vault
|
||||
if (organizationDataOwnership && organizations.length > 0) {
|
||||
this.exportForm.enable();
|
||||
this.exportForm.controls.vaultSelector.setValue(organizations[0].id);
|
||||
}
|
||||
|
||||
// When personalOwnership is disabled and we have no orgs, disable the form
|
||||
if (disablePersonalOwnership && organizations.length === 0) {
|
||||
// When organizationDataOwnership is enabled and we have no orgs, disable the form
|
||||
if (organizationDataOwnership && organizations.length === 0) {
|
||||
this.exportForm.disable();
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ export class ExportComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
}
|
||||
|
||||
// When neither policy is enabled, enable the form and set the default vault to "myVault"
|
||||
if (!disablePersonalVaultExport && !disablePersonalOwnership) {
|
||||
if (!disablePersonalVaultExport && !organizationDataOwnership) {
|
||||
this.exportForm.controls.vaultSelector.setValue("myVault");
|
||||
}
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user