1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 06:13:38 +00:00

[PM-6568][PM-8820][Tech-Debt] Migrate all tools owned toasts to use CL ToastService instead of PlatformUtilsService (#9405)

* Migrate all tools owned toasts to use CL ToastService instead of PlatformUtilsService

* Fix test that was missing a mock

* Fix double checking file and file-content selection

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
Daniel James Smith
2024-06-19 18:28:47 +02:00
committed by GitHub
parent 88cc37e37f
commit 8d04731633
25 changed files with 197 additions and 128 deletions

View File

@@ -19,6 +19,7 @@ import {
UsernameGeneratorOptions,
} from "@bitwarden/common/tools/generator/username";
import { EmailForwarderOptions } from "@bitwarden/common/tools/models/domain/email-forwarder-options";
import { ToastService } from "@bitwarden/components";
@Directive()
export class GeneratorComponent implements OnInit, OnDestroy {
@@ -67,6 +68,7 @@ export class GeneratorComponent implements OnInit, OnDestroy {
protected route: ActivatedRoute,
protected ngZone: NgZone,
private win: Window,
protected toastService: ToastService,
) {
this.typeOptions = [
{ name: i18nService.t("password"), value: "password" },
@@ -317,11 +319,14 @@ export class GeneratorComponent implements OnInit, OnDestroy {
password ? this.password : this.username,
copyOptions,
);
this.platformUtilsService.showToast(
"info",
null,
this.i18nService.t("valueCopied", this.i18nService.t(password ? "password" : "username")),
);
this.toastService.showToast({
variant: "info",
title: null,
message: this.i18nService.t(
"valueCopied",
this.i18nService.t(password ? "password" : "username"),
),
});
}
select() {