mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-25 12:15:18 +01:00
feat: add confirm collection enhancements dialog, refs AC-2113 (#7884)
This commit is contained in:
parent
c36a38f74e
commit
783ae104a3
@ -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>
|
||||
|
@ -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
|
||||
|
@ -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?"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user