From ab442058c034681bb55ef61acf0099a5e9cba145 Mon Sep 17 00:00:00 2001 From: Isaac Janzen <50783505+janzenisaac@users.noreply.github.com> Date: Mon, 13 Mar 2023 13:12:33 -0500 Subject: [PATCH] FIX: Broken topic-timeline summarize topic button (#20661) # Context During the octane upgrade of the Topic Timeline the `summarize-topic` button was neglected, leaving it in a broken state. # Fix Update the button to replicate the original functionality Screenshot 2023-03-13 at 12 41 25 PM _updated timeline with summarize button_ --- .../discourse/app/components/topic-timeline.hbs | 1 + .../discourse/app/components/topic-timeline.js | 9 --------- .../app/components/topic-timeline/container.hbs | 4 ++-- .../discourse/app/components/topic-timeline/container.js | 9 +++++++++ 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline.hbs b/app/assets/javascripts/discourse/app/components/topic-timeline.hbs index 0125a149ebf..5b1b643040a 100644 --- a/app/assets/javascripts/discourse/app/components/topic-timeline.hbs +++ b/app/assets/javascripts/discourse/app/components/topic-timeline.hbs @@ -15,6 +15,7 @@ @mobileView={{@mobileView}} @toggleMultiSelect={{@toggleMultiSelect}} @showTopicSlowModeUpdate={{@showTopicSlowModeUpdate}} + @showSummary={{@showSummary}} @deleteTopic={{@deleteTopic}} @recoverTopic={{@recoverTopic}} @toggleClosed={{@toggleClosed}} diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline.js b/app/assets/javascripts/discourse/app/components/topic-timeline.js index 52f4aebdbd3..92c4f6d545a 100644 --- a/app/assets/javascripts/discourse/app/components/topic-timeline.js +++ b/app/assets/javascripts/discourse/app/components/topic-timeline.js @@ -24,15 +24,6 @@ export default class TopicTimeline extends Component { } } - get displaySummary() { - return ( - this.siteSettings.summary_timeline_button && - !this.args.fullScreen && - this.args.model.has_summary && - !this.args.model.postStream.summary - ); - } - get createdAt() { return new Date(this.args.model.created_at); } diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs b/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs index c97cc815d81..d63b2e150af 100644 --- a/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs +++ b/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs @@ -121,12 +121,12 @@ {{#if this.displaySummary}} {{/if}} diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/container.js b/app/assets/javascripts/discourse/app/components/topic-timeline/container.js index 22aa2721ee0..f96b681201e 100644 --- a/app/assets/javascripts/discourse/app/components/topic-timeline/container.js +++ b/app/assets/javascripts/discourse/app/components/topic-timeline/container.js @@ -77,6 +77,15 @@ export default class TopicTimelineScrollArea extends Component { this.dockCheck(); } + get displaySummary() { + return ( + this.siteSettings.summary_timeline_button && + !this.args.fullScreen && + this.args.model.has_summary && + !this.args.model.postStream.summary + ); + } + get displayTimeLineScrollArea() { if (this.args.mobileView) { return true;