mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
[PM-18524] Make the External ID in the Collection dialog conditional (#14096)
* [PM-18524] Make the external ID in the collection dialog conditional * [PM-18524] Update external ID in collection dialog to always be disabled * [PM-18524] Display ExternalID field only in Admin Console - Add isAdminConsoleActive flag to CollectionDialogParams - Update isExternalIdVisible$ observable to respect context - Set flag when dialog is opened from Admin Console routes * [PM-18524] Enable/disable External ID field based on feature flag
This commit is contained in:
@@ -1226,6 +1226,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
organizationId: this.organization?.id,
|
organizationId: this.organization?.id,
|
||||||
parentCollectionId: this.selectedCollection?.node.id,
|
parentCollectionId: this.selectedCollection?.node.id,
|
||||||
limitNestedCollections: !this.organization.canEditAnyCollection,
|
limitNestedCollections: !this.organization.canEditAnyCollection,
|
||||||
|
isAdminConsoleActive: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1251,6 +1252,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
readonly: readonly,
|
readonly: readonly,
|
||||||
isAddAccessCollection: c.unmanaged,
|
isAddAccessCollection: c.unmanaged,
|
||||||
limitNestedCollections: !this.organization.canEditAnyCollection,
|
limitNestedCollections: !this.organization.canEditAnyCollection,
|
||||||
|
isAdminConsoleActive: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
</bit-select>
|
</bit-select>
|
||||||
</bit-form-field>
|
</bit-form-field>
|
||||||
|
|
||||||
<bit-form-field>
|
<bit-form-field *ngIf="isExternalIdVisible$ | async">
|
||||||
<bit-label>{{ "externalId" | i18n }}</bit-label>
|
<bit-label>{{ "externalId" | i18n }}</bit-label>
|
||||||
<input bitInput formControlName="externalId" />
|
<input bitInput formControlName="externalId" />
|
||||||
<bit-hint>{{ "externalIdDesc" | i18n }}</bit-hint>
|
<bit-hint>{{ "externalIdDesc" | i18n }}</bit-hint>
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ export interface CollectionDialogParams {
|
|||||||
limitNestedCollections?: boolean;
|
limitNestedCollections?: boolean;
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
isAddAccessCollection?: boolean;
|
isAddAccessCollection?: boolean;
|
||||||
|
isAdminConsoleActive?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CollectionDialogResult {
|
export interface CollectionDialogResult {
|
||||||
@@ -138,6 +139,16 @@ export class CollectionDialogComponent implements OnInit, OnDestroy {
|
|||||||
protected showAddAccessWarning = false;
|
protected showAddAccessWarning = false;
|
||||||
protected collections: Collection[];
|
protected collections: Collection[];
|
||||||
protected buttonDisplayName: ButtonType = ButtonType.Save;
|
protected buttonDisplayName: ButtonType = ButtonType.Save;
|
||||||
|
protected isExternalIdVisible$ = this.configService
|
||||||
|
.getFeatureFlag$(FeatureFlag.SsoExternalIdVisibility)
|
||||||
|
.pipe(
|
||||||
|
map((isEnabled) => {
|
||||||
|
return (
|
||||||
|
!isEnabled ||
|
||||||
|
(!!this.params.isAdminConsoleActive && !!this.formGroup.get("externalId")?.value)
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
private orgExceedingCollectionLimit!: Organization;
|
private orgExceedingCollectionLimit!: Organization;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -478,7 +489,18 @@ export class CollectionDialogComponent implements OnInit, OnDestroy {
|
|||||||
this.formGroup.controls.access.disable();
|
this.formGroup.controls.access.disable();
|
||||||
} else {
|
} else {
|
||||||
this.formGroup.controls.name.enable();
|
this.formGroup.controls.name.enable();
|
||||||
this.formGroup.controls.externalId.enable();
|
|
||||||
|
this.configService
|
||||||
|
.getFeatureFlag$(FeatureFlag.SsoExternalIdVisibility)
|
||||||
|
.pipe(takeUntil(this.destroy$))
|
||||||
|
.subscribe((isEnabled) => {
|
||||||
|
if (isEnabled) {
|
||||||
|
this.formGroup.controls.externalId.disable();
|
||||||
|
} else {
|
||||||
|
this.formGroup.controls.externalId.enable();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.formGroup.controls.parent.enable();
|
this.formGroup.controls.parent.enable();
|
||||||
this.formGroup.controls.access.enable();
|
this.formGroup.controls.access.enable();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user