1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 09:43:23 +00:00

[EC-317] Desktop client delete user account (#3151)

* [EC-317] feat: add delete account section in settings

* [EC-317] feat: add new delete account modal

* [EC-317] feat: add ability to replace top-most modal

* [EC-317] chore: remove unecessary lint ignore

* [EC-317] fix: so delete account is closed if export vault is opened

* [EC-317] feat: inital delete account design without i18n

* [EC-317] feat: disabled but basic working delete functionality

* [EC-317] feat: implement according to new design

* [EC-317] feat: use translations

* [EC-317] feat: implement working deletion

* [EC-317] feat: add loading state and error messages

* [EC-317] feat: add menu bar item

* [EC-317] feat: update form to support typed reactive forms

* [EC-317] chore: update translation text after design review

* [EC-317] feat: move deletion logic to service

* [EC-317] refactor: update web deletion

* [EC-317] feat: disable submit if secret is empty

* [EC-317] fix: handle errors in components as well

* [EC-317] fix: use abstraction as interface

* [EC-317] refactor: extract deleteAccount from api service

* [EC-317] fix: typo in translations

* [EC-317] chore: rename to accountApiService
This commit is contained in:
Andreas Coroiu
2022-07-29 21:49:58 +02:00
committed by GitHub
parent cc91b79a15
commit a22ef4d36c
23 changed files with 264 additions and 48 deletions

View File

@@ -40,6 +40,7 @@ import { CipherType } from "@bitwarden/common/enums/cipherType";
import { MenuUpdateRequest } from "../main/menu/menu.updater";
import { DeleteAccountComponent } from "./accounts/delete-account.component";
import { PremiumComponent } from "./accounts/premium.component";
import { SettingsComponent } from "./accounts/settings.component";
import { ExportComponent } from "./vault/export.component";
@@ -153,9 +154,7 @@ export class AppComponent implements OnInit {
this.systemService.cancelProcessReload();
break;
case "loggedOut":
if (this.modal != null) {
this.modal.close();
}
this.modalService.closeAll();
this.notificationsService.updateConnection();
this.updateAppMenu();
await this.systemService.clearPendingClipboard();
@@ -180,9 +179,7 @@ export class AppComponent implements OnInit {
}
break;
case "locked":
if (this.modal != null) {
this.modal.close();
}
this.modalService.closeAll();
if (
message.userId == null ||
message.userId === (await this.stateService.getUserId())
@@ -223,6 +220,9 @@ export class AppComponent implements OnInit {
}
break;
}
case "deleteAccount":
this.modalService.open(DeleteAccountComponent, { replaceTopModal: true });
break;
case "openPasswordHistory":
await this.openModal<PasswordGeneratorHistoryComponent>(
PasswordGeneratorHistoryComponent,
@@ -368,9 +368,7 @@ export class AppComponent implements OnInit {
}
async openExportVault() {
if (this.modal != null) {
this.modal.close();
}
this.modalService.closeAll();
const [modal, childComponent] = await this.modalService.openViewRef(
ExportComponent,
@@ -388,9 +386,7 @@ export class AppComponent implements OnInit {
}
async addFolder() {
if (this.modal != null) {
this.modal.close();
}
this.modalService.closeAll();
const [modal, childComponent] = await this.modalService.openViewRef(
FolderAddEditComponent,
@@ -410,9 +406,7 @@ export class AppComponent implements OnInit {
}
async openGenerator() {
if (this.modal != null) {
this.modal.close();
}
this.modalService.closeAll();
[this.modal] = await this.modalService.openViewRef(
GeneratorComponent,
@@ -542,9 +536,7 @@ export class AppComponent implements OnInit {
}
private async openModal<T>(type: Type<T>, ref: ViewContainerRef) {
if (this.modal != null) {
this.modal.close();
}
this.modalService.closeAll();
[this.modal] = await this.modalService.openViewRef(type, ref);