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',
|
||||
SAML: 'saml',
|
||||
QUOTED_EMAIL_REPLY: 'quoted_email_reply',
|
||||
CHANNEL_ZAPI: 'channel_zapi',
|
||||
};
|
||||
|
||||
export const PREMIUM_FEATURES = [
|
||||
|
||||
@ -12,13 +12,10 @@ import { isValidURL } from '../../../../../helper/URLHelper';
|
||||
import NextButton from 'dashboard/components-next/button/Button.vue';
|
||||
import Switch from 'dashboard/components-next/switch/Switch.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 store = useStore();
|
||||
const { t } = useI18n();
|
||||
const { isFeatureFlagEnabled } = usePolicy();
|
||||
|
||||
const inboxName = ref('');
|
||||
const phoneNumber = ref('');
|
||||
@ -99,10 +96,7 @@ const switchToZapi = () => {
|
||||
|
||||
<template>
|
||||
<form class="flex flex-wrap mx-0" @submit.prevent="createChannel()">
|
||||
<div
|
||||
v-if="isFeatureFlagEnabled(FEATURE_FLAGS.CHANNEL_ZAPI)"
|
||||
class="w-full mb-6"
|
||||
>
|
||||
<div class="w-full mb-6">
|
||||
<PromoBanner
|
||||
:title="$t('INBOX_MGMT.ADD.WHATSAPP.ZAPI_PROMO.SWITCH_BANNER.TITLE')"
|
||||
:description="
|
||||
|
||||
@ -8,7 +8,6 @@ import { isPhoneE164OrEmpty, isNumber } from 'shared/helpers/Validators';
|
||||
|
||||
import NextButton from 'dashboard/components-next/button/Button.vue';
|
||||
import PromoBanner from 'dashboard/components-next/banner/PromoBanner.vue';
|
||||
import { FEATURE_FLAGS } from 'dashboard/featureFlags';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -30,15 +29,7 @@ export default {
|
||||
computed: {
|
||||
...mapGetters({
|
||||
uiFlags: 'inboxes/getUIFlags',
|
||||
isFeatureEnabledonAccount: 'accounts/isFeatureEnabledonAccount',
|
||||
accountId: 'getCurrentAccountId',
|
||||
}),
|
||||
isZapiEnabled() {
|
||||
return this.isFeatureEnabledonAccount(
|
||||
this.accountId,
|
||||
FEATURE_FLAGS.CHANNEL_ZAPI
|
||||
);
|
||||
},
|
||||
},
|
||||
validations: {
|
||||
inboxName: { required },
|
||||
@ -98,7 +89,7 @@ export default {
|
||||
|
||||
<template>
|
||||
<form class="flex flex-wrap flex-col mx-0" @submit.prevent="createChannel()">
|
||||
<div v-if="isZapiEnabled" class="mb-6">
|
||||
<div class="mb-6">
|
||||
<PromoBanner
|
||||
:title="$t('INBOX_MGMT.ADD.WHATSAPP.ZAPI_PROMO.SWITCH_BANNER.TITLE')"
|
||||
:description="
|
||||
|
||||
@ -9,7 +9,6 @@ import NextButton from 'dashboard/components-next/button/Button.vue';
|
||||
import PromoBanner from 'dashboard/components-next/banner/PromoBanner.vue';
|
||||
import { isPhoneE164OrEmpty } from 'shared/helpers/Validators';
|
||||
import { parseAPIErrorResponse } from 'dashboard/store/utils/api';
|
||||
import { FEATURE_FLAGS } from 'dashboard/featureFlags';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -41,8 +40,6 @@ export default {
|
||||
computed: {
|
||||
...mapGetters({
|
||||
uiFlags: 'inboxes/getUIFlags',
|
||||
isFeatureEnabledonAccount: 'accounts/isFeatureEnabledonAccount',
|
||||
accountId: 'getCurrentAccountId',
|
||||
}),
|
||||
authTokeni18nKey() {
|
||||
return this.useAPIKey ? 'API_KEY_SECRET' : 'AUTH_TOKEN';
|
||||
@ -50,12 +47,6 @@ export default {
|
||||
isWhatsApp() {
|
||||
return this.type === 'whatsapp';
|
||||
},
|
||||
isZapiEnabled() {
|
||||
return this.isFeatureEnabledonAccount(
|
||||
this.accountId,
|
||||
FEATURE_FLAGS.CHANNEL_ZAPI
|
||||
);
|
||||
},
|
||||
},
|
||||
validations() {
|
||||
let validations = {
|
||||
@ -139,7 +130,7 @@ export default {
|
||||
|
||||
<template>
|
||||
<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
|
||||
:title="$t('INBOX_MGMT.ADD.WHATSAPP.ZAPI_PROMO.SWITCH_BANNER.TITLE')"
|
||||
:description="
|
||||
|
||||
@ -10,13 +10,10 @@ import ChannelSelector from 'dashboard/components/ChannelSelector.vue';
|
||||
import BaileysWhatsapp from './BaileysWhatsapp.vue';
|
||||
import ZapiWhatsapp from './ZapiWhatsapp.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 router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const { isFeatureFlagEnabled } = usePolicy();
|
||||
|
||||
const PROVIDER_TYPES = {
|
||||
WHATSAPP: 'whatsapp',
|
||||
@ -62,16 +59,13 @@ const availableProviders = computed(() => {
|
||||
description: t('INBOX_MGMT.ADD.WHATSAPP.PROVIDERS.BAILEYS_DESC'),
|
||||
icon: 'i-woot-baileys',
|
||||
},
|
||||
];
|
||||
|
||||
if (isFeatureFlagEnabled(FEATURE_FLAGS.CHANNEL_ZAPI)) {
|
||||
providers.push({
|
||||
{
|
||||
key: PROVIDER_TYPES.ZAPI,
|
||||
title: t('INBOX_MGMT.ADD.WHATSAPP.PROVIDERS.ZAPI'),
|
||||
description: t('INBOX_MGMT.ADD.WHATSAPP.PROVIDERS.ZAPI_DESC'),
|
||||
icon: 'i-woot-zapi',
|
||||
});
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
return providers;
|
||||
});
|
||||
@ -119,10 +113,7 @@ const handleManualLinkClick = () => {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="isFeatureFlagEnabled(FEATURE_FLAGS.CHANNEL_ZAPI)"
|
||||
class="mt-6 relative overflow-visible"
|
||||
>
|
||||
<div class="mt-6 relative overflow-visible">
|
||||
<img
|
||||
src="~dashboard/assets/images/curved-arrow.svg"
|
||||
alt=""
|
||||
|
||||
@ -222,6 +222,3 @@
|
||||
chatwoot_internal: true
|
||||
- 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
|
||||
|
||||
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 = {
|
||||
key: { id: 'msg_123', remoteJid: '5511912345678@s.whatsapp.net', fromMe: false },
|
||||
pushName: 'John Doe',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user