FIX: change dismiss new button label (#22075)

Button which is opening modal to dismiss topics should be "Dismiss…"
This commit is contained in:
Krzysztof Kotlarek 2023-06-13 13:18:39 +10:00 committed by GitHub
parent 9854b034c6
commit 4270ab932a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -5,11 +5,13 @@ import isElementInViewport from "discourse/lib/is-element-in-viewport";
import discourseComputed, { on } from "discourse-common/utils/decorators";
import I18n from "I18n";
import Component from "@ember/component";
import { inject as service } from "@ember/service";
export default Component.extend({
tagName: "",
classNames: ["topic-dismiss-buttons"],
currentUser: service(),
position: null,
selectedTopics: null,
model: null,
@ -60,7 +62,9 @@ export default Component.extend({
@discourseComputed("selectedTopics.length")
dismissNewLabel(selectedTopicCount) {
if (selectedTopicCount === 0) {
if (this.currentUser.new_new_view_enabled) {
return I18n.t("topics.bulk.dismiss_button");
} else if (selectedTopicCount === 0) {
return I18n.t("topics.bulk.dismiss_new");
}
return I18n.t("topics.bulk.dismiss_new_with_selected", {

View File

@ -15,7 +15,7 @@ describe "Filtering topics", type: :system, js: true do
visit("/new")
expect(topic_list).to have_topic(topic)
find(".dismiss-read").click
find(".dismiss-read", text: "Dismiss…").click
expect(dismiss_new_modal).to have_dismiss_topics_checked
expect(dismiss_new_modal).to have_dismiss_posts_checked
expect(dismiss_new_modal).to have_untrack_unchecked