DEV: Convert post-enqueued modal to component-based API (#23295)

This commit is contained in:
Isaac Janzen 2023-08-29 11:09:57 -05:00 committed by GitHub
parent 5d438f805c
commit 2671de3f86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 20 deletions

View File

@ -0,0 +1,21 @@
<DModal
@closeModal={{@closeModal}}
@title={{i18n "review.approval.title"}}
class="post-enqueued-modal"
>
<:body>
<p>{{i18n "review.approval.description"}}</p>
<p>
{{html-safe
(i18n "review.approval.pending_posts" count=@model.pending_count)
}}
</p>
</:body>
<:footer>
<DButton
@action={{@closeModal}}
class="btn-primary"
@label="review.approval.ok"
/>
</:footer>
</DModal>

View File

@ -32,13 +32,13 @@ import { isEmpty } from "@ember/utils";
import { isTesting } from "discourse-common/config/environment";
import Service, { inject as service } from "@ember/service";
import { shortDate } from "discourse/lib/formatter";
import showModal from "discourse/lib/show-modal";
import { categoryBadgeHTML } from "discourse/helpers/category-link";
import renderTags from "discourse/lib/render-tags";
import { htmlSafe } from "@ember/template";
import { iconHTML } from "discourse-common/lib/icon-library";
import prepareFormTemplateData from "discourse/lib/form-template-validation";
import DiscardDraftModal from "discourse/components/modal/discard-draft";
import PostEnqueuedModal from "discourse/components/modal/post-enqueued";
async function loadDraft(store, opts = {}) {
let { draft, draftKey, draftSequence } = opts;
@ -1169,10 +1169,7 @@ export default class ComposerService extends Service {
@action
postWasEnqueued(details) {
showModal("post-enqueued", {
model: details,
title: "review.approval.title",
});
this.modal.show(PostEnqueuedModal, { model: details });
}
// Notify the composer messages controller that a reply has been typed. Some

View File

@ -22,7 +22,6 @@ const KNOWN_LEGACY_MODALS = [
"group-default-notifications",
"login",
"move-to-topic",
"post-enqueued",
"raw-email",
"reject-reason-reviewable",
"reorder-categories",

View File

@ -1,14 +0,0 @@
<DModalBody>
<p>{{i18n "review.approval.description"}}</p>
<p>{{html-safe
(i18n "review.approval.pending_posts" count=this.model.pending_count)
}}</p>
</DModalBody>
<div class="modal-footer">
<DButton
@action={{route-action "closeModal"}}
@class="btn-primary"
@label="review.approval.ok"
/>
</div>