Files
David TaylorandGitHub 666b5dddde DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733)
`discourse-common` was created in the past to share logic between the
'wizard' app and the main 'discourse' app. Since then, the wizard has
been consolidated into the main app, so the separation of
`discourse-common` is no longer useful.

This commit moves `discourse-common/(lib|utils)/*` into
`discourse/lib/*`, adds shims for the imports, and updates existing
uses in core.
2025-01-13 13:02:49 +00:00

44 lines
1.3 KiB
JavaScript

import Component from "@ember/component";
import { alias, equal } from "@ember/object/computed";
import { htmlSafe } from "@ember/template";
import discourseComputed from "discourse/lib/decorators";
export const NEW_TOPIC_SELECTION = "new_topic";
export const EXISTING_TOPIC_SELECTION = "existing_topic";
export const NEW_MESSAGE_SELECTION = "new_message";
export default class ChatToTopicSelector extends Component {
newTopicSelection = NEW_TOPIC_SELECTION;
existingTopicSelection = EXISTING_TOPIC_SELECTION;
newMessageSelection = NEW_MESSAGE_SELECTION;
selection = null;
@equal("selection", NEW_TOPIC_SELECTION) newTopic;
@equal("selection", EXISTING_TOPIC_SELECTION) existingTopic;
@equal("selection", NEW_MESSAGE_SELECTION) newMessage;
@alias("site.can_create_tag") canAddTags;
@alias("site.can_tag_pms") canTagMessages;
topicTitle = null;
categoryId = null;
tags = null;
selectedTopicId = null;
chatMessageIds = null;
chatChannelId = null;
@discourseComputed()
newTopicInstruction() {
return htmlSafe(this.instructionLabels[NEW_TOPIC_SELECTION]);
}
@discourseComputed()
existingTopicInstruction() {
return htmlSafe(this.instructionLabels[EXISTING_TOPIC_SELECTION]);
}
@discourseComputed()
newMessageInstruction() {
return htmlSafe(this.instructionLabels[NEW_MESSAGE_SELECTION]);
}
}