1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-06-25 10:25:36 +02:00

feat: add confirm collection enhancements dialog, refs AC-2113 (#7884)

This commit is contained in:
Vincent Salucci 2024-02-09 09:14:33 -06:00 committed by GitHub
parent c36a38f74e
commit 783ae104a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 31 additions and 10 deletions

View File

@ -67,7 +67,12 @@
{{ "collectionEnhancementsLearnMore" | i18n }}
</a>
</p>
<button type="button" bitButton buttonType="primary" [bitAction]="enableCollectionEnhancements">
<button
type="button"
bitButton
buttonType="primary"
(click)="showConfirmCollectionEnhancementsDialog()"
>
{{ "enable" | i18n }}
</button>
</form>

View File

@ -16,7 +16,7 @@ import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.se
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { Utils } from "@bitwarden/common/platform/misc/utils";
import { DialogService } from "@bitwarden/components";
import { DialogService, SimpleDialogOptions } from "@bitwarden/components";
import { ApiKeyComponent } from "../../../auth/settings/security/api-key.component";
import { PurgeVaultComponent } from "../../../vault/settings/purge-vault.component";
@ -183,15 +183,25 @@ export class AccountComponent {
this.platformUtilsService.showToast("success", null, this.i18nService.t("organizationUpdated"));
};
enableCollectionEnhancements = async () => {
await this.organizationApiService.enableCollectionEnhancements(this.organizationId);
async showConfirmCollectionEnhancementsDialog() {
const collectionEnhancementsDialogOptions: SimpleDialogOptions = {
title: this.i18nService.t("confirmCollectionEnhancementsDialogTitle"),
content: this.i18nService.t("confirmCollectionEnhancementsDialogContent"),
type: "warning",
acceptButtonText: this.i18nService.t("continue"),
acceptAction: async () => {
await this.organizationApiService.enableCollectionEnhancements(this.organizationId);
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("updatedCollectionManagement"),
);
};
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("updatedCollectionManagement"),
);
},
};
await this.dialogService.openSimpleDialog(collectionEnhancementsDialogOptions);
}
submitCollectionManagement = async () => {
// Early exit if self-hosted

View File

@ -7519,5 +7519,11 @@
},
"smFreeTrialConfirmationEmail": {
"message": "We've sent a confirmation email to your email at "
},
"confirmCollectionEnhancementsDialogTitle": {
"message": "This action is irreversible"
},
"confirmCollectionEnhancementsDialogContent": {
"message": "Turning on this feature will deprecate the manager role and replace it with a Can manage permission. This will take a few moments. Do not make any organization changes until it is complete. Are you sure you want to proceed?"
}
}