feat: Add ability to create a new conversation if the previous conversation is resolved (#2512)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
@@ -22,10 +22,16 @@ export default {
|
||||
return window.chatwootWebChannel.preChatFormEnabled;
|
||||
},
|
||||
preChatFormOptions() {
|
||||
let requireEmail = false;
|
||||
let preChatMessage = '';
|
||||
const options = window.chatwootWebChannel.preChatFormOptions || {};
|
||||
if (!this.isOnNewConversation) {
|
||||
requireEmail = options.require_email;
|
||||
preChatMessage = options.pre_chat_message;
|
||||
}
|
||||
return {
|
||||
requireEmail: options.require_email,
|
||||
preChatMessage: options.pre_chat_message,
|
||||
requireEmail,
|
||||
preChatMessage,
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
@@ -6,6 +6,7 @@ global.chatwootWebChannel = {
|
||||
avatarUrl: 'https://test.url',
|
||||
hasAConnectedAgentBot: 'AgentBot',
|
||||
enabledFeatures: ['emoji_picker', 'attachments'],
|
||||
preChatFormOptions: { require_email: false, pre_chat_message: '' },
|
||||
};
|
||||
|
||||
global.chatwootWidgetDefaults = {
|
||||
@@ -31,6 +32,14 @@ describe('configMixin', () => {
|
||||
avatarUrl: 'https://test.url',
|
||||
hasAConnectedAgentBot: 'AgentBot',
|
||||
enabledFeatures: ['emoji_picker', 'attachments'],
|
||||
preChatFormOptions: {
|
||||
pre_chat_message: '',
|
||||
require_email: false,
|
||||
},
|
||||
});
|
||||
expect(wrapper.vm.preChatFormOptions).toEqual({
|
||||
requireEmail: false,
|
||||
preChatMessage: '',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user