mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 03:33:54 +00:00
* Rename service-factory folder * Move cryptographic service factories * Move crypto models * Move crypto services * Move domain base class * Platform code owners * Move desktop log services * Move log files * Establish component library ownership * Move background listeners * Move background background * Move localization to Platform * Move browser alarms to Platform * Move browser state to Platform * Move CLI state to Platform * Move Desktop native concerns to Platform * Move flag and misc to Platform * Lint fixes * Move electron state to platform * Move web state to Platform * Move lib state to Platform * Fix broken tests * Rename interface to idiomatic TS * `npm run prettier` 🤖 * Resolve review feedback * Set platform as owners of web core and shared * Expand moved services * Fix test types --------- Co-authored-by: Hinton <hinton@users.noreply.github.com>
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
import { DialogRef, DIALOG_DATA } from "@angular/cdk/dialog";
|
|
import { Component, Inject } from "@angular/core";
|
|
|
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
|
|
|
import { SecretService } from "../../secrets/secret.service";
|
|
|
|
export interface SecretHardDeleteOperation {
|
|
secretIds: string[];
|
|
organizationId: string;
|
|
}
|
|
|
|
@Component({
|
|
templateUrl: "./secret-hard-delete.component.html",
|
|
})
|
|
export class SecretHardDeleteDialogComponent {
|
|
constructor(
|
|
public dialogRef: DialogRef,
|
|
private secretService: SecretService,
|
|
private i18nService: I18nService,
|
|
private platformUtilsService: PlatformUtilsService,
|
|
@Inject(DIALOG_DATA) public data: SecretHardDeleteOperation
|
|
) {}
|
|
|
|
get title() {
|
|
return this.data.secretIds.length === 1 ? "hardDeleteSecret" : "hardDeleteSecrets";
|
|
}
|
|
|
|
get submitButtonText() {
|
|
return this.data.secretIds.length === 1 ? "deleteSecret" : "deleteSecrets";
|
|
}
|
|
|
|
delete = async () => {
|
|
await this.secretService.deleteTrashed(this.data.organizationId, this.data.secretIds);
|
|
const message =
|
|
this.data.secretIds.length === 1 ? "hardDeleteSuccessToast" : "hardDeletesSuccessToast";
|
|
this.dialogRef.close(this.data.secretIds);
|
|
this.platformUtilsService.showToast("success", null, this.i18nService.t(message));
|
|
};
|
|
}
|