From 8e8092c828dda5a5bd8b8f527161f7a794f99d4e Mon Sep 17 00:00:00 2001 From: John Harrington <84741727+harr1424@users.noreply.github.com> Date: Tue, 4 Nov 2025 14:34:22 -0700 Subject: [PATCH] [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 * Update libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts Co-authored-by: Oscar Hinton --------- Co-authored-by: Oscar Hinton --- .../src/components/export.component.ts | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts b/libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts index 610f30c1f67..e81217e54c2 100644 --- a/libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts +++ b/libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts @@ -342,13 +342,25 @@ export class ExportComponent implements OnInit, OnDestroy, AfterViewInit { } private observeFormSelections(): void { - // Set up dynamic format options based on vault selection - this.formatOptions$ = this.exportForm.controls.vaultSelector.valueChanges.pipe( - startWith(this.exportForm.controls.vaultSelector.value), - map((vaultSelection) => { - const isMyVault = vaultSelection === "myVault"; - // Update organizationId based on vault selection - this.organizationId = isMyVault ? undefined : vaultSelection; + // Update organizationId when vault selection changes + // In Admin Console context, organizationId is already set via @Input + // In Password Manager context, user changes vaultSelector which updates _organizationId$ + this.exportForm.controls.vaultSelector.valueChanges + .pipe(takeUntil(this.destroy$)) + .subscribe((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 }; }), switchMap((options) => this.exportService.formats$(options)),