This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/plugins/chat/assets/javascripts/discourse/components/chat-to-topic-selector.js
Roman Rizzi 0a5f548635
DEV: Move discourse-chat to the core repo. (#18776)
As part of this move, we are also renaming `discourse-chat` to `chat`.
2022-11-02 10:41:30 -03:00

45 lines
1.3 KiB
JavaScript

import Component from "@ember/component";
import { htmlSafe } from "@ember/template";
import discourseComputed from "discourse-common/utils/decorators";
import { alias, equal } from "@ember/object/computed";
export const NEW_TOPIC_SELECTION = "newTopic";
export const EXISTING_TOPIC_SELECTION = "existingTopic";
export const NEW_MESSAGE_SELECTION = "newMessage";
export default Component.extend({
newTopicSelection: NEW_TOPIC_SELECTION,
existingTopicSelection: EXISTING_TOPIC_SELECTION,
newMessageSelection: NEW_MESSAGE_SELECTION,
selection: null,
newTopic: equal("selection", NEW_TOPIC_SELECTION),
existingTopic: equal("selection", EXISTING_TOPIC_SELECTION),
newMessage: equal("selection", NEW_MESSAGE_SELECTION),
canAddTags: alias("site.can_create_tag"),
canTagMessages: alias("site.can_tag_pms"),
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]);
},
});