feat: enable Dialogflow integration all inboxes except email (#3285)

Fixes #2461

Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
Muhsin Keloth
2021-11-12 17:53:03 +05:30
committed by GitHub
parent d78cb67a2a
commit cf5f6d5a74
8 changed files with 29 additions and 8 deletions

View File

@@ -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;

View File

@@ -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 = {

View File

@@ -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,