Skip to content

A platform for community discussion. Free, open, simple.

DEV: Remove dead code (`latestTopicOnly`) (#11833)

Jarek Radosz8881ae4af4da
diff --git a/app/assets/javascripts/discourse/app/controllers/discovery/categories.js b/app/assets/javascripts/discourse/app/controllers/discovery/categories.js
index 01879ddc2e8..b286fd4fda0 100644
--- a/app/assets/javascripts/discourse/app/controllers/discovery/categories.js
+++ b/app/assets/javascripts/discourse/app/controllers/discovery/categories.js
@@ -19,15 +19,6 @@ export default DiscoveryController.extend({
canEdit: reads("currentUser.staff"),
- @discourseComputed("model.categories.[].featuredTopics.length")
- latestTopicOnly() {
- return (
- this.get("model.categories").find(
- (c) => c.get("featuredTopics.length") > 1
- ) === undefined
- );
- },
-
@discourseComputed("model.parentCategory")
categoryPageStyle(parentCategory) {
let style = this.site.mobileView
diff --git a/app/assets/javascripts/discourse/app/templates/components/categories-with-featured-topics.hbs b/app/assets/javascripts/discourse/app/templates/components/categories-with-featured-topics.hbs
index 9243d150285..b62e4a8fb54 100644
--- a/app/assets/javascripts/discourse/app/templates/components/categories-with-featured-topics.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/categories-with-featured-topics.hbs
@@ -1,3 +1,2 @@
{{categories-only categories=categories
- latestTopicOnly=latestTopicOnly
showTopics="true"}}
diff --git a/app/assets/javascripts/discourse/app/templates/components/featured-topic.hbs b/app/assets/javascripts/discourse/app/templates/components/featured-topic.hbs
index 937d05c1d56..c6a04a2d695 100644
--- a/app/assets/javascripts/discourse/app/templates/components/featured-topic.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/featured-topic.hbs
@@ -2,11 +2,4 @@
<a href={{topic.lastUnreadUrl}} class="title">{{html-safe topic.fancyTitle}}</a>
{{topic-post-badges newPosts=topic.totalUnread unseen=topic.unseen url=topic.lastUnreadUrl}}
-{{#if latestTopicOnly}}
- <div class="last-user-info">
- {{i18n "categories.latest_by"}} <a href={{html-safe topic.lastPosterUrl}}>{{topic.last_poster.username}}</a>
- <a href={{topic.lastPostUrl}}>{{format-age topic.last_posted_at}}</a>
- </div>
-{{else}}
- <a href={{topic.lastPostUrl}} class="last-posted-at">{{format-age topic.last_posted_at}}</a>
-{{/if}}
+<a href={{topic.lastPostUrl}} class="last-posted-at">{{format-age topic.last_posted_at}}</a>
diff --git a/app/assets/javascripts/discourse/app/templates/components/parent-category-row.hbs b/app/assets/javascripts/discourse/app/templates/components/parent-category-row.hbs
index 58e4b1a693a..dbf5cc2922b 100644
--- a/app/assets/javascripts/discourse/app/templates/components/parent-category-row.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/parent-category-row.hbs
@@ -32,7 +32,7 @@
{{#if showTopics}}
<td class="latest">
{{#each category.featuredTopics as |t|}}
- {{featured-topic topic=t latestTopicOnly=latestTopicOnly}}
+ {{featured-topic topic=t}}
{{/each}}
</td>
{{/if}}
diff --git a/app/assets/javascripts/discourse/app/templates/discovery/categories.hbs b/app/assets/javascripts/discourse/app/templates/discovery/categories.hbs
index 6a5c91b8b8e..282c608b75b 100644
--- a/app/assets/javascripts/discourse/app/templates/discovery/categories.hbs
+++ b/app/assets/javascripts/discourse/app/templates/discovery/categories.hbs
@@ -1,6 +1,5 @@
{{#discovery-categories refresh=(action "refresh")}}
{{component categoryPageStyle
categories=model.categories
- latestTopicOnly=latestTopicOnly
topics=model.topics}}
{{/discovery-categories}}
diff --git a/app/assets/javascripts/discourse/app/templates/mobile/components/categories-with-featured-topics.hbs b/app/assets/javascripts/discourse/app/templates/mobile/components/categories-with-featured-topics.hbs
index 9243d150285..b62e4a8fb54 100644
--- a/app/assets/javascripts/discourse/app/templates/mobile/components/categories-with-featured-topics.hbs
+++ b/app/assets/javascripts/discourse/app/templates/mobile/components/categories-with-featured-topics.hbs
@@ -1,3 +1,2 @@
{{categories-only categories=categories
- latestTopicOnly=latestTopicOnly
showTopics="true"}}
diff --git a/app/assets/javascripts/discourse/app/templates/mobile/discovery/categories.hbs b/app/assets/javascripts/discourse/app/templates/mobile/discovery/categories.hbs
index 6a5c91b8b8e..282c608b75b 100644
--- a/app/assets/javascripts/discourse/app/templates/mobile/discovery/categories.hbs
+++ b/app/assets/javascripts/discourse/app/templates/mobile/discovery/categories.hbs
@@ -1,6 +1,5 @@
{{#discovery-categories refresh=(action "refresh")}}
{{component categoryPageStyle
categories=model.categories
- latestTopicOnly=latestTopicOnly
topics=model.topics}}
{{/discovery-categories}}
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 30f998f7b36..e3d88511e1c 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -838,7 +838,6 @@ en:
posts: "Posts"
topics: "Topics"
latest: "Latest"
- latest_by: "latest by"
toggle_ordering: "toggle ordering control"
subcategories: "Subcategories"
muted: "Muted categories"