This commit is contained in:
@@ -19,11 +19,12 @@
|
||||
:readonly="formState.readOnly"
|
||||
:label="$ay.t('FormFieldVisible')"
|
||||
:ref="item.key"
|
||||
:disabled="item.stockRequired || formState.readOnly"
|
||||
:disabled="formState.readOnly"
|
||||
@change="visibleChanged(item)"
|
||||
:data-cy="item.key + 'Visible'"
|
||||
></v-checkbox>
|
||||
<v-checkbox
|
||||
v-if="!requiredDisabled(item)"
|
||||
v-model="item.required"
|
||||
:readonly="formState.readOnly"
|
||||
:label="$ay.t('FormFieldEntryRequired')"
|
||||
@@ -152,9 +153,6 @@ export default {
|
||||
this.formState.dirty = true;
|
||||
},
|
||||
requiredDisabled: function(item) {
|
||||
if (item.stockRequired) {
|
||||
return true;
|
||||
}
|
||||
if (item.key == "Wiki" || item.key == "Attachments") {
|
||||
return true;
|
||||
}
|
||||
@@ -187,12 +185,8 @@ export default {
|
||||
let fldItem = vm.obj[i];
|
||||
if (fldItem.custom == false) {
|
||||
//Process regular stock field
|
||||
//If it's *not* set to stockRequired (i.e. built in field with biz rules that can't be hidden or changed)
|
||||
// and it's also set to hidden or required then it's template-worthy
|
||||
if (
|
||||
!fldItem.stockRequired &&
|
||||
(fldItem.visible == false || fldItem.required == true)
|
||||
) {
|
||||
//If it's set to hidden or required then it's template-worthy
|
||||
if (fldItem.visible == false || fldItem.required == true) {
|
||||
temp.push({
|
||||
fld: fldItem.key,
|
||||
required: fldItem.required,
|
||||
@@ -381,7 +375,7 @@ async function initDataObject(vm) {
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
|
||||
}
|
||||
//set vm.obj to the combined synthesized snapshot array of template and availble fields for working data for this form
|
||||
// - {key, ltdisplay, hideable, custom, required, hide, type}
|
||||
// - {key, ltdisplay, custom, required, hide, type}
|
||||
//Iterate ObjectFields
|
||||
//create a new object based on the f.a.f. item and any existing template values for that item
|
||||
|
||||
@@ -420,9 +414,8 @@ async function initDataObject(vm) {
|
||||
let objItem = {
|
||||
key: faf.fieldKey,
|
||||
title: vm.$ay.t(faf.tKey), //sb already cached either above or from the main form it's customizing
|
||||
stockRequired: !faf.hideable,
|
||||
custom: faf.isCustomField,
|
||||
required: faf.hideable === false || templateItem.required === true,
|
||||
required: templateItem.required === true,
|
||||
visible: templateItem.hide !== true,
|
||||
type: templateItem.type
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user