feat: enable Dialogflow integration all inboxes except email (#3285)
Fixes #2461 Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
@@ -59,9 +59,10 @@ export default {
|
||||
...mapGetters({
|
||||
uiFlags: 'integrations/getUIFlags',
|
||||
websiteInboxes: 'inboxes/getWebsiteInboxes',
|
||||
dialogFlowEnabledInboxes: 'inboxes/dialogFlowEnabledInboxes',
|
||||
}),
|
||||
inboxes() {
|
||||
return this.websiteInboxes
|
||||
return this.dialogFlowEnabledInboxes
|
||||
.filter(inbox => {
|
||||
if (!this.isIntegrationDialogflow) {
|
||||
return true;
|
||||
|
||||
@@ -78,6 +78,11 @@ export const getters = {
|
||||
item => item.channel_type === INBOX_TYPES.TWILIO && item.medium === 'sms'
|
||||
);
|
||||
},
|
||||
dialogFlowEnabledInboxes($state) {
|
||||
return $state.records.filter(
|
||||
item => item.channel_type !== INBOX_TYPES.EMAIL
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export const actions = {
|
||||
|
||||
@@ -24,6 +24,11 @@ describe('#getters', () => {
|
||||
expect(getters.getTwilioSMSInboxes(state).length).toEqual(1);
|
||||
});
|
||||
|
||||
it('dialogFlowEnabledInboxes', () => {
|
||||
const state = { records: inboxList };
|
||||
expect(getters.dialogFlowEnabledInboxes(state).length).toEqual(5);
|
||||
});
|
||||
|
||||
it('getInbox', () => {
|
||||
const state = {
|
||||
records: inboxList,
|
||||
|
||||
Reference in New Issue
Block a user