DEV: Use `@discourse/lint-configs` (#517)
This commit is contained in:
parent
6ed4a13fe7
commit
71f8484a75
|
@ -0,0 +1 @@
|
|||
module.exports = require("@discourse/lint-configs/eslint");
|
|
@ -1,4 +1,3 @@
|
|||
.bundle/
|
||||
auto_generated
|
||||
.DS_Store
|
||||
node_modules/
|
||||
node_modules
|
||||
/gems
|
||||
/auto_generated
|
17
.prettierrc
17
.prettierrc
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
"plugins": ["prettier-plugin-ember-template-tag"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": "*.gjs",
|
||||
"options": {
|
||||
"parser": "ember-template-tag"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": "*.gts",
|
||||
"options": {
|
||||
"parser": "ember-template-tag"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
module.exports = require("@discourse/lint-configs/prettier");
|
|
@ -1,4 +1 @@
|
|||
module.exports = {
|
||||
plugins: ["ember-template-lint-plugin-discourse"],
|
||||
extends: "discourse:recommended",
|
||||
};
|
||||
module.exports = require("@discourse/lint-configs/template-lint");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { action } from "@ember/object";
|
||||
import I18n from "I18n";
|
||||
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
|
||||
import { action } from "@ember/object";
|
||||
|
||||
export default DropdownSelectBoxComponent.extend({
|
||||
classNames: ["assign-actions-dropdown"],
|
||||
|
|
|
@ -1,9 +1,25 @@
|
|||
import Component from "@glimmer/component";
|
||||
import AssignActionsDropdown from "./assign-actions-dropdown";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { action } from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
import AssignActionsDropdown from "./assign-actions-dropdown";
|
||||
|
||||
export default class AssignedTopicListColumn extends Component {
|
||||
@service taskActions;
|
||||
@service router;
|
||||
|
||||
@action
|
||||
async unassign(targetId, targetType = "Topic") {
|
||||
await this.taskActions.unassign(targetId, targetType);
|
||||
this.router.refresh();
|
||||
}
|
||||
|
||||
@action
|
||||
reassign(topic) {
|
||||
this.taskActions.showAssignModal(topic, {
|
||||
onSuccess: () => this.router.refresh(),
|
||||
});
|
||||
}
|
||||
|
||||
<template>
|
||||
{{#if @topic.assigned_to_user}}
|
||||
<AssignActionsDropdown
|
||||
|
@ -24,20 +40,4 @@ export default class AssignedTopicListColumn extends Component {
|
|||
<AssignActionsDropdown @topic={{@topic}} @unassign={{this.unassign}} />
|
||||
{{/if}}
|
||||
</template>
|
||||
|
||||
@service taskActions;
|
||||
@service router;
|
||||
|
||||
@action
|
||||
async unassign(targetId, targetType = "Topic") {
|
||||
await this.taskActions.unassign(targetId, targetType);
|
||||
this.router.refresh();
|
||||
}
|
||||
|
||||
@action
|
||||
reassign(topic) {
|
||||
this.taskActions.showAssignModal(topic, {
|
||||
onSuccess: () => this.router.refresh(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import Component from "@ember/component";
|
||||
import I18n from "I18n";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import I18n from "I18n";
|
||||
|
||||
export default class RemindAssignsFrequency extends Component {
|
||||
@discourseComputed(
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import UserMenuNotificationsList from "discourse/components/user-menu/notifications-list";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import UserMenuNotificationItem from "discourse/lib/user-menu/notification-item";
|
||||
import UserMenuAssignItem from "../../lib/user-menu/assign-item";
|
||||
import Notification from "discourse/models/notification";
|
||||
import I18n from "I18n";
|
||||
import Topic from "discourse/models/topic";
|
||||
import I18n from "I18n";
|
||||
import UserMenuAssignItem from "../../lib/user-menu/assign-item";
|
||||
import UserMenuAssignsListEmptyState from "./assigns-list-empty-state";
|
||||
|
||||
export default class UserMenuAssignNotificationsList extends UserMenuNotificationsList {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import UserTopicsList from "discourse/controllers/user-topics-list";
|
||||
import { alias } from "@ember/object/computed";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import { inject as controller } from "@ember/controller";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { action } from "@ember/object";
|
||||
import { alias } from "@ember/object/computed";
|
||||
import { inject as service } from "@ember/service";
|
||||
import UserTopicsList from "discourse/controllers/user-topics-list";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
|
||||
export default class GroupAssignedShow extends UserTopicsList {
|
||||
@service taskActions;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { inject as service } from "@ember/service";
|
||||
import Controller, { inject as controller } from "@ember/controller";
|
||||
import { action } from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
|
||||
export default class GroupAssigned extends Controller {
|
||||
@service router;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import UserTopicsList from "discourse/controllers/user-topics-list";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import { inject as controller } from "@ember/controller";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { action } from "@ember/object";
|
||||
import { inject as 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 { htmlSafe } from "@ember/template";
|
||||
|
||||
export default class UserActivityAssigned extends UserTopicsList {
|
||||
@service taskActions;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import I18n from "I18n";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import I18n from "I18n";
|
||||
|
||||
export default {
|
||||
name: "assign-extend-user-messages",
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import { htmlSafe } from "@ember/template";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import { h } from "virtual-dom";
|
||||
import SearchAdvancedOptions from "discourse/components/search-advanced-options";
|
||||
import { renderAvatar } from "discourse/helpers/user-avatar";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import { iconHTML, iconNode } from "discourse-common/lib/icon-library";
|
||||
import { escapeExpression } from "discourse/lib/utilities";
|
||||
import { h } from "virtual-dom";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
import getURL from "discourse-common/lib/get-url";
|
||||
import SearchAdvancedOptions from "discourse/components/search-advanced-options";
|
||||
import I18n from "I18n";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import { registerTopicFooterDropdown } from "discourse/lib/register-topic-footer-dropdown";
|
||||
import { escapeExpression } from "discourse/lib/utilities";
|
||||
import RawHtml from "discourse/widgets/raw-html";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
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 BulkAssign from "../components/bulk-actions/assign-user";
|
||||
|
||||
const PLUGIN_ID = "discourse-assign";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import UserMenuBaseItem from "discourse/lib/user-menu/base-item";
|
||||
import { postUrl } from "discourse/lib/utilities";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
import { emojiUnescape } from "discourse/lib/text";
|
||||
import UserMenuBaseItem from "discourse/lib/user-menu/base-item";
|
||||
import { postUrl } from "discourse/lib/utilities";
|
||||
import I18n from "I18n";
|
||||
|
||||
const ICON = "user-plus";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import Category from "discourse/models/category";
|
||||
import { computed } from "@ember/object";
|
||||
import Category from "discourse/models/category";
|
||||
|
||||
export default {
|
||||
name: "extend-category-for-assign",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import EmberObject from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
import rawRenderGlimmer from "discourse/lib/raw-render-glimmer";
|
||||
import AssignedTopicListColumn from "../components/assigned-topic-list-column";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
const ASSIGN_LIST_ROUTES = ["userActivity.assigned", "group.assigned.show"];
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { findOrResetCachedTopicList } from "discourse/lib/cached-topic-list";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default class GroupAssignedShow extends DiscourseRoute {
|
||||
model(params) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default class GroupAssigned extends DiscourseRoute {
|
||||
@service router;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import I18n from "I18n";
|
||||
import UserTopicListRoute from "discourse/routes/user-topic-list";
|
||||
import cookie from "discourse/lib/cookie";
|
||||
import UserTopicListRoute from "discourse/routes/user-topic-list";
|
||||
import I18n from "I18n";
|
||||
|
||||
export default class UserActivityAssigned extends UserTopicListRoute {
|
||||
templateName = "user-activity-assigned";
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import Service, { inject as service } from "@ember/service";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import AssignUser from "../components/modal/assign-user";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import Service, { inject as service } from "@ember/service";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import AssignUser from "../components/modal/assign-user";
|
||||
|
||||
export default class TaskActions extends Service {
|
||||
@service modal;
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
"author": "Discourse",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"eslint-config-discourse": "^4.0.0",
|
||||
"prettier-plugin-ember-template-tag": "^0.3.2"
|
||||
"@discourse/lint-configs": "^1.0.0",
|
||||
"ember-template-lint": "^5.11.2",
|
||||
"eslint": "^8.51.0",
|
||||
"prettier": "^2.8.8"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
|
||||
acceptance("Discourse Assign | Assign disabled mobile", function (needs) {
|
||||
needs.user({ can_assign: true });
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import { cloneJSON } from "discourse-common/lib/object";
|
||||
import userFixtures from "discourse/tests/fixtures/user-fixtures";
|
||||
import {
|
||||
acceptance,
|
||||
updateCurrentUser,
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import { click, fillIn, visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import userFixtures from "discourse/tests/fixtures/user-fixtures";
|
||||
import pretender, {
|
||||
parsePostData,
|
||||
response,
|
||||
} from "discourse/tests/helpers/create-pretender";
|
||||
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";
|
||||
|
||||
acceptance("Discourse Assign | Assign mobile", function (needs) {
|
||||
needs.user();
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import topicFixtures from "discourse/tests/fixtures/topic";
|
||||
import {
|
||||
acceptance,
|
||||
query,
|
||||
updateCurrentUser,
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import { cloneJSON } from "discourse-common/lib/object";
|
||||
import I18n from "I18n";
|
||||
import topicFixtures from "discourse/tests/fixtures/topic";
|
||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import NotificationFixture from "../fixtures/notifications-fixtures";
|
||||
|
||||
function assignCurrentUserToTopic(needs) {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { click, currentURL, visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import {
|
||||
acceptance,
|
||||
query,
|
||||
queryAll,
|
||||
updateCurrentUser,
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import { click, currentURL, visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import I18n from "I18n";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
|
||||
const USER_MENU_ASSIGN_RESPONSE = {
|
||||
notifications: [
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { test } from "qunit";
|
||||
import { click, fillIn, visit } from "@ember/test-helpers";
|
||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import { test } from "qunit";
|
||||
import pretender, {
|
||||
parsePostData,
|
||||
response,
|
||||
} from "discourse/tests/helpers/create-pretender";
|
||||
import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
|
||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import I18n from "I18n";
|
||||
|
||||
acceptance("Discourse Assign | Bulk actions", function (needs) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import I18n from "I18n";
|
||||
import DiscoveryFixtures from "discourse/tests/fixtures/discovery-fixtures";
|
||||
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
||||
import I18n from "I18n";
|
||||
|
||||
function stubCategory(needs, customFields) {
|
||||
needs.site({
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
||||
import AssignedTopics from "../fixtures/assigned-group-assignments-fixtures";
|
||||
import GroupMembers from "../fixtures/group-members-fixtures";
|
||||
import { test } from "qunit";
|
||||
|
||||
acceptance("Discourse Assign | GroupAssignments", function (needs) {
|
||||
needs.user();
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import topicFixtures from "discourse/tests/fixtures/topic";
|
||||
import {
|
||||
acceptance,
|
||||
updateCurrentUser,
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
import { cloneJSON } from "discourse-common/lib/object";
|
||||
import topicFixtures from "discourse/tests/fixtures/topic";
|
||||
|
||||
acceptance(
|
||||
"Discourse Assign | Never track topics assign reason",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { fillIn, visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
|
||||
acceptance("Discourse Assign | Search - Full Page", function (needs) {
|
||||
needs.settings({ assign_enabled: true });
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
import AssignedTopics from "../fixtures/assigned-topics-fixtures";
|
||||
import { cloneJSON } from "discourse-common/lib/object";
|
||||
import { test } from "qunit";
|
||||
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(
|
||||
"Discourse Assign | Unassign/reassign from the topics list",
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import I18n from "I18n";
|
||||
import { currentURL, visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import {
|
||||
acceptance,
|
||||
updateCurrentUser,
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import { currentURL, visit } from "@ember/test-helpers";
|
||||
import AssignedTopics from "../fixtures/assigned-topics-fixtures";
|
||||
import { cloneJSON } from "discourse-common/lib/object";
|
||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import { test } from "qunit";
|
||||
import { cloneJSON } from "discourse-common/lib/object";
|
||||
import I18n from "I18n";
|
||||
import AssignedTopics from "../fixtures/assigned-topics-fixtures";
|
||||
|
||||
acceptance("Discourse Assign | User Private Messages", function (needs) {
|
||||
needs.user({
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import hbs from "htmlbars-inline-precompile";
|
||||
import componentTest, {
|
||||
setupRenderingTest,
|
||||
} from "discourse/tests/helpers/component-test";
|
||||
import { discourseModule, query } from "discourse/tests/helpers/qunit-helpers";
|
||||
import hbs from "htmlbars-inline-precompile";
|
||||
|
||||
discourseModule(
|
||||
"Discourse Assign | Integration | Component | group-assigned-filter",
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import hbs from "htmlbars-inline-precompile";
|
||||
import componentTest, {
|
||||
setupRenderingTest,
|
||||
} from "discourse/tests/helpers/component-test";
|
||||
import { discourseModule, query } from "discourse/tests/helpers/qunit-helpers";
|
||||
import hbs from "htmlbars-inline-precompile";
|
||||
|
||||
discourseModule(
|
||||
"Discourse Assign | Integration | Component | group-assigned-filter",
|
||||
|
|
Loading…
Reference in New Issue