mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 21:33:27 +00:00
[PM-27648] [Defect] The .zip option is displayed on organizational export in Admin Console (#17140)
* consider admin console context when determining export types and callout * checkpoint on simplified fix before swapping to signals * Update libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com> * Update libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com> --------- Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
This commit is contained in:
@@ -342,13 +342,25 @@ export class ExportComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private observeFormSelections(): void {
|
private observeFormSelections(): void {
|
||||||
// Set up dynamic format options based on vault selection
|
// Update organizationId when vault selection changes
|
||||||
this.formatOptions$ = this.exportForm.controls.vaultSelector.valueChanges.pipe(
|
// In Admin Console context, organizationId is already set via @Input
|
||||||
startWith(this.exportForm.controls.vaultSelector.value),
|
// In Password Manager context, user changes vaultSelector which updates _organizationId$
|
||||||
map((vaultSelection) => {
|
this.exportForm.controls.vaultSelector.valueChanges
|
||||||
const isMyVault = vaultSelection === "myVault";
|
.pipe(takeUntil(this.destroy$))
|
||||||
// Update organizationId based on vault selection
|
.subscribe((vaultSelection) => {
|
||||||
this.organizationId = isMyVault ? undefined : vaultSelection;
|
if (!this.isAdminConsoleContext) {
|
||||||
|
// Password Manager: Update organizationId based on vaultSelector
|
||||||
|
const isMyVault = vaultSelection === "myVault";
|
||||||
|
this.organizationId = isMyVault ? undefined : vaultSelection;
|
||||||
|
}
|
||||||
|
// Admin Console: organizationId is already set via @Input, no update needed
|
||||||
|
});
|
||||||
|
|
||||||
|
// Set up dynamic format options based on the organizationId observable
|
||||||
|
// This is the single source of truth for both export contexts
|
||||||
|
this.formatOptions$ = this._organizationId$.pipe(
|
||||||
|
map((organizationId) => {
|
||||||
|
const isMyVault = !organizationId;
|
||||||
return { isMyVault };
|
return { isMyVault };
|
||||||
}),
|
}),
|
||||||
switchMap((options) => this.exportService.formats$(options)),
|
switchMap((options) => this.exportService.formats$(options)),
|
||||||
|
|||||||
Reference in New Issue
Block a user