From 5f02605aca0ea70ea85715ee20458a1ea6d608e9 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 21 Feb 2025 16:43:48 +0200 Subject: [PATCH] ref --- .../crm/src/views/calendar/timeline.js | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/client/modules/crm/src/views/calendar/timeline.js b/client/modules/crm/src/views/calendar/timeline.js index 207f89e08d..3d262e7ad1 100644 --- a/client/modules/crm/src/views/calendar/timeline.js +++ b/client/modules/crm/src/views/calendar/timeline.js @@ -33,6 +33,7 @@ import {DataSet} from 'vis-data'; import {Timeline} from 'vis-timeline'; import moment from 'moment'; import $ from 'jquery'; +import RecordModal from 'helpers/record-modal'; class TimelineView extends View { @@ -687,33 +688,31 @@ class TimelineView extends View { }); } - viewEvent(scope, id) { - Espo.Ui.notifyWait(); + /** + * + * @param {string} scope + * @param {string} id + */ + async viewEvent(scope, id) { + const helper = new RecordModal(); - const viewName = this.getMetadata().get(['clientDefs', scope, 'modalViews', 'detail']) || - 'views/modals/detail'; + /** @type {import('views/modals/detail').default} */ + let modalView; - this.createView('quickView', viewName, { - scope: scope, + modalView = await helper.showDetail(this, { + entityType: scope, id: id, - removeDisabled: false - }, (view) => { - view.render(); - view.notify(false); - - this.listenToOnce(view, 'after:destroy', () => { - this.runFetch(); - }); - - this.listenTo(view, 'after:save', (m, o) => { - o = o || {}; - + removeDisabled: false, + afterSave: (model, o) => { if (!o.bypassClose) { - view.close(); + modalView.close(); } this.runFetch(); - }); + }, + afterDestroy: () => { + this.runFetch(); + }, }); }