From f3e956a7a3818d0807e57c877a533168c11835bf Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 11 Oct 2022 12:17:36 +0100 Subject: [PATCH] FIX: Staff action log 'show details' links (#18542) Followup to 03b7b7d1bc7c978c280e441a610a5ef5c049c60c --- .../admin-logs-staff-action-logs.js | 22 +++++++++++++++++++ .../routes/admin-logs-staff-action-logs.js | 12 ---------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/admin/addon/controllers/admin-logs-staff-action-logs.js b/app/assets/javascripts/admin/addon/controllers/admin-logs-staff-action-logs.js index a8a297d47c4..11e5324bd61 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-logs-staff-action-logs.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-logs-staff-action-logs.js @@ -5,6 +5,7 @@ import discourseComputed from "discourse-common/utils/decorators"; import { exportEntity } from "discourse/lib/export-csv"; import { outputExportResult } from "discourse/lib/export-result"; import { scheduleOnce } from "@ember/runloop"; +import showModal from "discourse/lib/show-modal"; export default Controller.extend({ queryParams: ["filters"], @@ -147,4 +148,25 @@ export default Controller.extend({ loadMore() { this.model.loadMore(); }, + + @action + showDetailsModal(model, event) { + event?.preventDefault(); + showModal("admin-staff-action-log-details", { + model, + admin: true, + modalClass: "log-details-modal", + }); + }, + + @action + showCustomDetailsModal(model, event) { + event?.preventDefault(); + let modal = showModal("admin-theme-change", { + model, + admin: true, + modalClass: "history-modal", + }); + modal.loadDiff(); + }, }); diff --git a/app/assets/javascripts/admin/addon/routes/admin-logs-staff-action-logs.js b/app/assets/javascripts/admin/addon/routes/admin-logs-staff-action-logs.js index f643d41e181..c00f1e135cc 100644 --- a/app/assets/javascripts/admin/addon/routes/admin-logs-staff-action-logs.js +++ b/app/assets/javascripts/admin/addon/routes/admin-logs-staff-action-logs.js @@ -1,6 +1,5 @@ import DiscourseRoute from "discourse/routes/discourse"; import EmberObject from "@ember/object"; -import showModal from "discourse/lib/show-modal"; export default DiscourseRoute.extend({ queryParams: { @@ -43,17 +42,6 @@ export default DiscourseRoute.extend({ }, actions: { - showDetailsModal(model) { - showModal("admin-staff-action-log-details", { model, admin: true }); - this.controllerFor("modal").set("modalClass", "log-details-modal"); - }, - - showCustomDetailsModal(model) { - let modal = showModal("admin-theme-change", { model, admin: true }); - this.controllerFor("modal").set("modalClass", "history-modal"); - modal.loadDiff(); - }, - onFiltersChange(filters) { if (filters && Object.keys(filters) === 0) { this.transitionTo("adminLogs.staffActionLogs");