Skip to content

EspoCRM – Open Source CRM Application

refresh panel and dashlet notify

Yuri Kuznetsov09dea0be015f
diff --git a/client/modules/crm/src/views/dashlets/activities.js b/client/modules/crm/src/views/dashlets/activities.js
index f4e4fb1ab7..9009ae0956 100644
--- a/client/modules/crm/src/views/dashlets/activities.js
+++ b/client/modules/crm/src/views/dashlets/activities.js
@@ -175,13 +175,17 @@ class ActivitiesDashletView extends BaseDashletView {
this.collection.fetch();
}
- actionRefresh() {
- this.collection.fetch({
+ async actionRefresh() {
+ Espo.Ui.notify(' ... ');
+
+ await this.collection.fetch({
previousTotal: this.collection.total,
previousDataList: this.collection.models.map(model => {
return Espo.Utils.cloneDeep(model.attributes);
}),
});
+
+ Espo.Ui.notify();
}
// noinspection JSUnusedGlobalSymbols
diff --git a/client/modules/crm/src/views/record/panels/activities.js b/client/modules/crm/src/views/record/panels/activities.js
index f6c1b246b1..d6b5a9c167 100644
--- a/client/modules/crm/src/views/record/panels/activities.js
+++ b/client/modules/crm/src/views/record/panels/activities.js
@@ -631,10 +631,6 @@ class ActivitiesPanelView extends RelationshipPanelView {
});
}
- actionRefresh() {
- this.collection.fetch();
- }
-
actionSetHeld(data) {
const id = data.id;
diff --git a/client/modules/crm/src/views/record/panels/tasks.js b/client/modules/crm/src/views/record/panels/tasks.js
index 10baed6410..485b3fe628 100644
--- a/client/modules/crm/src/views/record/panels/tasks.js
+++ b/client/modules/crm/src/views/record/panels/tasks.js
@@ -194,10 +194,6 @@ export default class TasksRelationshipPanelView extends RelationshipPanelView {
});
}
- actionRefresh() {
- this.collection.fetch();
- }
-
// noinspection JSUnusedGlobalSymbols
actionComplete(data) {
const id = data.id;
diff --git a/client/src/views/dashlets/abstract/record-list.js b/client/src/views/dashlets/abstract/record-list.js
index c376b633fa..137bc58747 100644
--- a/client/src/views/dashlets/abstract/record-list.js
+++ b/client/src/views/dashlets/abstract/record-list.js
@@ -176,17 +176,22 @@ class RecordListDashletView extends BaseDashletView {
}
}
- actionRefresh() {
+ async actionRefresh() {
if (!this.collection) {
return;
}
this.collection.where = this.searchManager.getWhere();
- this.collection.fetch({
+
+ Espo.Ui.notify(' ... ');
+
+ await this.collection.fetch({
previousDataList: this.collection.models.map(model => {
return Espo.Utils.cloneDeep(model.attributes);
}),
});
+
+ Espo.Ui.notify();
}
// noinspection JSUnusedGlobalSymbols
diff --git a/client/src/views/dashlets/stream.js b/client/src/views/dashlets/stream.js
index d7ef7649d5..1e3ddc1742 100644
--- a/client/src/views/dashlets/stream.js
+++ b/client/src/views/dashlets/stream.js
@@ -34,12 +34,16 @@ class StreamDashletView extends BaseDashletView {
templateContent = '<div class="list-container">{{{list}}}</div>'
- actionRefresh() {
+ async actionRefresh() {
if (!this.getRecordView()) {
return;
}
- this.getRecordView().showNewRecords();
+ Espo.Ui.notify(' ... ');
+
+ await this.getRecordView().showNewRecords();
+
+ Espo.Ui.notify();
}
afterRender() {
diff --git a/client/src/views/record/panels/relationship.js b/client/src/views/record/panels/relationship.js
index 56f60a2664..184cc3f0db 100644
--- a/client/src/views/record/panels/relationship.js
+++ b/client/src/views/record/panels/relationship.js
@@ -621,8 +621,12 @@ class RelationshipPanelView extends BottomPanelView {
*
* @protected
*/
- actionRefresh() {
- this.collection.fetch();
+ async actionRefresh() {
+ Espo.Ui.notify(' ... ');
+
+ await this.collection.fetch()
+
+ Espo.Ui.notify();
}
/**
diff --git a/client/src/views/record/panels/side.js b/client/src/views/record/panels/side.js
index 1e4561ae43..d9bed1d8fe 100644
--- a/client/src/views/record/panels/side.js
+++ b/client/src/views/record/panels/side.js
@@ -385,8 +385,12 @@ class SidePanelView extends View {
/**
* A `refresh` action.
*/
- actionRefresh() {
- this.model.fetch();
+ async actionRefresh() {
+ Espo.Ui.notify(' ... ');
+
+ await this.model.fetch();
+
+ Espo.Ui.notify();
}
// noinspection JSUnusedGlobalSymbols
diff --git a/client/src/views/stream/panel.js b/client/src/views/stream/panel.js
index e743568993..2212ff2c7f 100644
--- a/client/src/views/stream/panel.js
+++ b/client/src/views/stream/panel.js
@@ -852,10 +852,16 @@ class PanelStreamView extends RelationshipPanelView {
return this.getView('list')
}
- actionRefresh() {
- if (this.getListView()) {
- this.getListView().showNewRecords();
+ async actionRefresh() {
+ if (!this.getListView()) {
+ return;
}
+
+ Espo.Ui.notify(' ... ');
+
+ await this.getListView().showNewRecords();
+
+ Espo.Ui.notify();
}
preview() {