diff --git a/client/src/views/email/record/detail-quick.js b/client/src/views/email/record/detail-quick.js index a32526482f..bb51f7eb45 100644 --- a/client/src/views/email/record/detail-quick.js +++ b/client/src/views/email/record/detail-quick.js @@ -26,11 +26,10 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/email/record/detail-quick', ['views/email/record/detail'], function (Dep) { +import EmailDetailRecordView from 'views/email/record/detail'; - return Dep.extend({ +export default class extends EmailDetailRecordView { - isWide: true, - sideView: false, - }); -}); + isWide = true + sideView = false +} diff --git a/client/src/views/email/record/detail-side.js b/client/src/views/email/record/detail-side.js index c659f9d862..f3655c129d 100644 --- a/client/src/views/email/record/detail-side.js +++ b/client/src/views/email/record/detail-side.js @@ -26,7 +26,6 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/email/record/detail-side', ['views/record/detail-side'], function (Dep) { +import DetailSideRecordView from 'views/record/detail-side'; - return Dep.extend({}); -}); +export default class extends DetailSideRecordView {} diff --git a/client/src/views/email/record/edit-quick.js b/client/src/views/email/record/edit-quick.js index 2b1cfe040f..eb5a9f9e33 100644 --- a/client/src/views/email/record/edit-quick.js +++ b/client/src/views/email/record/edit-quick.js @@ -26,11 +26,10 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/email/record/edit-quick', ['views/email/record/edit'], function (Dep) { +import EmailEditRecordView from 'views/email/record/edit'; - return Dep.extend({ +export default class extends EmailEditRecordView { - isWide: true, - sideView: false, - }); -}); + isWide = true + sideView = false +} diff --git a/client/src/views/email/record/list-expanded.js b/client/src/views/email/record/list-expanded.js index fb71ca6035..84bc478ce1 100644 --- a/client/src/views/email/record/list-expanded.js +++ b/client/src/views/email/record/list-expanded.js @@ -26,24 +26,23 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define( - 'views/email/record/list-expanded', - ['views/record/list-expanded', 'views/email/record/list'], - function (Dep, List) { +import ListExpandedRecordView from 'views/record/list-expanded'; +import List from 'views/email/record/list'; - return Dep.extend({ +export default class extends ListExpandedRecordView { - actionMarkAsImportant: function (data) { - List.prototype.actionMarkAsImportant.call(this, data); - }, + // noinspection JSUnusedGlobalSymbols + actionMarkAsImportant(data) { + List.prototype.actionMarkAsImportant.call(this, data); + } - actionMarkAsNotImportant: function (data) { - List.prototype.actionMarkAsNotImportant.call(this, data); - }, + // noinspection JSUnusedGlobalSymbols + actionMarkAsNotImportant(data) { + List.prototype.actionMarkAsNotImportant.call(this, data); + } - actionMoveToTrash: function (data) { - List.prototype.actionMoveToTrash.call(this, data); - }, - - }); -}); + // noinspection JSUnusedGlobalSymbols + actionMoveToTrash(data) { + List.prototype.actionMoveToTrash.call(this, data); + } +} diff --git a/client/src/views/email/record/list-related.js b/client/src/views/email/record/list-related.js index fbd0b033f6..f1fa555113 100644 --- a/client/src/views/email/record/list-related.js +++ b/client/src/views/email/record/list-related.js @@ -26,10 +26,10 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/email/record/list-related', ['views/record/list'], function (Dep) { +import ListRecordView from 'views/record/list'; - return Dep.extend({ +export default class extends ListRecordView { + + massActionList = ['remove', 'massUpdate'] +} - massActionList: ['remove', 'massUpdate'], - }); -}); diff --git a/client/src/views/email/record/panels/default-side.js b/client/src/views/email/record/panels/default-side.js index 066ad3aaeb..03c04ca8ab 100644 --- a/client/src/views/email/record/panels/default-side.js +++ b/client/src/views/email/record/panels/default-side.js @@ -26,32 +26,34 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/email/record/panels/default-side', ['views/record/panels/default-side'], function (Dep) { +import DefaultSidePanelView from 'views/record/panels/default-side'; - return Dep.extend({ +export default class extends DefaultSidePanelView { - setupFields: function () { - Dep.prototype.setupFields.call(this); + setupFields() { + super.setupFields(); - this.fieldList.push({ - name: 'hasAttachment', - view: 'views/email/fields/has-attachment', - noLabel: true, - }); + this.fieldList.push({ + name: 'hasAttachment', + view: 'views/email/fields/has-attachment', + noLabel: true, + }); - this.controlHasAttachmentField(); + this.controlHasAttachmentField(); - this.listenTo(this.model, 'change:hasAttachment', this.controlHasAttachmentField, this); - }, + this.listenTo(this.model, 'change:hasAttachment', () => this.controlHasAttachmentField()); + } - controlHasAttachmentField: function () { - if (this.model.get('hasAttachment')) { - this.recordViewObject.showField('hasAttachment'); + /** + * @private + */ + controlHasAttachmentField() { + if (this.model.get('hasAttachment')) { + this.recordViewObject.showField('hasAttachment'); - return; - } + return; + } - this.recordViewObject.hideField('hasAttachment'); - }, - }); -}); + this.recordViewObject.hideField('hasAttachment'); + } +} diff --git a/client/src/views/email/record/panels/event.js b/client/src/views/email/record/panels/event.js index 84311a4a5f..2e46e27026 100644 --- a/client/src/views/email/record/panels/event.js +++ b/client/src/views/email/record/panels/event.js @@ -26,62 +26,64 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/email/record/panels/event', ['views/record/panels/side'], function (Dep) { +import SidePanelView from 'views/record/panels/side'; - return class extends Dep { +export default class extends SidePanelView { - setupFields() { - super.setupFields(); + setupFields() { + super.setupFields(); - this.fieldList.push({ - name: 'icsEventDateStart', - readOnly: true, - labelText: this.translate('dateStart', 'fields', 'Meeting'), - }); + this.fieldList.push({ + name: 'icsEventDateStart', + readOnly: true, + labelText: this.translate('dateStart', 'fields', 'Meeting'), + }); - this.fieldList.push({ - name: 'createdEvent', - readOnly: true, - }); + this.fieldList.push({ + name: 'createdEvent', + readOnly: true, + }); - this.fieldList.push({ - name: 'createEvent', - readOnly: true, - noLabel: true, - }); + this.fieldList.push({ + name: 'createEvent', + readOnly: true, + noLabel: true, + }); - this.controlEventField(); + this.controlEventField(); - this.listenTo(this.model, 'change:icsEventData', this.controlEventField, this); - this.listenTo(this.model, 'change:createdEventId', this.controlEventField, this); - } - - controlEventField() { - if (!this.model.get('icsEventData')) { - this.recordViewObject.hideField('createEvent'); - this.recordViewObject.showField('createdEvent'); - - return; - } - - const eventData = this.model.get('icsEventData'); - - if (eventData.createdEvent) { - this.recordViewObject.hideField('createEvent'); - this.recordViewObject.showField('createdEvent'); - - return; - } - - if (!this.model.get('createdEventId')) { - this.recordViewObject.hideField('createdEvent'); - this.recordViewObject.showField('createEvent'); - - return; - } + this.listenTo(this.model, 'change:icsEventData', this.controlEventField, this); + this.listenTo(this.model, 'change:createdEventId', this.controlEventField, this); + } + /** + * @private + */ + controlEventField() { + if (!this.model.get('icsEventData')) { this.recordViewObject.hideField('createEvent'); this.recordViewObject.showField('createdEvent'); + + return; } - }; -}); + + const eventData = this.model.get('icsEventData'); + + if (eventData.createdEvent) { + this.recordViewObject.hideField('createEvent'); + this.recordViewObject.showField('createdEvent'); + + return; + } + + if (!this.model.get('createdEventId')) { + this.recordViewObject.hideField('createdEvent'); + this.recordViewObject.showField('createEvent'); + + return; + } + + this.recordViewObject.hideField('createEvent'); + this.recordViewObject.showField('createdEvent'); + } +} diff --git a/client/src/views/email/record/row-actions/dashlet.js b/client/src/views/email/record/row-actions/dashlet.js index 85c8f280d1..d3ac1856fc 100644 --- a/client/src/views/email/record/row-actions/dashlet.js +++ b/client/src/views/email/record/row-actions/dashlet.js @@ -26,99 +26,96 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/email/record/row-actions/dashlet', ['views/record/row-actions/default'], function (Dep) { +import DefaultRowActionsView from 'views/record/row-actions/default'; - return Dep.extend({ +export default class extends DefaultRowActionsView { - setup: function () { - Dep.prototype.setup.call(this); + setup() { + super.setup(); - this.listenTo(this.model, 'change:isImportant', () => { - setTimeout(() => { - this.reRender(); - }, 10); - }); - }, + this.listenTo(this.model, 'change:isImportant', () => { + setTimeout(() => this.reRender(), 10); + }); + } - getActionList: function () { - var list = [{ - action: 'quickView', - label: 'View', - data: { - id: this.model.id - }, - groupIndex: 0, - }]; + getActionList() { + let list = [{ + action: 'quickView', + label: 'View', + data: { + id: this.model.id + }, + groupIndex: 0, + }]; - if (this.options.acl.edit) { - list = list.concat([ - { - action: 'quickEdit', - label: 'Edit', - data: { - id: this.model.id - }, - groupIndex: 0, - } - ]); - } - - if (this.model.get('isUsers') && this.model.get('status') !== 'Draft') { - if (!this.model.get('inTrash')) { - list.push({ - action: 'moveToTrash', - label: 'Move to Trash', - data: { - id: this.model.id - }, - groupIndex: 1, - }); - } else { - list.push({ - action: 'retrieveFromTrash', - label: 'Retrieve from Trash', - data: { - id: this.model.id - }, - groupIndex: 1, - }); - } - } - - if (this.getAcl().checkModel(this.model, 'delete')) { - list.push({ - action: 'quickRemove', - label: 'Remove', + if (this.options.acl.edit) { + list = list.concat([ + { + action: 'quickEdit', + label: 'Edit', data: { id: this.model.id }, groupIndex: 0, + } + ]); + } + + if (this.model.get('isUsers') && this.model.get('status') !== 'Draft') { + if (!this.model.get('inTrash')) { + list.push({ + action: 'moveToTrash', + label: 'Move to Trash', + data: { + id: this.model.id + }, + groupIndex: 1, + }); + } else { + list.push({ + action: 'retrieveFromTrash', + label: 'Retrieve from Trash', + data: { + id: this.model.id + }, + groupIndex: 1, }); } + } - if (this.model.get('isUsers')) { - if (!this.model.get('isImportant')) { - list.push({ - action: 'markAsImportant', - label: 'Mark as Important', - data: { - id: this.model.id - }, - groupIndex: 1, - }); - } else { - list.push({ - action: 'markAsNotImportant', - label: 'Unmark Importance', - data: { - id: this.model.id - }, - groupIndex: 1, - }); - } + if (this.getAcl().checkModel(this.model, 'delete')) { + list.push({ + action: 'quickRemove', + label: 'Remove', + data: { + id: this.model.id + }, + groupIndex: 0, + }); + } + + if (this.model.get('isUsers')) { + if (!this.model.get('isImportant')) { + list.push({ + action: 'markAsImportant', + label: 'Mark as Important', + data: { + id: this.model.id + }, + groupIndex: 1, + }); + } else { + list.push({ + action: 'markAsNotImportant', + label: 'Unmark Importance', + data: { + id: this.model.id + }, + groupIndex: 1, + }); } + } - return list; - }, - }); -}); + return list; + } +}