cs
This commit is contained in:
@@ -52,7 +52,7 @@ class MassUpdateModalView extends ModalView {
|
||||
events = {
|
||||
/** @this MassUpdateModalView */
|
||||
'click a[data-action="add-field"]': function (e) {
|
||||
let field = $(e.currentTarget).data('name');
|
||||
const field = $(e.currentTarget).data('name');
|
||||
|
||||
this.addField(field);
|
||||
},
|
||||
@@ -86,7 +86,7 @@ class MassUpdateModalView extends ModalView {
|
||||
|
||||
this.hasActionMap = {};
|
||||
|
||||
let totalCount = this.options.totalCount;
|
||||
const totalCount = this.options.totalCount;
|
||||
|
||||
this.helper = new MassActionHelper(this);
|
||||
|
||||
@@ -139,11 +139,11 @@ class MassUpdateModalView extends ModalView {
|
||||
|
||||
this.addedFieldList.push(name);
|
||||
|
||||
let label = this.getHelper().escapeString(
|
||||
const label = this.getHelper().escapeString(
|
||||
this.translate(name, 'fields', this.entityType)
|
||||
);
|
||||
|
||||
let $cell =
|
||||
const $cell =
|
||||
$('<div>')
|
||||
.addClass('cell form-group')
|
||||
.attr('data-name', name)
|
||||
@@ -158,7 +158,7 @@ class MassUpdateModalView extends ModalView {
|
||||
.attr('data-name', name)
|
||||
);
|
||||
|
||||
let $row =
|
||||
const $row =
|
||||
$('<div>')
|
||||
.addClass('item grid-auto-fill-md')
|
||||
.attr('data-name', name)
|
||||
@@ -166,13 +166,13 @@ class MassUpdateModalView extends ModalView {
|
||||
|
||||
this.$el.find('.fields-container').append($row);
|
||||
|
||||
let type = this.model.getFieldType(name);
|
||||
let viewName = this.model.getFieldParam(name, 'view') || this.getFieldManager().getViewName(type);
|
||||
const type = this.model.getFieldType(name);
|
||||
const viewName = this.model.getFieldParam(name, 'view') || this.getFieldManager().getViewName(type);
|
||||
|
||||
let actionList = this.getMetadata().get(['entityDefs', this.entityType, name, 'massUpdateActionList']) ||
|
||||
const actionList = this.getMetadata().get(['entityDefs', this.entityType, name, 'massUpdateActionList']) ||
|
||||
this.getMetadata().get(['fields', type, 'massUpdateActionList']);
|
||||
|
||||
let hasActionDropdown = actionList !== null;
|
||||
const hasActionDropdown = actionList !== null;
|
||||
|
||||
this.hasActionMap[name] = hasActionDropdown;
|
||||
|
||||
@@ -192,13 +192,13 @@ class MassUpdateModalView extends ModalView {
|
||||
});
|
||||
|
||||
if (hasActionDropdown) {
|
||||
let $select =
|
||||
const $select =
|
||||
$('<select>')
|
||||
.addClass('item-action form-control')
|
||||
.attr('data-name', name);
|
||||
|
||||
actionList.forEach(action => {
|
||||
let label = this.translate(Espo.Utils.upperCaseFirst(action));
|
||||
const label = this.translate(Espo.Utils.upperCaseFirst(action));
|
||||
|
||||
$select.append(
|
||||
$('<option>')
|
||||
@@ -207,7 +207,7 @@ class MassUpdateModalView extends ModalView {
|
||||
);
|
||||
});
|
||||
|
||||
let $cellAction =
|
||||
const $cellAction =
|
||||
$('<div>')
|
||||
.addClass('cell call-action form-group')
|
||||
.attr('data-name', name)
|
||||
@@ -239,14 +239,14 @@ class MassUpdateModalView extends ModalView {
|
||||
actionUpdate() {
|
||||
this.disableButton('update');
|
||||
|
||||
let attributes = {};
|
||||
let actions = {};
|
||||
const attributes = {};
|
||||
const actions = {};
|
||||
|
||||
this.addedFieldList.forEach(field => {
|
||||
let action = this.fetchAction(field);
|
||||
let itemAttributes = this.getFieldView(field).fetch();
|
||||
const action = this.fetchAction(field);
|
||||
const itemAttributes = this.getFieldView(field).fetch();
|
||||
|
||||
let itemActualAttributes = {};
|
||||
const itemActualAttributes = {};
|
||||
|
||||
this.getFieldManager()
|
||||
.getEntityTypeFieldActualAttributeList(this.entityType, field)
|
||||
@@ -264,7 +264,7 @@ class MassUpdateModalView extends ModalView {
|
||||
let notValid = false;
|
||||
|
||||
this.addedFieldList.forEach(field => {
|
||||
let view = this.getFieldView(field);
|
||||
const view = this.getFieldView(field);
|
||||
|
||||
notValid = view.validate() || notValid;
|
||||
});
|
||||
@@ -328,7 +328,7 @@ class MassUpdateModalView extends ModalView {
|
||||
return this.ACTION_UPDATE;
|
||||
}
|
||||
|
||||
let $dropdown = this.$el.find('select.item-action[data-name="' + name + '"]');
|
||||
const $dropdown = this.$el.find('select.item-action[data-name="' + name + '"]');
|
||||
|
||||
return $dropdown.val() || this.ACTION_UPDATE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user