1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

[CL-715] - [Defect] SSH key Private Key field visibility should toggle to hidden when switching items to view in desktop (#15224)

* fix sshKey visibility

* add missing ngIf

* use two-way binding over explicit key
This commit is contained in:
Jordan Aasen
2025-06-25 11:45:42 -07:00
committed by GitHub
parent 4003608019
commit 7403b38f39
2 changed files with 11 additions and 2 deletions

View File

@@ -19,6 +19,7 @@
bitIconButton
bitPasswordInputToggle
data-testid="toggle-privateKey"
[(toggled)]="revealSshKey"
></button>
<button
bitIconButton="bwi-clone"

View File

@@ -1,7 +1,7 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { CommonModule } from "@angular/common";
import { Component, Input } from "@angular/core";
import { Component, Input, OnChanges, SimpleChanges } from "@angular/core";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { SshKeyView } from "@bitwarden/common/vault/models/view/ssh-key.view";
@@ -27,6 +27,14 @@ import { ReadOnlyCipherCardComponent } from "../read-only-cipher-card/read-only-
IconButtonModule,
],
})
export class SshKeyViewComponent {
export class SshKeyViewComponent implements OnChanges {
@Input() sshKey: SshKeyView;
revealSshKey = false;
ngOnChanges(changes: SimpleChanges): void {
if (changes["sshKey"]) {
this.revealSshKey = false;
}
}
}