From 48de33fc7a360e0a23df3351b3ad63d1c5579aac Mon Sep 17 00:00:00 2001 From: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com> Date: Fri, 5 Jul 2024 10:37:18 -0500 Subject: [PATCH] [SM-1016] Fix new access token dialog (#9918) * swap to bit-dialog title & subtitle * remove dialogRef.disableClose & use toastService --- .../dialogs/access-token-dialog.component.html | 9 +-------- .../dialogs/access-token-dialog.component.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/access/dialogs/access-token-dialog.component.html b/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/access/dialogs/access-token-dialog.component.html index 8a24c48271..3d653710a4 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/access/dialogs/access-token-dialog.component.html +++ b/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/access/dialogs/access-token-dialog.component.html @@ -1,11 +1,4 @@ - - - {{ "newAccessToken" | i18n }} - - {{ data.subTitle }} - - - +
{{ "downloadAccessToken" | i18n }}
diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/access/dialogs/access-token-dialog.component.ts b/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/access/dialogs/access-token-dialog.component.ts index caa9407903..fbc0058789 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/access/dialogs/access-token-dialog.component.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/access/dialogs/access-token-dialog.component.ts @@ -3,6 +3,7 @@ import { Component, Inject, OnInit } from "@angular/core"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; +import { ToastService } from "@bitwarden/components"; export interface AccessTokenDetails { subTitle: string; @@ -18,10 +19,9 @@ export class AccessTokenDialogComponent implements OnInit { public dialogRef: DialogRef, @Inject(DIALOG_DATA) public data: AccessTokenDetails, private platformUtilsService: PlatformUtilsService, + private toastService: ToastService, private i18nService: I18nService, - ) { - this.dialogRef.disableClose = true; - } + ) {} ngOnInit(): void { // TODO remove null checks once strictNullChecks in TypeScript is turned on. @@ -33,11 +33,11 @@ export class AccessTokenDialogComponent implements OnInit { copyAccessToken(): void { this.platformUtilsService.copyToClipboard(this.data.accessToken); - this.platformUtilsService.showToast( - "success", - null, - this.i18nService.t("accessTokenCreatedAndCopied"), - ); + this.toastService.showToast({ + variant: "success", + title: null, + message: this.i18nService.t("accessTokenCreatedAndCopied"), + }); this.dialogRef.close(); } }