1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

[PM-21021] - fix toggled hidden field state for custom fields view (#14595)

* fix toggled hidden field state for custom fields view

* fix hidden field toggle for cards and login details
This commit is contained in:
Jordan Aasen
2025-05-09 18:09:26 -07:00
committed by GitHub
parent 23d4f04b22
commit 2282a74abd
5 changed files with 45 additions and 6 deletions

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, OnInit } from "@angular/core";
import { Component, Input, OnChanges, OnInit, SimpleChanges } from "@angular/core";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service";
@@ -45,7 +45,7 @@ import { VaultAutosizeReadOnlyTextArea } from "../../directives/readonly-textare
VaultAutosizeReadOnlyTextArea,
],
})
export class CustomFieldV2Component implements OnInit {
export class CustomFieldV2Component implements OnInit, OnChanges {
@Input() cipher: CipherView;
fieldType = FieldType;
fieldOptions: any;
@@ -67,6 +67,12 @@ export class CustomFieldV2Component implements OnInit {
this.fieldOptions = this.getLinkedFieldsOptionsForCipher();
}
ngOnChanges(changes: SimpleChanges): void {
if (changes["cipher"]) {
this.revealedHiddenFields = [];
}
}
getLinkedType(linkedId: LinkedIdType) {
const linkedType = this.fieldOptions.get(linkedId);
return this.i18nService.t(linkedType.i18nKey);