feat: Add AgentBot APIs (#2323)

This commit is contained in:
Sojan Jose
2021-06-01 22:34:25 +05:30
committed by GitHub
parent 9d16e52e33
commit 22965be6dc
31 changed files with 552 additions and 67 deletions

View File

@@ -1,8 +1,5 @@
export default {
computed: {
hideInputForBotConversations() {
return window.chatwootWebChannel.hideInputForBotConversations;
},
useInboxAvatarForBot() {
return window.chatwootWidgetDefaults.useInboxAvatarForBot;
},

View File

@@ -3,7 +3,6 @@ import configMixin from '../configMixin';
import Vue from 'vue';
global.chatwootWebChannel = {
hideInputForBotConversations: true,
avatarUrl: 'https://test.url',
hasAConnectedAgentBot: 'AgentBot',
enabledFeatures: ['emoji_picker', 'attachments'],
@@ -25,12 +24,10 @@ describe('configMixin', () => {
const wrapper = createWrapper(vm);
expect(wrapper.vm.hasEmojiPickerEnabled).toBe(true);
expect(wrapper.vm.hasAttachmentsEnabled).toBe(true);
expect(wrapper.vm.hideInputForBotConversations).toBe(true);
expect(wrapper.vm.hasAConnectedAgentBot).toBe(true);
expect(wrapper.vm.useInboxAvatarForBot).toBe(true);
expect(wrapper.vm.inboxAvatarUrl).toBe('https://test.url');
expect(wrapper.vm.channelConfig).toEqual({
hideInputForBotConversations: true,
avatarUrl: 'https://test.url',
hasAConnectedAgentBot: 'AgentBot',
enabledFeatures: ['emoji_picker', 'attachments'],

View File

@@ -62,10 +62,7 @@
leave-class="opacity-100 transform translate-y-0"
leave-to-class="opacity-0 transform "
>
<div
v-if="showInputTextArea && currentView === 'messageView'"
class="input-wrap"
>
<div v-if="currentView === 'messageView'" class="input-wrap">
<chat-footer />
</div>
<team-availability
@@ -146,15 +143,6 @@ export default {
fileUploadSizeLimit() {
return MAXIMUM_FILE_UPLOAD_SIZE;
},
showInputTextArea() {
if (this.hideInputForBotConversations) {
if (this.isOpen) {
return true;
}
return false;
}
return true;
},
isHeaderCollapsed() {
if (!this.hasIntroText || this.conversationSize) {
return true;