From dce2549ff771fcee0fa39a1c56e8a1143d0deec4 Mon Sep 17 00:00:00 2001 From: Davide Iadeluca <146922689+DavideIadeluca@users.noreply.github.com> Date: Mon, 30 Sep 2024 13:02:58 +0200 Subject: [PATCH] [1.x] [extensibility] refactor(core): improve extensibility of `IndexPage` (#4045) * refactor(core): improve extensibility of `IndexPage` * refactor(core): refactor the extensibility refactor --- .../js/src/forum/components/IndexPage.tsx | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/framework/core/js/src/forum/components/IndexPage.tsx b/framework/core/js/src/forum/components/IndexPage.tsx index 404eb3487..fb944ea53 100644 --- a/framework/core/js/src/forum/components/IndexPage.tsx +++ b/framework/core/js/src/forum/components/IndexPage.tsx @@ -60,19 +60,31 @@ export default class IndexPage -
-
-
    {listItems(this.viewItems().toArray())}
-
    {listItems(this.actionItems().toArray())}
-
- -
+
{this.contentItems().toArray()}
); } + contentItems(): ItemList { + const items = new ItemList(); + + items.add('toolbar',
{this.toolbarItems().toArray()}
, 100); + items.add('discussionList', , 90); + + return items; + } + + toolbarItems(): ItemList { + const items = new ItemList(); + + items.add('view',
    {listItems(this.viewItems().toArray())}
, 100); + items.add('action',
    {listItems(this.actionItems().toArray())}
, 90); + + return items; + } + setTitle() { app.setTitle(extractText(app.translator.trans('core.forum.index.meta_title_text'))); app.setTitleCount(0);