1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

[PM-15938] - Restrict viewing hidden input based on permission (#13016)

* allow string or boolean disabled prop in input directive

* fix tests

* add test

* disable custom fields in partial edit

* disable custom fields in partial edit

* manually disable inputs

* revert changes to directive

* revert other changes

* remove unnecessary check for partial-edit
This commit is contained in:
Jordan Aasen
2025-02-04 12:59:25 -08:00
committed by GitHub
parent 327aed9763
commit a9f24b6d24
2 changed files with 36 additions and 14 deletions

View File

@@ -158,20 +158,23 @@ export class CustomFieldsComponent implements OnInit, AfterViewInit {
value = field.value === "true" ? true : false;
}
this.fields.push(
this.formBuilder.group<CustomField>({
type: field.type,
name: field.name,
value: value,
linkedId: field.linkedId,
newField: false,
}),
);
});
const customField = this.formBuilder.group<CustomField>({
type: field.type,
name: field.name,
value: value,
linkedId: field.linkedId,
newField: false,
});
if (!this.cipherFormContainer.originalCipherView?.viewPassword) {
this.customFieldsForm.disable();
}
if (
field.type === FieldType.Hidden &&
!this.cipherFormContainer.originalCipherView?.viewPassword
) {
customField.controls.value.disable();
}
this.fields.push(customField);
});
// Disable the form if in partial-edit mode
// Must happen after the initial fields are populated