Skip to content

A platform for community discussion. Free, open, simple.

DEV: Use imports for select-kit components & deprecate string lookups (#33219)

David Tayloraab7b9fc68e9
diff --git a/app/assets/javascripts/select-kit/addon/components/category-drop.js b/app/assets/javascripts/select-kit/addon/components/category-drop.js
index 56896b0f695..4236ddd1651 100644
--- a/app/assets/javascripts/select-kit/addon/components/category-drop.js
+++ b/app/assets/javascripts/select-kit/addon/components/category-drop.js
@@ -18,6 +18,7 @@ import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
+import CategoryDropHeader from "./category-drop/category-drop-header";
export const NO_CATEGORIES_ID = "no-categories";
export const ALL_CATEGORIES_ID = "all-categories";
@@ -39,7 +40,7 @@ const MORE_COLLECTION = "MORE_COLLECTION";
countSubcategories: false,
autoInsertNoneItem: false,
displayCategoryDescription: "displayCategoryDescription",
- headerComponent: "category-drop/category-drop-header",
+ headerComponent: CategoryDropHeader,
parentCategory: false,
allowUncategorized: "allowUncategorized",
shouldDisplayIcon: "shouldDisplayIcon",
diff --git a/app/assets/javascripts/select-kit/addon/components/category-selector.js b/app/assets/javascripts/select-kit/addon/components/category-selector.js
index 3da47b8d4dd..fc32aeb2c1a 100644
--- a/app/assets/javascripts/select-kit/addon/components/category-selector.js
+++ b/app/assets/javascripts/select-kit/addon/components/category-selector.js
@@ -6,6 +6,7 @@ import Category from "discourse/models/category";
import CategoryRow from "select-kit/components/category-row";
import MultiSelectComponent from "select-kit/components/multi-select";
import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";
+import SelectedChoiceCategory from "./selected-choice-category";
@classNames("category-selector")
@selectKitOptions({
@@ -13,7 +14,7 @@ import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";
allowAny: false,
allowUncategorized: true,
displayCategoryDescription: false,
- selectedChoiceComponent: "selected-choice-category",
+ selectedChoiceComponent: SelectedChoiceCategory,
})
@pluginApiIdentifiers(["category-selector"])
export default class CategorySelector extends MultiSelectComponent {
diff --git a/app/assets/javascripts/select-kit/addon/components/color-palettes.js b/app/assets/javascripts/select-kit/addon/components/color-palettes.js
index 14683ec1a11..26cfbcfb7b4 100644
--- a/app/assets/javascripts/select-kit/addon/components/color-palettes.js
+++ b/app/assets/javascripts/select-kit/addon/components/color-palettes.js
@@ -1,6 +1,7 @@
import { classNames } from "@ember-decorators/component";
import { i18n } from "discourse-i18n";
import ComboBoxComponent from "select-kit/components/combo-box";
+import ColorPalettesRow from "./color-palettes/color-palettes-row";
import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";
@classNames("color-palettes")
@@ -10,6 +11,6 @@ import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";
@pluginApiIdentifiers(["color-palettes"])
export default class ColorPalettes extends ComboBoxComponent {
modifyComponentForRow() {
- return "color-palettes/color-palettes-row";
+ return ColorPalettesRow;
}
}
diff --git a/app/assets/javascripts/select-kit/addon/components/combo-box.js b/app/assets/javascripts/select-kit/addon/components/combo-box.js
index a96fc431776..7245e000a52 100644
--- a/app/assets/javascripts/select-kit/addon/components/combo-box.js
+++ b/app/assets/javascripts/select-kit/addon/components/combo-box.js
@@ -1,6 +1,7 @@
import { gte } from "@ember/object/computed";
import { classNames } from "@ember-decorators/component";
import SingleSelectComponent from "select-kit/components/single-select";
+import ComboBoxHeader from "./combo-box/combo-box-header";
import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";
@classNames("combobox", "combo-box")
@@ -10,7 +11,7 @@ import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";
caretDownIcon: "caret-down",
autoFilterable: "autoFilterable",
clearable: false,
- headerComponent: "combo-box/combo-box-header",
+ headerComponent: ComboBoxHeader,
shouldDisplayIcon: false,
})
export default class ComboBox extends SingleSelectComponent {
diff --git a/app/assets/javascripts/select-kit/addon/components/dropdown-select-box.js b/app/assets/javascripts/select-kit/addon/components/dropdown-select-box.js
index d021d1d7b49..0fe478a8ecd 100644
--- a/app/assets/javascripts/select-kit/addon/components/dropdown-select-box.js
+++ b/app/assets/javascripts/select-kit/addon/components/dropdown-select-box.js
@@ -1,5 +1,7 @@
import { classNames } from "@ember-decorators/component";
import SingleSelectComponent from "select-kit/components/single-select";
+import DropdownSelectBoxHeader from "./dropdown-select-box/dropdown-select-box-header";
+import DropdownSelectBoxRow from "./dropdown-select-box/dropdown-select-box-row";
import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";
@classNames("dropdown-select-box")
@@ -7,7 +9,7 @@ import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";
autoFilterable: false,
filterable: false,
showFullTitle: true,
- headerComponent: "dropdown-select-box/dropdown-select-box-header",
+ headerComponent: DropdownSelectBoxHeader,
caretUpIcon: "caret-up",
caretDownIcon: "caret-down",
showCaret: false,
@@ -17,6 +19,6 @@ import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";
@pluginApiIdentifiers(["dropdown-select-box"])
export default class DropdownSelectBox extends SingleSelectComponent {
modifyComponentForRow() {
- return "dropdown-select-box/dropdown-select-box-row";
+ return DropdownSelectBoxRow;
}
}
diff --git a/app/assets/javascripts/select-kit/addon/components/email-group-user-chooser.js b/app/assets/javascripts/select-kit/addon/components/email-group-user-chooser.js
index 162a67e339d..e9603d55dfb 100644
--- a/app/assets/javascripts/select-kit/addon/components/email-group-user-chooser.js
+++ b/app/assets/javascripts/select-kit/addon/components/email-group-user-chooser.js
@@ -4,11 +4,13 @@ import {
selectKitOptions,
} from "select-kit/components/select-kit";
import UserChooserComponent from "select-kit/components/user-chooser";
+import EmailGroupUserChooserFilter from "./email-group-user-chooser-filter";
+import EmailGroupUserChooserRow from "./email-group-user-chooser-row";
@classNames("email-group-user-chooser")
@classNameBindings("selectKit.options.fullWidthWrap:full-width-wrap")
@selectKitOptions({
- filterComponent: "email-group-user-chooser-filter",
+ filterComponent: EmailGroupUserChooserFilter,
fullWidthWrap: false,
autoWrap: false,
})
@@ -18,7 +20,7 @@ export default class EmailGroupUserChooser extends UserChooserComponent {
nameProperty = "name";
modifyComponentForRow() {
- return "email-group-user-chooser-row";
+ return EmailGroupUserChooserRow;
}
search() {
diff --git a/app/assets/javascripts/select-kit/addon/components/flair-chooser.js b/app/assets/javascripts/select-kit/addon/components/flair-chooser.js
index 7d6e54505e2..239e654a5e7 100644
--- a/app/assets/javascripts/select-kit/addon/components/flair-chooser.js
+++ b/app/assets/javascripts/select-kit/addon/components/flair-chooser.js
@@ -5,15 +5,17 @@ import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
+import FlairRow from "./flair-row";
+import SelectedFlair from "./selected-flair";
@classNames("flair-chooser")
@selectKitOptions({
- selectedNameComponent: "selected-flair",
+ selectedNameComponent: SelectedFlair,
})
@pluginApiIdentifiers(["flair-chooser"])
export default class FlairChooser extends ComboBoxComponent {
modifyComponentForRow() {
- return "flair-row";
+ return FlairRow;
}
@computed("value", "content.[]", "selectKit.noneItem")
diff --git a/app/assets/javascripts/select-kit/addon/components/font-selector.js b/app/assets/javascripts/select-kit/addon/components/font-selector.js
index 2aa4c8068f5..6feb0dc239c 100644
--- a/app/assets/javascripts/select-kit/addon/components/font-selector.js
+++ b/app/assets/javascripts/select-kit/addon/components/font-selector.js
@@ -1,14 +1,16 @@
import { classNames } from "@ember-decorators/component";
import ComboBoxComponent from "select-kit/components/combo-box";
+import FontSelectorRow from "./font-selector/font-selector-row";
import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";
+import SelectedFont from "./selected-font";
@classNames("font-selector")
@pluginApiIdentifiers(["font-selector"])
@selectKitOptions({
- selectedNameComponent: "selected-font",
+ selectedNameComponent: SelectedFont,
})
export default class FontSelector extends ComboBoxComponent {
modifyComponentForRow() {
- return "font-selector/font-selector-row";
+ return FontSelectorRow;
}
}
diff --git a/app/assets/javascripts/select-kit/addon/components/future-date-input-selector.js b/app/assets/javascripts/select-kit/addon/components/future-date-input-selector.js
index f71232331a2..5e038ba685f 100644
--- a/app/assets/javascripts/select-kit/addon/components/future-date-input-selector.js
+++ b/app/assets/javascripts/select-kit/addon/components/future-date-input-selector.js
@@ -7,14 +7,15 @@ import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
+import FutureDateInputSelectorHeader from "./future-date-input-selector/future-date-input-selector-header";
+import FutureDateInputSelectorRow from "./future-date-input-selector/future-date-input-selector-row";
export const FORMAT = "YYYY-MM-DD HH:mmZ";
@classNames("future-date-input-selector")
@selectKitOptions({
autoInsertNoneItem: false,
- headerComponent:
- "future-date-input-selector/future-date-input-selector-header",
+ headerComponent: FutureDateInputSelectorHeader,
})
@pluginApiIdentifiers("future-date-input-selector")
export default class FutureDateInputSelector extends ComboBoxComponent {
@@ -28,7 +29,7 @@ export default class FutureDateInputSelector extends ComboBoxComponent {
}
modifyComponentForRow() {
- return "future-date-input-selector/future-date-input-selector-row";
+ return FutureDateInputSelectorRow;
}
@action
diff --git a/app/assets/javascripts/select-kit/addon/components/homepage-style-selector.js b/app/assets/javascripts/select-kit/addon/components/homepage-style-selector.js
index e567bc47eb0..794185cb828 100644
--- a/app/assets/javascripts/select-kit/addon/components/homepage-style-selector.js
+++ b/app/assets/javascripts/select-kit/addon/components/homepage-style-selector.js
@@ -1,11 +1,12 @@
import { classNames } from "@ember-decorators/component";
import ComboBoxComponent from "select-kit/components/combo-box";
+import HomepageStyleSelectorRow from "./homepage-style-selector/homepage-style-selector-row";
import { pluginApiIdentifiers } from "./select-kit";
@classNames("homepage-style-selector")
@pluginApiIdentifiers(["homepage-style-selector"])
export default class HomepageStyleSelector extends ComboBoxComponent {
modifyComponentForRow() {
- return "homepage-style-selector/homepage-style-selector-row";
+ return HomepageStyleSelectorRow;
}
}
diff --git a/app/assets/javascripts/select-kit/addon/components/list-setting.js b/app/assets/javascripts/select-kit/addon/components/list-setting.js
index 4f8d76ea8d9..dcac872fc00 100644
--- a/app/assets/javascripts/select-kit/addon/components/list-setting.js
+++ b/app/assets/javascripts/select-kit/addon/components/list-setting.js
@@ -8,11 +8,13 @@ import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
+import CreateColorRow from "./create-color-row";
+import SelectedChoice from "./selected-choice";
+import SelectedChoiceColor from "./selected-choice-color";
@classNames("list-setting")
@selectKitOptions({
filterable: true,
- selectedChoiceComponent: "selectedChoiceComponent",
})
@pluginApiIdentifiers("list-setting")
export default class ListSetting extends MultiSelectComponent {
@@ -24,16 +26,16 @@ export default class ListSetting extends MultiSelectComponent {
modifyComponentForRow(collection) {
if (collection === MAIN_COLLECTION && this.settingName?.includes("color")) {
- return "create-color-row";
+ return CreateColorRow;
}
}
@computed("settingName")
get selectedChoiceComponent() {
if (this.settingName?.includes("color")) {
- return "selected-choice-color";
+ return SelectedChoiceColor;
} else {
- return "selected-choice";
+ return SelectedChoice;
}
}
diff --git a/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser.js b/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser.js
index d911c96916d..da53232cf99 100644
--- a/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser.js
+++ b/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser.js
@@ -15,6 +15,8 @@ import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
+import SelectKitRow from "./select-kit/select-kit-row";
+import TagRow from "./tag-row";
@attributeBindings("selectKit.options.categoryId:category-id")
@classNames("mini-tag-chooser")
@@ -45,10 +47,10 @@ export default class MiniTagChooser extends MultiSelectComponent {
modifyComponentForRow(collection, item) {
if (this.getValue(item) === this.selectKit.filter && !item.count) {
- return "select-kit/select-kit-row";
+ return SelectKitRow;
}
- return "tag-row";
+ return TagRow;
}
modifyNoSelection() {
diff --git a/app/assets/javascripts/select-kit/addon/components/multi-select.gjs b/app/assets/javascripts/select-kit/addon/components/multi-select.gjs
index c19a5ba577b..61cca6f02e9 100644
--- a/app/assets/javascripts/select-kit/addon/components/multi-select.gjs
+++ b/app/assets/javascripts/select-kit/addon/components/multi-select.gjs
@@ -14,6 +14,8 @@ import SelectKitComponent, {
} from "select-kit/components/select-kit";
import SelectKitBody from "select-kit/components/select-kit/select-kit-body";
import { isNumeric } from "select-kit/lib/input-utils";
+import MultiSelectFilter from "./multi-select/multi-select-filter";
+import MultiSelectHeader from "./multi-select/multi-select-header";
@classNames("multi-select")
@selectKitOptions({
@@ -23,8 +25,8 @@ import { isNumeric } from "select-kit/lib/input-utils";
filterIcon: null,
closeOnChange: false,
autoInsertNoneItem: false,
- headerComponent: "multi-select/multi-select-header",
- filterComponent: "multi-select/multi-select-filter",
+ headerComponent: MultiSelectHeader,
+ filterComponent: MultiSelectFilter,
autoFilterable: true,
caretDownIcon: "caretIcon",
caretUpIcon: "caretIcon",
diff --git a/app/assets/javascripts/select-kit/addon/components/notifications-button.js b/app/assets/javascripts/select-kit/addon/components/notifications-button.js
index cc4311c7bce..9e513e18411 100644
--- a/app/assets/javascripts/select-kit/addon/components/notifications-button.js
+++ b/app/assets/javascripts/select-kit/addon/components/notifications-button.js
@@ -7,6 +7,7 @@ import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
+import NotificationsButtonRow from "./notifications-button/notifications-button-row";
@classNames("notifications-button")
@selectKitOptions({
@@ -31,7 +32,7 @@ export default class NotificationsButton extends DropdownSelectBoxComponent {
title: this.getTitle(content.key),
});
}
- return "notifications-button/notifications-button-row";
+ return NotificationsButtonRow;
}
modifySelection(content) {
diff --git a/app/assets/javascripts/select-kit/addon/components/notifications-filter.js b/app/assets/javascripts/select-kit/addon/components/notifications-filter.js
index e48aa72a6e8..21167e7d944 100644
--- a/app/assets/javascripts/select-kit/addon/components/notifications-filter.js
+++ b/app/assets/javascripts/select-kit/addon/components/notifications-filter.js
@@ -3,10 +3,11 @@ import { classNames } from "@ember-decorators/component";
import { i18n } from "discourse-i18n";
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
import { selectKitOptions } from "select-kit/components/select-kit";
+import NotificationsFilterHeader from "./notifications-filter/notifications-filter-header";
@classNames("notifications-filter")
@selectKitOptions({
- headerComponent: "notifications-filter/notifications-filter-header",
+ headerComponent: NotificationsFilterHeader,
})
export default class NotificationsFilter extends DropdownSelectBoxComponent {
nameProperty = "label";
diff --git a/app/assets/javascripts/select-kit/addon/components/period-chooser.js b/app/assets/javascripts/select-kit/addon/components/period-chooser.js
index dc1251a7892..756a1d96ea6 100644
--- a/app/assets/javascripts/select-kit/addon/components/period-chooser.js
+++ b/app/assets/javascripts/select-kit/addon/components/period-chooser.js
@@ -4,6 +4,8 @@ import { classNameBindings, classNames } from "@ember-decorators/component";
import { i18n } from "discourse-i18n";
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
import { selectKitOptions } from "select-kit/components/select-kit";
+import PeriodChooserHeader from "./period-chooser/period-chooser-header";
+import PeriodChooserRow from "./period-chooser/period-chooser-row";
@classNames("period-chooser")
@classNameBindings("showPeriods::hidden")
@@ -12,7 +14,7 @@ import { selectKitOptions } from "select-kit/components/select-kit";
autoFilterable: false,
fullDay: "fullDay",
customStyle: true,
- headerComponent: "period-chooser/period-chooser-header",
+ headerComponent: PeriodChooserHeader,
headerAriaLabel: i18n("period_chooser.aria_label"),
})
export default class PeriodChooser extends DropdownSelectBoxComponent {
@@ -24,7 +26,7 @@ export default class PeriodChooser extends DropdownSelectBoxComponent {
showPeriods = true;
modifyComponentForRow() {
- return "period-chooser/period-chooser-row";
+ return PeriodChooserRow;
}
@action
diff --git a/app/assets/javascripts/select-kit/addon/components/select-kit.js b/app/assets/javascripts/select-kit/addon/components/select-kit.js
index 051b190fb83..62e2612210f 100644
--- a/app/assets/javascripts/select-kit/addon/components/select-kit.js
+++ b/app/assets/javascripts/select-kit/addon/components/select-kit.js
@@ -24,6 +24,12 @@ import {
applyOnChangePluginApiCallbacks,
} from "select-kit/lib/plugin-api";
import selectKitPropUtils from "select-kit/lib/select-kit-prop-utils";
+import ErrorsCollection from "./select-kit/errors-collection";
+import SelectKitCollection from "./select-kit/select-kit-collection";
+import SelectKitFilter from "./select-kit/select-kit-filter";
+import SelectKitRow from "./select-kit/select-kit-row";
+import SelectedChoice from "./selected-choice";
+import SelectedName from "./selected-name";
export const MAIN_COLLECTION = "MAIN_COLLECTION";
export const ERRORS_COLLECTION = "ERRORS_COLLECTION";
@@ -71,6 +77,12 @@ export function resolveComponent(context, component) {
const owner = getOwner(context);
if (typeof component === "string") {
+ deprecated(
+ `[${component}] SelectKit components should be imported and passed by reference, not as a string`,
+ {
+ id: "discourse.select-kit-resolved-components",
+ }
+ );
const result = owner.resolveRegistration(`component:${component}`);
if (!result) {
throw new Error(`Component not found: ${component}`);
@@ -123,9 +135,9 @@ function protoProp(prototype, key, descriptor) {
limitMatches: null,
placement: isDocumentRTL() ? "bottom-end" : "bottom-start",
verticalOffset: 3,
- filterComponent: "select-kit/select-kit-filter",
- selectedNameComponent: "selected-name",
- selectedChoiceComponent: "selected-choice",
+ filterComponent: SelectKitFilter,
+ selectedNameComponent: SelectedName,
+ selectedChoiceComponent: SelectedChoice,
castInteger: false,
focusAfterOnChange: true,
triggerOnChangeOnTab: true,
@@ -239,7 +251,7 @@ export default class SelectKit extends Component {
_modifyComponentForRowWrapper(collection, item) {
let component = this.modifyComponentForRow(collection, item);
- return component || "select-kit/select-kit-row";
+ return component || SelectKitRow;
}
modifyComponentForRow() {}
@@ -269,10 +281,10 @@ export default class SelectKit extends Component {
if (!component) {
switch (identifier) {
case ERRORS_COLLECTION:
- component = "select-kit/errors-collection";
+ component = ErrorsCollection;
break;
default:
- component = "select-kit/select-kit-collection";
+ component = SelectKitCollection;
break;
}
}
diff --git a/app/assets/javascripts/select-kit/addon/components/single-select.gjs b/app/assets/javascripts/select-kit/addon/components/single-select.gjs
index 7e32e16dc1a..ea921731b07 100644
--- a/app/assets/javascripts/select-kit/addon/components/single-select.gjs
+++ b/app/assets/javascripts/select-kit/addon/components/single-select.gjs
@@ -12,10 +12,11 @@ import SelectKitComponent, {
} from "select-kit/components/select-kit";
import SelectKitBody from "select-kit/components/select-kit/select-kit-body";
import { isNumeric } from "select-kit/lib/input-utils";
+import SingleSelectHeader from "./select-kit/single-select-header";
@classNames("single-select")
@selectKitOptions({
- headerComponent: "select-kit/single-select-header",
+ headerComponent: SingleSelectHeader,
})
@pluginApiIdentifiers(["single-select"])
export default class SingleSelect extends SelectKitComponent {
diff --git a/app/assets/javascripts/select-kit/addon/components/tag-chooser.js b/app/assets/javascripts/select-kit/addon/components/tag-chooser.js
index 6e04c9a04f3..a156e775e8d 100644
--- a/app/assets/javascripts/select-kit/addon/components/tag-chooser.js
+++ b/app/assets/javascripts/select-kit/addon/components/tag-chooser.js
@@ -8,6 +8,8 @@ import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
+import SelectKitRow from "./select-kit/select-kit-row";
+import TagChooserRow from "./tag-chooser-row";
@classNames("tag-chooser")
@attributeBindings("categoryId")
@@ -38,10 +40,10 @@ export default class TagChooser extends MultiSelectComponent {
modifyComponentForRow(collection, item) {
if (this.getValue(item) === this.selectKit.filter && !item.count) {
- return "select-kit/select-kit-row";
+ return SelectKitRow;
}
- return "tag-chooser-row";
+ return TagChooserRow;
}
@computed("site.can_create_tag", "allowCreate")
diff --git a/app/assets/javascripts/select-kit/addon/components/tag-drop.js b/app/assets/javascripts/select-kit/addon/components/tag-drop.js
index 7cd6ce8f4f5..404bc25f1e1 100644
--- a/app/assets/javascripts/select-kit/addon/components/tag-drop.js
+++ b/app/assets/javascripts/select-kit/addon/components/tag-drop.js
@@ -14,6 +14,8 @@ import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
+import TagDropHeader from "./tag-drop/tag-drop-header";
+import TagRow from "./tag-row";
export const NO_TAG_ID = "no-tags";
export const ALL_TAGS_ID = "all-tags";
@@ -30,7 +32,7 @@ const MORE_TAGS_COLLECTION = "MORE_TAGS_COLLECTION";
caretUpIcon: "caret-down",
fullWidthOnMobile: true,
filterable: true,
- headerComponent: "tag-drop/tag-drop-header",
+ headerComponent: TagDropHeader,
autoInsertNoneItem: false,
})
@pluginApiIdentifiers("tag-drop")
@@ -96,7 +98,7 @@ export default class TagDrop extends ComboBoxComponent {
}
modifyComponentForRow() {
- return "tag-row";
+ return TagRow;
}
@computed("tagId")
diff --git a/app/assets/javascripts/select-kit/addon/components/tag-group-chooser.js b/app/assets/javascripts/select-kit/addon/components/tag-group-chooser.js
index 60f2dac5115..ab8073ac974 100644
--- a/app/assets/javascripts/select-kit/addon/components/tag-group-chooser.js
+++ b/app/assets/javascripts/select-kit/addon/components/tag-group-chooser.js
@@ -8,6 +8,7 @@ import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
+import TagChooserRow from "./tag-chooser-row";
@classNames("tag-group-chooser", "tag-chooser")
@selectKitOptions({
@@ -21,7 +22,7 @@ export default class TagGroupChooser extends MultiSelectComponent {
@service tagUtils;
modifyComponentForRow() {
- return "tag-chooser-row";
+ return TagChooserRow;
}
@computed("tagGroups.[]")
diff --git a/app/assets/javascripts/select-kit/addon/components/topic-chooser.js b/app/assets/javascripts/select-kit/addon/components/topic-chooser.js
index b4dbcb6b374..d3e62cd7ab9 100644
--- a/app/assets/javascripts/select-kit/addon/components/topic-chooser.js
+++ b/app/assets/javascripts/select-kit/addon/components/topic-chooser.js
@@ -6,6 +6,7 @@ import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
+import TopicRow from "./topic-row";
@classNames("topic-chooser")
@selectKitOptions({
@@ -21,7 +22,7 @@ export default class TopicChooser extends ComboBoxComponent {
titleProperty = "title";
modifyComponentForRow() {
- return "topic-row";
+ return TopicRow;
}
search(filter) {
diff --git a/app/assets/javascripts/select-kit/addon/components/user-chooser.js b/app/assets/javascripts/select-kit/addon/components/user-chooser.js
index c46e68cf347..1db02622017 100644
--- a/app/assets/javascripts/select-kit/addon/components/user-chooser.js
+++ b/app/assets/javascripts/select-kit/addon/components/user-chooser.js
@@ -11,6 +11,7 @@ import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
+import UserRow from "./user-chooser/user-row";
export const CUSTOM_USER_SEARCH_OPTIONS = [];
@@ -33,7 +34,7 @@ export default class UserChooser extends MultiSelectComponent {
valueProperty = "username";
modifyComponentForRow() {
- return "user-chooser/user-row";
+ return UserRow;
}
@computed("value.[]")
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-chooser.js b/plugins/chat/assets/javascripts/discourse/components/chat-channel-chooser.js
index fa8e962dfc2..fadc3dcbd69 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-chooser.js
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-chooser.js
@@ -4,14 +4,16 @@ import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
+import ChatChannelChooserHeader from "./chat-channel-chooser-header";
+import ChatChannelChooserRow from "./chat-channel-chooser-row";
@classNames("chat-channel-chooser")
@selectKitOptions({
- headerComponent: "chat-channel-chooser-header",
+ headerComponent: ChatChannelChooserHeader,
})
@pluginApiIdentifiers("chat-channel-chooser")
export default class ChatChannelChooser extends ComboBoxComponent {
modifyComponentForRow() {
- return "chat-channel-chooser-row";
+ return ChatChannelChooserRow;
}
}