1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 05:43:41 +00:00

[AC-1721] Disable Collection Management settings on self-hosted (#6921)

* feat: disable collection management setting when self-hosted and hide save button, refs AC-1721

* fix: remove debug code, refs AC-1721
This commit is contained in:
Vincent Salucci
2023-11-27 10:28:31 -06:00
committed by GitHub
parent 301142fbf2
commit 162c669177
2 changed files with 8 additions and 1 deletions

View File

@@ -64,6 +64,7 @@
<input type="checkbox" bitCheckbox formControlName="limitCollectionCreationDeletion" />
</bit-form-control>
<button
*ngIf="!selfHosted"
type="submit"
bitButton
bitFormButton

View File

@@ -66,7 +66,7 @@ export class AccountComponent {
});
protected collectionManagementFormGroup = this.formBuilder.group({
limitCollectionCreationDeletion: [false],
limitCollectionCreationDeletion: this.formBuilder.control({ value: false, disabled: true }),
});
protected organizationId: string;
@@ -114,6 +114,7 @@ export class AccountComponent {
// Update disabled states - reactive forms prefers not using disabled attribute
if (!this.selfHosted) {
this.formGroup.get("orgName").enable();
this.collectionManagementFormGroup.get("limitCollectionCreationDeletion").enable();
}
if (!this.selfHosted || this.canEditSubscription) {
@@ -171,6 +172,11 @@ export class AccountComponent {
};
submitCollectionManagement = async () => {
// Early exit if self-hosted
if (this.selfHosted) {
return;
}
const request = new OrganizationCollectionManagementUpdateRequest();
request.limitCreateDeleteOwnerAdmin =
this.collectionManagementFormGroup.value.limitCollectionCreationDeletion;