FIX: Disable insert link button when editing a category (#10549)

FIX: Disable insert link button when editing a category (#10549)

diff --git a/app/assets/javascripts/discourse/app/components/edit-category-topic-template.js b/app/assets/javascripts/discourse/app/components/edit-category-topic-template.js
index 1ccf804..f36425e 100644
--- a/app/assets/javascripts/discourse/app/components/edit-category-topic-template.js
+++ b/app/assets/javascripts/discourse/app/components/edit-category-topic-template.js
@@ -3,6 +3,10 @@ import { buildCategoryPanel } from "discourse/components/edit-category-panel";
 import { observes } from "discourse-common/utils/decorators";
 
 export default buildCategoryPanel("topic-template", {
+  // Modals are defined using the singleton pattern.
+  // Opening the insert link modal will destroy the edit category modal.
+  showInsertLinkButton: false,
+
   @observes("activeTab")
   _activeTabChanged: function() {
     if (this.activeTab) {
diff --git a/app/assets/javascripts/discourse/app/templates/components/edit-category-topic-template.hbs b/app/assets/javascripts/discourse/app/templates/components/edit-category-topic-template.hbs
index 6b9fa9b..746dc89 100644
--- a/app/assets/javascripts/discourse/app/templates/components/edit-category-topic-template.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/edit-category-topic-template.hbs
@@ -1,2 +1,2 @@
 <label>{{i18n "category.topic_template"}}</label>
-{{d-editor value=category.topic_template}}
+{{d-editor value=category.topic_template showLink=showInsertLinkButton}}

GitHub sha: 2a3a173e

This commit appears in #10549 which was merged by romanrizzi.