mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
chore: Displayed WhatsApp API provider name in inbox settings (#5346)
This commit is contained in:
@@ -16,6 +16,9 @@ export default {
|
||||
channelType() {
|
||||
return this.inbox.channel_type;
|
||||
},
|
||||
whatsAppAPIProvider() {
|
||||
return this.inbox.provider || '';
|
||||
},
|
||||
isAPIInbox() {
|
||||
return this.channelType === INBOX_TYPES.API;
|
||||
},
|
||||
@@ -47,10 +50,22 @@ export default {
|
||||
isASmsInbox() {
|
||||
return this.channelType === INBOX_TYPES.SMS || this.isATwilioSMSChannel;
|
||||
},
|
||||
isATwilioWhatsappChannel() {
|
||||
isATwilioWhatsAppChannel() {
|
||||
const { medium: medium = '' } = this.inbox;
|
||||
return this.isATwilioChannel && medium === 'whatsapp';
|
||||
},
|
||||
isAWhatsAppCloudChannel() {
|
||||
return (
|
||||
this.channelType === INBOX_TYPES.WHATSAPP &&
|
||||
this.whatsAppAPIProvider === 'whatsapp_cloud'
|
||||
);
|
||||
},
|
||||
is360DialogWhatsAppChannel() {
|
||||
return (
|
||||
this.channelType === INBOX_TYPES.WHATSAPP &&
|
||||
this.whatsAppAPIProvider === 'default'
|
||||
);
|
||||
},
|
||||
chatAdditionalAttributes() {
|
||||
const { additional_attributes: additionalAttributes } = this.chat || {};
|
||||
return additionalAttributes || {};
|
||||
@@ -75,15 +90,15 @@ export default {
|
||||
badgeKey = this.facebookBadge;
|
||||
} else if (this.isATwilioChannel) {
|
||||
badgeKey = this.twilioBadge;
|
||||
} else if (this.isAWhatsappChannel) {
|
||||
} else if (this.isAWhatsAppChannel) {
|
||||
badgeKey = 'whatsapp';
|
||||
}
|
||||
return badgeKey || this.channelType;
|
||||
},
|
||||
isAWhatsappChannel() {
|
||||
isAWhatsAppChannel() {
|
||||
return (
|
||||
this.channelType === INBOX_TYPES.WHATSAPP ||
|
||||
this.isATwilioWhatsappChannel
|
||||
this.isATwilioWhatsAppChannel
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
@@ -109,7 +109,7 @@ describe('inboxMixin', () => {
|
||||
expect(wrapper.vm.isASmsInbox).toBe(true);
|
||||
});
|
||||
|
||||
it('isATwilioWhatsappChannel returns true if channel type is Twilio and medium is whatsapp', () => {
|
||||
it('isATwilioWhatsAppChannel returns true if channel type is Twilio and medium is WhatsApp', () => {
|
||||
const Component = {
|
||||
render() {},
|
||||
mixins: [inboxMixin],
|
||||
@@ -124,7 +124,7 @@ describe('inboxMixin', () => {
|
||||
};
|
||||
const wrapper = shallowMount(Component);
|
||||
expect(wrapper.vm.isATwilioChannel).toBe(true);
|
||||
expect(wrapper.vm.isATwilioWhatsappChannel).toBe(true);
|
||||
expect(wrapper.vm.isATwilioWhatsAppChannel).toBe(true);
|
||||
});
|
||||
|
||||
it('isAnEmailChannel returns true if channel type is email', () => {
|
||||
|
||||
Reference in New Issue
Block a user