From cd6183de93d4b4c2efe4c00008850dd9e52e3190 Mon Sep 17 00:00:00 2001 From: Keegan George Date: Wed, 14 Jun 2023 11:16:39 -0700 Subject: [PATCH] DEV: Temporarily hide form when editing topic with template (#22099) --- .../discourse/app/components/composer-editor.hbs | 1 + .../javascripts/discourse/app/components/d-editor.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/composer-editor.hbs b/app/assets/javascripts/discourse/app/components/composer-editor.hbs index 82aa91cebc2..5b1041b8c86 100644 --- a/app/assets/javascripts/discourse/app/components/composer-editor.hbs +++ b/app/assets/javascripts/discourse/app/components/composer-editor.hbs @@ -18,6 +18,7 @@ @popupMenuOptions={{this.popupMenuOptions}} @formTemplateIds={{this.formTemplateIds}} @replyingToTopic={{this.composer.replyingToTopic}} + @editingPost={{this.composer.editingPost}} @disabled={{this.disableTextarea}} @outletArgs={{hash composer=this.composer editorType="composer"}} > diff --git a/app/assets/javascripts/discourse/app/components/d-editor.js b/app/assets/javascripts/discourse/app/components/d-editor.js index ebd23ddd1e5..0b57f82b1c8 100644 --- a/app/assets/javascripts/discourse/app/components/d-editor.js +++ b/app/assets/javascripts/discourse/app/components/d-editor.js @@ -247,9 +247,10 @@ export default Component.extend(TextareaTextManipulation, { this.selectedFormTemplateId = formTemplateId; }, - @discourseComputed("formTemplateIds", "replyingToTopic") - showFormTemplateForm(formTemplateIds, replyingToTopic) { - if (formTemplateIds?.length > 0 && !replyingToTopic) { + @discourseComputed("formTemplateIds", "replyingToTopic", "editingPost") + showFormTemplateForm(formTemplateIds, replyingToTopic, editingPost) { + // TODO(@keegan): Remove !editingPost once we add edit/draft support for form templates + if (formTemplateIds?.length > 0 && !replyingToTopic && !editingPost) { return true; }