1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

PM-11390: [Defect] View Login - Clicking Password History opens Edit Item window behind View Login window (#11119)

* Add password dialog component.

* Properly direct to browser password history screen.

* Add padding to history items.

* Update test to correct password history route.

* Remove unneeded provider.

* Use relative path for SharedModule.
This commit is contained in:
Alec Rippberger
2024-09-25 09:45:13 -05:00
committed by GitHub
parent 57c5c46cf7
commit 742900a663
11 changed files with 320 additions and 11 deletions

View File

@@ -27,10 +27,8 @@
</p>
<a
*ngIf="cipher.hasPasswordHistory && isLogin"
bitLink
class="tw-font-bold tw-no-underline"
routerLink="/cipher-password-history"
[queryParams]="{ cipherId: cipher.id }"
class="tw-font-bold tw-no-underline tw-cursor-pointer"
(click)="viewPasswordHistory()"
bitTypography="body2"
>
{{ "passwordHistory" | i18n }}

View File

@@ -3,6 +3,8 @@ import { Component, Input } from "@angular/core";
import { RouterModule } from "@angular/router";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { CipherId } from "@bitwarden/common/types/guid";
import { ViewPasswordHistoryService } from "@bitwarden/common/vault/abstractions/view-password-history.service";
import { CipherType } from "@bitwarden/common/vault/enums";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import {
@@ -31,7 +33,16 @@ import {
export class ItemHistoryV2Component {
@Input() cipher: CipherView;
constructor(private viewPasswordHistoryService: ViewPasswordHistoryService) {}
get isLogin() {
return this.cipher.type === CipherType.Login;
}
/**
* View the password history for the cipher.
*/
async viewPasswordHistory() {
await this.viewPasswordHistoryService.viewPasswordHistory(this.cipher?.id as CipherId);
}
}