DEV: Convert `staff-action-log-details` modal to component-based API (#23240)

<img width="800" alt="Screenshot 2023-08-24 at 3 08 38 PM" src="https://github.com/discourse/discourse/assets/50783505/c498c49c-88ca-4b34-90a0-194f177b5856">
This commit is contained in:
Isaac Janzen 2023-08-25 06:43:52 -05:00 committed by GitHub
parent 0c26d8b375
commit 3052779ea6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 18 deletions

View File

@ -0,0 +1,12 @@
<DModal
@title={{i18n "admin.logs.staff_actions.modal_title"}}
@closeModal={{@closeModal}}
class="log-details-modal"
>
<:body>
<pre>{{@model.staffActionLog.details}}</pre>
</:body>
<:footer>
<DButton @action={{@closeModal}} @label="close" />
</:footer>
</DModal>

View File

@ -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 },
});
}

View File

@ -1,6 +0,0 @@
import Controller from "@ember/controller";
import ModalFunctionality from "discourse/mixins/modal-functionality";
export default class AdminStaffActionLogDetailsController extends Controller.extend(
ModalFunctionality
) {}

View File

@ -1,6 +0,0 @@
<DModalBody @title="admin.logs.staff_actions.modal_title">
<pre>{{this.model.details}}</pre>
</DModalBody>
<div class="modal-footer">
<DButton @action={{route-action "closeModal"}} @label="close" />
</div>

View File

@ -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",
];