mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 20:54:31 +08:00
DEV: Convert post-enqueued
modal to component-based API (#23295)
This commit is contained in:
parent
5d438f805c
commit
2671de3f86
|
@ -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>
|
|
@ -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
|
||||
|
|
|
@ -22,7 +22,6 @@ const KNOWN_LEGACY_MODALS = [
|
|||
"group-default-notifications",
|
||||
"login",
|
||||
"move-to-topic",
|
||||
"post-enqueued",
|
||||
"raw-email",
|
||||
"reject-reason-reviewable",
|
||||
"reorder-categories",
|
||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue
Block a user