0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-15 17:24:47 +08:00
discourse/plugins/chat/assets/javascripts/discourse/components/chat-to-topic-selector.js
David Taylor a2cab9a342
DEV: Update remaining core plugin components to native-class syntax (#28611)
Changes made using the ember-native-class-codemod, plus some manual tweaks
2024-08-29 12:16:52 +01:00

43 lines
1.3 KiB
JavaScript
Vendored

import Component from "@ember/component";
import { alias, equal } from "@ember/object/computed";
import { htmlSafe } from "@ember/template";
import discourseComputed from "discourse-common/utils/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]);
}
}