From 57d9dbc33ea03cf8ab197e75f866f4bc2bc43b4a Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 11 Apr 2023 16:23:35 +0300 Subject: [PATCH] fix stream dashlet --- client/src/views/dashlets/abstract/record-list.js | 9 +++------ client/src/views/dashlets/stream.js | 12 +++++++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/client/src/views/dashlets/abstract/record-list.js b/client/src/views/dashlets/abstract/record-list.js index 37ffcc52be..7376624f07 100644 --- a/client/src/views/dashlets/abstract/record-list.js +++ b/client/src/views/dashlets/abstract/record-list.js @@ -26,22 +26,19 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define( - 'views/dashlets/abstract/record-list', - ['views/dashlets/abstract/base', 'search-manager'], - function (Dep, SearchManager) { +define('views/dashlets/abstract/record-list', +['views/dashlets/abstract/base', 'search-manager'], function (Dep, SearchManager) { return Dep.extend({ scope: null, listViewColumn: 'views/record/list', - listViewExpanded: 'views/record/list-expanded', listView: null, - _template: '
{{{list}}}
', + templateContent: '
{{{list}}}
', layoutType: 'expanded', diff --git a/client/src/views/dashlets/stream.js b/client/src/views/dashlets/stream.js index b9b666fc73..21d434e896 100644 --- a/client/src/views/dashlets/stream.js +++ b/client/src/views/dashlets/stream.js @@ -26,16 +26,22 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/dashlets/stream', 'views/dashlets/abstract/base', function (Dep) { +define('views/dashlets/stream', ['views/dashlets/abstract/base'], function (Dep) { return Dep.extend({ name: 'Stream', - _template: '
{{{list}}}
', + templateContent: '
{{{list}}}
', actionRefresh: function () { - this.getView('list').showNewRecords(); + let listView = this.getView('list'); + + if (!listView) { + return; + } + + listView.showNewRecords(); }, afterRender: function () {