diff --git a/client/src/views/action-history-record/fields/target-type.js b/client/src/views/action-history-record/fields/target-type.js index adc75ffdeb..aecd93d191 100644 --- a/client/src/views/action-history-record/fields/target-type.js +++ b/client/src/views/action-history-record/fields/target-type.js @@ -26,13 +26,14 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/action-history-record/fields/target-type', ['views/fields/enum'], function (Dep) { +import EnumFieldView from 'views/fields/enum'; - return Dep.extend({ +export default class extends EnumFieldView { + + setupOptions() { + super.setupOptions(); + + this.params.options = this.getMetadata().getScopeEntityList(); + } +} - setupOptions: function () { - Dep.prototype.setupOptions.call(this); - this.params.options = this.getMetadata().getScopeEntityList(); - }, - }); -}); diff --git a/client/src/views/action-history-record/fields/target.js b/client/src/views/action-history-record/fields/target.js index cd09cfd73b..1acd7b579c 100644 --- a/client/src/views/action-history-record/fields/target.js +++ b/client/src/views/action-history-record/fields/target.js @@ -26,38 +26,43 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/action-history-record/fields/target', ['views/fields/link-parent'], function (Dep) { +import LinkParentFieldView from 'views/fields/link-parent'; - return Dep.extend({ +class ActionHistoryRecordTargetFieldView extends LinkParentFieldView +{ + displayScopeColorInListMode = true - displayScopeColorInListMode: true, + ignoreScopeList = [ + 'Preferences', + 'ExternalAccount', + 'Notification', + 'Note', + 'ArrayValue', + ] - ignoreScopeList: ['Preferences', 'ExternalAccount', 'Notification', 'Note', 'ArrayValue'], + setup() { + super.setup(); - setup: function () { - Dep.prototype.setup.call(this); + this.foreignScopeList = this.getMetadata().getScopeEntityList().filter(item => { + if (!this.getUser().isAdmin() && !this.getAcl().checkScopeHasAcl(item)) { + return false; + } - this.foreignScopeList = this.getMetadata().getScopeEntityList().filter(item => { - if (!this.getUser().isAdmin()) { - if (!this.getAcl().checkScopeHasAcl(item)) { - return; - } - } + if (this.ignoreScopeList.includes(item)) { + return false; + } - if (~this.ignoreScopeList.indexOf(item)) { - return; - } + if (!this.getAcl().checkScope(item)) { + return false; + } - if (!this.getAcl().checkScope(item)) { - return; - } + return true; + }); - return true; - }); + this.getLanguage().sortEntityList(this.foreignScopeList); - this.getLanguage().sortEntityList(this.foreignScopeList); + this.foreignScope = this.model.get(this.typeName) || this.foreignScopeList[0]; + } +} - this.foreignScope = this.model.get(this.typeName) || this.foreignScopeList[0]; - }, - }); -}); +export default ActionHistoryRecordTargetFieldView; diff --git a/client/src/views/action-history-record/modals/detail.js b/client/src/views/action-history-record/modals/detail.js index e65b387f62..996cadeceb 100644 --- a/client/src/views/action-history-record/modals/detail.js +++ b/client/src/views/action-history-record/modals/detail.js @@ -26,15 +26,11 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/action-history-record/modals/detail', ['views/modals/detail'], function (Dep) { +import DetailModalView from 'views/modals/detail'; - return Dep.extend({ - - fullFormDisabled: true, - - editDisabled: true, - - sideDisabled: true, - }); -}); +export default class extends DetailModalView { + fullFormDisabled = true + editDisabled = true + sideDisabled = true +} diff --git a/client/src/views/action-history-record/record/list.js b/client/src/views/action-history-record/record/list.js index 8f733c6e95..ce8c337484 100644 --- a/client/src/views/action-history-record/record/list.js +++ b/client/src/views/action-history-record/record/list.js @@ -26,12 +26,10 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/action-history-record/record/list', ['views/record/list'], function (Dep) { +import ListRecordView from 'views/record/list'; - return Dep.extend({ +export default class extends ListRecordView { - rowActionsView: 'views/record/row-actions/view-and-remove', - - massActionList: ['remove', 'export'], - }); -}); + rowActionsView = 'views/record/row-actions/view-and-remove' + massActionList = ['remove', 'export'] +} diff --git a/client/src/views/address-map/view.js b/client/src/views/address-map/view.js index 573d958cb3..a2a9348499 100644 --- a/client/src/views/address-map/view.js +++ b/client/src/views/address-map/view.js @@ -26,90 +26,92 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/address-map/view', ['views/main'], function (Dep) { +import MainView from 'views/main'; - return Dep.extend({ +class AddressMapView extends MainView { - templateContent: ` -