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

[PM-18017] Show key connector domain in remove password page (#14695)

* Passed in userId on RemovePasswordComponent.

* Added userId on other references to KeyConnectorService methods

* remove password component refactor, test coverage, enabled strict

* explicit user id provided to key connector service

* redirect to / instead when user not logged in or not managing organization

* key connector service explicit user id

* key connector service no longer requires account service

* key connector service missing null type

* cli convert to key connector unit tests

* remove unnecessary SyncService

* error toast not showing on ErrorResponse

* bad import due to merge conflict

* bad import due to merge conflict

* missing loading in remove password component for browser extension

* error handling in remove password component

* organization observable race condition in key-connector

* usesKeyConnector always returns boolean

* unit test coverage

* key connector reactive

* reactive key connector service

* introducing convertAccountRequired$

* cli build fix

* moving message sending side effect to sync

* key connector service unit tests

* fix unit tests

* move key connector components to KM team ownership

* new unit tests in wrong place

* key connector domain shown in remove password component

* type safety improvements

* convert to key connector command localization

* key connector domain in convert to key connector command

* convert to key connector command unit tests with prompt assert

* organization name placement change in the remove password component

* unit test update

* key connector url required to be provided when migrating user

* unit tests in wrong place after KM code ownership move

* infinite page reload

* failing unit tests

* failing unit tests

---------

Co-authored-by: Todd Martin <tmartin@bitwarden.com>
This commit is contained in:
Maciej Zieniuk
2025-05-19 14:58:51 +02:00
committed by GitHub
parent ef592bf23a
commit 239556b55f
18 changed files with 201 additions and 140 deletions

View File

@@ -22,6 +22,7 @@ describe("RemovePasswordComponent", () => {
const organization = {
id: "test-organization-id",
name: "test-organization-name",
keyConnectorUrl: "https://key-connector-url.com",
} as Organization;
const accountService = mockAccountServiceWith(userId);
@@ -124,7 +125,10 @@ describe("RemovePasswordComponent", () => {
await component.convert();
expect(component.continuing).toBe(true);
expect(mockKeyConnectorService.migrateUser).toHaveBeenCalledWith(userId);
expect(mockKeyConnectorService.migrateUser).toHaveBeenCalledWith(
organization.keyConnectorUrl,
userId,
);
expect(mockToastService.showToast).toHaveBeenCalledWith({
variant: "success",
message: "removed master password",
@@ -140,7 +144,10 @@ describe("RemovePasswordComponent", () => {
await component.convert();
expect(component.continuing).toBe(false);
expect(mockKeyConnectorService.migrateUser).toHaveBeenCalledWith(userId);
expect(mockKeyConnectorService.migrateUser).toHaveBeenCalledWith(
organization.keyConnectorUrl,
userId,
);
expect(mockToastService.showToast).toHaveBeenCalledWith({
variant: "error",
title: "error occurred",
@@ -164,7 +171,10 @@ describe("RemovePasswordComponent", () => {
await component.convert();
expect(component.continuing).toBe(false);
expect(mockKeyConnectorService.migrateUser).toHaveBeenCalledWith(userId);
expect(mockKeyConnectorService.migrateUser).toHaveBeenCalledWith(
organization.keyConnectorUrl,
userId,
);
expect(mockToastService.showToast).toHaveBeenCalledWith({
variant: "error",
title: "error occurred",

View File

@@ -66,7 +66,10 @@ export class RemovePasswordComponent implements OnInit {
this.continuing = true;
try {
await this.keyConnectorService.migrateUser(this.activeUserId);
await this.keyConnectorService.migrateUser(
this.organization.keyConnectorUrl,
this.activeUserId,
);
this.toastService.showToast({
variant: "success",