This commit is contained in:
Yuri Kuznetsov
2023-06-16 12:48:49 +03:00
parent 0e2f00665c
commit f731419f86
8 changed files with 20 additions and 28 deletions

View File

@@ -125,10 +125,7 @@ define('crm:views/calendar/calendar', ['view', 'lib!full-calendar'], function (D
this.allDayScopeList = this.getMetadata()
.get('clientDefs.Calendar.allDayScopeList') || this.allDayScopeList;
this.colors = _.extend(
this.colors,
Espo.Utils.clone(this.getHelper().themeManager.getParam('calendarColors') || {}),
);
this.colors = {...this.colors, ...this.getHelper().themeManager.getParam('calendarColors')};
this.scopeFilter = false;

View File

@@ -56,9 +56,9 @@ define('crm:views/calendar/modals/edit', ['views/modals/edit'], function (Dep) {
this.getModelFactory().create(this.scope, model => {
model.populateDefaults();
var attributes = this.getRecordView().fetch();
let attributes = this.getRecordView().fetch();
attributes = _.extend(attributes, this.getRecordView().model.getClonedAttributes());
attributes = {...attributes, ...this.getRecordView().model.getClonedAttributes()};
this.filterAttributesForEntityType(attributes, scope);

View File

@@ -139,10 +139,7 @@ define('crm:views/calendar/timeline', ['view', 'lib!vis'], function (Dep, Vis) {
this.allDayScopeList = this.getMetadata()
.get('clientDefs.Calendar.allDayScopeList') || this.allDayScopeList || [];
this.colors = _.extend(
this.colors,
Espo.Utils.clone(this.getHelper().themeManager.getParam('calendarColors') || {}),
);
this.colors = {...this.colors, ...this.getHelper().themeManager.getParam('calendarColors')};
this.isCustomViewAvailable = this.getAcl().get('userPermission') !== 'no';

View File

@@ -48,13 +48,9 @@ define('crm:views/scheduler/scheduler', ['view', 'lib!vis'], function (Dep, Vis)
this.endField = this.options.endField || 'dateEnd';
this.assignedUserField = this.options.assignedUserField || 'assignedUser';
this.colors = Espo.Utils.clone(
this.getMetadata().get('clientDefs.Calendar.colors') || {});
this.colors = Espo.Utils.clone(this.getMetadata().get('clientDefs.Calendar.colors') || {});
this.colors = _.extend(
this.colors,
Espo.Utils.clone(this.getHelper().themeManager.getParam('calendarColors') || {}),
);
this.colors = {...this.colors, ...this.getHelper().themeManager.getParam('calendarColors')};
let usersFieldDefault = 'users';

View File

@@ -44,10 +44,10 @@ class AdminController extends Controller {
let page = options.page;
if (options.options) {
options = _.extend(
Espo.Utils.parseUrlOptionsParam(options.options),
options
);
options = {
...Espo.Utils.parseUrlOptionsParam(options.options),
...options,
};
delete options.options;
}

View File

@@ -727,10 +727,11 @@ class ListView extends MainView {
this.prepareCreateReturnDispatchParams(returnDispatchParams);
_.extend(options, {
options = {
...options,
returnUrl: this.getRouter().getCurrentUrl(),
returnDispatchParams: returnDispatchParams,
});
};
return this.createView('quickCreate', viewName, options, (view) => {
view.render();
@@ -773,10 +774,11 @@ class ListView extends MainView {
this.prepareCreateReturnDispatchParams(returnDispatchParams);
_.extend(options, {
options = {
...options,
returnUrl: this.getRouter().getCurrentUrl(),
returnDispatchParams: returnDispatchParams
});
returnDispatchParams: returnDispatchParams,
};
router.navigate(url, {trigger: false});
router.dispatch(this.scope, 'create', options);

View File

@@ -352,7 +352,7 @@ class EditModalView extends ModalView {
attributes = this.getRecordView().fetch();
model = this.getRecordView().model;
attributes = _.extend(attributes, model.getClonedAttributes());
attributes = {...attributes, ...model.getClonedAttributes()};
options = {
attributes: attributes,
@@ -376,7 +376,7 @@ class EditModalView extends ModalView {
attributes = this.getRecordView().fetch();
model = this.getRecordView().model;
attributes = _.extend(attributes, model.getClonedAttributes());
attributes = {...attributes, ...model.getClonedAttributes()};
options = {
attributes: attributes,

View File

@@ -1200,7 +1200,7 @@ class BaseRecordView extends View {
}
if (!view.disabled && !view.readOnly && view.isFullyRendered()) {
_.extend(data, view.fetch());
data = {...data, ...view.fetch()};
}
}