This commit is contained in:
Yuri Kuznetsov
2023-12-31 11:31:57 +02:00
parent a9bc74b2bd
commit dfe7ff55e4
13 changed files with 57 additions and 57 deletions
+2 -2
View File
@@ -42,8 +42,8 @@ class ConvertCurrencyModalView extends MassConvertCurrencyModalView {
this.getFieldView('currency').fetchToModel();
this.getFieldView('currencyRates').fetchToModel();
let currency = this.model.get('currency');
let currencyRates = this.model.get('currencyRates');
const currency = this.model.get('currency');
const currencyRates = this.model.get('currencyRates');
Espo.Ajax
.postRequest('Action', {
+5 -5
View File
@@ -118,18 +118,18 @@ class ImagePreviewModalView extends ModalView {
onImageLoad() {}
afterRender() {
let $container = this.$el.find('.image-container');
let $img = this.$img = this.$el.find('.image-container img');
const $container = this.$el.find('.image-container');
const $img = this.$img = this.$el.find('.image-container img');
$img.on('load', () => {
let imgEl = $img.get(0);
const imgEl = $img.get(0);
Exif.getData(imgEl, () => {
if ($img.css('image-orientation') === 'from-image') {
return;
}
let orientation = Exif.getTag(this, 'Orientation');
const orientation = Exif.getTag(this, 'Orientation');
switch (orientation) {
case 2:
@@ -173,7 +173,7 @@ class ImagePreviewModalView extends ModalView {
}
const manageSize = () => {
let width = $container.width();
const width = $container.width();
$img.css('maxWidth', width);
};
+3 -3
View File
@@ -44,7 +44,7 @@ class KanbanMoveOverModalView extends ModalView {
events = {
/** @this KanbanMoveOverModalView */
'click [data-action="move"]': function (e) {
let value = $(e.currentTarget).data('value');
const value = $(e.currentTarget).data('value');
this.moveTo(value);
},
@@ -53,7 +53,7 @@ class KanbanMoveOverModalView extends ModalView {
setup() {
this.scope = this.model.entityType;
let iconHtml = this.getHelper().getScopeColorIconHtml(this.scope);
const iconHtml = this.getHelper().getScopeColorIconHtml(this.scope);
this.statusField = this.options.statusField;
@@ -94,7 +94,7 @@ class KanbanMoveOverModalView extends ModalView {
}
moveTo(status) {
var attributes = {};
const attributes = {};
attributes[this.statusField] = status;
+1 -2
View File
@@ -68,8 +68,7 @@ class LastViewedModalView extends ModalView {
}
loadList() {
let viewName =
this.getMetadata().get('clientDefs.' + this.scope + '.recordViews.listLastViewed') ||
const viewName = this.getMetadata().get('clientDefs.' + this.scope + '.recordViews.listLastViewed') ||
'views/record/list';
this.listenToOnce(this.collection, 'sync', () => {
+2 -2
View File
@@ -105,7 +105,7 @@ class MassActionModalView extends ModalView {
});
this.on('close', () => {
let status = this.model.get('status');
const status = this.model.get('status');
if (
status !== 'Pending' &&
@@ -124,7 +124,7 @@ class MassActionModalView extends ModalView {
Espo.Ajax
.getRequest(`MassAction/${this.id}/status`)
.then(response => {
let status = response.status;
const status = response.status;
this.model.set('status', status);
@@ -61,7 +61,7 @@ class MassConvertCurrencyModalView extends ModalView {
style: 'danger'
}, true);
let model = this.model = new Model();
const model = this.model = new Model();
model.set('currency', this.getConfig().get('defaultCurrency'));
model.set('baseCurrency', this.getConfig().get('baseCurrency'));
@@ -115,14 +115,14 @@ class MassConvertCurrencyModalView extends ModalView {
this.getFieldView('currency').fetchToModel();
this.getFieldView('currencyRates').fetchToModel();
let currency = this.model.get('currency');
let currencyRates = this.model.get('currencyRates');
const currency = this.model.get('currency');
const currencyRates = this.model.get('currencyRates');
let hasWhere = !this.options.ids || this.options.ids.length === 0;
const hasWhere = !this.options.ids || this.options.ids.length === 0;
let helper = new Helper(this);
const helper = new Helper(this);
let idle = hasWhere && helper.checkIsIdle(this.options.totalCount);
const idle = hasWhere && helper.checkIsIdle(this.options.totalCount);
Espo.Ajax.postRequest('MassAction', {
entityType: this.options.entityType,
+1 -1
View File
@@ -100,7 +100,7 @@ class MassUpdateModalView extends ModalView {
$('<span>').text(this.translate('Mass Update'))
)
var forbiddenList = this.getAcl().getScopeForbiddenFieldList(this.entityType, 'edit') || [];
const forbiddenList = this.getAcl().getScopeForbiddenFieldList(this.entityType, 'edit') || [];
this.wait(true);
@@ -73,18 +73,18 @@ class PasswordChangeRequestModalView extends ModalView {
// noinspection JSUnusedGlobalSymbols
actionSubmit() {
let $userName = this.$userName;
let $emailAddress = this.$emailAddress;
const $userName = this.$userName;
const $emailAddress = this.$emailAddress;
let userName = $userName.val();
let emailAddress = $emailAddress.val();
const userName = $userName.val();
const emailAddress = $emailAddress.val();
let isValid = true;
if (userName === '') {
isValid = false;
var message = this.getLanguage().translate('userCantBeEmpty', 'messages', 'User');
const message = this.getLanguage().translate('userCantBeEmpty', 'messages', 'User');
this.isPopoverUserNameDestroyed = false;
@@ -95,7 +95,7 @@ class PasswordChangeRequestModalView extends ModalView {
trigger: 'manual',
}).popover('show');
let $cellUserName = $userName.closest('.form-group');
const $cellUserName = $userName.closest('.form-group');
$cellUserName.addClass('has-error');
@@ -114,7 +114,7 @@ class PasswordChangeRequestModalView extends ModalView {
if (emailAddress === '') {
isValid = false;
let message = this.getLanguage().translate('emailAddressCantBeEmpty', 'messages', 'User');
const message = this.getLanguage().translate('emailAddressCantBeEmpty', 'messages', 'User');
this.isPopoverEmailAddressDestroyed = false;
@@ -125,7 +125,7 @@ class PasswordChangeRequestModalView extends ModalView {
trigger: 'manual',
}).popover('show');
let $cellEmailAddress = $emailAddress.closest('.form-group');
const $cellEmailAddress = $emailAddress.closest('.form-group');
$cellEmailAddress.addClass('has-error');
@@ -146,7 +146,7 @@ class PasswordChangeRequestModalView extends ModalView {
return;
}
let $submit = this.$el.find('button[data-name="submit"]');
const $submit = this.$el.find('button[data-name="submit"]');
$submit.addClass('disabled');
@@ -43,10 +43,10 @@ class ResolveSaveConflictModalView extends ModalView {
defaultResolution = 'current'
data() {
let dataList = [];
const dataList = [];
this.fieldList.forEach(item => {
let o = {
const o = {
field: item,
viewKey: item + 'Field',
resolution: this.defaultResolution,
@@ -85,17 +85,17 @@ class ResolveSaveConflictModalView extends ModalView {
this.currentAttributes = Espo.Utils.cloneDeep(this.options.currentAttributes);
this.actualAttributes = Espo.Utils.cloneDeep(this.options.actualAttributes);
let attributeList = this.options.attributeList;
const attributeList = this.options.attributeList;
let fieldList = [];
const fieldList = [];
this.getFieldManager()
.getEntityTypeFieldList(this.entityType)
.forEach(field => {
let fieldAttributeList = this.getFieldManager()
const fieldAttributeList = this.getFieldManager()
.getEntityTypeFieldAttributeList(this.entityType, field);
let intersect = attributeList.filter(value => fieldAttributeList.includes(value));
const intersect = attributeList.filter(value => fieldAttributeList.includes(value));
if (intersect.length) {
fieldList.push(field);
@@ -121,10 +121,10 @@ class ResolveSaveConflictModalView extends ModalView {
}
setResolution(field, resolution) {
let attributeList = this.getFieldManager()
const attributeList = this.getFieldManager()
.getEntityTypeFieldAttributeList(this.entityType, field);
let values = {};
const values = {};
let source = this.currentAttributes;
@@ -135,7 +135,7 @@ class ResolveSaveConflictModalView extends ModalView {
source = this.originalAttributes;
}
for (let attribute of attributeList) {
for (const attribute of attributeList) {
values[attribute] = source[attribute] || null;
}
@@ -143,9 +143,9 @@ class ResolveSaveConflictModalView extends ModalView {
}
createField(field) {
let type = this.model.getFieldType(field);
const type = this.model.getFieldType(field);
let viewName =
const viewName =
this.model.getFieldParam(field, 'view') ||
this.getFieldManager().getViewName(type);
@@ -160,10 +160,10 @@ class ResolveSaveConflictModalView extends ModalView {
afterRender() {
this.$el.find('[data-name="resolution"]').on('change', e => {
let $el = $(e.currentTarget);
const $el = $(e.currentTarget);
let field = $el.attr('data-field');
let resolution = $el.val();
const field = $el.attr('data-field');
const resolution = $el.val();
this.setResolution(field, resolution);
});
@@ -171,7 +171,7 @@ class ResolveSaveConflictModalView extends ModalView {
// noinspection JSUnusedGlobalSymbols
actionApply() {
let attributes = this.model.attributes;
const attributes = this.model.attributes;
this.originalModel.set(attributes);
+2 -2
View File
@@ -56,7 +56,7 @@ class SaveFiltersModalView extends ModalView {
this.headerText = this.translate('Save Filter');
let model = new Model();
const model = new Model();
this.createView('name', 'views/fields/varchar', {
selector: '.field[data-name="name"]',
@@ -80,7 +80,7 @@ class SaveFiltersModalView extends ModalView {
}
actionSave() {
let nameView = this.getFieldView('name');
const nameView = this.getFieldView('name');
nameView.fetchToModel();
@@ -55,7 +55,7 @@ class SelectCategoryTreeRecordsModalView extends SelectRecordsModalView {
style: 'danger',
label: 'Select',
onClick: dialog => {
let listView = this.getRecordView();
const listView = this.getRecordView();
if (listView.allResultIsChecked) {
this.trigger('select', {
@@ -65,7 +65,8 @@ class SelectCategoryTreeRecordsModalView extends SelectRecordsModalView {
});
}
else {
var list = listView.getSelected();
const list = listView.getSelected();
if (list.length) {
this.trigger('select', list);
}
@@ -99,7 +100,7 @@ class SelectCategoryTreeRecordsModalView extends SelectRecordsModalView {
this.collection = collection;
var searchManager = new SearchManager(collection, 'listSelect', null, this.getDateTime());
const searchManager = new SearchManager(collection, 'listSelect', null, this.getDateTime());
searchManager.emptyOnReset = true;
@@ -118,8 +119,8 @@ class SelectCategoryTreeRecordsModalView extends SelectRecordsModalView {
collection.where = searchManager.getWhere();
collection.url = collection.entityType + '/action/listTree';
var viewName = this.getMetadata()
.get('clientDefs.' + this.scope + '.recordViews.listSelectCategoryTree') ||
const viewName =
this.getMetadata().get('clientDefs.' + this.scope + '.recordViews.listSelectCategoryTree') ||
'views/record/list-tree';
this.listenToOnce(collection, 'sync', () => {
+1 -1
View File
@@ -52,7 +52,7 @@ class SelectTemplateModalView extends SelectRecordsModalView {
afterRender() {
super.afterRender();
let firstLinkElement = this.$el.find('a.link').first().get(0);
const firstLinkElement = this.$el.find('a.link').first().get(0);
if (firstLinkElement) {
// noinspection JSUnresolvedReference
+4 -4
View File
@@ -35,10 +35,10 @@ class ViewMapModalView extends ModalView {
backdrop = true
setup() {
let field = this.options.field;
const field = this.options.field;
let url = '#AddressMap/view/' + this.model.entityType + '/' + this.model.id + '/' + field;
let fieldLabel = this.translate(field, 'fields', this.model.entityType);
const url = '#AddressMap/view/' + this.model.entityType + '/' + this.model.id + '/' + field;
const fieldLabel = this.translate(field, 'fields', this.model.entityType);
this.headerElement =
$('<a>')
@@ -46,7 +46,7 @@ class ViewMapModalView extends ModalView {
.text(fieldLabel)
.get(0);
let viewName = this.model.getFieldParam(field + 'Map', 'view') ||
const viewName = this.model.getFieldParam(field + 'Map', 'view') ||
this.getFieldManager().getViewName('map');
this.createView('map', viewName, {