diff --git a/.eslintrc b/.eslintrc index 86ed71b..7898fbf 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,93 +1,3 @@ { - "env": { - "jasmine": true, - "node": true, - "mocha": true, - "browser": true, - "builtin": true - }, - "parserOptions": { - "ecmaVersion": 7, - "sourceType": "module" - }, - "globals": { - "Ember": true, - "jQuery": true, - "$": true, - "QUnit": true, - "RSVP": true, - "Discourse": true, - "Handlebars": true, - "I18n": true, - "bootbox": true, - "moduleFor": true, - "moduleForComponent": true, - "Pretender": true, - "sandbox": true, - "controllerFor": true, - "test": true, - "visit": true, - "andThen": true, - "click": true, - "currentPath": true, - "currentRouteName": true, - "currentURL": true, - "fillIn": true, - "keyEvent": true, - "triggerEvent": true, - "count": true, - "exists": true, - "visible": true, - "invisible": true, - "asyncRender": true, - "asyncTestDiscourse": true, - "fixture": true, - "find": true, - "sinon": true, - "moment": true, - "_": true, - "alert": true, - "define": true, - "require": true, - "requirejs": true, - "hasModule": true, - "Blob": true, - "File": true - }, - "rules": { - "block-scoped-var": 2, - "dot-notation": 0, - "eqeqeq": [2, "allow-null"], - "guard-for-in": 2, - "no-bitwise": 2, - "no-caller": 2, - "no-cond-assign": 0, - "no-debugger": 2, - "no-empty": 0, - "no-eval": 2, - "no-extend-native": 2, - "no-extra-parens": 0, - "no-inner-declarations": 2, - "no-irregular-whitespace": 2, - "no-iterator": 2, - "no-loop-func": 2, - "no-multi-str": 2, - "no-new": 2, - "no-plusplus": 0, - "no-proto": 2, - "no-script-url": 2, - "no-sequences": 2, - "no-shadow": 2, - "no-undef": 2, - "no-unused-vars": 2, - "no-with": 2, - "no-this-before-super": 2, - "semi": 2, - "strict": 0, - "valid-typeof": 2, - "wrap-iife": [2, "inside"], - "no-mixed-spaces-and-tabs": 2, - "no-trailing-spaces": 2 - }, - "parser": "babel-eslint" + "extends": "eslint-config-discourse" } diff --git a/.template-lintrc.js b/.template-lintrc.js new file mode 100644 index 0000000..dd2e0b9 --- /dev/null +++ b/.template-lintrc.js @@ -0,0 +1,4 @@ +module.exports = { + plugins: ["ember-template-lint-plugin-discourse"], + extends: "discourse:recommended" +}; diff --git a/assets/javascripts/discourse-assign/assigned-group-route-map.js.es6 b/assets/javascripts/discourse-assign/assigned-group-route-map.js.es6 index 891d62c..6714f88 100644 --- a/assets/javascripts/discourse-assign/assigned-group-route-map.js.es6 +++ b/assets/javascripts/discourse-assign/assigned-group-route-map.js.es6 @@ -1,8 +1,8 @@ export default { resource: "group", map() { - this.route("assigned", function() { + this.route("assigned", function () { this.route("show", { path: "/:filter" }); }); - } + }, }; diff --git a/assets/javascripts/discourse-assign/assigned-messages-route-map.js.es6 b/assets/javascripts/discourse-assign/assigned-messages-route-map.js.es6 index afee7fd..be90c7c 100644 --- a/assets/javascripts/discourse-assign/assigned-messages-route-map.js.es6 +++ b/assets/javascripts/discourse-assign/assigned-messages-route-map.js.es6 @@ -2,5 +2,5 @@ export default { resource: "user.userPrivateMessages", map() { this.route("assigned"); - } + }, }; diff --git a/assets/javascripts/discourse-assign/assigns-activity-route-map.js.es6 b/assets/javascripts/discourse-assign/assigns-activity-route-map.js.es6 index 3547610..c20d643 100644 --- a/assets/javascripts/discourse-assign/assigns-activity-route-map.js.es6 +++ b/assets/javascripts/discourse-assign/assigns-activity-route-map.js.es6 @@ -2,5 +2,5 @@ export default { resource: "user.userActivity", map() { this.route("assigned"); - } + }, }; diff --git a/assets/javascripts/discourse-assign/connectors/above-review-filters/assigned-to-filter.hbs b/assets/javascripts/discourse-assign/connectors/above-review-filters/assigned-to-filter.hbs index f0d83f4..a7fa229 100644 --- a/assets/javascripts/discourse-assign/connectors/above-review-filters/assigned-to-filter.hbs +++ b/assets/javascripts/discourse-assign/connectors/above-review-filters/assigned-to-filter.hbs @@ -1,5 +1,5 @@ -
- +
+ {{user-selector single=true fullWidthWrap=true @@ -13,4 +13,4 @@ placeholderKey=placeholderKey autocomplete="off" }} -
\ No newline at end of file +
diff --git a/assets/javascripts/discourse-assign/connectors/above-review-filters/assigned-to-filter.js.es6 b/assets/javascripts/discourse-assign/connectors/above-review-filters/assigned-to-filter.js.es6 index f8158a2..dd6b88b 100644 --- a/assets/javascripts/discourse-assign/connectors/above-review-filters/assigned-to-filter.js.es6 +++ b/assets/javascripts/discourse-assign/connectors/above-review-filters/assigned-to-filter.js.es6 @@ -8,8 +8,8 @@ export default { .split("|") .filter(Boolean); const groupNames = this.site.groups - .filter(group => groupIDs.includes(group.id.toString())) + .filter((group) => groupIDs.includes(group.id.toString())) .mapBy("name"); component.set("allowedGroups", groupNames); - } + }, }; diff --git a/assets/javascripts/discourse-assign/connectors/category-custom-settings/assign-settings.hbs b/assets/javascripts/discourse-assign/connectors/category-custom-settings/assign-settings.hbs index 0ee2383..db707a7 100644 --- a/assets/javascripts/discourse-assign/connectors/category-custom-settings/assign-settings.hbs +++ b/assets/javascripts/discourse-assign/connectors/category-custom-settings/assign-settings.hbs @@ -1,5 +1,5 @@ -

{{i18n 'discourse_assign.assign.title'}}

-
+

{{i18n "discourse_assign.assign.title"}}

+
diff --git a/assets/javascripts/discourse-assign/connectors/category-custom-settings/assign-settings.js.es6 b/assets/javascripts/discourse-assign/connectors/category-custom-settings/assign-settings.js.es6 index dcd2b94..c85e99e 100644 --- a/assets/javascripts/discourse-assign/connectors/category-custom-settings/assign-settings.js.es6 +++ b/assets/javascripts/discourse-assign/connectors/category-custom-settings/assign-settings.js.es6 @@ -5,6 +5,6 @@ export default { "category.custom_fields.enable_unassigned_filter", value ? "true" : "false" ); - } - } + }, + }, }; diff --git a/assets/javascripts/discourse-assign/connectors/group-reports-nav-item/assigned-topic-list.js.es6 b/assets/javascripts/discourse-assign/connectors/group-reports-nav-item/assigned-topic-list.js.es6 index ace6464..0cedcb5 100644 --- a/assets/javascripts/discourse-assign/connectors/group-reports-nav-item/assigned-topic-list.js.es6 +++ b/assets/javascripts/discourse-assign/connectors/group-reports-nav-item/assigned-topic-list.js.es6 @@ -6,5 +6,5 @@ export default { args.group.can_show_assigned_tab && args.group.assignment_count > 0 ); - } + }, }; diff --git a/assets/javascripts/discourse-assign/connectors/user-activity-bottom/assigned-list.hbs b/assets/javascripts/discourse-assign/connectors/user-activity-bottom/assigned-list.hbs index 545f12b..f61e90e 100644 --- a/assets/javascripts/discourse-assign/connectors/user-activity-bottom/assigned-list.hbs +++ b/assets/javascripts/discourse-assign/connectors/user-activity-bottom/assigned-list.hbs @@ -1,5 +1,5 @@ {{#if currentUser.can_assign}} - {{#link-to 'userActivity.assigned'}} - {{d-icon "user-plus"}} {{i18n 'discourse_assign.assigned'}} + {{#link-to "userActivity.assigned"}} + {{d-icon "user-plus"}} {{i18n "discourse_assign.assigned"}} {{/link-to}} {{/if}} diff --git a/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.hbs b/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.hbs index 58984c4..4582d60 100644 --- a/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.hbs +++ b/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.hbs @@ -1,4 +1,4 @@ -{{#link-to 'userPrivateMessages.assigned' model}} +{{#link-to "userPrivateMessages.assigned" model}} {{d-icon "user-plus" class="glyph"}} - {{i18n 'discourse_assign.assigned'}} + {{i18n "discourse_assign.assigned"}} {{/link-to}} diff --git a/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.js.es6 b/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.js.es6 index 9853ce3..f59a3e7 100644 --- a/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.js.es6 +++ b/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.js.es6 @@ -10,5 +10,5 @@ export function shouldShowAssigned(args, component) { export default { shouldRender(args, component) { return shouldShowAssigned(args, component); - } + }, }; diff --git a/assets/javascripts/discourse-assign/connectors/user-preferences-notifications/remind-assigns-frequency.js.es6 b/assets/javascripts/discourse-assign/connectors/user-preferences-notifications/remind-assigns-frequency.js.es6 index 4db0626..5221c76 100644 --- a/assets/javascripts/discourse-assign/connectors/user-preferences-notifications/remind-assigns-frequency.js.es6 +++ b/assets/javascripts/discourse-assign/connectors/user-preferences-notifications/remind-assigns-frequency.js.es6 @@ -1,5 +1,5 @@ export default { shouldRender(args, component) { return component.currentUser && component.currentUser.get("can_assign"); - } + }, }; diff --git a/assets/javascripts/discourse-assign/controllers/assign-user.js.es6 b/assets/javascripts/discourse-assign/controllers/assign-user.js.es6 index cf143c7..5d5800a 100644 --- a/assets/javascripts/discourse-assign/controllers/assign-user.js.es6 +++ b/assets/javascripts/discourse-assign/controllers/assign-user.js.es6 @@ -10,7 +10,7 @@ export default Ember.Controller.extend({ this._super(...arguments); this.allowedGroups = []; - ajax("/assign/suggestions").then(data => { + ajax("/assign/suggestions").then((data) => { this.set("assignSuggestions", data.suggestions); this.set("allowedGroups", data.assign_allowed_on_groups); }); @@ -26,7 +26,7 @@ export default Ember.Controller.extend({ assignUser(user) { this.setProperties({ "model.username": user.username, - "model.allowedGroups": this.taskActions.allowedGroups + "model.allowedGroups": this.taskActions.allowedGroups, }); this.send("assign"); }, @@ -45,8 +45,8 @@ export default Ember.Controller.extend({ type: "PUT", data: { username: this.get("model.username"), - topic_id: this.get("model.topic.id") - } + topic_id: this.get("model.topic.id"), + }, }) .then(() => { if (this.get("model.onSuccess")) { @@ -54,6 +54,6 @@ export default Ember.Controller.extend({ } }) .catch(popupAjaxError); - } - } + }, + }, }); diff --git a/assets/javascripts/discourse-assign/controllers/group-assigned-show.js.es6 b/assets/javascripts/discourse-assign/controllers/group-assigned-show.js.es6 index bbcf7d8..efb1fb3 100644 --- a/assets/javascripts/discourse-assign/controllers/group-assigned-show.js.es6 +++ b/assets/javascripts/discourse-assign/controllers/group-assigned-show.js.es6 @@ -24,10 +24,10 @@ export default UserTopicsList.extend({ params: { order: this.order, ascending: this.ascending, - q: this.q - } + q: this.q, + }, }) - .then(result => this.set("model", result)) + .then((result) => this.set("model", result)) .finally(() => { this.set("loading", false); }); @@ -54,6 +54,6 @@ export default UserTopicsList.extend({ }, onChangeFilter(value) { debounce(this, this._setSearchTerm, value, INPUT_DELAY * 2); - } - } + }, + }, }); diff --git a/assets/javascripts/discourse-assign/controllers/group-assigned.js.es6 b/assets/javascripts/discourse-assign/controllers/group-assigned.js.es6 index 6bcfadd..8493999 100644 --- a/assets/javascripts/discourse-assign/controllers/group-assigned.js.es6 +++ b/assets/javascripts/discourse-assign/controllers/group-assigned.js.es6 @@ -42,9 +42,9 @@ export default Controller.extend({ const groupName = this.group.name; ajax(`/assign/members/${groupName}`, { type: "GET", - data: { filter: this.filter, offset: this.offset } + data: { filter: this.filter, offset: this.offset }, }) - .then(result => { + .then((result) => { if (this.router.currentRoute.params.filter !== "everyone") { this.transitionToRoute("group.assigned.show", groupName, "everyone"); } @@ -70,9 +70,9 @@ export default Controller.extend({ this.set("offset", this.offset + 50); ajax(`/assign/members/${this.group.name}`, { type: "GET", - data: { filter: this.filter, offset: this.offset } + data: { filter: this.filter, offset: this.offset }, }) - .then(result => { + .then((result) => { this.members.pushObjects(result.members); }) .finally(() => this.set("loading", false)); @@ -87,5 +87,5 @@ export default Controller.extend({ @action onChangeFilterName(value) { debounce(this, this._setFilter, value, INPUT_DELAY * 2); - } + }, }); diff --git a/assets/javascripts/discourse-assign/controllers/user-activity-assigned.js.es6 b/assets/javascripts/discourse-assign/controllers/user-activity-assigned.js.es6 index 059a2fa..15ca1e2 100644 --- a/assets/javascripts/discourse-assign/controllers/user-activity-assigned.js.es6 +++ b/assets/javascripts/discourse-assign/controllers/user-activity-assigned.js.es6 @@ -25,6 +25,6 @@ export default UserTopicsList.extend({ this.setProperties({ order: sortBy, ascending: false }); this.model.refreshSort(sortBy, false); } - } - } + }, + }, }); diff --git a/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6 b/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6 index aa7b310..f67eb8e 100644 --- a/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6 +++ b/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6 @@ -7,11 +7,12 @@ import { queryRegistry } from "discourse/widgets/widget"; import { getOwner } from "discourse-common/lib/get-owner"; import { htmlSafe } from "@ember/template"; import getURL from "discourse-common/lib/get-url"; +import I18n from "I18n"; function titleForState(user) { if (user) { return I18n.t("discourse_assign.unassign.help", { - username: user.username + username: user.username, }); } else { return I18n.t("discourse_assign.assign.help"); @@ -48,14 +49,14 @@ function registerTopicFooterButtons(api) { user.username }${renderAvatar(user, { imageSize: "small", - ignoreTitle: true + ignoreTitle: true, })}` ); } else { return htmlSafe( `${renderAvatar(user, { imageSize: "tiny", - ignoreTitle: true + ignoreTitle: true, })}${label}` ); } @@ -86,21 +87,21 @@ function registerTopicFooterButtons(api) { dependentKeys: [ "topic.assigned_to_user", "currentUser.can_assign", - "topic.assigned_to_user.username" + "topic.assigned_to_user.username", ], displayed() { return this.currentUser && this.currentUser.can_assign; - } + }, }); } function initialize(api) { api.addNavigationBarItem({ name: "unassigned", - customFilter: category => { + customFilter: (category) => { return category && category.enable_unassigned_filter; }, - customHref: category => { + customHref: (category) => { if (category) { return getURL(category.url) + "/l/latest?status=open&assigned=nobody"; } @@ -115,7 +116,7 @@ function initialize(api) { queryParams["status"] === "open" ); }, - before: "top" + before: "top", }); // You can't act on flags claimed by another user @@ -146,7 +147,7 @@ function initialize(api) { didInsertElement() { this._super(...arguments); - this.messageBus.subscribe("/staff/topic-assignment", data => { + this.messageBus.subscribe("/staff/topic-assignment", (data) => { let flaggedPost = this.flaggedPost; if (data.topic_id === flaggedPost.get("topic.id")) { flaggedPost.set( @@ -162,7 +163,7 @@ function initialize(api) { this._super(...arguments); this.messageBus.unsubscribe("/staff/topic-assignment"); - } + }, }, { ignoreMissing: true } ); @@ -177,7 +178,7 @@ function initialize(api) { assignedToUser.username ) ); - } + }, }); api.modifyClass("model:bookmark", { @@ -189,13 +190,13 @@ function initialize(api) { assignedToUser.username ) ); - } + }, }); api.addPostSmallActionIcon("assigned", "user-plus"); api.addPostSmallActionIcon("unassigned", "user-times"); - api.addPostTransformCallback(transformed => { + api.addPostTransformCallback((transformed) => { if ( transformed.actionCode === "assigned" || transformed.actionCode === "unassigned" @@ -207,7 +208,7 @@ function initialize(api) { api.addDiscoveryQueryParam("assigned", { replace: true, refreshModel: true }); - api.addTagsHtmlCallback(topic => { + api.addTagsHtmlCallback((topic) => { const assignedTo = topic.get("assigned_to_user.username"); if (assignedTo) { const assignedPath = topic.assignedToUserPath; @@ -217,13 +218,13 @@ function initialize(api) { } }); - api.addUserMenuGlyph(widget => { + api.addUserMenuGlyph((widget) => { if (widget.currentUser && widget.currentUser.can_assign) { const glyph = { label: "discourse_assign.assigned", className: "assigned", icon: "user-plus", - href: `${widget.currentUser.path}/activity/assigned` + href: `${widget.currentUser.path}/activity/assigned`, }; if (queryRegistry("quick-access-panel")) { @@ -246,16 +247,16 @@ function initialize(api) { "a", { attributes: { class: "assigned-to-username", href } }, assignedToUser.username - ) + ), ]); - } + }, }); api.modifyClass("controller:topic", { subscribe() { this._super(...arguments); - this.messageBus.subscribe("/staff/topic-assignment", data => { + this.messageBus.subscribe("/staff/topic-assignment", (data) => { const topic = this.model; const topicId = topic.id; @@ -276,10 +277,10 @@ function initialize(api) { if (!this.get("model.id")) return; this.messageBus.unsubscribe("/staff/topic-assignment"); - } + }, }); - api.decorateWidget("post-contents:after-cooked", dec => { + api.decorateWidget("post-contents:after-cooked", (dec) => { if (dec.attrs.post_number === 1) { const postModel = dec.getModel(); if (postModel) { @@ -287,7 +288,7 @@ function initialize(api) { if (assignedToUser) { return dec.widget.attach("assigned-to", { assignedToUser, - href: Ember.get(postModel, "topic.assignedToUserPath") + href: Ember.get(postModel, "topic.assignedToUserPath"), }); } } @@ -304,8 +305,8 @@ function initialize(api) { save() { this.saveAttrNames.push("custom_fields"); this._super(...arguments); - } - } + }, + }, }); api.addKeyboardShortcut("g a", "", { path: "/my/activity/assigned" }); @@ -319,7 +320,9 @@ export default { return; } - withPluginApi("0.8.11", api => initialize(api, container)); - withPluginApi("0.8.28", api => registerTopicFooterButtons(api, container)); - } + withPluginApi("0.8.11", (api) => initialize(api, container)); + withPluginApi("0.8.28", (api) => + registerTopicFooterButtons(api, container) + ); + }, }; diff --git a/assets/javascripts/discourse-assign/pre-initializers/extend-category-for-assign.js.es6 b/assets/javascripts/discourse-assign/pre-initializers/extend-category-for-assign.js.es6 index 1b11660..5a81eb8 100644 --- a/assets/javascripts/discourse-assign/pre-initializers/extend-category-for-assign.js.es6 +++ b/assets/javascripts/discourse-assign/pre-initializers/extend-category-for-assign.js.es6 @@ -15,9 +15,9 @@ export default { return this.custom_fields.enable_unassigned_filter === "true"; } return false; - } + }, } - ) + ), }); - } + }, }; diff --git a/assets/javascripts/discourse-assign/routes/group-assigned-show.js.es6 b/assets/javascripts/discourse-assign/routes/group-assigned-show.js.es6 index 1b49d10..6cd13c8 100644 --- a/assets/javascripts/discourse-assign/routes/group-assigned-show.js.es6 +++ b/assets/javascripts/discourse-assign/routes/group-assigned-show.js.es6 @@ -28,19 +28,19 @@ export default DiscourseRoute.extend({ params: { order: params.order, ascending: params.ascending, - q: params.q - } + q: params.q, + }, }); }, setupController(controller, model) { controller.setProperties({ model, - searchTerm: this.currentModel.params.q + searchTerm: this.currentModel.params.q, }); }, renderTemplate() { this.render("group-topics-list"); - } + }, }); diff --git a/assets/javascripts/discourse-assign/routes/group-assigned.js.es6 b/assets/javascripts/discourse-assign/routes/group-assigned.js.es6 index 244d62d..fb15464 100644 --- a/assets/javascripts/discourse-assign/routes/group-assigned.js.es6 +++ b/assets/javascripts/discourse-assign/routes/group-assigned.js.es6 @@ -10,7 +10,7 @@ export default DiscourseRoute.extend({ controller.setProperties({ model, members: [], - group: this.modelFor("group") + group: this.modelFor("group"), }); controller.group.set("assignment_count", model.assignment_count); @@ -28,6 +28,6 @@ export default DiscourseRoute.extend({ actions: { changeAssigned() { this.refresh(); - } - } + }, + }, }); diff --git a/assets/javascripts/discourse-assign/routes/user-activity-assigned.js.es6 b/assets/javascripts/discourse-assign/routes/user-activity-assigned.js.es6 index 171a14c..ce448ba 100644 --- a/assets/javascripts/discourse-assign/routes/user-activity-assigned.js.es6 +++ b/assets/javascripts/discourse-assign/routes/user-activity-assigned.js.es6 @@ -1,9 +1,10 @@ +import I18n from "I18n"; import UserTopicListRoute from "discourse/routes/user-topic-list"; export default UserTopicListRoute.extend({ queryParams: { order: { refreshModel: true }, - ascending: { refreshModel: true } + ascending: { refreshModel: true }, }, userActionType: 16, noContentHelpKey: "discourse_assigns.no_assigns", @@ -17,8 +18,8 @@ export default UserTopicListRoute.extend({ // core is a bit odd here and is not sending an array, should be fixed exclude_category_ids: [-1], order: params.order, - ascending: params.ascending - } + ascending: params.ascending, + }, }); }, @@ -39,6 +40,6 @@ export default UserTopicListRoute.extend({ actions: { changeAssigned() { this.refresh(); - } - } + }, + }, }); diff --git a/assets/javascripts/discourse/components/assign-actions-dropdown.js.es6 b/assets/javascripts/discourse/components/assign-actions-dropdown.js.es6 index 94e20aa..f3d10b1 100644 --- a/assets/javascripts/discourse/components/assign-actions-dropdown.js.es6 +++ b/assets/javascripts/discourse/components/assign-actions-dropdown.js.es6 @@ -1,3 +1,4 @@ +import I18n from "I18n"; import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box"; export default DropdownSelectBoxComponent.extend({ @@ -14,15 +15,15 @@ export default DropdownSelectBoxComponent.extend({ icon: "user-times", name: I18n.t("discourse_assign.unassign.title"), description: I18n.t("discourse_assign.unassign.help", { - username: this.topic.assigned_to_user.username - }) + username: this.topic.assigned_to_user.username, + }), }, { id: "reassign", icon: "users", name: I18n.t("discourse_assign.reassign.title"), - description: I18n.t("discourse_assign.reassign.help") - } + description: I18n.t("discourse_assign.reassign.help"), + }, ]; }, @@ -36,6 +37,6 @@ export default DropdownSelectBoxComponent.extend({ this.reassign(this.topic, this.user); break; } - } - } + }, + }, }); diff --git a/assets/javascripts/discourse/components/assigned-to.js.es6 b/assets/javascripts/discourse/components/assigned-to.js.es6 index aa7e0e3..c4e6f2b 100644 --- a/assets/javascripts/discourse/components/assigned-to.js.es6 +++ b/assets/javascripts/discourse/components/assigned-to.js.es6 @@ -1,3 +1,3 @@ export default Ember.Component.extend({ - classNames: ["assigned-to-user"] + classNames: ["assigned-to-user"], }); diff --git a/assets/javascripts/discourse/components/assigned-topic-list-item.js.es6 b/assets/javascripts/discourse/components/assigned-topic-list-item.js.es6 index 5f1c53f..2203ee5 100644 --- a/assets/javascripts/discourse/components/assigned-topic-list-item.js.es6 +++ b/assets/javascripts/discourse/components/assigned-topic-list-item.js.es6 @@ -1,6 +1,6 @@ import { ListItemDefaults, - default as TopicListItem + default as TopicListItem, } from "discourse/components/topic-list-item"; // This is a backward compatible fix so that this change: @@ -10,11 +10,17 @@ let assignedTopicListItem = null; if (ListItemDefaults) { assignedTopicListItem = Ember.Component.extend(ListItemDefaults, { - isPrivateMessage: Ember.computed.equal("topic.archetype", "private_message") + isPrivateMessage: Ember.computed.equal( + "topic.archetype", + "private_message" + ), }); } else { assignedTopicListItem = TopicListItem.extend({ - isPrivateMessage: Ember.computed.equal("topic.archetype", "private_message") + isPrivateMessage: Ember.computed.equal( + "topic.archetype", + "private_message" + ), }); } diff --git a/assets/javascripts/discourse/components/claim-topic.js.es6 b/assets/javascripts/discourse/components/claim-topic.js.es6 index 49cda18..9640f5d 100644 --- a/assets/javascripts/discourse/components/claim-topic.js.es6 +++ b/assets/javascripts/discourse/components/claim-topic.js.es6 @@ -11,7 +11,7 @@ export default Ember.Component.extend({ this.set("unassigning", true); return ajax("/assign/unassign", { type: "PUT", - data: { topic_id: this.get("topic.id") } + data: { topic_id: this.get("topic.id") }, }) .then(() => { this.set("topic.assigned_to_user", null); @@ -27,12 +27,12 @@ export default Ember.Component.extend({ let topic = this.topic; ajax(`/assign/claim/${topic.id}`, { - method: "PUT" + method: "PUT", }) .then(() => { this.set("topic.assigned_to_user", this.currentUser); }) - .catch(e => { + .catch((e) => { if (e.jqXHR && e.jqXHR.responseJSON) { let json = e.jqXHR.responseJSON; if (json && json.extras) { @@ -47,6 +47,6 @@ export default Ember.Component.extend({ } this.set("claiming", false); }); - } - } + }, + }, }); diff --git a/assets/javascripts/discourse/components/flagged-topic-listener.js.es6 b/assets/javascripts/discourse/components/flagged-topic-listener.js.es6 index 3997a29..da96bc5 100644 --- a/assets/javascripts/discourse/components/flagged-topic-listener.js.es6 +++ b/assets/javascripts/discourse/components/flagged-topic-listener.js.es6 @@ -7,10 +7,10 @@ function assignIfEqual(topic, data) { export default Ember.Component.extend({ didInsertElement() { this._super(); - this.messageBus.subscribe("/staff/topic-assignment", data => { + this.messageBus.subscribe("/staff/topic-assignment", (data) => { let flaggedTopics = this.flaggedTopics; if (flaggedTopics) { - flaggedTopics.forEach(ft => assignIfEqual(ft.topic, data)); + flaggedTopics.forEach((ft) => assignIfEqual(ft.topic, data)); } else { assignIfEqual(this.topic, data); } @@ -20,5 +20,5 @@ export default Ember.Component.extend({ willDestroyElement() { this._super(); this.messageBus.unsubscribe("/staff/topic-assignment"); - } + }, }); diff --git a/assets/javascripts/discourse/components/group-assigned-filter.js.es6 b/assets/javascripts/discourse/components/group-assigned-filter.js.es6 index e0188e1..98078aa 100644 --- a/assets/javascripts/discourse/components/group-assigned-filter.js.es6 +++ b/assets/javascripts/discourse/components/group-assigned-filter.js.es6 @@ -1,5 +1,5 @@ import Component from "@ember/component"; export default Component.extend({ - tagName: "li" + tagName: "li", }); diff --git a/assets/javascripts/discourse/components/group-assigned-menu-item.js.es6 b/assets/javascripts/discourse/components/group-assigned-menu-item.js.es6 index 91ad923..eed7fd0 100644 --- a/assets/javascripts/discourse/components/group-assigned-menu-item.js.es6 +++ b/assets/javascripts/discourse/components/group-assigned-menu-item.js.es6 @@ -1,3 +1,3 @@ export default Ember.Component.extend({ - tagName: "" + tagName: "", }); diff --git a/assets/javascripts/discourse/components/remind-assigns-frequency.js.es6 b/assets/javascripts/discourse/components/remind-assigns-frequency.js.es6 index b1002f2..a57cdf5 100644 --- a/assets/javascripts/discourse/components/remind-assigns-frequency.js.es6 +++ b/assets/javascripts/discourse/components/remind-assigns-frequency.js.es6 @@ -1,3 +1,4 @@ +import I18n from "I18n"; import computed from "discourse-common/utils/decorators"; export default Ember.Component.extend({ @@ -5,11 +6,11 @@ export default Ember.Component.extend({ @computed("user.reminders_frequency") availableFrequencies(userRemindersFrequency) { - return userRemindersFrequency.map(freq => { + return userRemindersFrequency.map((freq) => { return { name: I18n.t(freq.name), value: freq.value, - selected: false + selected: false, }; }); }, @@ -31,6 +32,6 @@ export default Ember.Component.extend({ actions: { setFrequency(newFrequency) { this.set("user.custom_fields.remind_assigns_frequency", newFrequency); - } - } + }, + }, }); diff --git a/assets/javascripts/discourse/services/task-actions.js.es6 b/assets/javascripts/discourse/services/task-actions.js.es6 index e1eaf48..90b37f6 100644 --- a/assets/javascripts/discourse/services/task-actions.js.es6 +++ b/assets/javascripts/discourse/services/task-actions.js.es6 @@ -5,7 +5,7 @@ export default Ember.Service.extend({ unassign(topicId) { return ajax("/assign/unassign", { type: "PUT", - data: { topic_id: topicId } + data: { topic_id: topicId }, }); }, @@ -13,8 +13,8 @@ export default Ember.Service.extend({ return showModal("assign-user", { model: { topic, - username: topic.get("assigned_to_user.username") - } + username: topic.get("assigned_to_user.username"), + }, }); }, @@ -23,8 +23,8 @@ export default Ember.Service.extend({ type: "PUT", data: { username: user.username, - topic_id: topic.id - } + topic_id: topic.id, + }, }); - } + }, }); diff --git a/assets/javascripts/discourse/templates/components/assigned-to.hbs b/assets/javascripts/discourse/templates/components/assigned-to.hbs index 934a4e1..c20ef10 100644 --- a/assets/javascripts/discourse/templates/components/assigned-to.hbs +++ b/assets/javascripts/discourse/templates/components/assigned-to.hbs @@ -1,5 +1,5 @@ {{avatar user imageSize="small"}} - + {{user.username}} {{yield}} diff --git a/assets/javascripts/discourse/templates/components/assigned-topic-list-item.hbs b/assets/javascripts/discourse/templates/components/assigned-topic-list-item.hbs index 97dfd4f..44c956f 100644 --- a/assets/javascripts/discourse/templates/components/assigned-topic-list-item.hbs +++ b/assets/javascripts/discourse/templates/components/assigned-topic-list-item.hbs @@ -5,18 +5,18 @@ This causes the topic-post-badge to be considered the same word as "text" at the end of the link, preventing it from line wrapping onto its own line. --}} - - + + {{~raw "topic-status" topic=topic}} {{~#if isPrivateMessage}} - {{~d-icon "envelope" class="private-message-icon"}} + {{~d-icon "envelope" class="private-message-icon"}} {{~/if}} {{~topic-link topic class="raw-link raw-topic-link"}} {{~#if topic.featured_link}} - {{~topic-featured-link topic}} + {{~topic-featured-link topic}} {{~/if}} {{~#if showTopicPostBadges}} - {{~raw "topic-post-badges" unread=topic.unread newPosts=topic.displayNewPosts unseen=topic.unseen url=topic.lastUnreadUrl newDotText=newDotText}} + {{~raw "topic-post-badges" unread=topic.unread newPosts=topic.displayNewPosts unseen=topic.unseen url=topic.lastUnreadUrl newDotText=newDotText}} {{~/if}}