From d4096b8dfb22eb68edfc8577ff1127390fdf7ac2 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 10 May 2024 13:24:09 +0300 Subject: [PATCH] stream view list modal pagination --- client/res/templates/record/list-expanded.tpl | 12 ++++++++++-- client/src/views/modals/related-list.js | 1 + client/src/views/record/list-expanded.js | 8 ++++++++ client/src/views/stream/panel.js | 2 ++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/client/res/templates/record/list-expanded.tpl b/client/res/templates/record/list-expanded.tpl index 63b7522735..490c59e88f 100644 --- a/client/res/templates/record/list-expanded.tpl +++ b/client/res/templates/record/list-expanded.tpl @@ -37,6 +37,16 @@ class='list-action-item' }} {{/each}} + + + + {{#if hasPagination}} + {{{pagination}}} + {{/if}} {{/if}} @@ -49,7 +59,6 @@ {{/each}} - {{#unless hasPagination}} {{#if showMoreEnabled}} {{#if showMoreActive}}
@@ -69,7 +78,6 @@
{{/if}} {{/if}} - {{/unless}} {{else}} diff --git a/client/src/views/modals/related-list.js b/client/src/views/modals/related-list.js index 09853604f8..d2e998a6ba 100644 --- a/client/src/views/modals/related-list.js +++ b/client/src/views/modals/related-list.js @@ -437,6 +437,7 @@ class RelatedListModalView extends ModalView { editDisabled: this.defs.editDisabled, removeDisabled: this.defs.removeDisabled, }, + forcePagination: this.options.forcePagination, pagination: this.getConfig().get('listPagination') || this.getMetadata().get(['clientDefs', this.scope, 'listPagination']) || null, diff --git a/client/src/views/record/list-expanded.js b/client/src/views/record/list-expanded.js index d3d4ed174b..eb85e9b504 100644 --- a/client/src/views/record/list-expanded.js +++ b/client/src/views/record/list-expanded.js @@ -45,6 +45,14 @@ class ListExpandedRecordView extends ListRecordView { checkedList = null listContainerEl = '.list > ul' + init() { + if (this.options.forcePagination) { + this.paginationDisabled = false; + } + + super.init(); + } + setup() { super.setup(); diff --git a/client/src/views/stream/panel.js b/client/src/views/stream/panel.js index c3eb2f396b..979db13744 100644 --- a/client/src/views/stream/panel.js +++ b/client/src/views/stream/panel.js @@ -769,6 +769,7 @@ class PanelStreamView extends RelationshipPanelView { title: this.translate('Stream') + ' @right ' + this.translate('posts', 'filters', 'Note'), forceSelectAllAttributes: true, + forcePagination: true, }, }; @@ -785,6 +786,7 @@ class PanelStreamView extends RelationshipPanelView { title: this.translate('Stream') + ' @right ' + this.translate('activity', 'filters', 'Note'), forceSelectAllAttributes: true, filtersLayoutName: 'filtersGlobal', + forcePagination: true, }, };