From befbdda0bc3ef92c09077c270211c8b5c06f7f66 Mon Sep 17 00:00:00 2001 From: Davide Iadeluca Date: Tue, 17 Sep 2024 12:23:08 +0200 Subject: [PATCH 1/2] refactor(core): improve extensibility of `DiscussionPage` --- .../js/src/forum/components/DiscussionPage.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/framework/core/js/src/forum/components/DiscussionPage.tsx b/framework/core/js/src/forum/components/DiscussionPage.tsx index 12d70726c3..2b3067774d 100644 --- a/framework/core/js/src/forum/components/DiscussionPage.tsx +++ b/framework/core/js/src/forum/components/DiscussionPage.tsx @@ -80,12 +80,20 @@ export default class DiscussionPage - -
{this.discussion ? this.pageContent().toArray() : this.loadingItems().toArray()}
- + 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; } /** From 797d7e076319fda5c27ed9dbfb9ffa43c54b8b92 Mon Sep 17 00:00:00 2001 From: Davide Iadeluca Date: Tue, 17 Sep 2024 12:24:02 +0200 Subject: [PATCH 2/2] chore(core): improve type safety --- framework/core/js/src/forum/components/DiscussionPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/core/js/src/forum/components/DiscussionPage.tsx b/framework/core/js/src/forum/components/DiscussionPage.tsx index 2b3067774d..1a1cff4a04 100644 --- a/framework/core/js/src/forum/components/DiscussionPage.tsx +++ b/framework/core/js/src/forum/components/DiscussionPage.tsx @@ -79,7 +79,7 @@ export default class DiscussionPage{this.viewItems().toArray()}; }