DEV: Convert select-kit subclasses to native class syntax (#28491)

This covers all select-kit subclasses in core and core plugins

Followup to https://github.com/discourse/discourse/pull/28489
This commit is contained in:
David Taylor
2024-08-23 13:19:26 +01:00
committed by GitHub
parent bb04a1e0d3
commit fe6c91daa3
14 changed files with 248 additions and 220 deletions

View File

@ -1,14 +1,17 @@
import { classNames } from "@ember-decorators/component";
import ComboBoxComponent from "select-kit/components/combo-box";
import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
export default ComboBoxComponent.extend({
pluginApiIdentifiers: ["chat-channel-chooser"],
classNames: ["chat-channel-chooser"],
selectKitOptions: {
headerComponent: "chat-channel-chooser-header",
},
@classNames("chat-channel-chooser")
@selectKitOptions({
headerComponent: "chat-channel-chooser-header",
})
@pluginApiIdentifiers("chat-channel-chooser")
export default class ChatChannelChooser extends ComboBoxComponent {
modifyComponentForRow() {
return "chat-channel-chooser-row";
},
});
}
}

View File

@ -1,14 +1,18 @@
import { classNames } from "@ember-decorators/component";
import NotificationsButtonComponent from "select-kit/components/notifications-button";
import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
import { threadNotificationButtonLevels } from "discourse/plugins/chat/discourse/lib/chat-notification-levels";
export default NotificationsButtonComponent.extend({
pluginApiIdentifiers: ["thread-notifications-button"],
classNames: ["thread-notifications-button"],
content: threadNotificationButtonLevels,
selectKitOptions: {
i18nPrefix: "chat.thread.notifications",
showFullTitle: false,
btnCustomClasses: "btn-flat",
},
});
@classNames("thread-notifications-button")
@selectKitOptions({
i18nPrefix: "chat.thread.notifications",
showFullTitle: false,
btnCustomClasses: "btn-flat",
})
@pluginApiIdentifiers("thread-notifications-button")
export default class ChatThreadTrackingDropdown extends NotificationsButtonComponent {
content = threadNotificationButtonLevels;
}

View File

@ -1,14 +1,18 @@
import { classNames } from "@ember-decorators/component";
import NotificationsButtonComponent from "select-kit/components/notifications-button";
import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
import { threadNotificationButtonLevels } from "discourse/plugins/chat/discourse/lib/chat-notification-levels";
export default NotificationsButtonComponent.extend({
pluginApiIdentifiers: ["thread-notifications-button"],
classNames: ["thread-notifications-button"],
content: threadNotificationButtonLevels,
selectKitOptions: {
i18nPrefix: "chat.thread.notifications",
showFullTitle: false,
btnCustomClasses: "btn-flat",
},
});
@classNames("thread-notifications-button")
@selectKitOptions({
i18nPrefix: "chat.thread.notifications",
showFullTitle: false,
btnCustomClasses: "btn-flat",
})
@pluginApiIdentifiers("thread-notifications-button")
export default class ThreadNotificationsButton extends NotificationsButtonComponent {
content = threadNotificationButtonLevels;
}