diff --git a/.prettierrc b/.prettierrc
index 0967ef42..8a1423e9 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -1 +1,17 @@
-{}
+{
+ "plugins": ["prettier-plugin-ember-template-tag"],
+ "overrides": [
+ {
+ "files": "*.gjs",
+ "options": {
+ "parser": "ember-template-tag"
+ }
+ },
+ {
+ "files": "*.gts",
+ "options": {
+ "parser": "ember-template-tag"
+ }
+ }
+ ]
+}
diff --git a/assets/javascripts/discourse/components/assign-user-form.hbs b/assets/javascripts/discourse/components/assign-user-form.hbs
index 2160f236..2aeb2a5b 100644
--- a/assets/javascripts/discourse/components/assign-user-form.hbs
+++ b/assets/javascripts/discourse/components/assign-user-form.hbs
@@ -51,7 +51,6 @@
\ No newline at end of file
diff --git a/assets/javascripts/discourse/components/assign-user-form.js b/assets/javascripts/discourse/components/assign-user-form.js
index ceb81846..ce8fa9b2 100644
--- a/assets/javascripts/discourse/components/assign-user-form.js
+++ b/assets/javascripts/discourse/components/assign-user-form.js
@@ -9,8 +9,8 @@ export default class AssignUserForm extends Component {
@service capabilities;
@tracked assigneeError = false;
- @tracked assigneeName =
- this.args.model.username || this.args.model.group_name;
+ @tracked
+ assigneeName = this.args.model.username || this.args.model.group_name;
constructor() {
super(...arguments);
diff --git a/assets/javascripts/discourse/components/assigned-topic-list-column.gjs b/assets/javascripts/discourse/components/assigned-topic-list-column.gjs
new file mode 100644
index 00000000..a910e42a
--- /dev/null
+++ b/assets/javascripts/discourse/components/assigned-topic-list-column.gjs
@@ -0,0 +1,45 @@
+import Component from "@glimmer/component";
+import AssignActionsDropdown from "./assign-actions-dropdown";
+import { inject as service } from "@ember/service";
+import { action } from "@ember/object";
+
+export default class AssignedTopicListColumn_Test extends Component {
+
+
+ {{#if @topic.assigned_to_user}}
+
+ {{else if @topic.assigned_to_group}}
+
+ {{else}}
+
+ {{/if}}
+
+
+
+ @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(),
+ });
+ }
+}
diff --git a/assets/javascripts/discourse/components/assigned-topic-list-item.hbs b/assets/javascripts/discourse/components/assigned-topic-list-item.hbs
deleted file mode 100644
index c7396151..00000000
--- a/assets/javascripts/discourse/components/assigned-topic-list-item.hbs
+++ /dev/null
@@ -1,86 +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 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 (or (not this.hideCategory) (not this.topic.isPinnedUncategorized))}}
- {{category-link this.topic.category}}
- {{/if}}
- {{discourse-tags this.topic mode="list" tagsForUser=this.tagsForUser}}
- {{raw
- "list/action-list"
- topic=this.topic
- postNumbers=this.topic.liked_post_numbers
- className="likes"
- icon="heart"
- }}
-
- {{#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
deleted file mode 100644
index a112ea92..00000000
--- a/assets/javascripts/discourse/components/assigned-topic-list-item.js
+++ /dev/null
@@ -1,8 +0,0 @@
-import TopicListItem from "discourse/components/topic-list-item";
-import { equal } from "@ember/object/computed";
-
-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
deleted file mode 100644
index 4d38c6ae..00000000
--- a/assets/javascripts/discourse/components/assigned-topic-list.hbs
+++ /dev/null
@@ -1,46 +0,0 @@
-{{#unless this.skipHeader}}
-
-{{/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/components/assigned-topic-list.js b/assets/javascripts/discourse/components/assigned-topic-list.js
deleted file mode 100644
index 057566b3..00000000
--- a/assets/javascripts/discourse/components/assigned-topic-list.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import TopicList from "discourse/components/topic-list";
-
-export default class AssignedTopicList extends TopicList {}
diff --git a/assets/javascripts/discourse/components/basic-assigned-topic-list.hbs b/assets/javascripts/discourse/components/basic-assigned-topic-list.hbs
deleted file mode 100644
index 16ca1068..00000000
--- a/assets/javascripts/discourse/components/basic-assigned-topic-list.hbs
+++ /dev/null
@@ -1,40 +0,0 @@
-
- {{#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/basic-assigned-topic-list.js b/assets/javascripts/discourse/components/basic-assigned-topic-list.js
deleted file mode 100644
index d667de3c..00000000
--- a/assets/javascripts/discourse/components/basic-assigned-topic-list.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import BasicTopicList from "discourse/components/basic-topic-list";
-
-export default class BasicAssignedTopicList extends BasicTopicList {}
diff --git a/assets/javascripts/discourse/connectors/topic-list-after-columns/assign-buttons.hbr b/assets/javascripts/discourse/connectors/topic-list-after-columns/assign-buttons.hbr
new file mode 100644
index 00000000..a0ec055b
--- /dev/null
+++ b/assets/javascripts/discourse/connectors/topic-list-after-columns/assign-buttons.hbr
@@ -0,0 +1 @@
+{{raw "assign-topic-buttons" topic=context.topic}}
\ No newline at end of file
diff --git a/assets/javascripts/discourse/controllers/group-assigned-show.js b/assets/javascripts/discourse/controllers/group-assigned-show.js
index 9edba01e..43fab2a4 100644
--- a/assets/javascripts/discourse/controllers/group-assigned-show.js
+++ b/assets/javascripts/discourse/controllers/group-assigned-show.js
@@ -8,6 +8,7 @@ import { action } from "@ember/object";
export default class GroupAssignedShow extends UserTopicsList {
@service taskActions;
+ @service router;
@controller user;
queryParams = ["order", "ascending", "search"];
@@ -45,13 +46,13 @@ export default class GroupAssignedShow extends UserTopicsList {
@action
async unassign(targetId, targetType = "Topic") {
await this.taskActions.unassign(targetId, targetType);
- this.send("changeAssigned");
+ this.router.refresh();
}
@action
reassign(topic) {
this.taskActions.showAssignModal(topic, {
- onSuccess: () => this.send("changeAssigned"),
+ onSuccess: () => this.router.refresh(),
});
}
diff --git a/assets/javascripts/discourse/controllers/user-activity-assigned.js b/assets/javascripts/discourse/controllers/user-activity-assigned.js
index 06d0e3bf..260021cf 100644
--- a/assets/javascripts/discourse/controllers/user-activity-assigned.js
+++ b/assets/javascripts/discourse/controllers/user-activity-assigned.js
@@ -56,19 +56,6 @@ export default class UserActivityAssigned extends UserTopicsList {
});
}
- @action
- async unassign(targetId, targetType = "Topic") {
- await this.taskActions.unassign(targetId, targetType);
- this.send("changeAssigned");
- }
-
- @action
- reassign(topic) {
- this.taskActions.showAssignModal(topic, {
- onSuccess: () => this.send("changeAssigned"),
- });
- }
-
@action
changeSort(sortBy) {
if (sortBy === this.order) {
diff --git a/assets/javascripts/discourse/raw-templates/assign-topic-buttons.hbr b/assets/javascripts/discourse/raw-templates/assign-topic-buttons.hbr
new file mode 100644
index 00000000..82b20e11
--- /dev/null
+++ b/assets/javascripts/discourse/raw-templates/assign-topic-buttons.hbr
@@ -0,0 +1 @@
+{{{view.html}}}
\ No newline at end of file
diff --git a/assets/javascripts/discourse/raw-views/assign-topic-buttons.gjs b/assets/javascripts/discourse/raw-views/assign-topic-buttons.gjs
new file mode 100644
index 00000000..d96a8fd9
--- /dev/null
+++ b/assets/javascripts/discourse/raw-views/assign-topic-buttons.gjs
@@ -0,0 +1,21 @@
+import EmberObject from "@ember/object";
+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"];
+
+export default class extends EmberObject {
+ @service router;
+
+ get html() {
+ if (ASSIGN_LIST_ROUTES.includes(this.router.currentRouteName)) {
+ return rawRenderGlimmer(
+ this,
+ "div.assign-topic-buttons",
+ ,
+ { topic: this.topic }
+ );
+ }
+ }
+}
diff --git a/assets/javascripts/discourse/routes/group-assigned-show.js b/assets/javascripts/discourse/routes/group-assigned-show.js
index e560b70b..c00a5c83 100644
--- a/assets/javascripts/discourse/routes/group-assigned-show.js
+++ b/assets/javascripts/discourse/routes/group-assigned-show.js
@@ -2,12 +2,6 @@ import DiscourseRoute from "discourse/routes/discourse";
import { findOrResetCachedTopicList } from "discourse/lib/cached-topic-list";
export default class GroupAssignedShow extends DiscourseRoute {
- beforeModel(transition) {
- if (transition.from?.localName === "show") {
- this.session.set("topicListScrollPosition", 1);
- }
- }
-
model(params) {
let filter;
if (["everyone", this.modelFor("group").name].includes(params.filter)) {
@@ -36,8 +30,4 @@ export default class GroupAssignedShow extends DiscourseRoute {
search: this.currentModel.params.search,
});
}
-
- renderTemplate() {
- this.render("group-topics-list");
- }
}
diff --git a/assets/javascripts/discourse/routes/group-assigned.js b/assets/javascripts/discourse/routes/group-assigned.js
index c6352f26..56d1544e 100644
--- a/assets/javascripts/discourse/routes/group-assigned.js
+++ b/assets/javascripts/discourse/routes/group-assigned.js
@@ -1,6 +1,5 @@
import DiscourseRoute from "discourse/routes/discourse";
import { ajax } from "discourse/lib/ajax";
-import { action } from "@ember/object";
export default class GroupAssigned extends DiscourseRoute {
model() {
@@ -28,9 +27,4 @@ export default class GroupAssigned extends DiscourseRoute {
this.transitionTo("group.assigned.show", "everyone");
}
}
-
- @action
- changeAssigned() {
- this.refresh();
- }
}
diff --git a/assets/javascripts/discourse/routes/user-activity-assigned.js b/assets/javascripts/discourse/routes/user-activity-assigned.js
index daca6215..6bf605b4 100644
--- a/assets/javascripts/discourse/routes/user-activity-assigned.js
+++ b/assets/javascripts/discourse/routes/user-activity-assigned.js
@@ -1,7 +1,6 @@
import I18n from "I18n";
import UserTopicListRoute from "discourse/routes/user-topic-list";
import cookie from "discourse/lib/cookie";
-import { action } from "@ember/object";
export default class UserActivityAssigned extends UserTopicListRoute {
templateName = "user-activity-assigned";
@@ -34,9 +33,4 @@ export default class UserActivityAssigned extends UserTopicListRoute {
titleToken() {
return I18n.t("discourse_assign.assigned");
}
-
- @action
- changeAssigned() {
- this.refresh();
- }
}
diff --git a/assets/javascripts/discourse/templates/group-topics-list.hbs b/assets/javascripts/discourse/templates/group-assigned-show.hbs
similarity index 97%
rename from assets/javascripts/discourse/templates/group-topics-list.hbs
rename to assets/javascripts/discourse/templates/group-assigned-show.hbs
index ac5e0f4c..52252a8b 100644
--- a/assets/javascripts/discourse/templates/group-topics-list.hbs
+++ b/assets/javascripts/discourse/templates/group-assigned-show.hbs
@@ -16,7 +16,7 @@
@selector=".paginated-topics-list .topic-list tr"
@action={{action "loadMore"}}
>
-
-