Feature: Send attachments to widget user (#621)
This commit is contained in:
parent
fe70843fae
commit
f7e5f1fabf
16 changed files with 317 additions and 92 deletions
|
@ -4,17 +4,7 @@
|
|||
:message="message.content"
|
||||
:status="message.status"
|
||||
/>
|
||||
<AgentMessage
|
||||
v-else
|
||||
:agent-name="agentName"
|
||||
:avatar-url="avatarUrl"
|
||||
:content-type="message.content_type"
|
||||
:message-content-attributes="message.content_attributes"
|
||||
:message-id="message.id"
|
||||
:message-type="message.message_type"
|
||||
:message="message.content"
|
||||
:show-avatar="message.showAvatar"
|
||||
/>
|
||||
<AgentMessage v-else :message="message" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -28,28 +18,15 @@ export default {
|
|||
UserMessage,
|
||||
},
|
||||
props: {
|
||||
message: Object,
|
||||
showAvatar: Boolean,
|
||||
message: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
isUserMessage() {
|
||||
return this.message.message_type === MESSAGE_TYPE.INCOMING;
|
||||
},
|
||||
agentName() {
|
||||
if (this.message.message_type === MESSAGE_TYPE.TEMPLATE) {
|
||||
return 'Bot';
|
||||
}
|
||||
|
||||
return this.message.sender ? this.message.sender.name : '';
|
||||
},
|
||||
avatarUrl() {
|
||||
if (this.message.message_type === MESSAGE_TYPE.TEMPLATE) {
|
||||
// eslint-disable-next-line
|
||||
return require('dashboard/assets/images/chatwoot_bot.png');
|
||||
}
|
||||
|
||||
return this.message.sender ? this.message.sender.avatar_url : '';
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue