mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 02:03:39 +00:00
[PM-20988][PM-20986][PM-20983][PM-20971][PM-21019] - Multiple defect fixes for desktop cipher form update (#14559)
* multiple bug fixes * favor getters to local state * fix tests
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { NgIf } from "@angular/common";
|
||||
import { Component, Input, OnInit } from "@angular/core";
|
||||
import { Component, Input } from "@angular/core";
|
||||
|
||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||
@@ -28,19 +28,9 @@ import { ReadOnlyCipherCardComponent } from "../read-only-cipher-card/read-only-
|
||||
ReadOnlyCipherCardComponent,
|
||||
],
|
||||
})
|
||||
export class ViewIdentitySectionsComponent implements OnInit {
|
||||
export class ViewIdentitySectionsComponent {
|
||||
@Input({ required: true }) cipher: CipherView | null = null;
|
||||
|
||||
showPersonalDetails: boolean = false;
|
||||
showIdentificationDetails: boolean = false;
|
||||
showContactDetails: boolean = false;
|
||||
|
||||
ngOnInit(): void {
|
||||
this.showPersonalDetails = this.hasPersonalDetails();
|
||||
this.showIdentificationDetails = this.hasIdentificationDetails();
|
||||
this.showContactDetails = this.hasContactDetails();
|
||||
}
|
||||
|
||||
/** Returns all populated address fields */
|
||||
get addressFields(): string {
|
||||
if (!this.cipher) {
|
||||
@@ -57,7 +47,7 @@ export class ViewIdentitySectionsComponent implements OnInit {
|
||||
}
|
||||
|
||||
/** Returns true when any of the "personal detail" attributes are populated */
|
||||
private hasPersonalDetails(): boolean {
|
||||
get hasPersonalDetails(): boolean {
|
||||
if (!this.cipher) {
|
||||
return false;
|
||||
}
|
||||
@@ -67,7 +57,7 @@ export class ViewIdentitySectionsComponent implements OnInit {
|
||||
}
|
||||
|
||||
/** Returns true when any of the "identification detail" attributes are populated */
|
||||
private hasIdentificationDetails(): boolean {
|
||||
get hasIdentificationDetails(): boolean {
|
||||
if (!this.cipher) {
|
||||
return false;
|
||||
}
|
||||
@@ -77,7 +67,7 @@ export class ViewIdentitySectionsComponent implements OnInit {
|
||||
}
|
||||
|
||||
/** Returns true when any of the "contact detail" attributes are populated */
|
||||
private hasContactDetails(): boolean {
|
||||
get hasContactDetails(): boolean {
|
||||
if (!this.cipher) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user