-
-
+
+
+
import UserMessage from 'widget/components/UserMessage.vue';
import AgentMessageBubble from 'widget/components/AgentMessageBubble.vue';
+import MessageReplyButton from 'widget/components/MessageReplyButton.vue';
import timeMixin from 'dashboard/mixins/time';
import ImageBubble from 'widget/components/ImageBubble.vue';
import FileBubble from 'widget/components/FileBubble.vue';
@@ -72,6 +95,9 @@ import configMixin from '../mixins/configMixin';
import messageMixin from '../mixins/messageMixin';
import { isASubmittedFormMessage } from 'shared/helpers/MessageTypeHelper';
import darkModeMixin from 'widget/mixins/darkModeMixin.js';
+import ReplyToChip from 'widget/components/ReplyToChip.vue';
+import DragWrapper from 'widget/components/DragWrapper.vue';
+import { BUS_EVENTS } from 'shared/constants/busEvents';
export default {
name: 'AgentMessage',
@@ -81,6 +107,9 @@ export default {
Thumbnail,
UserMessage,
FileBubble,
+ MessageReplyButton,
+ ReplyToChip,
+ DragWrapper,
},
mixins: [timeMixin, configMixin, messageMixin, darkModeMixin],
props: {
@@ -88,6 +117,10 @@ export default {
type: Object,
default: () => {},
},
+ replyTo: {
+ type: Object,
+ default: () => {},
+ },
},
data() {
return {
@@ -180,6 +213,9 @@ export default {
'has-text': this.shouldDisplayAgentMessage,
};
},
+ hasReplyTo() {
+ return this.replyTo && (this.replyTo.content || this.replyTo.attachments);
+ },
},
watch: {
message() {
@@ -193,6 +229,9 @@ export default {
onImageLoadError() {
this.hasImageError = true;
},
+ toggleReply() {
+ bus.$emit(BUS_EVENTS.TOGGLE_REPLY_TO_MESSAGE, this.message);
+ },
},
};
diff --git a/app/javascript/widget/components/ChatFooter.vue b/app/javascript/widget/components/ChatFooter.vue
index 9de6d4275..2a8ef36dc 100755
--- a/app/javascript/widget/components/ChatFooter.vue
+++ b/app/javascript/widget/components/ChatFooter.vue
@@ -1,10 +1,20 @@