chore: remove zapi feature flag (#132)
This commit is contained in:
parent
c3a90803d1
commit
7a3544ba99
@ -41,7 +41,6 @@ export const FEATURE_FLAGS = {
|
|||||||
CAPTAIN_V2: 'captain_integration_v2',
|
CAPTAIN_V2: 'captain_integration_v2',
|
||||||
SAML: 'saml',
|
SAML: 'saml',
|
||||||
QUOTED_EMAIL_REPLY: 'quoted_email_reply',
|
QUOTED_EMAIL_REPLY: 'quoted_email_reply',
|
||||||
CHANNEL_ZAPI: 'channel_zapi',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const PREMIUM_FEATURES = [
|
export const PREMIUM_FEATURES = [
|
||||||
|
|||||||
@ -12,13 +12,10 @@ import { isValidURL } from '../../../../../helper/URLHelper';
|
|||||||
import NextButton from 'dashboard/components-next/button/Button.vue';
|
import NextButton from 'dashboard/components-next/button/Button.vue';
|
||||||
import Switch from 'dashboard/components-next/switch/Switch.vue';
|
import Switch from 'dashboard/components-next/switch/Switch.vue';
|
||||||
import PromoBanner from 'dashboard/components-next/banner/PromoBanner.vue';
|
import PromoBanner from 'dashboard/components-next/banner/PromoBanner.vue';
|
||||||
import { usePolicy } from 'dashboard/composables/usePolicy';
|
|
||||||
import { FEATURE_FLAGS } from 'dashboard/featureFlags';
|
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { isFeatureFlagEnabled } = usePolicy();
|
|
||||||
|
|
||||||
const inboxName = ref('');
|
const inboxName = ref('');
|
||||||
const phoneNumber = ref('');
|
const phoneNumber = ref('');
|
||||||
@ -99,10 +96,7 @@ const switchToZapi = () => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<form class="flex flex-wrap mx-0" @submit.prevent="createChannel()">
|
<form class="flex flex-wrap mx-0" @submit.prevent="createChannel()">
|
||||||
<div
|
<div class="w-full mb-6">
|
||||||
v-if="isFeatureFlagEnabled(FEATURE_FLAGS.CHANNEL_ZAPI)"
|
|
||||||
class="w-full mb-6"
|
|
||||||
>
|
|
||||||
<PromoBanner
|
<PromoBanner
|
||||||
:title="$t('INBOX_MGMT.ADD.WHATSAPP.ZAPI_PROMO.SWITCH_BANNER.TITLE')"
|
:title="$t('INBOX_MGMT.ADD.WHATSAPP.ZAPI_PROMO.SWITCH_BANNER.TITLE')"
|
||||||
:description="
|
:description="
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import { isPhoneE164OrEmpty, isNumber } from 'shared/helpers/Validators';
|
|||||||
|
|
||||||
import NextButton from 'dashboard/components-next/button/Button.vue';
|
import NextButton from 'dashboard/components-next/button/Button.vue';
|
||||||
import PromoBanner from 'dashboard/components-next/banner/PromoBanner.vue';
|
import PromoBanner from 'dashboard/components-next/banner/PromoBanner.vue';
|
||||||
import { FEATURE_FLAGS } from 'dashboard/featureFlags';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -30,15 +29,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
uiFlags: 'inboxes/getUIFlags',
|
uiFlags: 'inboxes/getUIFlags',
|
||||||
isFeatureEnabledonAccount: 'accounts/isFeatureEnabledonAccount',
|
|
||||||
accountId: 'getCurrentAccountId',
|
|
||||||
}),
|
}),
|
||||||
isZapiEnabled() {
|
|
||||||
return this.isFeatureEnabledonAccount(
|
|
||||||
this.accountId,
|
|
||||||
FEATURE_FLAGS.CHANNEL_ZAPI
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
validations: {
|
validations: {
|
||||||
inboxName: { required },
|
inboxName: { required },
|
||||||
@ -98,7 +89,7 @@ export default {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<form class="flex flex-wrap flex-col mx-0" @submit.prevent="createChannel()">
|
<form class="flex flex-wrap flex-col mx-0" @submit.prevent="createChannel()">
|
||||||
<div v-if="isZapiEnabled" class="mb-6">
|
<div class="mb-6">
|
||||||
<PromoBanner
|
<PromoBanner
|
||||||
:title="$t('INBOX_MGMT.ADD.WHATSAPP.ZAPI_PROMO.SWITCH_BANNER.TITLE')"
|
:title="$t('INBOX_MGMT.ADD.WHATSAPP.ZAPI_PROMO.SWITCH_BANNER.TITLE')"
|
||||||
:description="
|
:description="
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import NextButton from 'dashboard/components-next/button/Button.vue';
|
|||||||
import PromoBanner from 'dashboard/components-next/banner/PromoBanner.vue';
|
import PromoBanner from 'dashboard/components-next/banner/PromoBanner.vue';
|
||||||
import { isPhoneE164OrEmpty } from 'shared/helpers/Validators';
|
import { isPhoneE164OrEmpty } from 'shared/helpers/Validators';
|
||||||
import { parseAPIErrorResponse } from 'dashboard/store/utils/api';
|
import { parseAPIErrorResponse } from 'dashboard/store/utils/api';
|
||||||
import { FEATURE_FLAGS } from 'dashboard/featureFlags';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -41,8 +40,6 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
uiFlags: 'inboxes/getUIFlags',
|
uiFlags: 'inboxes/getUIFlags',
|
||||||
isFeatureEnabledonAccount: 'accounts/isFeatureEnabledonAccount',
|
|
||||||
accountId: 'getCurrentAccountId',
|
|
||||||
}),
|
}),
|
||||||
authTokeni18nKey() {
|
authTokeni18nKey() {
|
||||||
return this.useAPIKey ? 'API_KEY_SECRET' : 'AUTH_TOKEN';
|
return this.useAPIKey ? 'API_KEY_SECRET' : 'AUTH_TOKEN';
|
||||||
@ -50,12 +47,6 @@ export default {
|
|||||||
isWhatsApp() {
|
isWhatsApp() {
|
||||||
return this.type === 'whatsapp';
|
return this.type === 'whatsapp';
|
||||||
},
|
},
|
||||||
isZapiEnabled() {
|
|
||||||
return this.isFeatureEnabledonAccount(
|
|
||||||
this.accountId,
|
|
||||||
FEATURE_FLAGS.CHANNEL_ZAPI
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
validations() {
|
validations() {
|
||||||
let validations = {
|
let validations = {
|
||||||
@ -139,7 +130,7 @@ export default {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<form class="flex flex-wrap flex-col mx-0" @submit.prevent="createChannel()">
|
<form class="flex flex-wrap flex-col mx-0" @submit.prevent="createChannel()">
|
||||||
<div v-if="isWhatsApp && isZapiEnabled" class="mb-6">
|
<div v-if="isWhatsApp" class="mb-6">
|
||||||
<PromoBanner
|
<PromoBanner
|
||||||
:title="$t('INBOX_MGMT.ADD.WHATSAPP.ZAPI_PROMO.SWITCH_BANNER.TITLE')"
|
:title="$t('INBOX_MGMT.ADD.WHATSAPP.ZAPI_PROMO.SWITCH_BANNER.TITLE')"
|
||||||
:description="
|
:description="
|
||||||
|
|||||||
@ -10,13 +10,10 @@ import ChannelSelector from 'dashboard/components/ChannelSelector.vue';
|
|||||||
import BaileysWhatsapp from './BaileysWhatsapp.vue';
|
import BaileysWhatsapp from './BaileysWhatsapp.vue';
|
||||||
import ZapiWhatsapp from './ZapiWhatsapp.vue';
|
import ZapiWhatsapp from './ZapiWhatsapp.vue';
|
||||||
import PromoBanner from 'dashboard/components-next/banner/PromoBanner.vue';
|
import PromoBanner from 'dashboard/components-next/banner/PromoBanner.vue';
|
||||||
import { usePolicy } from 'dashboard/composables/usePolicy';
|
|
||||||
import { FEATURE_FLAGS } from 'dashboard/featureFlags';
|
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { isFeatureFlagEnabled } = usePolicy();
|
|
||||||
|
|
||||||
const PROVIDER_TYPES = {
|
const PROVIDER_TYPES = {
|
||||||
WHATSAPP: 'whatsapp',
|
WHATSAPP: 'whatsapp',
|
||||||
@ -62,16 +59,13 @@ const availableProviders = computed(() => {
|
|||||||
description: t('INBOX_MGMT.ADD.WHATSAPP.PROVIDERS.BAILEYS_DESC'),
|
description: t('INBOX_MGMT.ADD.WHATSAPP.PROVIDERS.BAILEYS_DESC'),
|
||||||
icon: 'i-woot-baileys',
|
icon: 'i-woot-baileys',
|
||||||
},
|
},
|
||||||
];
|
{
|
||||||
|
|
||||||
if (isFeatureFlagEnabled(FEATURE_FLAGS.CHANNEL_ZAPI)) {
|
|
||||||
providers.push({
|
|
||||||
key: PROVIDER_TYPES.ZAPI,
|
key: PROVIDER_TYPES.ZAPI,
|
||||||
title: t('INBOX_MGMT.ADD.WHATSAPP.PROVIDERS.ZAPI'),
|
title: t('INBOX_MGMT.ADD.WHATSAPP.PROVIDERS.ZAPI'),
|
||||||
description: t('INBOX_MGMT.ADD.WHATSAPP.PROVIDERS.ZAPI_DESC'),
|
description: t('INBOX_MGMT.ADD.WHATSAPP.PROVIDERS.ZAPI_DESC'),
|
||||||
icon: 'i-woot-zapi',
|
icon: 'i-woot-zapi',
|
||||||
});
|
},
|
||||||
}
|
];
|
||||||
|
|
||||||
return providers;
|
return providers;
|
||||||
});
|
});
|
||||||
@ -119,10 +113,7 @@ const handleManualLinkClick = () => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div class="mt-6 relative overflow-visible">
|
||||||
v-if="isFeatureFlagEnabled(FEATURE_FLAGS.CHANNEL_ZAPI)"
|
|
||||||
class="mt-6 relative overflow-visible"
|
|
||||||
>
|
|
||||||
<img
|
<img
|
||||||
src="~dashboard/assets/images/curved-arrow.svg"
|
src="~dashboard/assets/images/curved-arrow.svg"
|
||||||
alt=""
|
alt=""
|
||||||
|
|||||||
@ -222,6 +222,3 @@
|
|||||||
chatwoot_internal: true
|
chatwoot_internal: true
|
||||||
- name: quoted_email_reply
|
- name: quoted_email_reply
|
||||||
display_name: Quoted Email Reply
|
display_name: Quoted Email Reply
|
||||||
- name: channel_zapi
|
|
||||||
display_name: Z-API Channel
|
|
||||||
enabled: false
|
|
||||||
|
|||||||
@ -722,7 +722,7 @@ describe Whatsapp::IncomingMessageBaileysService do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context 'when processing multiple messages' do
|
context 'when processing multiple messages' do
|
||||||
it 'creates separate contacts and conversations for each message' do # rubocop:disable RSpec/ExampleLength
|
it 'creates separate contacts and conversations for each message' do
|
||||||
raw_message1 = {
|
raw_message1 = {
|
||||||
key: { id: 'msg_123', remoteJid: '5511912345678@s.whatsapp.net', fromMe: false },
|
key: { id: 'msg_123', remoteJid: '5511912345678@s.whatsapp.net', fromMe: false },
|
||||||
pushName: 'John Doe',
|
pushName: 'John Doe',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user