Skip to content

Commit

Permalink
DEV: Remove summarization code (discourse#27373)
Browse files Browse the repository at this point in the history
  • Loading branch information
keegangeorge authored Jul 2, 2024
1 parent 052550c commit ea58140
Show file tree
Hide file tree
Showing 48 changed files with 584 additions and 2,315 deletions.

This file was deleted.

This file was deleted.

55 changes: 0 additions & 55 deletions app/assets/javascripts/discourse/app/components/summary-box.hbs

This file was deleted.

43 changes: 0 additions & 43 deletions app/assets/javascripts/discourse/app/components/summary-box.js

This file was deleted.

53 changes: 18 additions & 35 deletions app/assets/javascripts/discourse/app/components/topic-map.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import DButton from "discourse/components/d-button";
import PluginOutlet from "discourse/components/plugin-outlet";
import SummaryBox from "discourse/components/summary-box";
import PrivateMessageMap from "discourse/components/topic-map/private-message-map";
import TopicMapExpanded from "discourse/components/topic-map/topic-map-expanded";
import TopicMapSummary from "discourse/components/topic-map/topic-map-summary";
import concatClass from "discourse/helpers/concat-class";
import I18n from "discourse-i18n";
import or from "truth-helpers/helpers/or";

const MIN_POST_READ_TIME = 4;

Expand Down Expand Up @@ -98,41 +96,26 @@ export default class TopicMap extends Component {
</section>
{{/unless}}

{{#if (or @model.has_summary @model.summarizable)}}
<section class="information toggle-summary">
<section class="information toggle-summary">
{{#if @model.has_summary}}
<p>{{htmlSafe this.topRepliesSummaryInfo}}</p>
{{/if}}
<PluginOutlet
@name="topic-map-expanded-after"
@defaultGlimmer={{true}}
@outletArgs={{hash topic=@model postStream=@postStream}}
>
{{#if @model.has_summary}}
<p>{{htmlSafe this.topRepliesSummaryInfo}}</p>
<DButton
@action={{if @postStream.summary @cancelFilter @showTopReplies}}
@translatedTitle={{this.topRepliesTitle}}
@translatedLabel={{this.topRepliesLabel}}
@icon={{this.topRepliesIcon}}
class="top-replies"
/>
{{/if}}
<PluginOutlet
@name="topic-map-expanded-after"
@defaultGlimmer={{true}}
@outletArgs={{hash topic=@model postStream=@postStream}}
>
<div class="summarization-buttons">
{{#if @model.has_summary}}
<DButton
@action={{if @postStream.summary @cancelFilter @showTopReplies}}
@translatedTitle={{this.topRepliesTitle}}
@translatedLabel={{this.topRepliesLabel}}
@icon={{this.topRepliesIcon}}
class="top-replies"
/>
{{/if}}
</div>

{{#if @model.summarizable}}
<SummaryBox
@topic={{@model}}
@postStream={{@postStream}}
@cancelFilter={{@cancelFilter}}
@showTopReplies={{@showTopReplies}}
@collapseSummary={{@collapseSummary}}
@showSummary={{@showSummary}}
/>
{{/if}}
</PluginOutlet>
</section>
{{/if}}
</PluginOutlet>
</section>

{{#if @showPMMap}}
<section class="information private-message-map">
Expand Down
18 changes: 0 additions & 18 deletions app/assets/javascripts/discourse/app/controllers/topic.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,6 @@ export default Controller.extend(bufferedProperty("model"), {
});
},

collapseSummary() {
this.get("model.postStream").collapseSummary();
},

showSummary() {
this.get("model.postStream").showSummary(this.currentUser);
},

removeAllowedUser(user) {
return this.get("model.details")
.removeAllowedUser(user)
Expand Down Expand Up @@ -1649,9 +1641,6 @@ export default Controller.extend(bufferedProperty("model"), {
this.onMessage,
this.get("model.message_bus_last_id")
);

const summariesChannel = `/summaries/topic/${this.get("model.id")}`;
this.messageBus.subscribe(summariesChannel, this._updateSummary);
},

unsubscribe() {
Expand All @@ -1661,13 +1650,6 @@ export default Controller.extend(bufferedProperty("model"), {
}

this.messageBus.unsubscribe("/topic/*", this.onMessage);
this.messageBus.unsubscribe("/summaries/topic/*", this._updateSummary);
},

@bind
_updateSummary(update) {
const postStream = this.get("model.postStream");
postStream.processSummaryUpdate(update);
},

@bind
Expand Down
Loading

0 comments on commit ea58140

Please sign in to comment.