A platform for community discussion. Free, open, simple.
UX: remove footer-messages (#36874)
chapoib230f830d345
diff --git a/app/assets/stylesheets/common/base/_topic-list.scss b/app/assets/stylesheets/common/base/_topic-list.scssindex 84aa69bc5f9..ac791fd4d29 100644--- a/app/assets/stylesheets/common/base/_topic-list.scss+++ b/app/assets/stylesheets/common/base/_topic-list.scss@@ -420,14 +420,6 @@transform: rotate(180deg);}-.top-title-buttons {- display: flex;- margin: var(--space-2) 0;- flex-wrap: wrap;- font-size: var(--font-down-1);- gap: var(--space-2);-}-.table-heading {border-bottom: 3px solid var(--primary-low);}diff --git a/config/locales/client.en.yml b/config/locales/client.en.ymlindex a2465c52d44..a7926da029e 100644--- a/config/locales/client.en.yml+++ b/config/locales/client.en.yml@@ -3623,20 +3623,6 @@ en:new_new: "Nothing new at the moment... check back soon!"new: "Nothing new at the moment... check back soon!"- bottom:- latest: "There are no more latest topics."- posted: "There are no more posted topics."- read: "There are no more read topics."- new: "There are no more new topics."- unread: "There are no more unread topics."- unseen: "There are no more unseen topics."- category: "There are no more %{category} topics."- tag: "There are no more %{tag} topics."- top: "There are no more top topics."- hot: "There are no more hot topics."- bookmarks: "There are no more bookmarked topics."- filter: "There are no more topics."-topic_bulk_actions:dismiss:name: "Dismiss"@@ -3773,9 +3759,6 @@ en:created_at: "Created: %{date}"bumped_at: "Latest: %{date}"- browse_all_categories_latest: "<a href='%{basePath}/categories'>Browse all categories</a> or <a href='%{basePath}/latest'>view latest topics</a>."- browse_all_categories_latest_or_top: "<a href='%{basePath}/categories'>Browse all categories</a>, <a href='%{basePath}/latest'>view latest topics</a> or see top:"- browse_all_tags_or_latest: "<a href='%{basePath}/tags'>Browse all tags</a> or <a href='%{basePath}/latest'>view latest topics</a>."browse_latest_topics: "Browse latest topics"browse_new_replies: "Browse new replies"browse_new_topics: "Browse new topics"diff --git a/frontend/discourse/app/components/discovery/topics.gjs b/frontend/discourse/app/components/discovery/topics.gjsindex de5d4944676..75adedf3897 100644--- a/frontend/discourse/app/components/discovery/topics.gjs+++ b/frontend/discourse/app/components/discovery/topics.gjs@@ -1,23 +1,18 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";-import { fn, hash } from "@ember/helper";+import { hash } from "@ember/helper";import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";-import { htmlSafe } from "@ember/template";import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";import CountI18n from "discourse/components/count-i18n";-import DiscourseLinkedText from "discourse/components/discourse-linked-text";import DiscoveryTopicsList from "discourse/components/discovery-topics-list";import EmptyTopicFilter from "discourse/components/empty-topic-filter";-import FooterMessage from "discourse/components/footer-message";import LoadMore from "discourse/components/load-more";import NewListHeaderControlsWrapper from "discourse/components/new-list-header-controls-wrapper";import PluginOutlet from "discourse/components/plugin-outlet";-import TopPeriodButtons from "discourse/components/top-period-buttons";import TopicDismissButtons from "discourse/components/topic-dismiss-buttons";import List from "discourse/components/topic-list/list";-import basePath from "discourse/helpers/base-path";import hideApplicationFooter from "discourse/helpers/hide-application-footer";import lazyHash from "discourse/helpers/lazy-hash";import loadingSpinner from "discourse/helpers/loading-spinner";@@ -25,11 +20,9 @@ import { popupAjaxError } from "discourse/lib/ajax-error";import { filterTypeForMode } from "discourse/lib/filter-mode";import { applyBehaviorTransformer } from "discourse/lib/transformer";import PeriodChooser from "discourse/select-kit/components/period-chooser";-import { not, or } from "discourse/truth-helpers";-import { i18n } from "discourse-i18n";+import { or } from "discourse/truth-helpers";export default class DiscoveryTopics extends Component {- @service composer;@service documentTitle;@service currentUser;@service topicTrackingState;@@ -132,53 +125,6 @@ export default class DiscoveryTopics extends Component {return !this.new || this.currentUser?.new_new_view_enabled;}- get footerMessage() {- const topicsLength = this.args.model.get("topics.length");- if (!this.allLoaded) {- return;- }-- const filterSegments = (this.args.model.get("filter") || "").split("/");- const lastFilterSegment = filterSegments.at(-1);- const newOrUnreadFilter =- lastFilterSegment === "new" || lastFilterSegment === "unread";- const { category, tag } = this.args;- if (category) {- // We have a different custom display for the empty new + unread filter education.- if (topicsLength === 0 && newOrUnreadFilter) {- return;- }-- return i18n("topics.bottom.category", {- category: category.name,- });- } else if (tag) {- // We have a different custom display for the empty new + unread filter education.- if (topicsLength === 0 && newOrUnreadFilter) {- return;- }-- return i18n("topics.bottom.tag", {- tag: tag.name,- });- } else {- if (topicsLength === 0) {- // We have a different custom display for the empty new + unread filter education.- if (newOrUnreadFilter) {- return;- }-- return i18n(`topics.none.${lastFilterSegment}`, {- category: filterSegments[1],- });- } else {- return i18n(`topics.bottom.${lastFilterSegment}`, {- category: filterSegments[1],- });- }- }- }-get showEmptyFilterEducationInFooter() {const topicsLength = this.args.model.get("topics.length");@@ -375,56 +321,18 @@ export default class DiscoveryTopics extends Component {@dismissRead={{@dismissRead}}/>- <FooterMessage @message={{this.footerMessage}}>- <:messageDetails>- {{#if @tag}}- {{htmlSafe- (i18n "topic.browse_all_tags_or_latest" basePath=(basePath))- }}- {{else if this.latest}}- {{#if @category.canCreateTopic}}- <DiscourseLinkedText- @action={{fn- this.composer.openNewTopic- (hash category=@category)- }}- @text="topic.suggest_create_topic"- />- {{/if}}- {{else if this.top}}- {{htmlSafe- (i18n- "topic.browse_all_categories_latest_or_top"- basePath=(basePath)- )- }}- <TopPeriodButtons- @period={{@period}}- @action={{@changePeriod}}- />- {{else if (not (or this.new this.unread))}}- {{htmlSafe- (i18n- "topic.browse_all_categories_latest" basePath=(basePath)- )- }}- {{/if}}- </:messageDetails>- <:afterMessage>- {{#if this.showEmptyFilterEducationInFooter}}- <EmptyTopicFilter- @newFilter={{this.new}}- @unreadFilter={{this.unread}}- @trackingCounts={{hash- newTopics=this.newTopicsCount- newReplies=this.newRepliesCount- }}- @changeNewListSubset={{@changeNewListSubset}}- @newListSubset={{@model.params.subset}}- />- {{/if}}- </:afterMessage>- </FooterMessage>+ {{#if this.showEmptyFilterEducationInFooter}}+ <EmptyTopicFilter+ @newFilter={{this.new}}+ @unreadFilter={{this.unread}}+ @trackingCounts={{hash+ newTopics=this.newTopicsCount+ newReplies=this.newRepliesCount+ }}+ @changeNewListSubset={{@changeNewListSubset}}+ @newListSubset={{@model.params.subset}}+ />+ {{/if}}</PluginOutlet>{{/if}}</footer>diff --git a/frontend/discourse/app/components/footer-message.gjs b/frontend/discourse/app/components/footer-message.gjsdeleted file mode 100644index e7c50f6dac0..00000000000--- a/frontend/discourse/app/components/footer-message.gjs+++ /dev/null@@ -1,17 +0,0 @@-/* eslint-disable ember/no-classic-components */-import Component from "@ember/component";-import { classNames } from "@ember-decorators/component";--@classNames("footer-message")-export default class FooterMessage extends Component {- <template>- {{#if this.message}}- <h3>- {{this.message}}- {{yield to="messageDetails"}}- </h3>- {{/if}}-- {{yield to="afterMessage"}}- </template>-}diff --git a/frontend/discourse/app/components/top-period-buttons.gjs b/frontend/discourse/app/components/top-period-buttons.gjsdeleted file mode 100644index 5dba5cea33a..00000000000--- a/frontend/discourse/app/components/top-period-buttons.gjs+++ /dev/null@@ -1,31 +0,0 @@-/* eslint-disable ember/no-classic-components */-import Component from "@ember/component";-import { fn } from "@ember/helper";-import { action } from "@ember/object";-import { classNames } from "@ember-decorators/component";-import DButton from "discourse/components/d-button";-import periodTitle from "discourse/helpers/period-title";-import discourseComputed from "discourse/lib/decorators";--@classNames("top-title-buttons")-export default class TopPeriodButtons extends Component {- @discourseComputed("period")- periods(period) {- return this.site.get("periods").filter((p) => p !== period);- }-- @action- changePeriod(p) {- this.action(p);- }-- <template>- {{#each this.periods as |p|}}- <DButton- @action={{fn this.changePeriod p}}- @translatedLabel={{periodTitle p}}- class="btn-default"- />- {{/each}}- </template>-}diff --git a/frontend/discourse/tests/acceptance/tags-test.js b/frontend/discourse/tests/acceptance/tags-test.jsindex 43120214cb6..63e448d01d2 100644--- a/frontend/discourse/tests/acceptance/tags-test.js+++ b/frontend/discourse/tests/acceptance/tags-test.js@@ -632,11 +632,6 @@ acceptance();server.put("/topics/bulk", () => helper.response({}));});-- test("load more footer message is present", async function (assert) {- await visit("/tag/planters");- assert.dom(".topic-list-bottom .footer-message").doesNotExist();- });});@@ -714,10 +709,6 @@ acceptance("Tag show - topic list without `more_topics_url`", function (needs) {);server.put("/topics/bulk", () => helper.response({}));});- test("load more footer message is not present", async function (assert) {- await visit("/tag/planters");- assert.dom(".topic-list-bottom .footer-message").exists();- });});acceptance("Tag separator customization", function (needs) {diff --git a/plugins/styleguide/assets/javascripts/discourse/components/sections/molecules/footer-message.gjs b/plugins/styleguide/assets/javascripts/discourse/components/sections/molecules/footer-message.gjsdeleted file mode 100644index 2354736d56f..00000000000--- a/plugins/styleguide/assets/javascripts/discourse/components/sections/molecules/footer-message.gjs+++ /dev/null@@ -1,59 +0,0 @@-import Component from "@glimmer/component";-import FooterMessage from "discourse/components/footer-message";-import StyleguideExample from "discourse/plugins/styleguide/discourse/components/styleguide-example";--export default class FooterMessageMolecule extends Component {- defaultCode = `<FooterMessage- @education={{@dummy.sentence}}- @message={{@dummy.short_sentence}}-/>`;-- latestCode = `<FooterMessage- @education={{@dummy.sentence}}- @message={{@dummy.short_sentence}}- @latest={{true}}- @canCreateTopicOnCategory={{true}}- @createTopic={{@dummyAction}}-/>`;-- topCode = `<FooterMessage- @education={{@dummy.sentence}}- @message={{@dummy.short_sentence}}- @top={{true}}- @changePeriod={{@dummyAction}}-/>`;-- <template>- <StyleguideExample- @title="<FooterMessage> - default"- @code={{this.defaultCode}}- >- <FooterMessage- @education={{@dummy.sentence}}- @message={{@dummy.short_sentence}}- />- </StyleguideExample>-- <StyleguideExample- @title="<FooterMessage> - latest"- @code={{this.latestCode}}- >- <FooterMessage- @education={{@dummy.sentence}}- @message={{@dummy.short_sentence}}- @latest={{true}}- @canCreateTopicOnCategory={{true}}- @createTopic={{@dummyAction}}- />- </StyleguideExample>-- <StyleguideExample @title="<FooterMessage> - top" @code={{this.topCode}}>- <FooterMessage- @education={{@dummy.sentence}}- @message={{@dummy.short_sentence}}- @top={{true}}- @changePeriod={{@dummyAction}}- />- </StyleguideExample>- </template>-}diff --git a/plugins/styleguide/assets/javascripts/discourse/lib/styleguide.js b/plugins/styleguide/assets/javascripts/discourse/lib/styleguide.jsindex 25730d59a38..9fad85c1986 100644--- a/plugins/styleguide/assets/javascripts/discourse/lib/styleguide.js+++ b/plugins/styleguide/assets/javascripts/discourse/lib/styleguide.js@@ -14,7 +14,6 @@ import categories from "../components/sections/molecules/categories";import charCounter from "../components/sections/molecules/char-counter";import dialog from "../components/sections/molecules/dialog";import emptyState from "../components/sections/molecules/empty-state";-import footerMessage from "../components/sections/molecules/footer-message";import menus from "../components/sections/molecules/menus";import multiselect from "../components/sections/molecules/multi-select";import navigationBar from "../components/sections/molecules/navigation-bar";@@ -66,7 +65,6 @@ const SECTIONS = [{ component: categories, category: "molecules", id: "categories" },{ component: charCounter, category: "molecules", id: "char-counter" },{ component: emptyState, category: "molecules", id: "empty-state" },- { component: footerMessage, category: "molecules", id: "footer-message" },{ component: navigationBar, category: "molecules", id: "navigation-bar" },{component: navigationStacked,diff --git a/plugins/styleguide/config/locales/client.en.yml b/plugins/styleguide/config/locales/client.en.ymlindex 25940a48646..4f6f2312b37 100644--- a/plugins/styleguide/config/locales/client.en.yml+++ b/plugins/styleguide/config/locales/client.en.yml@@ -67,8 +67,6 @@ en:title: "Topic List"basic_topic_list:title: "Basic Topic List"- footer_message:- title: "Footer Message"signup_cta:title: "Signup CTA"topic_timer_info:diff --git a/plugins/styleguide/spec/system/smoke_test_spec.rb b/plugins/styleguide/spec/system/smoke_test_spec.rbindex dc3fae53804..c7cb2b23e70 100644--- a/plugins/styleguide/spec/system/smoke_test_spec.rb+++ b/plugins/styleguide/spec/system/smoke_test_spec.rb@@ -24,7 +24,6 @@ RSpec.describe "Styleguide Smoke Test", type: :system do{ href: "/molecules/categories", title: "Categories" },{ href: "/molecules/char-counter", title: "Character Counter" },{ href: "/molecules/empty-state", title: "Empty State" },- { href: "/molecules/footer-message", title: "Footer Message" },{ href: "/molecules/menus", title: "Menus" },{ href: "/molecules/navigation-bar", title: "Navigation Bar" },{ href: "/molecules/navigation-stacked", title: "Navigation Stacked" },diff --git a/spec/requests/admin/site_texts_controller_spec.rb b/spec/requests/admin/site_texts_controller_spec.rbindex d7bd3f9a823..56caf378714 100644--- a/spec/requests/admin/site_texts_controller_spec.rb+++ b/spec/requests/admin/site_texts_controller_spec.rb@@ -52,23 +52,6 @@ RSpec.describe Admin::SiteTextsController doexpect(value).to eq(I18n.t("js.yes_value", locale: :de))end- it "can return the value of the translation in the selected locale rather than English if specified" do- SiteSetting.default_locale = "it"- get "/admin/customize/site_texts.json",- params: {- q: "all tags",- locale: "it",- only_selected_locale: true,- }- value =- response.parsed_body["site_texts"].find do |text|- text["id"] == "js.topic.browse_all_tags_or_latest"- end[- "value"- ]- expect(value).to eq(I18n.t("js.topic.browse_all_tags_or_latest", locale: "it"))- end-it "returns an error on invalid locale" doget "/admin/customize/site_texts.json", params: { locale: "?" }expect(response.status).to eq(400)diff --git a/spec/system/unified_new_topic_list_spec.rb b/spec/system/unified_new_topic_list_spec.rbindex 535fe26b46f..92dee105f28 100644--- a/spec/system/unified_new_topic_list_spec.rb+++ b/spec/system/unified_new_topic_list_spec.rb@@ -220,24 +220,6 @@ describe "Unified new topic list", type: :system doexpect(tabs_toggle.replies_tab).to have_count(1)expect(tabs_toggle.topics_tab).to have_count(1)end-- it "does not show a 'no more topics' footer message that clashes with the empty topic filter" do- TopicUser.update_last_read(user, new_topic_in_category.id, 1, 1, 1)- TopicUser.update_last_read(user, new_reply_in_category.id, 2, 1, 1)- TopicUser.update_last_read(user, old_topic_in_category.id, 2, 1, 1)-- visit("/c/#{category.slug}/#{category.id}/l/new")-- expect(page).not_to have_content(- I18n.t("js.topics.bottom.category", category: category.name),- )-- visit("/c/#{category.slug}/#{category.id}/l/unread")-- expect(page).not_to have_content(- I18n.t("js.topics.bottom.category", category: category.name),- )- endendcontext "when the /new topic list is scoped to a tag" do@@ -318,20 +300,6 @@ describe "Unified new topic list", type: :system doexpect(tabs_toggle.replies_tab).to have_count(1)expect(tabs_toggle.topics_tab).to have_count(1)end-- it "does not show a 'no more topics' footer message that clashes with the empty topic filter" do- TopicUser.update_last_read(user, new_topic_with_tag.id, 1, 1, 1)- TopicUser.update_last_read(user, new_reply_with_tag.id, 2, 1, 1)- TopicUser.update_last_read(user, old_topic_with_tag.id, 2, 1, 1)-- visit("/tag/#{tag.name}/l/new")-- expect(page).not_to have_content(I18n.t("js.topics.bottom.tag", tag: tag.name))-- visit("/tag/#{tag.name}/l/unread")-- expect(page).not_to have_content(I18n.t("js.topics.bottom.tag", tag: tag.name))- endendend