[SM-1016] Fix new access token dialog (#9918)
* swap to bit-dialog title & subtitle * remove dialogRef.disableClose & use toastService
This commit is contained in:
parent
2b1fe2d305
commit
48de33fc7a
|
@ -1,11 +1,4 @@
|
||||||
<bit-dialog dialogSize="default">
|
<bit-dialog dialogSize="default" [title]="'newAccessToken' | i18n" [subtitle]="data.subTitle">
|
||||||
<ng-container bitDialogTitle>
|
|
||||||
<span>{{ "newAccessToken" | i18n }}</span>
|
|
||||||
<span class="tw-text-sm tw-normal-case tw-text-muted">
|
|
||||||
{{ data.subTitle }}
|
|
||||||
</span>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<div bitDialogContent>
|
<div bitDialogContent>
|
||||||
<bit-callout type="info" [title]="'accessTokenCallOutTitle' | i18n">
|
<bit-callout type="info" [title]="'accessTokenCallOutTitle' | i18n">
|
||||||
{{ "downloadAccessToken" | i18n }}<br />
|
{{ "downloadAccessToken" | i18n }}<br />
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { Component, Inject, OnInit } from "@angular/core";
|
||||||
|
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
|
import { ToastService } from "@bitwarden/components";
|
||||||
|
|
||||||
export interface AccessTokenDetails {
|
export interface AccessTokenDetails {
|
||||||
subTitle: string;
|
subTitle: string;
|
||||||
|
@ -18,10 +19,9 @@ export class AccessTokenDialogComponent implements OnInit {
|
||||||
public dialogRef: DialogRef,
|
public dialogRef: DialogRef,
|
||||||
@Inject(DIALOG_DATA) public data: AccessTokenDetails,
|
@Inject(DIALOG_DATA) public data: AccessTokenDetails,
|
||||||
private platformUtilsService: PlatformUtilsService,
|
private platformUtilsService: PlatformUtilsService,
|
||||||
|
private toastService: ToastService,
|
||||||
private i18nService: I18nService,
|
private i18nService: I18nService,
|
||||||
) {
|
) {}
|
||||||
this.dialogRef.disableClose = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
// TODO remove null checks once strictNullChecks in TypeScript is turned on.
|
// TODO remove null checks once strictNullChecks in TypeScript is turned on.
|
||||||
|
@ -33,11 +33,11 @@ export class AccessTokenDialogComponent implements OnInit {
|
||||||
|
|
||||||
copyAccessToken(): void {
|
copyAccessToken(): void {
|
||||||
this.platformUtilsService.copyToClipboard(this.data.accessToken);
|
this.platformUtilsService.copyToClipboard(this.data.accessToken);
|
||||||
this.platformUtilsService.showToast(
|
this.toastService.showToast({
|
||||||
"success",
|
variant: "success",
|
||||||
null,
|
title: null,
|
||||||
this.i18nService.t("accessTokenCreatedAndCopied"),
|
message: this.i18nService.t("accessTokenCreatedAndCopied"),
|
||||||
);
|
});
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue