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 discourseComputed, { on } from "discourse-common/utils/decorators";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
|
import { inject as service } from "@ember/service";
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: "",
|
tagName: "",
|
||||||
classNames: ["topic-dismiss-buttons"],
|
classNames: ["topic-dismiss-buttons"],
|
||||||
|
|
||||||
|
currentUser: service(),
|
||||||
position: null,
|
position: null,
|
||||||
selectedTopics: null,
|
selectedTopics: null,
|
||||||
model: null,
|
model: null,
|
||||||
|
@ -60,7 +62,9 @@ export default Component.extend({
|
||||||
|
|
||||||
@discourseComputed("selectedTopics.length")
|
@discourseComputed("selectedTopics.length")
|
||||||
dismissNewLabel(selectedTopicCount) {
|
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");
|
||||||
}
|
}
|
||||||
return I18n.t("topics.bulk.dismiss_new_with_selected", {
|
return I18n.t("topics.bulk.dismiss_new_with_selected", {
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe "Filtering topics", type: :system, js: true do
|
||||||
visit("/new")
|
visit("/new")
|
||||||
|
|
||||||
expect(topic_list).to have_topic(topic)
|
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_topics_checked
|
||||||
expect(dismiss_new_modal).to have_dismiss_posts_checked
|
expect(dismiss_new_modal).to have_dismiss_posts_checked
|
||||||
expect(dismiss_new_modal).to have_untrack_unchecked
|
expect(dismiss_new_modal).to have_untrack_unchecked
|
||||||
|
|
Loading…
Reference in New Issue