From a20bf843fcd75b05914b08916b0b75682b56a975 Mon Sep 17 00:00:00 2001 From: Daniel Waterworth Date: Mon, 5 Feb 2024 12:03:35 -0600 Subject: [PATCH] DEV: Switch site-settings category-list component to gjs (#25569) --- .../site-settings/category-list.gjs | 28 +++++++++++++++++++ .../site-settings/category-list.hbs | 7 ----- .../components/site-settings/category-list.js | 15 ---------- 3 files changed, 28 insertions(+), 22 deletions(-) create mode 100644 app/assets/javascripts/admin/addon/components/site-settings/category-list.gjs delete mode 100644 app/assets/javascripts/admin/addon/components/site-settings/category-list.hbs delete mode 100644 app/assets/javascripts/admin/addon/components/site-settings/category-list.js diff --git a/app/assets/javascripts/admin/addon/components/site-settings/category-list.gjs b/app/assets/javascripts/admin/addon/components/site-settings/category-list.gjs new file mode 100644 index 00000000000..c180dc0716d --- /dev/null +++ b/app/assets/javascripts/admin/addon/components/site-settings/category-list.gjs @@ -0,0 +1,28 @@ +import Component from "@ember/component"; +import { action, computed } from "@ember/object"; +import Category from "discourse/models/category"; +import htmlSafe from "discourse-common/helpers/html-safe"; +import SettingValidationMessage from "admin/components/setting-validation-message"; +import CategorySelector from "select-kit/components/category-selector"; + +export default class CategoryList extends Component { + @computed("value") + get selectedCategories() { + return Category.findByIds(this.value.split("|").filter(Boolean)); + } + + @action + onChangeSelectedCategories(value) { + this.set("value", (value || []).mapBy("id").join("|")); + } + + +} diff --git a/app/assets/javascripts/admin/addon/components/site-settings/category-list.hbs b/app/assets/javascripts/admin/addon/components/site-settings/category-list.hbs deleted file mode 100644 index 473a7549897..00000000000 --- a/app/assets/javascripts/admin/addon/components/site-settings/category-list.hbs +++ /dev/null @@ -1,7 +0,0 @@ - - -
{{html-safe this.setting.description}}
- \ No newline at end of file diff --git a/app/assets/javascripts/admin/addon/components/site-settings/category-list.js b/app/assets/javascripts/admin/addon/components/site-settings/category-list.js deleted file mode 100644 index 65966787210..00000000000 --- a/app/assets/javascripts/admin/addon/components/site-settings/category-list.js +++ /dev/null @@ -1,15 +0,0 @@ -import Component from "@ember/component"; -import { action, computed } from "@ember/object"; -import Category from "discourse/models/category"; - -export default class CategoryList extends Component { - @computed("value") - get selectedCategories() { - return Category.findByIds(this.value.split("|").filter(Boolean)); - } - - @action - onChangeSelectedCategories(value) { - this.set("value", (value || []).mapBy("id").join("|")); - } -}