From 3052779ea6af3e9e9ac3cf5c3cc8871841c5bd15 Mon Sep 17 00:00:00 2001
From: Isaac Janzen <50783505+janzenisaac@users.noreply.github.com>
Date: Fri, 25 Aug 2023 06:43:52 -0500
Subject: [PATCH] DEV: Convert `staff-action-log-details` modal to
component-based API (#23240)
---
.../components/modal/staff-action-log-details.hbs | 12 ++++++++++++
.../controllers/admin-logs-staff-action-logs.js | 8 +++-----
.../modals/admin-staff-action-log-details.js | 6 ------
.../modal/admin-staff-action-log-details.hbs | 6 ------
.../javascripts/discourse/app/services/modal.js | 2 +-
5 files changed, 16 insertions(+), 18 deletions(-)
create mode 100644 app/assets/javascripts/admin/addon/components/modal/staff-action-log-details.hbs
delete mode 100644 app/assets/javascripts/admin/addon/controllers/modals/admin-staff-action-log-details.js
delete mode 100644 app/assets/javascripts/admin/addon/templates/modal/admin-staff-action-log-details.hbs
diff --git a/app/assets/javascripts/admin/addon/components/modal/staff-action-log-details.hbs b/app/assets/javascripts/admin/addon/components/modal/staff-action-log-details.hbs
new file mode 100644
index 00000000000..726a2255cb0
--- /dev/null
+++ b/app/assets/javascripts/admin/addon/components/modal/staff-action-log-details.hbs
@@ -0,0 +1,12 @@
+
+ <:body>
+ {{@model.staffActionLog.details}}
+
+ <:footer>
+
+
+
\ No newline at end of file
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 b11d92e0f65..73c61699696 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,9 +5,9 @@ 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";
import { inject as service } from "@ember/service";
import ThemeChangeModal from "../components/modal/theme-change";
+import StaffActionLogDetailsModal from "../components/modal/staff-action-log-details";
export default class AdminLogsStaffActionLogsController extends Controller {
@service modal;
@@ -156,10 +156,8 @@ export default class AdminLogsStaffActionLogsController extends Controller {
@action
showDetailsModal(model, event) {
event?.preventDefault();
- showModal("admin-staff-action-log-details", {
- model,
- admin: true,
- modalClass: "log-details-modal",
+ this.modal.show(StaffActionLogDetailsModal, {
+ model: { staffActionLog: model },
});
}
diff --git a/app/assets/javascripts/admin/addon/controllers/modals/admin-staff-action-log-details.js b/app/assets/javascripts/admin/addon/controllers/modals/admin-staff-action-log-details.js
deleted file mode 100644
index 7859abf24aa..00000000000
--- a/app/assets/javascripts/admin/addon/controllers/modals/admin-staff-action-log-details.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import Controller from "@ember/controller";
-import ModalFunctionality from "discourse/mixins/modal-functionality";
-
-export default class AdminStaffActionLogDetailsController extends Controller.extend(
- ModalFunctionality
-) {}
diff --git a/app/assets/javascripts/admin/addon/templates/modal/admin-staff-action-log-details.hbs b/app/assets/javascripts/admin/addon/templates/modal/admin-staff-action-log-details.hbs
deleted file mode 100644
index 8a843048e7d..00000000000
--- a/app/assets/javascripts/admin/addon/templates/modal/admin-staff-action-log-details.hbs
+++ /dev/null
@@ -1,6 +0,0 @@
-
- {{this.model.details}}
-
-
\ No newline at end of file
diff --git a/app/assets/javascripts/discourse/app/services/modal.js b/app/assets/javascripts/discourse/app/services/modal.js
index 560a438d670..7af846700e0 100644
--- a/app/assets/javascripts/discourse/app/services/modal.js
+++ b/app/assets/javascripts/discourse/app/services/modal.js
@@ -37,7 +37,7 @@ const KNOWN_LEGACY_MODALS = [
"share-and-invite",
"tag-upload",
"admin-reseed",
- "admin-staff-action-log-details",
+ "admin-form-template-validation-options",
"admin-uploaded-image-list",
];