Skip to content

EspoCRM – Open Source CRM Application

stream refresh title

Yuri Kuznetsov1abefcec344e
diff --git a/client/res/templates/stream.tpl b/client/res/templates/stream.tpl
index 76b29a2332..9261df1512 100644
--- a/client/res/templates/stream.tpl
+++ b/client/res/templates/stream.tpl
@@ -2,7 +2,10 @@
<div class="row">
<div class="col-sm-7 col-xs-5">
{{#if displayTitle}}
- <h3>{{translate 'Stream'}}</h3>
+ <h3><span
+ data-action="fullRefresh"
+ style="user-select: none; cursor: pointer"
+ >{{translate 'Stream'}}</span></h3>
{{/if}}
</div>
<div class="col-sm-5 col-xs-7">
diff --git a/client/src/views/global-stream.js b/client/src/views/global-stream.js
index a1608a3dfa..5ec1293f27 100644
--- a/client/src/views/global-stream.js
+++ b/client/src/views/global-stream.js
@@ -38,7 +38,12 @@ class GlobalStreamView extends View {
<div class="page-header">
<div class="row">
<div class="col-sm-7 col-xs-5">
- <h3>{{translate 'GlobalStream' category='scopeNames'}}</h3>
+ <h3>
+ <span
+ data-action="fullRefresh"
+ style="user-select: none; cursor: pointer"
+ >{{translate 'GlobalStream' category='scopeNames'}}</span>
+ </h3>
</div>
<div class="col-sm-5 col-xs-7"></div>
</div>
@@ -51,22 +56,23 @@ class GlobalStreamView extends View {
</div>
`
- /** @type {import('collections/note').default} */
collection
setup() {
this.wait(
- this.getCollectionFactory().create('Note')
- .then(/** import('collections/note').default */collection => {
- this.collection = collection;
- this.collection.url = 'GlobalStream';
- this.collection.maxSize = this.getConfig().get('recordsPerPage');
- this.collection.paginationByNumber = true;
-
- this.setupSearchManager();
- this.createSearchView();
- })
+ (async () => {
+ this.collection = await this.getCollectionFactory().create('Note');
+
+ this.collection.url = 'GlobalStream';
+ this.collection.maxSize = this.getConfig().get('recordsPerPage');
+ this.collection.paginationByNumber = true;
+
+ this.setupSearchManager();
+ await this.createSearchView();
+ })()
);
+
+ this.addActionHandler('fullRefresh', () => this.actionFullRefresh());
}
setupSearchManager() {
@@ -113,6 +119,17 @@ class GlobalStreamView extends View {
});
});
}
+
+ /**
+ * @private
+ */
+ async actionFullRefresh() {
+ Espo.Ui.notifyWait();
+
+ await this.collection.fetch();
+
+ Espo.Ui.notify();
+ }
}
export default GlobalStreamView;
diff --git a/client/src/views/stream.js b/client/src/views/stream.js
index 66bdf41737..482abbe665 100644
--- a/client/src/views/stream.js
+++ b/client/src/views/stream.js
@@ -70,6 +70,7 @@ class StreamView extends View {
this.addActionHandler('createPost', () => this.actionCreatePost());
this.addHandler('keydown.stream', '', /** KeyboardEvent */event => this.onKeyDown(event));
+ this.addActionHandler('fullRefresh', () => this.actionFullRefresh());
}
afterRender() {
@@ -211,6 +212,17 @@ class StreamView extends View {
this.actionCreatePost();
}
}
+
+ /**
+ * @private
+ */
+ async actionFullRefresh() {
+ Espo.Ui.notifyWait();
+
+ await this.collection.fetch();
+
+ Espo.Ui.notify();
+ }
}
export default StreamView;