From 7d3c4a5f1388b65601dbbc7eda9235f540f9e57d Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Mon, 11 May 2020 17:05:40 +0200 Subject: [PATCH] FIX: Show category name in badge preview on edit (#9726) --- .../discourse/app/components/edit-category-general.js | 2 +- .../app/templates/components/category-name-fields.hbs | 2 +- test/javascripts/acceptance/category-edit-test.js | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/edit-category-general.js b/app/assets/javascripts/discourse/app/components/edit-category-general.js index 9d3e548a20a..ad9c056623b 100644 --- a/app/assets/javascripts/discourse/app/components/edit-category-general.js +++ b/app/assets/javascripts/discourse/app/components/edit-category-general.js @@ -66,7 +66,7 @@ export default buildCategoryPanel("general", { @discourseComputed( "category.parent_category_id", - "category.categoryName", + "category.name", "category.color", "category.text_color" ) diff --git a/app/assets/javascripts/discourse/app/templates/components/category-name-fields.hbs b/app/assets/javascripts/discourse/app/templates/components/category-name-fields.hbs index b54858ff79f..7bcefbbe18b 100644 --- a/app/assets/javascripts/discourse/app/templates/components/category-name-fields.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/category-name-fields.hbs @@ -2,7 +2,7 @@ {{#unless category.isUncategorizedCategory}}
- {{text-field value=category.name placeholderKey="category.name_placeholder" maxlength="50"}} + {{text-field value=category.name placeholderKey="category.name_placeholder" maxlength="50" class="category-name"}}
{{/unless}}
diff --git a/test/javascripts/acceptance/category-edit-test.js b/test/javascripts/acceptance/category-edit-test.js index efdf73d90dd..7123b2dcaab 100644 --- a/test/javascripts/acceptance/category-edit-test.js +++ b/test/javascripts/acceptance/category-edit-test.js @@ -21,6 +21,11 @@ QUnit.test("Editing the category", async assert => { await visit("/c/bug"); await click(".edit-category"); + + assert.equal(find(".d-modal .badge-category").text(), "bug"); + await fillIn("input.category-name", "testing"); + assert.equal(find(".d-modal .badge-category").text(), "testing"); + await fillIn("#edit-text-color", "#ff0000"); await click(".edit-category-topic-template");