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:
parent
0c26d8b375
commit
3052779ea6
|
@ -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>
|
|
@ -5,9 +5,9 @@ import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import { exportEntity } from "discourse/lib/export-csv";
|
import { exportEntity } from "discourse/lib/export-csv";
|
||||||
import { outputExportResult } from "discourse/lib/export-result";
|
import { outputExportResult } from "discourse/lib/export-result";
|
||||||
import { scheduleOnce } from "@ember/runloop";
|
import { scheduleOnce } from "@ember/runloop";
|
||||||
import showModal from "discourse/lib/show-modal";
|
|
||||||
import { inject as service } from "@ember/service";
|
import { inject as service } from "@ember/service";
|
||||||
import ThemeChangeModal from "../components/modal/theme-change";
|
import ThemeChangeModal from "../components/modal/theme-change";
|
||||||
|
import StaffActionLogDetailsModal from "../components/modal/staff-action-log-details";
|
||||||
|
|
||||||
export default class AdminLogsStaffActionLogsController extends Controller {
|
export default class AdminLogsStaffActionLogsController extends Controller {
|
||||||
@service modal;
|
@service modal;
|
||||||
|
@ -156,10 +156,8 @@ export default class AdminLogsStaffActionLogsController extends Controller {
|
||||||
@action
|
@action
|
||||||
showDetailsModal(model, event) {
|
showDetailsModal(model, event) {
|
||||||
event?.preventDefault();
|
event?.preventDefault();
|
||||||
showModal("admin-staff-action-log-details", {
|
this.modal.show(StaffActionLogDetailsModal, {
|
||||||
model,
|
model: { staffActionLog: model },
|
||||||
admin: true,
|
|
||||||
modalClass: "log-details-modal",
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
import Controller from "@ember/controller";
|
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
|
||||||
|
|
||||||
export default class AdminStaffActionLogDetailsController extends Controller.extend(
|
|
||||||
ModalFunctionality
|
|
||||||
) {}
|
|
|
@ -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>
|
|
|
@ -37,7 +37,7 @@ const KNOWN_LEGACY_MODALS = [
|
||||||
"share-and-invite",
|
"share-and-invite",
|
||||||
"tag-upload",
|
"tag-upload",
|
||||||
"admin-reseed",
|
"admin-reseed",
|
||||||
"admin-staff-action-log-details",
|
"admin-form-template-validation-options",
|
||||||
"admin-uploaded-image-list",
|
"admin-uploaded-image-list",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue