From e063c3d05110b57bc4ca3a7d575872acd0d0203a Mon Sep 17 00:00:00 2001 From: --global <> Date: Tue, 26 Nov 2024 17:23:23 -0500 Subject: [PATCH 1/4] Changes to disabled user from seeing password that they shouldn't see or edit easily. --- .../custom-fields/custom-fields.component.ts | 25 ++++++++++++------- .../custom-fields-v2.component.html | 3 +++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/libs/vault/src/cipher-form/components/custom-fields/custom-fields.component.ts b/libs/vault/src/cipher-form/components/custom-fields/custom-fields.component.ts index 1aeb9e0da08..f3d1b4a1b0d 100644 --- a/libs/vault/src/cipher-form/components/custom-fields/custom-fields.component.ts +++ b/libs/vault/src/cipher-form/components/custom-fields/custom-fields.component.ts @@ -154,15 +154,22 @@ export class CustomFieldsComponent implements OnInit, AfterViewInit { value = field.value === "true" ? true : false; } - this.fields.push( - this.formBuilder.group({ - type: field.type, - name: field.name, - value: value, - linkedId: field.linkedId, - newField: false, - }), - ); + const formGroup = this.formBuilder.group({ + type: field.type, + name: field.name, + value: value, + linkedId: field.linkedId, + newField: false, + }); + + if ( + field.type === FieldType.Hidden && + !this.cipherFormContainer.originalCipherView.viewPassword + ) { + formGroup.get("value")?.disable(); + } + + this.fields.push(formGroup); }); // Disable the form if in partial-edit mode diff --git a/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html b/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html index b82b2e7a8a3..e2516018d3c 100644 --- a/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html +++ b/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html @@ -28,6 +28,7 @@

{{ "customFields" | i18n }}

{{ "customFields" | i18n }} diff --git a/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html b/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html index 79099d08c2c..591ed2e53d8 100644 --- a/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html +++ b/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html @@ -28,7 +28,6 @@

{{ "customFields" | i18n }}

{{ "customFields" | i18n }}