EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
field custom paramList prop
Yuri Kuznetsov749f3c686eef
diff --git a/client/src/views/fields/base.js b/client/src/views/fields/base.jsindex 5630c2f57f..60d8af6f1b 100644--- a/client/src/views/fields/base.js+++ b/client/src/views/fields/base.js@@ -54,6 +54,7 @@ class BaseFieldView extends View {/*** @typedef {Object} module:views/fields/base~params+ * @property {boolean} [inlineEditDisabled] Disable inline edit.* @property {boolean} [readOnly] Read-only.*/@@ -178,6 +179,14 @@ class BaseFieldView extends View {*/name+ /**+ * A field parameter list. To be used for custom fields not defined in metadata > fields.+ *+ * @type {string[]}+ * @since 9.0.0+ */+ paramList+/*** Definitions.*@@ -719,15 +728,17 @@ class BaseFieldView extends View {this.labelText = this.translate(this.name, 'fields', this.entityType);}- this.getFieldManager().getParamList(this.type).forEach(d => {- const name = d.name;+ const paramList = this.paramList || this.getFieldManager().getParamList(this.type).map(it => it.name);- if (!(name in this.params)) {- this.params[name] = this.model.getFieldParam(this.name, name);+ paramList.forEach(name => {+ if (name in this.params) {+ return;+ }- if (typeof this.params[name] === 'undefined') {- this.params[name] = null;- }+ this.params[name] = this.model.getFieldParam(this.name, name);++ if (typeof this.params[name] === 'undefined') {+ this.params[name] = null;}});