1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 17:53:39 +00:00

[PM-28264] Consolidate and update the UI for key connector migration/confirmation (#17642)

* Consolidate the RemovePasswordComponent

* Add getting confirmation details for confirm key connector

* Add missing message
This commit is contained in:
Thomas Avery
2025-12-10 15:24:20 -06:00
committed by GitHub
parent 93640e65e3
commit fe4895d97e
30 changed files with 496 additions and 206 deletions

View File

@@ -1,4 +1,5 @@
import { Directive, OnInit } from "@angular/core";
import { CommonModule } from "@angular/common";
import { Component, OnInit } from "@angular/core";
import { Router } from "@angular/router";
import { firstValueFrom } from "rxjs";
@@ -9,17 +10,33 @@ import { KeyConnectorService } from "@bitwarden/common/key-management/key-connec
import { ErrorResponse } from "@bitwarden/common/models/response/error.response";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { Utils } from "@bitwarden/common/platform/misc/utils";
import { UserId } from "@bitwarden/common/types/guid";
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
import { DialogService, ToastService } from "@bitwarden/components";
import {
DialogService,
ToastService,
ButtonModule,
BitActionDirective,
IconButtonModule,
} from "@bitwarden/components";
import { I18nPipe } from "@bitwarden/ui-common";
@Directive()
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
selector: "km-ui-remove-password",
templateUrl: "remove-password.component.html",
standalone: true,
imports: [CommonModule, ButtonModule, I18nPipe, BitActionDirective, IconButtonModule],
})
export class RemovePasswordComponent implements OnInit {
continuing = false;
leaving = false;
loading = true;
organization!: Organization;
keyConnectorHostName!: string;
private activeUserId!: UserId;
constructor(
@@ -55,6 +72,7 @@ export class RemovePasswordComponent implements OnInit {
await this.router.navigate(["/"]);
return;
}
this.keyConnectorHostName = Utils.getHostname(this.organization.keyConnectorUrl);
this.loading = false;
}
@@ -73,7 +91,7 @@ export class RemovePasswordComponent implements OnInit {
this.toastService.showToast({
variant: "success",
message: this.i18nService.t("removedMasterPassword"),
message: this.i18nService.t("organizationVerified"),
});
await this.router.navigate(["/"]);
@@ -86,9 +104,11 @@ export class RemovePasswordComponent implements OnInit {
leave = async () => {
const confirmed = await this.dialogService.openSimpleDialog({
title: this.organization.name,
content: { key: "leaveOrganizationConfirmation" },
title: { key: "leaveOrganization" },
content: { key: "leaveOrganizationContent" },
type: "warning",
acceptButtonText: { key: "leaveNow" },
cancelButtonText: { key: "cancel" },
});
if (!confirmed) {