diff --git a/app/assets/javascripts/admin/addon/components/site-settings/tag-group-list.hbs b/app/assets/javascripts/admin/addon/components/site-settings/tag-group-list.hbs new file mode 100644 index 00000000000..475a9fcf365 --- /dev/null +++ b/app/assets/javascripts/admin/addon/components/site-settings/tag-group-list.hbs @@ -0,0 +1,7 @@ + +
{{html-safe this.setting.description}}
+ \ No newline at end of file diff --git a/app/assets/javascripts/admin/addon/components/site-settings/tag-group-list.js b/app/assets/javascripts/admin/addon/components/site-settings/tag-group-list.js new file mode 100644 index 00000000000..5d11c75027f --- /dev/null +++ b/app/assets/javascripts/admin/addon/components/site-settings/tag-group-list.js @@ -0,0 +1,15 @@ +import Component from "@ember/component"; +import { action } from "@ember/object"; +import discourseComputed from "discourse-common/utils/decorators"; + +export default class TagGroupList extends Component { + @discourseComputed("value") + selectedTagGroups(value) { + return value.split("|").filter(Boolean); + } + + @action + onTagGroupChange(tagGroups) { + this.set("value", tagGroups.join("|")); + } +} diff --git a/app/assets/javascripts/admin/addon/mixins/setting-component.js b/app/assets/javascripts/admin/addon/mixins/setting-component.js index f54f179046b..fa1675ce542 100644 --- a/app/assets/javascripts/admin/addon/mixins/setting-component.js +++ b/app/assets/javascripts/admin/addon/mixins/setting-component.js @@ -27,6 +27,7 @@ const CUSTOM_TYPES = [ "upload", "group_list", "tag_list", + "tag_group_list", "color", "simple_list", "emoji_list", diff --git a/lib/site_settings/type_supervisor.rb b/lib/site_settings/type_supervisor.rb index a13797e1f91..db4bfa054a1 100644 --- a/lib/site_settings/type_supervisor.rb +++ b/lib/site_settings/type_supervisor.rb @@ -54,6 +54,7 @@ class SiteSettings::TypeSupervisor simple_list: 23, emoji_list: 24, html_deprecated: 25, + tag_group_list: 26, ) end diff --git a/spec/lib/site_settings/type_supervisor_spec.rb b/spec/lib/site_settings/type_supervisor_spec.rb index 59400f49207..45bd084d93f 100644 --- a/spec/lib/site_settings/type_supervisor_spec.rb +++ b/spec/lib/site_settings/type_supervisor_spec.rb @@ -95,6 +95,9 @@ RSpec.describe SiteSettings::TypeSupervisor do it "'emoji_list' should be at the right position" do expect(SiteSettings::TypeSupervisor.types[:emoji_list]).to eq(24) end + it "'tag_group_list' should be at the right position" do + expect(SiteSettings::TypeSupervisor.types[:tag_group_list]).to eq(26) + end end end