From 4912a2e059a0b7e803f00c4a7f12a004252f2cb0 Mon Sep 17 00:00:00 2001 From: Davide Iadeluca <146922689+DavideIadeluca@users.noreply.github.com> Date: Mon, 30 Sep 2024 13:19:14 +0200 Subject: [PATCH] [1.x] [extensibility] refactor(core): improve extensibility of `DiscussionPage` (#4046) * refactor(core): improve extensibility of `DiscussionPage` * chore(core): improve type safety --- .../src/forum/components/DiscussionPage.tsx | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/framework/core/js/src/forum/components/DiscussionPage.tsx b/framework/core/js/src/forum/components/DiscussionPage.tsx index 12d70726c..1a1cff4a0 100644 --- a/framework/core/js/src/forum/components/DiscussionPage.tsx +++ b/framework/core/js/src/forum/components/DiscussionPage.tsx @@ -79,13 +79,21 @@ export default class DiscussionPage - -
{this.discussion ? this.pageContent().toArray() : this.loadingItems().toArray()}
- + view(): Mithril.Children { + return
{this.viewItems().toArray()}
; + } + + viewItems(): ItemList { + const items = new ItemList(); + + items.add('pane', , 100); + items.add( + 'discussions', +
{this.discussion ? this.pageContent().toArray() : this.loadingItems().toArray()}
, + 90 ); + + return items; } /**