DEV: Bump dependencies and fix linting (#630)

This commit is contained in:
David Taylor 2025-02-06 16:43:11 +00:00 committed by GitHub
parent e213c7d6aa
commit 444440abda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 856 additions and 710 deletions

View File

@ -1,6 +1,6 @@
import { action } from "@ember/object";
import { classNames } from "@ember-decorators/component";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
import { selectKitOptions } from "select-kit/components/select-kit";
@ -22,16 +22,16 @@ export default class AssignActionsDropdown extends DropdownSelectBoxComponent {
{
id: "unassign",
icon: this.group ? "group-times" : "user-xmark",
name: I18n.t("discourse_assign.unassign.title"),
description: I18n.t("discourse_assign.unassign.help", {
name: i18n("discourse_assign.unassign.title"),
description: i18n("discourse_assign.unassign.help", {
username: this.assignee,
}),
},
{
id: "reassign",
icon: "users",
name: I18n.t("discourse_assign.reassign.title"),
description: I18n.t("discourse_assign.reassign.help"),
name: i18n("discourse_assign.reassign.title"),
description: i18n("discourse_assign.reassign.help"),
},
]);
}
@ -43,8 +43,8 @@ export default class AssignActionsDropdown extends DropdownSelectBoxComponent {
options = options.concat({
id: `unassign_post_${postId}`,
icon: assignee.username ? "user-xmark" : "group-times",
name: I18n.t("discourse_assign.unassign_post.title"),
description: I18n.t("discourse_assign.unassign_post.help", {
name: i18n("discourse_assign.unassign_post.title"),
description: i18n("discourse_assign.unassign_post.help", {
username: assignee.username || assignee.name,
}),
});

View File

@ -3,8 +3,8 @@ import { action } from "@ember/object";
import { service } from "@ember/service";
import DButton from "discourse/components/d-button";
import DropdownMenu from "discourse/components/dropdown-menu";
import icon from "discourse-common/helpers/d-icon";
import i18n from "discourse-common/helpers/i18n";
import icon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
import DMenu from "float-kit/components/d-menu";
export default class AssignedToPost extends Component {

View File

@ -4,8 +4,8 @@ import { TextArea } from "@ember/legacy-built-in-components";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
import { service } from "@ember/service";
import icon from "discourse-common/helpers/d-icon";
import i18n from "discourse-common/helpers/i18n";
import icon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
import ComboBox from "select-kit/components/combo-box";
import not from "truth-helpers/helpers/not";
import AssigneeChooser from "./assignee-chooser";

View File

@ -2,7 +2,7 @@ import Component from "@glimmer/component";
import { action } from "@ember/object";
import { service } from "@ember/service";
import { TrackedObject } from "@ember-compat/tracked-built-ins";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
export default class AssignUser extends Component {
@service taskActions;
@ -26,7 +26,7 @@ export default class AssignUser extends Component {
break;
}
return I18n.t(
return i18n(
`discourse_assign.assign${i18nSuffix}.${
this.model.reassign ? "reassign_title" : "title"
}`

View File

@ -6,7 +6,7 @@ import DButton from "discourse/components/d-button";
import DModal from "discourse/components/d-modal";
import DModalCancel from "discourse/components/d-modal-cancel";
import { popupAjaxError } from "discourse/lib/ajax-error";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
import TopicAssignments from "../topic-assignments";
export default class EditTopicAssignments extends Component {
@ -16,9 +16,9 @@ export default class EditTopicAssignments extends Component {
get title() {
if (this.topic.isAssigned() || this.topic.hasAssignedPosts()) {
return I18n.t("edit_assignments_modal.title");
return i18n("edit_assignments_modal.title");
} else {
return I18n.t("discourse_assign.assign_modal.title");
return i18n("discourse_assign.assign_modal.title");
}
}

View File

@ -1,6 +1,6 @@
import Component from "@ember/component";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import discourseComputed from "discourse/lib/decorators";
import { i18n } from "discourse-i18n";
export default class RemindAssignsFrequency extends Component {
@discourseComputed(
@ -22,7 +22,7 @@ export default class RemindAssignsFrequency extends Component {
@discourseComputed("user.reminders_frequency")
availableFrequencies(userRemindersFrequency) {
return userRemindersFrequency.map((freq) => ({
name: I18n.t(freq.name),
name: i18n(freq.name),
value: freq.value,
selected: false,
}));

View File

@ -1,8 +1,7 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import i18n from "discourse-common/helpers/i18n";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
import ComboBox from "select-kit/components/combo-box";
import Assignment from "./assignment";
@ -21,9 +20,9 @@ export default class TopicAssignments extends Component {
#toComboBoxOption(assignment) {
const option = { id: assignment.id };
if (assignment.targetType === "Topic") {
option.name = I18n.t("edit_assignments_modal.topic");
option.name = i18n("edit_assignments_modal.topic");
} else {
option.name = `${I18n.t("edit_assignments_modal.post")} #${
option.name = `${i18n("edit_assignments_modal.post")} #${
assignment.postNumber
}`;
}

View File

@ -1,8 +1,8 @@
import { getOwner } from "@ember/application";
import { htmlSafe } from "@ember/template";
import { renderAvatar } from "discourse/helpers/user-avatar";
import { iconHTML } from "discourse-common/lib/icon-library";
import I18n from "I18n";
import { iconHTML } from "discourse/lib/icon-library";
import { i18n } from "discourse-i18n";
import EditTopicAssignments from "../components/modal/edit-topic-assignments";
const DEPENDENT_KEYS = [
@ -113,7 +113,7 @@ function extractPostId(buttonId) {
function editAssignmentsButton() {
const icon = iconHTML("pencil");
const label = I18n.t("discourse_assign.topic_level_menu.edit_assignments");
const label = i18n("discourse_assign.topic_level_menu.edit_assignments");
return {
id: "reassign",
name: htmlSafe(label),
@ -123,9 +123,7 @@ function editAssignmentsButton() {
function reassignToSelfButton() {
const icon = iconHTML("user-plus");
const label = I18n.t(
"discourse_assign.topic_level_menu.reassign_topic_to_me"
);
const label = i18n("discourse_assign.topic_level_menu.reassign_topic_to_me");
return {
id: "reassign-self",
name: htmlSafe(label),
@ -139,10 +137,9 @@ function unassignFromTopicButton(topic) {
const icon = topic.assigned_to_user
? avatarHtml(topic.assigned_to_user, "small")
: iconHTML("user-xmark");
const label = I18n.t(
"discourse_assign.topic_level_menu.unassign_from_topic",
{ username }
);
const label = i18n("discourse_assign.topic_level_menu.unassign_from_topic", {
username,
});
return {
id: "unassign",
@ -173,11 +170,11 @@ function unassignFromPostButton(postId, assignment) {
icon = iconHTML("group-times");
}
const label = I18n.t("discourse_assign.topic_level_menu.unassign_from_post", {
const label = i18n("discourse_assign.topic_level_menu.unassign_from_post", {
assignee,
post_number: assignment.post_number,
});
const dataName = I18n.t(
const dataName = i18n(
"discourse_assign.topic_level_menu.unassign_from_post_help",
{
assignee,
@ -193,14 +190,14 @@ function unassignFromPostButton(postId, assignment) {
function topicLevelUnassignButton(assignees) {
const avatars = topicLevelUnassignButtonAvatars(assignees);
const label = `<span class="unassign-label">${I18n.t(
const label = `<span class="unassign-label">${i18n(
"discourse_assign.topic_level_menu.unassign_with_ellipsis"
)}</span>`;
return {
id: null,
name: htmlSafe(
I18n.t("discourse_assign.topic_level_menu.unassign_with_ellipsis")
i18n("discourse_assign.topic_level_menu.unassign_with_ellipsis")
),
label: htmlSafe(`${avatars}${label}`),
};

View File

@ -1,7 +1,7 @@
import { set } from "@ember/object";
import { sort } from "@ember/object/computed";
import UserMenuNotificationsList from "discourse/components/user-menu/notifications-list";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
import UserMenuAssignsListEmptyState from "./assigns-list-empty-state";
export default class UserMenuAssignNotificationsList extends UserMenuNotificationsList {
@ -14,7 +14,7 @@ export default class UserMenuAssignNotificationsList extends UserMenuNotificatio
}
get dismissTitle() {
return I18n.t("user.dismiss_assigned_tooltip");
return i18n("user.dismiss_assigned_tooltip");
}
get showAllHref() {
@ -22,7 +22,7 @@ export default class UserMenuAssignNotificationsList extends UserMenuNotificatio
}
get showAllTitle() {
return I18n.t("user_menu.view_all_assigned");
return i18n("user_menu.view_all_assigned");
}
get itemsCacheKey() {
@ -47,7 +47,7 @@ export default class UserMenuAssignNotificationsList extends UserMenuNotificatio
}
get dismissConfirmationText() {
return I18n.t("notifications.dismiss_confirmation.body.assigns", {
return i18n("notifications.dismiss_confirmation.body.assigns", {
count: this._unreadAssignedNotificationsCount,
});
}

View File

@ -1,15 +1,15 @@
import Component from "@glimmer/component";
import { action } from "@ember/object";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
export default class AssignableInteractionFields extends Component {
assignableLevelOptions = [
{ name: I18n.t("groups.alias_levels.nobody"), value: 0 },
{ name: I18n.t("groups.alias_levels.only_admins"), value: 1 },
{ name: I18n.t("groups.alias_levels.mods_and_admins"), value: 2 },
{ name: I18n.t("groups.alias_levels.members_mods_and_admins"), value: 3 },
{ name: I18n.t("groups.alias_levels.owners_mods_and_admins"), value: 4 },
{ name: I18n.t("groups.alias_levels.everyone"), value: 99 },
{ name: i18n("groups.alias_levels.nobody"), value: 0 },
{ name: i18n("groups.alias_levels.only_admins"), value: 1 },
{ name: i18n("groups.alias_levels.mods_and_admins"), value: 2 },
{ name: i18n("groups.alias_levels.members_mods_and_admins"), value: 3 },
{ name: i18n("groups.alias_levels.owners_mods_and_admins"), value: 4 },
{ name: i18n("groups.alias_levels.everyone"), value: 99 },
];
get assignableLevel() {

View File

@ -4,8 +4,8 @@ import { alias } from "@ember/object/computed";
import { service } from "@ember/service";
import UserTopicsList from "discourse/controllers/user-topics-list";
import BulkSelectHelper from "discourse/lib/bulk-select-helper";
import { INPUT_DELAY } from "discourse-common/config/environment";
import discourseDebounce from "discourse-common/lib/debounce";
import discourseDebounce from "discourse/lib/debounce";
import { INPUT_DELAY } from "discourse/lib/environment";
export default class GroupAssignedShow extends UserTopicsList {
@service taskActions;

View File

@ -2,9 +2,9 @@ import Controller, { inject as controller } from "@ember/controller";
import { action } from "@ember/object";
import { service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import { INPUT_DELAY } from "discourse-common/config/environment";
import discourseDebounce from "discourse-common/lib/debounce";
import discourseComputed from "discourse-common/utils/decorators";
import discourseDebounce from "discourse/lib/debounce";
import discourseComputed from "discourse/lib/decorators";
import { INPUT_DELAY } from "discourse/lib/environment";
export default class GroupAssigned extends Controller {
@service router;

View File

@ -3,12 +3,12 @@ import { action } from "@ember/object";
import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import UserTopicsList from "discourse/controllers/user-topics-list";
import { INPUT_DELAY } from "discourse-common/config/environment";
import discourseDebounce from "discourse-common/lib/debounce";
import getURL from "discourse-common/lib/get-url";
import { iconHTML } from "discourse-common/lib/icon-library";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import discourseDebounce from "discourse/lib/debounce";
import discourseComputed from "discourse/lib/decorators";
import { INPUT_DELAY } from "discourse/lib/environment";
import getURL from "discourse/lib/get-url";
import { iconHTML } from "discourse/lib/icon-library";
import { i18n } from "discourse-i18n";
export default class UserActivityAssigned extends UserTopicsList {
@service taskActions;
@ -27,7 +27,7 @@ export default class UserActivityAssigned extends UserTopicsList {
@discourseComputed
emptyStateBody() {
return htmlSafe(
I18n.t("user.no_assignments_body", {
i18n("user.no_assignments_body", {
preferencesUrl: getURL("/my/preferences/notifications"),
icon: iconHTML("user-plus"),
})

View File

@ -1,5 +1,5 @@
import { withPluginApi } from "discourse/lib/plugin-api";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
export default {
name: "assign-extend-user-messages",
@ -11,7 +11,7 @@ export default {
if (currentUser?.can_assign && api.addUserMessagesNavigationDropdownRow) {
api.addUserMessagesNavigationDropdownRow(
"userPrivateMessages.assigned",
I18n.t("discourse_assign.assigned"),
i18n("discourse_assign.assigned"),
"user-plus"
);
}

View File

@ -1,7 +1,7 @@
import { htmlSafe } from "@ember/template";
import { withPluginApi } from "discourse/lib/plugin-api";
import { emojiUnescape } from "discourse/lib/text";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
import UserMenuAssignNotificationsList from "../components/user-menu/assigns-list";
export default {
@ -26,14 +26,11 @@ export default {
return class extends NotificationItemBase {
get linkTitle() {
if (this.isGroup()) {
return I18n.t(
`user.assigned_to_group.${this.postOrTopic()}`,
{
group_name: this.notification.data.display_username,
}
);
return i18n(`user.assigned_to_group.${this.postOrTopic()}`, {
group_name: this.notification.data.display_username,
});
}
return I18n.t(`user.assigned_to_you.${this.postOrTopic()}`);
return i18n(`user.assigned_to_you.${this.postOrTopic()}`);
}
get icon() {
@ -50,13 +47,10 @@ export default {
get description() {
return htmlSafe(
emojiUnescape(
I18n.t(
`user.assignment_description.${this.postOrTopic()}`,
{
topic_title: this.notification.fancy_title,
post_number: this.notification.post_number,
}
)
i18n(`user.assignment_description.${this.postOrTopic()}`, {
topic_title: this.notification.fancy_title,
post_number: this.notification.post_number,
})
)
);
}

View File

@ -5,16 +5,16 @@ import { isEmpty } from "@ember/utils";
import { hbs } from "ember-cli-htmlbars";
import { h } from "virtual-dom";
import { renderAvatar } from "discourse/helpers/user-avatar";
import discourseComputed from "discourse/lib/decorators";
import { withSilencedDeprecations } from "discourse/lib/deprecated";
import getURL from "discourse/lib/get-url";
import { iconHTML, iconNode } from "discourse/lib/icon-library";
import { withPluginApi } from "discourse/lib/plugin-api";
import { registerTopicFooterDropdown } from "discourse/lib/register-topic-footer-dropdown";
import { escapeExpression } from "discourse/lib/utilities";
import RawHtml from "discourse/widgets/raw-html";
import RenderGlimmer from "discourse/widgets/render-glimmer";
import { withSilencedDeprecations } from "discourse-common/lib/deprecated";
import getURL from "discourse-common/lib/get-url";
import { iconHTML, iconNode } from "discourse-common/lib/icon-library";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
import AssignButton, {
assignPost,
unassignPost,
@ -36,9 +36,9 @@ function defaultTitle(topic) {
topic.assigned_to_user?.username || topic.assigned_to_group?.name;
if (username) {
return I18n.t("discourse_assign.unassign.help", { username });
return i18n("discourse_assign.unassign.help", { username });
} else {
return I18n.t("discourse_assign.assign.help");
return i18n("discourse_assign.assign.help");
}
}
@ -62,7 +62,7 @@ function registerTopicFooterButtons(api) {
return defaultTitle(this.topic);
},
translatedLabel() {
return I18n.t("discourse_assign.assign.title");
return i18n("discourse_assign.assign.title");
},
async action() {
if (!this.currentUser?.can_assign) {
@ -118,7 +118,7 @@ function registerTopicFooterButtons(api) {
translatedLabel() {
const user = this.topic.assigned_to_user;
const group = this.topic.assigned_to_group;
const label = I18n.t("discourse_assign.assigned_to_w_ellipsis");
const label = i18n("discourse_assign.assigned_to_w_ellipsis");
if (user) {
return htmlSafe(
@ -158,7 +158,7 @@ function registerTopicFooterButtons(api) {
return defaultTitle(this.topic);
},
translatedLabel() {
const label = I18n.t("discourse_assign.unassign.title");
const label = i18n("discourse_assign.unassign.title");
return htmlSafe(
`<span class="unassign-label"><span class="text">${label}</span></span>`
@ -200,13 +200,13 @@ function registerTopicFooterButtons(api) {
return "user-plus";
},
translatedTitle() {
return I18n.t("discourse_assign.reassign.to_self_help");
return i18n("discourse_assign.reassign.to_self_help");
},
translatedAriaLabel() {
return I18n.t("discourse_assign.reassign.to_self_help");
return i18n("discourse_assign.reassign.to_self_help");
},
translatedLabel() {
const label = I18n.t("discourse_assign.reassign.to_self");
const label = i18n("discourse_assign.reassign.to_self");
return htmlSafe(
`<span class="unassign-label"><span class="text">${label}</span></span>`
@ -250,13 +250,13 @@ function registerTopicFooterButtons(api) {
return "group-plus";
},
translatedTitle() {
return I18n.t("discourse_assign.reassign.help");
return i18n("discourse_assign.reassign.help");
},
translatedAriaLabel() {
return I18n.t("discourse_assign.reassign.help");
return i18n("discourse_assign.reassign.help");
},
translatedLabel() {
const label = I18n.t("discourse_assign.reassign.title_w_ellipsis");
const label = i18n("discourse_assign.reassign.title_w_ellipsis");
return htmlSafe(
`<span class="unassign-label"><span class="text">${label}</span></span>`
@ -334,11 +334,11 @@ function initialize(api) {
? {
inOptionsForUsers: [
{
name: I18n.t("search.advanced.in.assigned"),
name: i18n("search.advanced.in.assigned"),
value: "assigned",
},
{
name: I18n.t("search.advanced.in.unassigned"),
name: i18n("search.advanced.in.unassigned"),
value: "unassigned",
},
],
@ -385,7 +385,7 @@ function initialize(api) {
this.args.topic.get("assigned_to_user.username") ===
this.currentUser.username
) {
return I18n.t("notification_reason.user");
return i18n("notification_reason.user");
}
return super.reasonText;
@ -521,7 +521,7 @@ function initialize(api) {
const assignedHtml = (username, path, type) => {
return `<span class="assigned-to--${type}">${htmlSafe(
I18n.t("discourse_assign.assigned_topic_to", {
i18n("discourse_assign.assigned_topic_to", {
username,
path,
})
@ -570,7 +570,7 @@ function initialize(api) {
href: `${topic.url}/${postNumber}`,
},
},
I18n.t("discourse_assign.assign_post_to_multiple", {
i18n("discourse_assign.assign_post_to_multiple", {
post_number: postNumber,
username: assignee.username || assignee.name,
})
@ -584,7 +584,7 @@ function initialize(api) {
assignedToUser ? iconNode("user-plus") : iconNode("group-plus"),
assignedToUser || assignedToGroup
? ""
: h("span.assign-text", I18n.t("discourse_assign.assigned")),
: h("span.assign-text", i18n("discourse_assign.assigned")),
assigneeElements,
]);
}

View File

@ -1,7 +1,7 @@
import { service } from "@ember/service";
import cookie from "discourse/lib/cookie";
import UserTopicListRoute from "discourse/routes/user-topic-list";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
export default class UserActivityAssigned extends UserTopicListRoute {
@service router;
@ -33,6 +33,6 @@ export default class UserActivityAssigned extends UserTopicListRoute {
}
titleToken() {
return I18n.t("discourse_assign.assigned");
return i18n("discourse_assign.assigned");
}
}

View File

@ -1,15 +1,16 @@
{
"private": true,
"devDependencies": {
"@discourse/lint-configs": "2.2.2",
"ember-template-lint": "6.0.0",
"eslint": "9.15.0",
"@discourse/lint-configs": "2.4.0",
"ember-template-lint": "6.1.0",
"eslint": "9.19.0",
"prettier": "2.8.8"
},
"engines": {
"node": ">= 18",
"node": ">= 22",
"npm": "please-use-pnpm",
"yarn": "please-use-pnpm",
"pnpm": ">= 9"
}
"pnpm": "9.x"
},
"packageManager": "pnpm@9.15.5"
}

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
import { click, fillIn, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { cloneJSON } from "discourse/lib/object";
import userFixtures from "discourse/tests/fixtures/user-fixtures";
import pretender, {
parsePostData,
@ -10,7 +11,6 @@ import {
updateCurrentUser,
} from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { cloneJSON } from "discourse-common/lib/object";
acceptance("Discourse Assign | Assign mobile", function (needs) {
needs.user();

View File

@ -1,5 +1,6 @@
import { click, fillIn, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { cloneJSON } from "discourse/lib/object";
import userFixtures from "discourse/tests/fixtures/user-fixtures";
import pretender, {
parsePostData,
@ -10,7 +11,6 @@ import {
updateCurrentUser,
} from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { cloneJSON } from "discourse-common/lib/object";
// TODO (glimmer-post-menu): Remove this file when the post menu widget code is removed from core
acceptance(

View File

@ -1,5 +1,6 @@
import { click, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { cloneJSON } from "discourse/lib/object";
import topicFixtures from "discourse/tests/fixtures/topic";
import {
acceptance,
@ -7,8 +8,7 @@ import {
updateCurrentUser,
} from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { cloneJSON } from "discourse-common/lib/object";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
import NotificationFixture from "../fixtures/notifications-fixtures";
function assignCurrentUserToTopic(needs) {
@ -173,7 +173,7 @@ acceptance("Discourse Assign | Assigned topic", function (needs) {
assert.strictEqual(
notification.querySelector("a").title,
I18n.t("notifications.titles.assigned"),
i18n("notifications.titles.assigned"),
"with correct title"
);
assert.strictEqual(

View File

@ -6,7 +6,7 @@ import {
queryAll,
updateCurrentUser,
} from "discourse/tests/helpers/qunit-helpers";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
const USER_MENU_ASSIGN_RESPONSE = {
notifications: [
@ -239,12 +239,12 @@ acceptance("Discourse Assign | user menu", function (needs) {
assert.strictEqual(
userAssign.querySelector("a").title,
I18n.t("user.assigned_to_you.topic"),
i18n("user.assigned_to_you.topic"),
"user assign has the right title"
);
assert.strictEqual(
groupAssign.querySelector("a").title,
I18n.t("user.assigned_to_group.topic", { group_name: "Team" }),
i18n("user.assigned_to_group.topic", { group_name: "Team" }),
"group assign has the right title"
);
});
@ -264,7 +264,7 @@ acceptance("Discourse Assign | user menu", function (needs) {
query(
".dismiss-notification-confirmation .d-modal__body"
).textContent.trim(),
I18n.t("notifications.dismiss_confirmation.body.assigns", { count: 173 }),
i18n("notifications.dismiss_confirmation.body.assigns", { count: 173 }),
"dismiss confirmation modal is shown"
);
@ -290,7 +290,7 @@ acceptance("Discourse Assign | user menu", function (needs) {
assert
.dom(".empty-state-title")
.hasText(
I18n.t("user.no_assignments_title"),
i18n("user.no_assignments_title"),
"empty state title is rendered"
);
assert.dom(".empty-state-body").exists("empty state body exists");

View File

@ -2,7 +2,7 @@ import { visit } from "@ember/test-helpers";
import { test } from "qunit";
import DiscoveryFixtures from "discourse/tests/fixtures/discovery-fixtures";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
function stubCategory(needs, customFields) {
needs.site({
@ -39,7 +39,7 @@ acceptance(
test("can see Unassigned button", async function (assert) {
await visit("/c/test");
const title = I18n.t("filters.unassigned.help");
const title = i18n("filters.unassigned.help");
assert.dom(`#navigation-bar li[title='${title}']`).exists();
});
}
@ -59,7 +59,7 @@ acceptance(
test("cannot see Unassigned button", async function (assert) {
await visit("/c/test");
const title = I18n.t("filters.unassigned.help");
const title = i18n("filters.unassigned.help");
assert.dom(`#navigation-bar li[title='${title}']`).doesNotExist();
});
}
@ -79,7 +79,7 @@ acceptance(
test("can see Unassigned button", async function (assert) {
await visit("/c/test");
const title = I18n.t("filters.unassigned.help");
const title = i18n("filters.unassigned.help");
assert.dom(`#navigation-bar li[title='${title}']`).exists();
});
}
@ -99,7 +99,7 @@ acceptance(
test("cannot see Unassigned button", async function (assert) {
await visit("/c/test");
const title = I18n.t("filters.unassigned.help");
const title = i18n("filters.unassigned.help");
assert.dom(`#navigation-bar li[title='${title}']`).doesNotExist();
});
}

View File

@ -1,11 +1,11 @@
import { visit } from "@ember/test-helpers";
import { test } from "qunit";
import { cloneJSON } from "discourse/lib/object";
import topicFixtures from "discourse/tests/fixtures/topic";
import {
acceptance,
updateCurrentUser,
} from "discourse/tests/helpers/qunit-helpers";
import { cloneJSON } from "discourse-common/lib/object";
acceptance(
"Discourse Assign | Never track topics assign reason",

View File

@ -1,8 +1,8 @@
import { visit } from "@ember/test-helpers";
import { test } from "qunit";
import { cloneJSON } from "discourse/lib/object";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { cloneJSON } from "discourse-common/lib/object";
import AssignedTopics from "../fixtures/assigned-topics-fixtures";
acceptance(

View File

@ -1,12 +1,12 @@
import { currentURL, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { cloneJSON } from "discourse/lib/object";
import {
acceptance,
updateCurrentUser,
} from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { cloneJSON } from "discourse-common/lib/object";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
import AssignedTopics from "../fixtures/assigned-topics-fixtures";
acceptance("Discourse Assign | User Private Messages", function (needs) {
@ -34,7 +34,7 @@ acceptance("Discourse Assign | User Private Messages", function (needs) {
const messagesDropdown = selectKit(".user-nav-messages-dropdown");
await messagesDropdown.expand();
await messagesDropdown.selectRowByName(I18n.t("discourse_assign.assigned"));
await messagesDropdown.selectRowByName(i18n("discourse_assign.assigned"));
assert.strictEqual(
currentURL(),
@ -44,7 +44,7 @@ acceptance("Discourse Assign | User Private Messages", function (needs) {
assert.strictEqual(
messagesDropdown.header().name(),
I18n.t("discourse_assign.assigned"),
i18n("discourse_assign.assigned"),
"assigned messages is selected in the dropdown"
);
});

View File

@ -1,5 +1,5 @@
import { cloneJSON } from "discourse/lib/object";
import topicFixtures from "discourse/tests/fixtures/topic";
import { cloneJSON } from "discourse-common/lib/object";
export default function topicWithAssignedPosts() {
const username = "eviltrout";