1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-21 16:18:28 +01: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

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

View File

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