DEV: Remove unused code from glimmer topic list (#28946)

This commit is contained in:
Jarek Radosz 2024-09-17 17:39:24 +02:00 committed by GitHub
parent 0a4ae392d9
commit 140d9aadfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 22 additions and 42 deletions

View File

@ -1,39 +1,29 @@
import Component from "@glimmer/component";
import { hash } from "@ember/helper";
import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import PluginOutlet from "discourse/components/plugin-outlet";
import coldAgeClass from "discourse/helpers/cold-age-class";
import concatClass from "discourse/helpers/concat-class";
import element from "discourse/helpers/element";
import formatDate from "discourse/helpers/format-date";
export default class ActivityColumn extends Component {
@service siteSettings;
get wrapperElement() {
return element(this.args.tagName ?? "td");
}
<template>
<this.wrapperElement
title={{htmlSafe @topic.bumpedAtTitle}}
class={{concatClass
"activity"
(coldAgeClass @topic.createdAt startDate=@topic.bumpedAt class="")
}}
...attributes
>
<a
href={{@topic.lastPostUrl}}
class="post-activity"
>{{! no whitespace
const ActivityColumn = <template>
<td
title={{htmlSafe @topic.bumpedAtTitle}}
class={{concatClass
"activity"
(coldAgeClass @topic.createdAt startDate=@topic.bumpedAt class="")
}}
...attributes
>
<a
href={{@topic.lastPostUrl}}
class="post-activity"
>{{! no whitespace
}}<PluginOutlet
@name="topic-list-before-relative-date"
@outletArgs={{hash topic=@topic}}
/>
{{~formatDate @topic.bumpedAt format="tiny" noTitle="true"~}}
</a>
</this.wrapperElement>
</template>
}
@name="topic-list-before-relative-date"
@outletArgs={{hash topic=@topic}}
/>
{{~formatDate @topic.bumpedAt format="tiny" noTitle="true"~}}
</a>
</td>
</template>;
export default ActivityColumn;

View File

@ -1,6 +1,5 @@
import Component from "@glimmer/component";
import { concat, hash } from "@ember/helper";
import { service } from "@ember/service";
import PluginOutlet from "discourse/components/plugin-outlet";
import PostsCountColumn from "discourse/components/topic-list/posts-count-column";
import TopicPostBadges from "discourse/components/topic-post-badges";
@ -16,12 +15,8 @@ import topicFeaturedLink from "discourse/helpers/topic-featured-link";
import topicLink from "discourse/helpers/topic-link";
export default class LatestTopicListItem extends Component {
@service appEvents;
get tagClassNames() {
if (this.args.topic.tags) {
return this.args.topic.tags.map((tagName) => `tag-${tagName}`);
}
return this.args.topic.tags?.map((tagName) => `tag-${tagName}`);
}
<template>

View File

@ -11,8 +11,6 @@ import i18n from "discourse-common/helpers/i18n";
export default class TopicList extends Component {
@service currentUser;
@service router;
@service siteSettings;
@tracked lastCheckedElementId;

View File

@ -9,7 +9,6 @@ import icon from "discourse-common/helpers/d-icon";
import i18n from "discourse-common/helpers/i18n";
export default class TopicListHeaderColumn extends Component {
@service modal;
@service router;
get localizedName() {

View File

@ -35,11 +35,9 @@ import { bind } from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
export default class TopicListItem extends Component {
@service appEvents;
@service currentUser;
@service historyStore;
@service messageBus;
@service router;
@service site;
@service siteSettings;