FIX: change dismiss new button label (#22075)
Button which is opening modal to dismiss topics should be "Dismiss…"
This commit is contained in:
parent
9854b034c6
commit
4270ab932a
|
@ -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", {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue