diff --git a/Gemfile.lock b/Gemfile.lock index 3cd058c..28b6f70 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,34 +3,42 @@ GEM specs: ast (2.4.2) json (2.6.3) - parallel (1.22.1) - parser (3.1.3.0) + parallel (1.23.0) + parser (3.2.2.3) ast (~> 2.4.1) - prettier_print (1.2.0) + racc + prettier_print (1.2.1) + racc (1.7.1) rainbow (3.1.1) - regexp_parser (2.6.1) + regexp_parser (2.8.1) rexml (3.2.5) - rubocop (1.41.1) + rubocop (1.52.1) json (~> 2.3) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.0) - parser (>= 3.1.1.0) - rubocop-discourse (3.0.1) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) + rubocop-capybara (2.18.0) + rubocop (~> 1.41) + rubocop-discourse (3.2.0) rubocop (>= 1.1.0) rubocop-rspec (>= 2.0.0) - rubocop-rspec (2.16.0) + rubocop-factory_bot (2.23.1) rubocop (~> 1.33) - ruby-progressbar (1.11.0) - syntax_tree (5.1.0) + rubocop-rspec (2.22.0) + rubocop (~> 1.33) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + ruby-progressbar (1.13.0) + syntax_tree (6.1.1) prettier_print (>= 1.2.0) - unicode-display_width (2.3.0) + unicode-display_width (2.4.2) PLATFORMS ruby diff --git a/README.md b/README.md index 4a6a8ea..c8ff8be 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Assign Plugin +# Assign Plugin Allows you to assign topics and individual posts (both private and public) to a user or group. diff --git a/assets/javascripts/discourse-assign/assigned-group-route-map.js b/assets/javascripts/discourse-assign/assigned-group-route-map.js index 6714f88..4b426b9 100644 --- a/assets/javascripts/discourse-assign/assigned-group-route-map.js +++ b/assets/javascripts/discourse-assign/assigned-group-route-map.js @@ -1,5 +1,6 @@ export default { resource: "group", + map() { this.route("assigned", function () { this.route("show", { path: "/:filter" }); diff --git a/assets/javascripts/discourse-assign/assigned-messages-route-map.js b/assets/javascripts/discourse-assign/assigned-messages-route-map.js index c05ad5d..8de2d1c 100644 --- a/assets/javascripts/discourse-assign/assigned-messages-route-map.js +++ b/assets/javascripts/discourse-assign/assigned-messages-route-map.js @@ -1,5 +1,6 @@ export default { resource: "user.userPrivateMessages", + map() { this.route("assigned", { path: "/assigned" }, function () { this.route("index", { path: "/" }); diff --git a/assets/javascripts/discourse-assign/assigns-activity-route-map.js b/assets/javascripts/discourse-assign/assigns-activity-route-map.js index c20d643..494c147 100644 --- a/assets/javascripts/discourse-assign/assigns-activity-route-map.js +++ b/assets/javascripts/discourse-assign/assigns-activity-route-map.js @@ -1,5 +1,6 @@ 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 9c179f9..7291a22 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,15 +1,15 @@
\ No newline at end of file diff --git a/assets/javascripts/discourse-assign/connectors/advanced-search-options-below/assigned-advanced-search.hbs b/assets/javascripts/discourse-assign/connectors/advanced-search-options-below/assigned-advanced-search.hbs index 9ccc30e..1597da5 100644 --- a/assets/javascripts/discourse-assign/connectors/advanced-search-options-below/assigned-advanced-search.hbs +++ b/assets/javascripts/discourse-assign/connectors/advanced-search-options-below/assigned-advanced-search.hbs @@ -4,7 +4,7 @@ }}
{{i18n "discourse_assign.add_unassigned_filter"}} diff --git a/assets/javascripts/discourse-assign/connectors/group-reports-nav-item/assigned-topic-list.hbs b/assets/javascripts/discourse-assign/connectors/group-reports-nav-item/assigned-topic-list.hbs index 8389064..3117f4a 100644 --- a/assets/javascripts/discourse-assign/connectors/group-reports-nav-item/assigned-topic-list.hbs +++ b/assets/javascripts/discourse-assign/connectors/group-reports-nav-item/assigned-topic-list.hbs @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/assets/javascripts/discourse-assign/connectors/group-reports-nav-item/assigned-topic-list.js b/assets/javascripts/discourse-assign/connectors/group-reports-nav-item/assigned-topic-list.js index 0cedcb5..476e450 100644 --- a/assets/javascripts/discourse-assign/connectors/group-reports-nav-item/assigned-topic-list.js +++ b/assets/javascripts/discourse-assign/connectors/group-reports-nav-item/assigned-topic-list.js @@ -1,8 +1,7 @@ export default { shouldRender(args, component) { return ( - component.currentUser && - component.currentUser.can_assign && + component.currentUser?.can_assign && args.group.can_show_assigned_tab && args.group.assignment_count > 0 ); diff --git a/assets/javascripts/discourse-assign/connectors/groups-interaction-custom-options/assignable-interaction-fields.hbs b/assets/javascripts/discourse-assign/connectors/groups-interaction-custom-options/assignable-interaction-fields.hbs index 87913f7..b3bee98 100644 --- a/assets/javascripts/discourse-assign/connectors/groups-interaction-custom-options/assignable-interaction-fields.hbs +++ b/assets/javascripts/discourse-assign/connectors/groups-interaction-custom-options/assignable-interaction-fields.hbs @@ -1,17 +1,20 @@
- -
\ No newline at end of file diff --git a/assets/javascripts/discourse-assign/connectors/groups-interaction-custom-options/assignable-interaction-fields.js b/assets/javascripts/discourse-assign/connectors/groups-interaction-custom-options/assignable-interaction-fields.js index ddbcf30..d565081 100644 --- a/assets/javascripts/discourse-assign/connectors/groups-interaction-custom-options/assignable-interaction-fields.js +++ b/assets/javascripts/discourse-assign/connectors/groups-interaction-custom-options/assignable-interaction-fields.js @@ -1,24 +1,17 @@ +import Component from "@glimmer/component"; import I18n from "I18n"; -import { or } from "@ember/object/computed"; -import { defineProperty } from "@ember/object"; -export default { - name: "assignable-interaction-fields", +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 }, + ]; - setupComponent(args, component) { - this.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 }, - ]; - - defineProperty( - component, - "assignableLevel", - or("model.assignable_level", "assignableLevelOptions.firstObject.value") - ); - }, -}; + get assignableLevel() { + return this.args.outletArgs.model.assignable_level || 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 80e7d10..8b1e9cf 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,4 +1,4 @@ -{{#if currentUser.can_assign}} +{{#if this.currentUser.can_assign}} {{d-icon "user-plus"}} {{i18n "discourse_assign.assigned"}} 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 319c8c4..2a46cd6 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 @@ - + {{d-icon "user-plus" class="glyph"}} {{i18n "discourse_assign.assigned"}} \ No newline at end of file diff --git a/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.js b/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.js index f59a3e7..10acd23 100644 --- a/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.js +++ b/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.js @@ -1,9 +1,7 @@ export function shouldShowAssigned(args, component) { - const needsButton = - component.currentUser && component.currentUser.get("can_assign"); + const needsButton = component.currentUser?.can_assign; return ( - needsButton && - (!component.get("site.mobileView") || args.model.get("isPrivateMessage")) + needsButton && (!component.site.mobileView || args.model.isPrivateMessage) ); } diff --git a/assets/javascripts/discourse-assign/connectors/user-preferences-notifications/remind-assigns-frequency.hbs b/assets/javascripts/discourse-assign/connectors/user-preferences-notifications/remind-assigns-frequency.hbs index 4d8899c..4b11f00 100644 --- a/assets/javascripts/discourse-assign/connectors/user-preferences-notifications/remind-assigns-frequency.hbs +++ b/assets/javascripts/discourse-assign/connectors/user-preferences-notifications/remind-assigns-frequency.hbs @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/assets/javascripts/discourse-assign/connectors/user-preferences-notifications/remind-assigns-frequency.js b/assets/javascripts/discourse-assign/connectors/user-preferences-notifications/remind-assigns-frequency.js index 5221c76..9886a5c 100644 --- a/assets/javascripts/discourse-assign/connectors/user-preferences-notifications/remind-assigns-frequency.js +++ b/assets/javascripts/discourse-assign/connectors/user-preferences-notifications/remind-assigns-frequency.js @@ -1,5 +1,5 @@ export default { shouldRender(args, component) { - return component.currentUser && component.currentUser.get("can_assign"); + return component.currentUser?.can_assign; }, }; diff --git a/assets/javascripts/discourse-assign/controllers/assign-user.js b/assets/javascripts/discourse-assign/controllers/assign-user.js index f07d370..6b54b5f 100644 --- a/assets/javascripts/discourse-assign/controllers/assign-user.js +++ b/assets/javascripts/discourse-assign/controllers/assign-user.js @@ -8,17 +8,19 @@ import { isEmpty } from "@ember/utils"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; -export default Controller.extend(ModalFunctionality, { - topicBulkActions: controller(), - assignSuggestions: null, - allowedGroups: null, - taskActions: service(), - autofocus: not("capabilities.touch"), - assigneeName: or("model.username", "model.group_name"), - assigneeError: false, +export default class AssignUser extends Controller.extend(ModalFunctionality) { + @service taskActions; + @controller topicBulkActions; - init() { - this._super(...arguments); + assignSuggestions = null; + allowedGroups = null; + assigneeError = false; + + @not("capabilities.touch") autofocus; + @or("model.username", "model.group_name") assigneeName; + + constructor() { + super(...arguments); this.set("allowedGroups", []); this.set("assigneeError", false); @@ -31,17 +33,17 @@ export default Controller.extend(ModalFunctionality, { this.set("allowedGroups", data.assign_allowed_on_groups); this.set("allowedGroupsForAssignment", data.assign_allowed_for_groups); }); - }, + } onShow() { this.set("assigneeError", false); - }, + } onClose() { - if (this.get("model.onClose") && this.get("model.username")) { - this.get("model.onClose")(this.get("model.username")); + if (this.model.onClose && this.model.username) { + this.model.onClose(this.model.username); } - }, + } bulkAction(username, note) { return this.topicBulkActions.performAndRefresh({ @@ -49,19 +51,19 @@ export default Controller.extend(ModalFunctionality, { username, note, }); - }, + } @discourseComputed("siteSettings.enable_assign_status") statusEnabled() { return this.siteSettings.enable_assign_status; - }, + } @discourseComputed("siteSettings.assign_statuses") availableStatuses() { return this.siteSettings.assign_statuses.split("|").map((status) => { return { id: status, name: status }; }); - }, + } @discourseComputed("siteSettings.assign_statuses", "model.status") status() { @@ -70,22 +72,19 @@ export default Controller.extend(ModalFunctionality, { this.model.target.assignment_status || this.siteSettings.assign_statuses.split("|")[0] ); - }, + } @action handleTextAreaKeydown(event) { if ((event.ctrlKey || event.metaKey) && event.key === "Enter") { this.assign(); } - }, + } @action assign() { if (this.isBulkAction) { - return this.bulkAction( - this.get("model.username"), - this.get("model.note") - ); + return this.bulkAction(this.model.username, this.model.note); } if (!this.assigneeName) { @@ -95,18 +94,15 @@ export default Controller.extend(ModalFunctionality, { let path = "/assign/assign"; - if (isEmpty(this.get("model.username"))) { + if (isEmpty(this.model.username)) { this.model.target.set("assigned_to_user", null); } - if (isEmpty(this.get("model.group_name"))) { + if (isEmpty(this.model.group_name)) { this.model.target.set("assigned_to_group", null); } - if ( - isEmpty(this.get("model.username")) && - isEmpty(this.get("model.group_name")) - ) { + if (isEmpty(this.model.username) && isEmpty(this.model.group_name)) { path = "/assign/unassign"; } @@ -115,19 +111,19 @@ export default Controller.extend(ModalFunctionality, { return ajax(path, { type: "PUT", data: { - username: this.get("model.username"), - group_name: this.get("model.group_name"), - target_id: this.get("model.target.id"), - target_type: this.get("model.targetType"), - note: this.get("model.note"), - status: this.get("model.status"), + username: this.model.username, + group_name: this.model.group_name, + target_id: this.model.target.id, + target_type: this.model.targetType, + note: this.model.note, + status: this.model.status, }, }) .then(() => { - this.get("model.onSuccess")?.(); + this.model.onSuccess?.(); }) .catch(popupAjaxError); - }, + } @action assignUser(name) { @@ -136,27 +132,27 @@ export default Controller.extend(ModalFunctionality, { if (name) { return this.assign(); } - }, + } @action assignUsername(selected) { this.setGroupOrUser(selected.firstObject); - }, + } setGroupOrUser(name) { this.set("assigneeError", false); + this.set("model.allowedGroups", this.taskActions.allowedGroups); + if (this.allowedGroupsForAssignment.includes(name)) { this.setProperties({ "model.username": null, "model.group_name": name, - "model.allowedGroups": this.taskActions.allowedGroups, }); } else { this.setProperties({ "model.username": name, "model.group_name": null, - "model.allowedGroups": this.taskActions.allowedGroups, }); } - }, -}); + } +} diff --git a/assets/javascripts/discourse-assign/controllers/group-assigned-show.js b/assets/javascripts/discourse-assign/controllers/group-assigned-show.js index 7966ce8..ff1a60d 100644 --- a/assets/javascripts/discourse-assign/controllers/group-assigned-show.js +++ b/assets/javascripts/discourse-assign/controllers/group-assigned-show.js @@ -6,22 +6,23 @@ import { inject as controller } from "@ember/controller"; import { inject as service } from "@ember/service"; import { action } from "@ember/object"; -export default UserTopicsList.extend({ - user: controller(), - taskActions: service(), - order: "", - ascending: false, - search: "", - bulkSelectEnabled: false, - selected: [], - canBulkSelect: alias("currentUser.staff"), +export default class GroupAssignedShow extends UserTopicsList { + @service taskActions; + @controller user; - queryParams: ["order", "ascending", "search"], + queryParams = ["order", "ascending", "search"]; + order = ""; + ascending = false; + search = ""; + bulkSelectEnabled = false; + selected = []; + + @alias("currentUser.staff") canBulkSelect; _setSearchTerm(searchTerm) { this.set("search", searchTerm); this.refreshModel(); - }, + } refreshModel() { this.set("loading", true); @@ -39,21 +40,21 @@ export default UserTopicsList.extend({ .finally(() => { this.set("loading", false); }); - }, + } @action unassign(targetId, targetType = "Topic") { this.taskActions .unassign(targetId, targetType) .then(() => this.send("changeAssigned")); - }, + } @action reassign(topic) { this.taskActions .assign(topic) .set("model.onSuccess", () => this.send("changeAssigned")); - }, + } @action changeSort(sortBy) { @@ -64,20 +65,20 @@ export default UserTopicsList.extend({ this.setProperties({ order: sortBy, ascending: false }); this.refreshModel(); } - }, + } @action onChangeFilter(value) { discourseDebounce(this, this._setSearchTerm, value, INPUT_DELAY * 2); - }, + } @action toggleBulkSelect() { this.toggleProperty("bulkSelectEnabled"); - }, + } @action refresh() { this.refreshModel(); - }, -}); + } +} diff --git a/assets/javascripts/discourse-assign/controllers/group-assigned.js b/assets/javascripts/discourse-assign/controllers/group-assigned.js index 4d0a53a..81188f1 100644 --- a/assets/javascripts/discourse-assign/controllers/group-assigned.js +++ b/assets/javascripts/discourse-assign/controllers/group-assigned.js @@ -6,33 +6,34 @@ import discourseComputed from "discourse-common/utils/decorators"; import discourseDebounce from "discourse-common/lib/debounce"; import { INPUT_DELAY } from "discourse-common/config/environment"; -export default Controller.extend({ - router: service(), - application: controller(), - loading: false, - offset: 0, - filterName: "", - filter: "", +export default class GroupAssigned extends Controller { + @service router; + @controller application; + + loading = false; + offset = 0; + filterName = ""; + filter = ""; @discourseComputed("router.currentRoute.queryParams.order") order(order) { return order || ""; - }, + } @discourseComputed("router.currentRoute.queryParams.ascending") ascending(ascending) { return ascending || false; - }, + } @discourseComputed("router.currentRoute.queryParams.search") search(search) { return search || ""; - }, + } @discourseComputed("site.mobileView") isDesktop(mobileView) { return !mobileView; - }, + } _setFilter(filter) { this.set("loading", true); @@ -53,7 +54,7 @@ export default Controller.extend({ .finally(() => { this.set("loading", false); }); - }, + } findMembers(refresh) { if (refresh) { @@ -77,15 +78,15 @@ export default Controller.extend({ }) .finally(() => this.set("loading", false)); } - }, + } @action loadMore() { this.findMembers(); - }, + } @action onChangeFilterName(value) { discourseDebounce(this, this._setFilter, value, INPUT_DELAY * 2); - }, -}); + } +} diff --git a/assets/javascripts/discourse-assign/controllers/user-activity-assigned.js b/assets/javascripts/discourse-assign/controllers/user-activity-assigned.js index c85ede6..4ebccae 100644 --- a/assets/javascripts/discourse-assign/controllers/user-activity-assigned.js +++ b/assets/javascripts/discourse-assign/controllers/user-activity-assigned.js @@ -10,23 +10,19 @@ import { iconHTML } from "discourse-common/lib/icon-library"; import I18n from "I18n"; import { htmlSafe } from "@ember/template"; -export default UserTopicsList.extend({ - user: controller(), - taskActions: service(), - queryParams: ["order", "ascending", "search"], - order: "", - ascending: false, - search: "", +export default class UserActivityAssigned extends UserTopicsList { + @service taskActions; + @controller user; - _setSearchTerm(searchTerm) { - this.set("search", searchTerm); - this.refreshModel(); - }, + queryParams = ["order", "ascending", "search"]; + order = ""; + ascending = false; + search = ""; @discourseComputed("model.topics.length", "search") doesntHaveAssignments(topicsLength, search) { return !search && !topicsLength; - }, + } @discourseComputed emptyStateBody() { @@ -36,7 +32,12 @@ export default UserTopicsList.extend({ icon: iconHTML("user-plus"), }) ); - }, + } + + _setSearchTerm(searchTerm) { + this.set("search", searchTerm); + this.refreshModel(); + } refreshModel() { this.set("loading", true); @@ -53,21 +54,21 @@ export default UserTopicsList.extend({ .finally(() => { this.set("loading", false); }); - }, + } @action unassign(targetId, targetType = "Topic") { this.taskActions .unassign(targetId, targetType) .then(() => this.send("changeAssigned")); - }, + } @action reassign(topic) { this.taskActions .assign(topic) .set("model.onSuccess", () => this.send("changeAssigned")); - }, + } @action changeSort(sortBy) { @@ -78,10 +79,10 @@ export default UserTopicsList.extend({ this.setProperties({ order: sortBy, ascending: false }); this.refreshModel(); } - }, + } @action onChangeFilter(value) { discourseDebounce(this, this._setSearchTerm, value, INPUT_DELAY * 2); - }, -}); + } +} diff --git a/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js b/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js index b6390ea..62955f7 100644 --- a/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js +++ b/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js @@ -26,23 +26,17 @@ const DEPENDENT_KEYS = [ "topic.assigned_to_user.username", ]; -function titleForState(name) { - if (name) { - return I18n.t("discourse_assign.unassign.help", { - username: name, - }); +function defaultTitle(topic) { + const username = + topic.assigned_to_user?.username || topic.assigned_to_group?.name; + + if (username) { + return I18n.t("discourse_assign.unassign.help", { username }); } else { return I18n.t("discourse_assign.assign.help"); } } -function defaultTitle(topic) { - return titleForState( - topic.get("topic.assigned_to_user.username") || - topic.get("topic.assigned_to_group.name") - ); -} - function includeIsAssignedOnTopic(api) { api.modifyClass("model:topic", { pluginId: PLUGIN_ID, @@ -57,7 +51,7 @@ function registerTopicFooterButtons(api) { id: "reassign", action(id) { - if (!this.get("currentUser.can_assign")) { + if (!this.currentUser?.can_assign) { return; } @@ -103,8 +97,8 @@ function registerTopicFooterButtons(api) { }, noneItem() { - const user = this.get("topic.assigned_to_user"); - const group = this.get("topic.assigned_to_group"); + const user = this.topic.assigned_to_user; + const group = this.topic.assigned_to_group; const label = I18n.t("discourse_assign.unassign.title_w_ellipsis"); const groupLabel = I18n.t("discourse_assign.unassign.title"); @@ -149,8 +143,7 @@ function registerTopicFooterButtons(api) { ]; if ( this.topic.isAssigned() && - this.get("topic.assigned_to_user")?.username !== - this.currentUser.username + this.topic.assigned_to_user?.username !== this.currentUser.username ) { content.push({ id: "reassign-self", @@ -176,7 +169,7 @@ function registerTopicFooterButtons(api) { displayed() { return ( - this.get("currentUser.can_assign") && + this.currentUser?.can_assign && !this.site.mobileView && this.topic.isAssigned() ); @@ -194,16 +187,16 @@ function registerTopicFooterButtons(api) { }, priority: 250, translatedTitle() { - return defaultTitle(this); + return defaultTitle(this.topic); }, translatedAriaLabel() { - return defaultTitle(this); + return defaultTitle(this.topic); }, translatedLabel() { return I18n.t("discourse_assign.assign.title"); }, action() { - if (!this.get("currentUser.can_assign")) { + if (!this.currentUser?.can_assign) { return; } @@ -238,14 +231,14 @@ function registerTopicFooterButtons(api) { api.registerTopicFooterButton({ id: "unassign-mobile-header", translatedTitle() { - return defaultTitle(this); + return defaultTitle(this.topic); }, translatedAriaLabel() { - return defaultTitle(this); + return defaultTitle(this.topic); }, translatedLabel() { - const user = this.get("topic.assigned_to_user"); - const group = this.get("topic.assigned_to_group"); + const user = this.topic.assigned_to_user; + const group = this.topic.assigned_to_group; const label = I18n.t("discourse_assign.assigned_to_w_ellipsis"); if (user) { @@ -280,10 +273,10 @@ function registerTopicFooterButtons(api) { return "user-times"; }, translatedTitle() { - return defaultTitle(this); + return defaultTitle(this.topic); }, translatedAriaLabel() { - return defaultTitle(this); + return defaultTitle(this.topic); }, translatedLabel() { const label = I18n.t("discourse_assign.unassign.title"); @@ -293,7 +286,7 @@ function registerTopicFooterButtons(api) { ); }, action() { - if (!this.get("currentUser.can_assign")) { + if (!this.currentUser?.can_assign) { return; } @@ -341,7 +334,7 @@ function registerTopicFooterButtons(api) { ); }, action() { - if (!this.get("currentUser.can_assign")) { + if (!this.currentUser?.can_assign) { return; } @@ -366,8 +359,7 @@ function registerTopicFooterButtons(api) { this.site.mobileView && this.currentUser?.can_assign && this.topic.isAssigned() && - this.get("topic.assigned_to_user")?.username !== - this.currentUser.username + this.topic.assigned_to_user?.username !== this.currentUser.username ); }, }); @@ -391,7 +383,7 @@ function registerTopicFooterButtons(api) { ); }, action() { - if (!this.get("currentUser.can_assign")) { + if (!this.currentUser?.can_assign) { return; } @@ -611,13 +603,13 @@ function initialize(api) { }; let assignedToIndirectly; - if (topic.get("indirectly_assigned_to")) { - assignedToIndirectly = Object.entries( - topic.get("indirectly_assigned_to") - ).map(([key, value]) => { - value.assigned_to.assignedToPostId = key; - return value; - }); + if (topic.indirectly_assigned_to) { + assignedToIndirectly = Object.entries(topic.indirectly_assigned_to).map( + ([key, value]) => { + value.assigned_to.assignedToPostId = key; + return value; + } + ); } else { assignedToIndirectly = []; } @@ -821,7 +813,7 @@ function initialize(api) { unsubscribe() { this._super(...arguments); - if (!this.get("model.id")) { + if (!this.model?.id) { return; } @@ -899,7 +891,7 @@ export default { SearchAdvancedOptions.reopen({ updateSearchTermForAssignedUsername() { const match = this.filterBlocks(REGEXP_USERNAME_PREFIX); - const userFilter = this.get("searchedTerms.assigned"); + const userFilter = this.searchedTerms?.assigned; let searchTerm = this.searchTerm || ""; let keyword = "assigned"; @@ -944,23 +936,20 @@ export default { }); } - withPluginApi("0.13.0", (api) => includeIsAssignedOnTopic(api)); - withPluginApi("0.11.0", (api) => initialize(api)); - withPluginApi("0.8.28", (api) => registerTopicFooterButtons(api)); + withPluginApi("0.13.0", (api) => { + includeIsAssignedOnTopic(api); + initialize(api); + registerTopicFooterButtons(api); - withPluginApi("0.11.7", (api) => { api.addSearchSuggestion("in:assigned"); api.addSearchSuggestion("in:unassigned"); - }); - withPluginApi("0.12.2", (api) => { api.addGroupPostSmallActionCode("assigned_group"); api.addGroupPostSmallActionCode("reassigned_group"); api.addGroupPostSmallActionCode("unassigned_group"); api.addGroupPostSmallActionCode("assigned_group_to_post"); api.addGroupPostSmallActionCode("unassigned_group_from_post"); - }); - withPluginApi("0.12.3", (api) => { + api.addUserSearchOption("assignableGroups"); }); }, diff --git a/assets/javascripts/discourse-assign/routes/group-assigned-show.js b/assets/javascripts/discourse-assign/routes/group-assigned-show.js index eca085f..e560b70 100644 --- a/assets/javascripts/discourse-assign/routes/group-assigned-show.js +++ b/assets/javascripts/discourse-assign/routes/group-assigned-show.js @@ -1,49 +1,43 @@ import DiscourseRoute from "discourse/routes/discourse"; import { findOrResetCachedTopicList } from "discourse/lib/cached-topic-list"; -export default DiscourseRoute.extend({ +export default class GroupAssignedShow extends DiscourseRoute { beforeModel(transition) { - if (!(transition.hasOwnProperty("from") && transition.from)) { - return; - } - if (transition.from.localName === "show") { + if (transition.from?.localName === "show") { this.session.set("topicListScrollPosition", 1); } - }, + } model(params) { - let filter = null; - if ( - ["everyone", this.modelFor("group").get("name")].includes(params.filter) - ) { - filter = `topics/group-topics-assigned/${this.modelFor("group").get( - "name" - )}`; + let filter; + if (["everyone", this.modelFor("group").name].includes(params.filter)) { + filter = `topics/group-topics-assigned/${this.modelFor("group").name}`; } else { filter = `topics/messages-assigned/${params.filter}`; } - const lastTopicList = findOrResetCachedTopicList(this.session, filter); - return lastTopicList - ? lastTopicList - : this.store.findFiltered("topicList", { - filter, - params: { - order: params.order, - ascending: params.ascending, - search: params.search, - direct: params.filter !== "everyone", - }, - }); - }, + + return ( + findOrResetCachedTopicList(this.session, filter) || + this.store.findFiltered("topicList", { + filter, + params: { + order: params.order, + ascending: params.ascending, + search: params.search, + direct: params.filter !== "everyone", + }, + }) + ); + } setupController(controller, model) { controller.setProperties({ model, search: this.currentModel.params.search, }); - }, + } renderTemplate() { this.render("group-topics-list"); - }, -}); + } +} diff --git a/assets/javascripts/discourse-assign/routes/group-assigned.js b/assets/javascripts/discourse-assign/routes/group-assigned.js index 89f0ade..c6352f2 100644 --- a/assets/javascripts/discourse-assign/routes/group-assigned.js +++ b/assets/javascripts/discourse-assign/routes/group-assigned.js @@ -2,10 +2,10 @@ import DiscourseRoute from "discourse/routes/discourse"; import { ajax } from "discourse/lib/ajax"; import { action } from "@ember/object"; -export default DiscourseRoute.extend({ +export default class GroupAssigned extends DiscourseRoute { model() { - return ajax(`/assign/members/${this.modelFor("group").get("name")}`); - }, + return ajax(`/assign/members/${this.modelFor("group").name}`); + } setupController(controller, model) { controller.setProperties({ @@ -19,7 +19,7 @@ export default DiscourseRoute.extend({ }); controller.findMembers(true); - }, + } redirect(model, transition) { if (transition.to.params.hasOwnProperty("filter")) { @@ -27,10 +27,10 @@ export default DiscourseRoute.extend({ } else { this.transitionTo("group.assigned.show", "everyone"); } - }, + } @action changeAssigned() { this.refresh(); - }, -}); + } +} diff --git a/assets/javascripts/discourse-assign/routes/user-activity-assigned.js b/assets/javascripts/discourse-assign/routes/user-activity-assigned.js index daec809..daca621 100644 --- a/assets/javascripts/discourse-assign/routes/user-activity-assigned.js +++ b/assets/javascripts/discourse-assign/routes/user-activity-assigned.js @@ -3,19 +3,19 @@ import UserTopicListRoute from "discourse/routes/user-topic-list"; import cookie from "discourse/lib/cookie"; import { action } from "@ember/object"; -export default UserTopicListRoute.extend({ - templateName: "user-activity-assigned", - controllerName: "user-activity-assigned", +export default class UserActivityAssigned extends UserTopicListRoute { + templateName = "user-activity-assigned"; + controllerName = "user-activity-assigned"; - userActionType: 16, - noContentHelpKey: "discourse_assigns.no_assigns", + userActionType = 16; + noContentHelpKey = "discourse_assigns.no_assigns"; beforeModel() { if (!this.currentUser) { cookie("destination_url", window.location.href); this.transitionTo("login"); } - }, + } model(params) { return this.store.findFiltered("topicList", { @@ -29,14 +29,14 @@ export default UserTopicListRoute.extend({ search: params.search, }, }); - }, + } titleToken() { return I18n.t("discourse_assign.assigned"); - }, + } @action changeAssigned() { this.refresh(); - }, -}); + } +} diff --git a/assets/javascripts/discourse/components/assigned-to.hbs b/assets/javascripts/discourse/components/assigned-to.hbs new file mode 100644 index 0000000..11708bb --- /dev/null +++ b/assets/javascripts/discourse/components/assigned-to.hbs @@ -0,0 +1,9 @@ +
+ {{avatar @user imageSize="small"}} + + + {{@user.username}} + + + {{yield}} +
\ No newline at end of file diff --git a/assets/javascripts/discourse/components/assigned-to.js b/assets/javascripts/discourse/components/assigned-to.js deleted file mode 100644 index 5769179..0000000 --- a/assets/javascripts/discourse/components/assigned-to.js +++ /dev/null @@ -1,5 +0,0 @@ -import Component from "@ember/component"; - -export default Component.extend({ - classNames: ["assigned-to-user"], -}); diff --git a/assets/javascripts/discourse/components/assigned-topic-list-item.hbs b/assets/javascripts/discourse/components/assigned-topic-list-item.hbs new file mode 100644 index 0000000..c739615 --- /dev/null +++ b/assets/javascripts/discourse/components/assigned-topic-list-item.hbs @@ -0,0 +1,86 @@ +{{! + The `~` syntax strip spaces between the elements, making it produce + `Some text`, + with no space between them. + 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. +}} +{{#if this.bulkSelectEnabled}} + + + +{{/if}} + + + {{~raw "topic-status" topic=this.topic}} + {{~#if this.isPrivateMessage}} + {{~d-icon "envelope" class="private-message-icon"}} + {{~/if}} + {{~topic-link this.topic class="raw-link raw-topic-link"}} + {{~#if this.topic.featured_link}} + {{~topic-featured-link this.topic}} + {{~/if}} + {{~#if this.showTopicPostBadges}} + {{~raw + "topic-post-badges" + unread=this.topic.unread + unseen=this.topic.unseen + url=this.topic.lastUnreadUrl + newDotText=this.newDotText + }} + {{~/if}} + + + {{#if this.expandPinned}} + {{raw "list/topic-excerpt" topic=this.topic}} + {{/if}} + + +{{#if this.showPosters}} + {{raw "list/posters-column" posters=this.topic.featuredUsers}} +{{/if}} + +{{raw "list/posts-count-column" topic=this.topic}} + +{{number + this.topic.views + numberKey="views_long" + }} +{{raw + "list/activity-column" + topic=this.topic + class="num topic-list-data" + tagName="td" +}} + + {{#if this.topic.assigned_to_user}} + + {{else if this.topic.assigned_to_group}} + + {{else}} + + {{/if}} + \ No newline at end of file diff --git a/assets/javascripts/discourse/components/assigned-topic-list-item.js b/assets/javascripts/discourse/components/assigned-topic-list-item.js index 7907e94..a112ea9 100644 --- a/assets/javascripts/discourse/components/assigned-topic-list-item.js +++ b/assets/javascripts/discourse/components/assigned-topic-list-item.js @@ -1,7 +1,8 @@ import TopicListItem from "discourse/components/topic-list-item"; import { equal } from "@ember/object/computed"; -export default TopicListItem.extend({ - classNames: ["assigned-topic-list-item"], - isPrivateMessage: equal("topic.archetype", "private_message"), -}); +export default class AssignedTopicListItem extends TopicListItem { + classNames = ["assigned-topic-list-item"]; + + @equal("topic.archetype", "private_message") isPrivateMessage; +} diff --git a/assets/javascripts/discourse/components/assigned-topic-list.hbs b/assets/javascripts/discourse/components/assigned-topic-list.hbs new file mode 100644 index 0000000..4d38c6a --- /dev/null +++ b/assets/javascripts/discourse/components/assigned-topic-list.hbs @@ -0,0 +1,46 @@ +{{#unless this.skipHeader}} + + {{raw + "topic-list-header" + canBulkSelect=this.canBulkSelect + canDoBulkActions=this.canDoBulkActions + toggleInTitle=this.toggleInTitle + hideCategory=this.hideCategory + showPosters=true + showLikes=this.showLikes + showOpLikes=this.showOpLikes + order=this.order + ascending=this.ascending + sortable=this.sortable + listTitle=this.listTitle + bulkSelectEnabled=this.bulkSelectEnabled + }} + +{{/unless}} + + + {{#each this.filteredTopics as |topic|}} + + + {{raw + "list/visited-line" + lastVisitedTopic=this.lastVisitedTopic + topic=topic + }} + {{/each}} + \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/components/assignee-chooser-row.hbs b/assets/javascripts/discourse/components/assignee-chooser-row.hbs similarity index 100% rename from assets/javascripts/discourse/templates/components/assignee-chooser-row.hbs rename to assets/javascripts/discourse/components/assignee-chooser-row.hbs diff --git a/assets/javascripts/discourse/components/assignee-chooser-row.js b/assets/javascripts/discourse/components/assignee-chooser-row.js index 8bc23bb..98f3f02 100644 --- a/assets/javascripts/discourse/components/assignee-chooser-row.js +++ b/assets/javascripts/discourse/components/assignee-chooser-row.js @@ -1,3 +1,3 @@ import EmailGroupUserChooserRow from "select-kit/components/email-group-user-chooser-row"; -export default EmailGroupUserChooserRow.extend(); +export default class AssigneeChooserRow extends EmailGroupUserChooserRow {} diff --git a/assets/javascripts/discourse/components/assignee-chooser.js b/assets/javascripts/discourse/components/assignee-chooser.js index 50ba720..0fd9e6e 100644 --- a/assets/javascripts/discourse/components/assignee-chooser.js +++ b/assets/javascripts/discourse/components/assignee-chooser.js @@ -1,7 +1,7 @@ import EmailGroupUserChooser from "select-kit/components/email-group-user-chooser"; -export default EmailGroupUserChooser.extend({ +export default class AssigneeChooser extends EmailGroupUserChooser { modifyComponentForRow() { return "assignee-chooser-row"; - }, -}); + } +} diff --git a/assets/javascripts/discourse/components/basic-assigned-topic-list.hbs b/assets/javascripts/discourse/components/basic-assigned-topic-list.hbs new file mode 100644 index 0000000..16ca106 --- /dev/null +++ b/assets/javascripts/discourse/components/basic-assigned-topic-list.hbs @@ -0,0 +1,40 @@ + + {{#if this.hasIncoming}} +
+ + + +
+ {{/if}} + + {{#if this.topics}} + + {{else}} + {{#unless this.loadingMore}} +
+ {{i18n "choose_topic.none_found"}} +
+ {{/unless}} + {{/if}} +
\ No newline at end of file diff --git a/assets/javascripts/discourse/components/flagged-topic-listener.js b/assets/javascripts/discourse/components/flagged-topic-listener.js index 95f2c6e..21f2765 100644 --- a/assets/javascripts/discourse/components/flagged-topic-listener.js +++ b/assets/javascripts/discourse/components/flagged-topic-listener.js @@ -7,21 +7,21 @@ function assignIfEqual(topic, data) { } } -export default Component.extend({ +export default class FlaggedTopicListener extends Component { didInsertElement() { - this._super(); + super.didInsertElement(...arguments); + this.messageBus.subscribe("/staff/topic-assignment", (data) => { - let flaggedTopics = this.flaggedTopics; - if (flaggedTopics) { - flaggedTopics.forEach((ft) => assignIfEqual(ft.topic, data)); + if (this.flaggedTopics) { + this.flaggedTopics.forEach((ft) => assignIfEqual(ft.topic, data)); } else { assignIfEqual(this.topic, data); } }); - }, + } willDestroyElement() { - this._super(); + super.willDestroyElement(...arguments); this.messageBus.unsubscribe("/staff/topic-assignment"); - }, -}); + } +} diff --git a/assets/javascripts/discourse/components/group-assigned-filter.hbs b/assets/javascripts/discourse/components/group-assigned-filter.hbs new file mode 100644 index 0000000..1b91bc3 --- /dev/null +++ b/assets/javascripts/discourse/components/group-assigned-filter.hbs @@ -0,0 +1,55 @@ +
  • + {{#if @showAvatar}} + + + +
    +
    {{format-username @filter.username}}
    +
    {{@filter.name}}
    +
    + +
    + {{@filter.assignments_count}} +
    +
    + {{else if @groupName}} + +
    + {{d-icon "group-plus"}} +
    +
    +
    {{@groupName}}
    +
    + +
    + {{@assignmentCount}} +
    +
    + {{else}} + +
    + {{i18n "discourse_assign.group_everyone"}} +
    +
    + {{@assignmentCount}} +
    +
    + {{/if}} +
  • \ No newline at end of file diff --git a/assets/javascripts/discourse/components/group-assigned-filter.js b/assets/javascripts/discourse/components/group-assigned-filter.js deleted file mode 100644 index 98078aa..0000000 --- a/assets/javascripts/discourse/components/group-assigned-filter.js +++ /dev/null @@ -1,5 +0,0 @@ -import Component from "@ember/component"; - -export default Component.extend({ - tagName: "li", -}); diff --git a/assets/javascripts/discourse/templates/components/group-assigned-menu-item.hbs b/assets/javascripts/discourse/components/group-assigned-menu-item.hbs similarity index 72% rename from assets/javascripts/discourse/templates/components/group-assigned-menu-item.hbs rename to assets/javascripts/discourse/components/group-assigned-menu-item.hbs index 2b9aff1..a820fdb 100644 --- a/assets/javascripts/discourse/templates/components/group-assigned-menu-item.hbs +++ b/assets/javascripts/discourse/components/group-assigned-menu-item.hbs @@ -1,4 +1,4 @@ {{d-icon "group-plus" class="glyph"}}{{i18n "discourse_assign.assigned"}} - ({{group.assignment_count}}) + ({{@group.assignment_count}}) \ No newline at end of file diff --git a/assets/javascripts/discourse/components/group-assigned-menu-item.js b/assets/javascripts/discourse/components/group-assigned-menu-item.js deleted file mode 100644 index 4449440..0000000 --- a/assets/javascripts/discourse/components/group-assigned-menu-item.js +++ /dev/null @@ -1,5 +0,0 @@ -import Component from "@ember/component"; - -export default Component.extend({ - tagName: "", -}); diff --git a/assets/javascripts/discourse/components/remind-assigns-frequency.hbs b/assets/javascripts/discourse/components/remind-assigns-frequency.hbs new file mode 100644 index 0000000..f422fa6 --- /dev/null +++ b/assets/javascripts/discourse/components/remind-assigns-frequency.hbs @@ -0,0 +1,14 @@ +{{#if this.siteSettings.assign_enabled}} +
    + + +
    +{{/if}} \ No newline at end of file diff --git a/assets/javascripts/discourse/components/remind-assigns-frequency.js b/assets/javascripts/discourse/components/remind-assigns-frequency.js index 09b478f..3260626 100644 --- a/assets/javascripts/discourse/components/remind-assigns-frequency.js +++ b/assets/javascripts/discourse/components/remind-assigns-frequency.js @@ -2,7 +2,7 @@ import Component from "@ember/component"; import I18n from "I18n"; import discourseComputed from "discourse-common/utils/decorators"; -export default Component.extend({ +export default class RemindAssignsFrequency extends Component { @discourseComputed( "user.custom_fields.remind_assigns_frequency", "siteSettings.remind_assigns_frequency" @@ -17,16 +17,14 @@ export default Component.extend({ } return siteDefaultAssignsFrequency; - }, + } @discourseComputed("user.reminders_frequency") availableFrequencies(userRemindersFrequency) { - return userRemindersFrequency.map((freq) => { - return { - name: I18n.t(freq.name), - value: freq.value, - selected: false, - }; - }); - }, -}); + return userRemindersFrequency.map((freq) => ({ + name: I18n.t(freq.name), + value: freq.value, + selected: false, + })); + } +} diff --git a/assets/javascripts/discourse/services/task-actions.js b/assets/javascripts/discourse/services/task-actions.js index 7baf2bb..6bfa01d 100644 --- a/assets/javascripts/discourse/services/task-actions.js +++ b/assets/javascripts/discourse/services/task-actions.js @@ -2,7 +2,7 @@ import Service from "@ember/service"; import { ajax } from "discourse/lib/ajax"; import showModal from "discourse/lib/show-modal"; -export default Service.extend({ +export default class TaskActions extends Service { i18nSuffix(targetType) { switch (targetType) { case "Post": @@ -10,7 +10,7 @@ export default Service.extend({ case "Topic": return "_modal"; } - }, + } unassign(targetId, targetType = "Topic") { return ajax("/assign/unassign", { @@ -20,7 +20,7 @@ export default Service.extend({ target_type: targetType, }, }); - }, + } assign(target, options = { isAssigned: false, targetType: "Topic" }) { return showModal("assign-user", { @@ -37,7 +37,7 @@ export default Service.extend({ status: target.assignment_status, }, }); - }, + } reassignUserToTopic(user, target, targetType = "Topic") { return ajax("/assign/assign", { @@ -49,5 +49,5 @@ export default Service.extend({ status: target.assignment_status, }, }); - }, -}); + } +} diff --git a/assets/javascripts/discourse/templates/components/assigned-to.hbs b/assets/javascripts/discourse/templates/components/assigned-to.hbs deleted file mode 100644 index 385f116..0000000 --- a/assets/javascripts/discourse/templates/components/assigned-to.hbs +++ /dev/null @@ -1,5 +0,0 @@ -{{avatar user imageSize="small"}} - - {{user.username}} - -{{yield}} \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/components/assigned-topic-list-item.hbs b/assets/javascripts/discourse/templates/components/assigned-topic-list-item.hbs deleted file mode 100644 index e42e8a6..0000000 --- a/assets/javascripts/discourse/templates/components/assigned-topic-list-item.hbs +++ /dev/null @@ -1,88 +0,0 @@ -{{! - The `~` syntax strip spaces between the elements, making it produce - `Some text`, - with no space between them. - 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. -}} -{{#if bulkSelectEnabled}} - - - -{{/if}} - - - {{~raw "topic-status" topic=topic}} - {{~#if isPrivateMessage}} - {{~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}} - {{~/if}} - {{~#if showTopicPostBadges}} - {{~raw - "topic-post-badges" - unread=topic.unread - unseen=topic.unseen - url=topic.lastUnreadUrl - newDotText=newDotText - }} - {{~/if}} - - - {{#if expandPinned}} - {{raw "list/topic-excerpt" topic=topic}} - {{/if}} - - -{{#if showPosters}} - {{raw "list/posters-column" posters=topic.featuredUsers}} -{{/if}} - -{{raw "list/posts-count-column" topic=topic}} - -{{number - topic.views - numberKey="views_long" - }} -{{raw - "list/activity-column" - topic=topic - class="num topic-list-data" - tagName="td" -}} - - {{#if topic.assigned_to_user}} - - {{else if topic.assigned_to_group}} - - {{else}} - - {{/if}} - \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/components/assigned-topic-list.hbs b/assets/javascripts/discourse/templates/components/assigned-topic-list.hbs deleted file mode 100644 index 8859516..0000000 --- a/assets/javascripts/discourse/templates/components/assigned-topic-list.hbs +++ /dev/null @@ -1,42 +0,0 @@ -{{#unless skipHeader}} - - {{raw - "topic-list-header" - canBulkSelect=canBulkSelect - canDoBulkActions=canDoBulkActions - toggleInTitle=toggleInTitle - hideCategory=hideCategory - showPosters=true - showLikes=showLikes - showOpLikes=showOpLikes - order=order - ascending=ascending - sortable=sortable - listTitle=listTitle - bulkSelectEnabled=bulkSelectEnabled - }} - -{{/unless}} - - - {{#each filteredTopics as |topic|}} - - - {{raw "list/visited-line" lastVisitedTopic=lastVisitedTopic topic=topic}} - {{/each}} - \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/components/basic-assigned-topic-list.hbs b/assets/javascripts/discourse/templates/components/basic-assigned-topic-list.hbs deleted file mode 100644 index 9cf8464..0000000 --- a/assets/javascripts/discourse/templates/components/basic-assigned-topic-list.hbs +++ /dev/null @@ -1,40 +0,0 @@ - - {{#if hasIncoming}} -
    - - - -
    - {{/if}} - - {{#if topics}} - - {{else}} - {{#unless loadingMore}} -
    - {{i18n "choose_topic.none_found"}} -
    - {{/unless}} - {{/if}} -
    \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/components/group-assigned-filter.hbs b/assets/javascripts/discourse/templates/components/group-assigned-filter.hbs deleted file mode 100644 index 14733de..0000000 --- a/assets/javascripts/discourse/templates/components/group-assigned-filter.hbs +++ /dev/null @@ -1,53 +0,0 @@ -{{#if showAvatar}} - - - -
    -
    {{format-username filter.username}}
    -
    {{filter.name}}
    -
    - -
    - {{filter.assignments_count}} -
    -
    -{{else if groupName}} - -
    - {{d-icon "group-plus"}} -
    -
    -
    {{groupName}}
    -
    - -
    - {{assignmentCount}} -
    -
    -{{else}} - -
    - {{i18n "discourse_assign.group_everyone"}} -
    -
    - {{assignmentCount}} -
    -
    -{{/if}} \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/components/remind-assigns-frequency.hbs b/assets/javascripts/discourse/templates/components/remind-assigns-frequency.hbs deleted file mode 100644 index 751a8b7..0000000 --- a/assets/javascripts/discourse/templates/components/remind-assigns-frequency.hbs +++ /dev/null @@ -1,12 +0,0 @@ -{{#if siteSettings.assign_enabled}} -
    - - -
    -{{/if}} \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/group-topics-list.hbs b/assets/javascripts/discourse/templates/group-topics-list.hbs index 79722a0..ac5e0f4 100644 --- a/assets/javascripts/discourse/templates/group-topics-list.hbs +++ b/assets/javascripts/discourse/templates/group-topics-list.hbs @@ -2,7 +2,7 @@
    + - - + \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/group/assigned.hbs b/assets/javascripts/discourse/templates/group/assigned.hbs index ea67982..05c1a75 100644 --- a/assets/javascripts/discourse/templates/group/assigned.hbs +++ b/assets/javascripts/discourse/templates/group/assigned.hbs @@ -3,53 +3,58 @@ @class="activity-nav" @desktopClass="action-list activity-list nav-stacked" > - {{#if isDesktop}} + {{#if this.isDesktop}}
    {{/if}} + + - {{#each members as |member|}} + + {{#each this.members as |member|}} {{/each}} - + + +
    {{outlet}}
    \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/mobile/components/assigned-topic-list-item.hbs b/assets/javascripts/discourse/templates/mobile/components/assigned-topic-list-item.hbs index 62a5fb3..5f778f0 100644 --- a/assets/javascripts/discourse/templates/mobile/components/assigned-topic-list-item.hbs +++ b/assets/javascripts/discourse/templates/mobile/components/assigned-topic-list-item.hbs @@ -1,25 +1,25 @@