DEV: drops jquery/simplify code/removes leaked event (#14947)

DEV: drops jquery/simplify code/removes leaked event (#14947)

diff --git a/app/assets/javascripts/admin/addon/components/staff-actions.js b/app/assets/javascripts/admin/addon/components/staff-actions.js
index a532c43..c639a04 100644
--- a/app/assets/javascripts/admin/addon/components/staff-actions.js
+++ b/app/assets/javascripts/admin/addon/components/staff-actions.js
@@ -1,39 +1,24 @@
+import { action } from "@ember/object";
 import Component from "@ember/component";
 import DiscourseURL from "discourse/lib/url";
 
 export default Component.extend({
-  classNames: ["table", "staff-actions"],
+  tagName: "",
 
-  willDestroyElement() {
-    $(this.element).off("click.discourse-staff-logs");
-  },
-
-  didInsertElement() {
-    this._super(...arguments);
-
-    $(this.element).on(
-      "click.discourse-staff-logs",
-      "[data-link-post-id]",
-      (e) => {
-        let postId = $(e.target).attr("data-link-post-id");
-
-        this.store.find("post", postId).then((p) => {
-          DiscourseURL.routeTo(p.get("url"));
-        });
-        return false;
-      }
-    );
+  @action
+  openLinks(event) {
+    const dataset = event.target.dataset;
 
-    $(this.element).on(
-      "click.discourse-staff-logs",
-      "[data-link-topic-id]",
-      (e) => {
-        let topicId = $(e.target).attr("data-link-topic-id");
+    if (dataset.linkPostId) {
+      event.preventDefault();
 
-        DiscourseURL.routeTo(`/t/${topicId}`);
+      this.store.find("post", dataset.linkPostId).then((post) => {
+        DiscourseURL.routeTo(post.url);
+      });
+    } else if (dataset.linkTopicId) {
+      event.preventDefault();
 
-        return false;
-      }
-    );
+      DiscourseURL.routeTo(`/t/${dataset.linkTopicId}`);
+    }
   },
 });
diff --git a/app/assets/javascripts/admin/addon/templates/components/staff-actions.hbs b/app/assets/javascripts/admin/addon/templates/components/staff-actions.hbs
new file mode 100644
index 0000000..67dae94
--- /dev/null
+++ b/app/assets/javascripts/admin/addon/templates/components/staff-actions.hbs
@@ -0,0 +1,4 @@
+{{!-- template-lint-disable no-invalid-interactive --}}
+<div class="table staff-actions" {{on "click" (fn this.openLinks)}}>
+  {{yield}}
+</div>

GitHub sha: ef881fdedcf60457f29fdea2bd046ab87ee56f25

This commit appears in #14947 which was approved by CvX. It was merged by jjaffeux.