1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 01:33:33 +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

@@ -8,7 +8,6 @@ import { ConfigService } from "@bitwarden/common/platform/abstractions/config/co
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service";
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 { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
import { SendType } from "@bitwarden/common/tools/send/enums/send-type";
@@ -18,7 +17,7 @@ import { SendAccessResponse } from "@bitwarden/common/tools/send/models/response
import { SendAccessView } from "@bitwarden/common/tools/send/models/view/send-access.view";
import { SEND_KDF_ITERATIONS } from "@bitwarden/common/tools/send/send-kdf";
import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction";
import { NoItemsModule } from "@bitwarden/components";
import { NoItemsModule, ToastService } from "@bitwarden/components";
import { SharedModule } from "../../shared";
@@ -67,7 +66,7 @@ export class AccessComponent implements OnInit {
private route: ActivatedRoute,
private cryptoService: CryptoService,
private sendApiService: SendApiService,
private platformUtilsService: PlatformUtilsService,
private toastService: ToastService,
private i18nService: I18nService,
private configService: ConfigService,
protected formBuilder: FormBuilder,
@@ -142,11 +141,11 @@ export class AccessComponent implements OnInit {
} else if (e.statusCode === 404) {
this.unavailable = true;
} else if (e.statusCode === 400) {
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),
e.message,
);
this.toastService.showToast({
variant: "error",
title: this.i18nService.t("errorOccurred"),
message: e.message,
});
} else {
this.error = true;
}