mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 17:12:45 +08:00
DEV: allow to skip the configured form template via the composer service (#23108)
* DEV: allow `formTemplateIds` to be explicitly set via the composer service * DEV: allow to skip the configured form template via the composer service
This commit is contained in:
parent
23222aa2d4
commit
a33c878b55
|
@ -162,8 +162,12 @@ export default class ComposerService extends Service {
|
|||
return this.set("_disableSubmit", value);
|
||||
}
|
||||
|
||||
@computed("model.category", "skipFormTemplate")
|
||||
get formTemplateIds() {
|
||||
if (!this.siteSettings.experimental_form_templates) {
|
||||
if (
|
||||
!this.siteSettings.experimental_form_templates ||
|
||||
this.skipFormTemplate
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -991,12 +995,12 @@ export default class ComposerService extends Service {
|
|||
? `<span class="topic-status">${iconHTML("envelope")}</span>`
|
||||
: "";
|
||||
|
||||
return `<div class='topic-title'>
|
||||
return `<div class="topic-title">
|
||||
<div class="topic-title__top-line">
|
||||
<span class='topic-statuses'>
|
||||
<span class="topic-statuses">
|
||||
${topicPM}${topicBookmarked}${topicClosed}${topicPinned}
|
||||
</span>
|
||||
<span class='fancy-title'>
|
||||
<span class="fancy-title">
|
||||
${topicOption.fancyTitle}
|
||||
</span>
|
||||
</div>
|
||||
|
@ -1196,6 +1200,7 @@ export default class ComposerService extends Service {
|
|||
@param {String} [opts.draftSequence]
|
||||
@param {Boolean} [opts.skipDraftCheck]
|
||||
@param {Boolean} [opts.skipJumpOnSave] Option to skip navigating to the post when saved in this composer session
|
||||
@param {Boolean} [opts.skipFormTemplate] Option to skip the form template even if configured for the category
|
||||
**/
|
||||
async open(opts = {}) {
|
||||
if (!opts.draftKey) {
|
||||
|
@ -1222,6 +1227,8 @@ export default class ComposerService extends Service {
|
|||
|
||||
this.set("skipJumpOnSave", !!opts.skipJumpOnSave);
|
||||
|
||||
this.set("skipFormTemplate", !!opts.skipFormTemplate);
|
||||
|
||||
// Scope the categories drop down to the category we opened the composer with.
|
||||
if (opts.categoryId && !opts.disableScopedCategory) {
|
||||
const category = this.site.categories.findBy("id", opts.categoryId);
|
||||
|
|
Loading…
Reference in New Issue
Block a user