Skip to content

Commit

Permalink
FOUR-19778 Encrypted field does not have read-only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
julceslauhub committed Oct 28, 2024
1 parent f32d5ff commit 48acf63
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/renderer/form-masked-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<input
v-else
v-model="localValue"
v-bind="componentConfig"
v-bind="componentConfigEncField"
v-uni-id="name"
:name="name"
class="form-control"
Expand Down Expand Up @@ -231,6 +231,7 @@ export default {
labelBtn: '',
errorEncryptedField: '',
concealExecuted: false,
componentConfigEncField: null,
};
},
computed: {
Expand Down Expand Up @@ -289,17 +290,18 @@ export default {
* "encrypted" attribute is enabled
*/
if (this.encryptedConfig?.encrypted) {
this.componentConfigEncField = JSON.parse(JSON.stringify(this.componentConfig));
if (uuidValidate(this.localValue)) {
this.inputType = "password";
this.iconBtn = "fas fa-eye";
this.labelBtn = this.$t("Reveal");
this.concealExecuted = true;
this.componentConfig.readonly = true;
this.componentConfigEncField.readonly = true;
} else {
this.inputType = "text";
this.iconBtn = "fas fa-eye-slash";
this.labelBtn = this.$t("Conceal");
this.componentConfig.readonly = false;
this.componentConfigEncField.readonly = this.componentConfig.readonly;
}
} else {
this.inputType = this.dataType;
Expand Down Expand Up @@ -381,7 +383,7 @@ export default {
this.iconBtn = "fas fa-eye";
this.labelBtn = this.$t("Reveal");
this.concealExecuted = true;
this.componentConfig.readonly = true;
this.componentConfigEncField.readonly = true;
this.errorEncryptedField = "";
// Assign uuid from encrypted data
Expand All @@ -392,7 +394,7 @@ export default {
this.inputType = this.dataType;
this.iconBtn = "fas fa-eye-slash";
this.labelBtn = this.$t("Conceal");
this.componentConfig.readonly = false;
this.componentConfigEncField.readonly = this.componentConfig.readonly;
// Assign value decrypted
this.localValue = decryptedValue;
Expand Down

0 comments on commit 48acf63

Please sign in to comment.