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


<img width="351" alt="Screenshot 2023-03-13 at 12 41 25 PM" src="https://user-images.githubusercontent.com/50783505/224785657-fc8124fe-f1d9-4cc8-917b-9cd859517da3.png">

_updated timeline with summarize button_
This commit is contained in:
Isaac Janzen
2023-03-13 13:12:33 -05:00
committed by GitHub
parent 72726830b5
commit ab442058c0
4 changed files with 12 additions and 11 deletions

View File

@ -15,6 +15,7 @@
@mobileView={{@mobileView}} @mobileView={{@mobileView}}
@toggleMultiSelect={{@toggleMultiSelect}} @toggleMultiSelect={{@toggleMultiSelect}}
@showTopicSlowModeUpdate={{@showTopicSlowModeUpdate}} @showTopicSlowModeUpdate={{@showTopicSlowModeUpdate}}
@showSummary={{@showSummary}}
@deleteTopic={{@deleteTopic}} @deleteTopic={{@deleteTopic}}
@recoverTopic={{@recoverTopic}} @recoverTopic={{@recoverTopic}}
@toggleClosed={{@toggleClosed}} @toggleClosed={{@toggleClosed}}

View File

@ -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() { get createdAt() {
return new Date(this.args.model.created_at); return new Date(this.args.model.created_at);
} }

View File

@ -121,12 +121,12 @@
{{#if this.displaySummary}} {{#if this.displaySummary}}
<button <button
type="button" type="button"
class="show-summary btn-small" class="show-summary btn btn-small"
label={{i18n "summary.short_label"}}
title={{i18n "summary.short_title"}} title={{i18n "summary.short_title"}}
{{on "click" @showSummary}} {{on "click" @showSummary}}
> >
{{d-icon "layer-group"}} {{d-icon "layer-group"}}
{{i18n "summary.short_label"}}
</button> </button>
{{/if}} {{/if}}

View File

@ -77,6 +77,15 @@ export default class TopicTimelineScrollArea extends Component {
this.dockCheck(); 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() { get displayTimeLineScrollArea() {
if (this.args.mobileView) { if (this.args.mobileView) {
return true; return true;