1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 11:13:46 +00:00

[AC-2026] Add flexible collections opt-in UI (#7443)

This commit is contained in:
Thomas Rittson
2024-01-25 16:56:31 +10:00
committed by GitHub
parent 8555dcc613
commit bcb232cc80
5 changed files with 57 additions and 3 deletions

View File

@@ -52,6 +52,25 @@
{{ "rotateApiKey" | i18n }}
</button>
</ng-container>
<form
*ngIf="
org && !loading && !org.flexibleCollections && (flexibleCollectionsMigrationEnabled$ | async)
"
>
<h1 bitTypography="h1" class="tw-mt-16 tw-pb-2.5">
{{ "collectionManagement" | i18n }}
<span bitBadge variant="warning" class="!tw-align-middle">{{ "beta" | i18n }}</span>
</h1>
<p>
{{ "collectionEnhancementsDesc" | i18n }}
<a href="https://bitwarden.com/help/collection-management" target="_blank" rel="noopener">
{{ "collectionEnhancementsLearnMore" | i18n }}
</a>
</p>
<button type="button" bitButton buttonType="primary" [bitAction]="enableCollectionEnhancements">
{{ "enable" | i18n }}
</button>
</form>
<form
*ngIf="org && !loading && org.flexibleCollections"
[bitSubmit]="submitCollectionManagement"

View File

@@ -41,6 +41,12 @@ export class AccountComponent {
canUseApi = false;
org: OrganizationResponse;
taxFormPromise: Promise<unknown>;
protected flexibleCollectionsMigrationEnabled$ = this.configService.getFeatureFlag$(
FeatureFlag.FlexibleCollectionsMigration,
false,
);
flexibleCollectionsV1Enabled$ = this.configService.getFeatureFlag$(
FeatureFlag.FlexibleCollectionsV1,
false,
@@ -177,6 +183,16 @@ export class AccountComponent {
this.platformUtilsService.showToast("success", null, this.i18nService.t("organizationUpdated"));
};
enableCollectionEnhancements = async () => {
await this.organizationApiService.enableCollectionEnhancements(this.organizationId);
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("updatedCollectionManagement"),
);
};
submitCollectionManagement = async () => {
// Early exit if self-hosted
if (this.selfHosted) {
@@ -194,7 +210,7 @@ export class AccountComponent {
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("collectionManagementUpdated"),
this.i18nService.t("updatedCollectionManagement"),
);
};