diff --git a/assets/javascripts/discourse-assign/routes/user-activity-assigned.js b/assets/javascripts/discourse-assign/routes/user-activity-assigned.js index e8f8613..daec809 100644 --- a/assets/javascripts/discourse-assign/routes/user-activity-assigned.js +++ b/assets/javascripts/discourse-assign/routes/user-activity-assigned.js @@ -4,11 +4,14 @@ import cookie from "discourse/lib/cookie"; import { action } from "@ember/object"; export default UserTopicListRoute.extend({ + templateName: "user-activity-assigned", + controllerName: "user-activity-assigned", + userActionType: 16, noContentHelpKey: "discourse_assigns.no_assigns", beforeModel() { - if (this.currentUser === undefined) { + if (!this.currentUser) { cookie("destination_url", window.location.href); this.transitionTo("login"); } @@ -16,11 +19,10 @@ export default UserTopicListRoute.extend({ model(params) { return this.store.findFiltered("topicList", { - filter: `topics/messages-assigned/${this.modelFor("user").get( - "username_lower" - )}`, + filter: `topics/messages-assigned/${ + this.modelFor("user").username_lower + }`, params: { - // 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, @@ -33,16 +35,6 @@ export default UserTopicListRoute.extend({ return I18n.t("discourse_assign.assigned"); }, - renderTemplate() { - this.render("user-activity-assigned"); - this.render("user-assigned-topics", { into: "user-activity-assigned" }); - }, - - setupController(controller, model) { - this._super(controller, model); - controller.set("model", model); - }, - @action changeAssigned() { this.refresh(); diff --git a/assets/javascripts/discourse/templates/user-activity-assigned.hbs b/assets/javascripts/discourse/templates/user-activity-assigned.hbs index e2147ca..5ccd0b5 100644 --- a/assets/javascripts/discourse/templates/user-activity-assigned.hbs +++ b/assets/javascripts/discourse/templates/user-activity-assigned.hbs @@ -1 +1,44 @@ -{{outlet}} \ No newline at end of file +{{#if doesntHaveAssignments}} + +{{else}} +
+
+ +
+
+ + + {{basic-assigned-topic-list + topicList=model + hideCategory=hideCategory + showPosters=true + bulkSelectEnabled=bulkSelectEnabled + selected=selected + hasIncoming=hasIncoming + incomingCount=incomingCount + showInserted=(action "showInserted") + tagsForUser=tagsForUser + changeSort=(action "changeSort") + unassign=(action "unassign") + reassign=(action "reassign") + onScroll=saveScrollPosition + scrollOnLoad=true + }} + + + +{{/if}} \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/user-assigned-topics.hbs b/assets/javascripts/discourse/templates/user-assigned-topics.hbs deleted file mode 100644 index 5ccd0b5..0000000 --- a/assets/javascripts/discourse/templates/user-assigned-topics.hbs +++ /dev/null @@ -1,44 +0,0 @@ -{{#if doesntHaveAssignments}} - -{{else}} -
-
- -
-
- - - {{basic-assigned-topic-list - topicList=model - hideCategory=hideCategory - showPosters=true - bulkSelectEnabled=bulkSelectEnabled - selected=selected - hasIncoming=hasIncoming - incomingCount=incomingCount - showInserted=(action "showInserted") - tagsForUser=tagsForUser - changeSort=(action "changeSort") - unassign=(action "unassign") - reassign=(action "reassign") - onScroll=saveScrollPosition - scrollOnLoad=true - }} - - - -{{/if}} \ No newline at end of file diff --git a/test/javascripts/acceptance/user-assignments-list.js b/test/javascripts/acceptance/user-assignments-list-test.js similarity index 100% rename from test/javascripts/acceptance/user-assignments-list.js rename to test/javascripts/acceptance/user-assignments-list-test.js