@capillarytech/creatives-library 8.0.65 → 8.0.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +7 -3
- package/v2Containers/Assets/images/whatsappOrZaloAccountIllustration.svg +11 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +2 -2
- package/v2Containers/Templates/constants.js +5 -0
- package/v2Containers/Templates/index.js +198 -104
- package/v2Containers/Templates/messages.js +12 -0
- package/v2Containers/Templates/reducer.js +7 -2
- package/v2Containers/Templates/sagas.js +6 -1
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +241 -83
- package/v2Containers/Templates/tests/mockData.js +31 -0
- package/v2Containers/Templates/tests/reducer.test.js +60 -0
- package/v2Containers/Whatsapp/constants.js +1 -39
- package/v2Containers/Whatsapp/index.js +13 -50
- package/v2Containers/Whatsapp/index.scss +0 -8
- package/v2Containers/Whatsapp/messages.js +0 -21
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +7738 -2600
- package/v2Containers/Whatsapp/tests/utils.test.js +2 -9
- package/v2Containers/Whatsapp/utils.js +4 -13
- package/v2Containers/Zalo/index.js +2 -1
- package/v2Containers/mockdata.js +133 -36
package/package.json
CHANGED
|
@@ -94,9 +94,13 @@ describe("Creatives testing template creation", () => {
|
|
|
94
94
|
name: globalMessages.email.defaultMessage,
|
|
95
95
|
});
|
|
96
96
|
await userEvent.click(whatsapp);
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
waitFor(() => {
|
|
98
|
+
expect(
|
|
99
|
+
creativesScreen.getByText(
|
|
100
|
+
/Whatsapp accounts are not setup for your brand/i
|
|
101
|
+
)
|
|
102
|
+
).toBeInTheDocument();
|
|
103
|
+
}, { timeout: 50000, interval: 500 });
|
|
100
104
|
await userEvent.click(line);
|
|
101
105
|
//assertions for template filters for line channel
|
|
102
106
|
expect(creativesScreen.getByText(/rich video message/i)).toBeInTheDocument();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="152" height="152" viewBox="0 0 152 152" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M86.9122 17.3023C106.492 7.08226 130.722 14.6223 141.322 44.7423C148.432 64.9823 149.082 88.5923 137.812 106.942C132.312 115.902 123.992 123.602 112.212 129.052C107.701 131.125 102.981 132.707 98.1322 133.772C97.6822 133.882 97.1622 133.992 96.6822 134.072C78.9322 137.702 59.5622 135.072 43.2022 128.072L42.8522 127.912C28.4122 121.622 16.3222 111.892 9.85221 99.9723C9.83606 99.944 9.8199 99.9125 9.80309 99.8796C9.77827 99.8312 9.75202 99.78 9.72221 99.7323C-0.927788 79.8523 8.75221 66.6223 16.0722 60.1623C18.7689 57.8105 21.8026 55.8757 25.0722 54.4223C34.0723 50.3945 42.7163 45.6142 50.9122 40.1323C62.9722 31.8323 75.7522 23.1323 86.9122 17.3023ZM35.1022 30.6523C35.1022 30.6523 27.7822 38.6523 32.4922 42.8423C36.1322 46.1023 47.4922 40.2323 48.1222 34.7123C48.6322 30.7523 42.4222 23.6723 35.1322 30.6523H35.1022ZM25.2122 46.1223C25.2122 46.1223 21.8422 45.2723 21.9622 49.1923C22.0822 53.1123 25.7522 51.3623 26.8322 50.5823C27.9122 49.8023 29.6322 46.9623 25.2122 46.1223Z" fill="#FFD24B"/>
|
|
3
|
+
<path d="M57.0425 61.592C53.7025 61.502 55.3525 61.242 59.4725 60.382C62.9825 59.652 67.6325 58.492 70.1325 56.702C79.1325 50.262 88.1325 50.122 93.2325 62.242C104.012 87.922 114.522 113.502 99.8525 134.772C99.8525 134.772 103.963 115.032 100.222 104.772C100.222 104.772 93.3525 114.152 82.9025 113.462C82.9025 113.462 99.9025 90.822 91.9025 83.042C91.9025 83.042 72.5125 73.042 74.4325 91.732C74.4325 91.732 76.6125 103.852 80.9825 109.802C80.9825 109.802 73.3325 109.342 69.1225 103.632C69.1225 103.632 66.7425 112.902 69.8825 135.632C69.8825 135.632 55.2025 118.202 68.1125 84.102C70.4025 78.122 84.2125 62.362 57.0425 61.592Z" fill="#103344"/>
|
|
4
|
+
<path d="M69.4523 132.793C66.3123 110.103 69.2123 103.603 69.2123 103.603C72.1223 107.543 76.6723 108.983 79.2123 109.503C79.5447 109.528 79.8631 109.364 80.0346 109.078C80.2061 108.792 80.2014 108.434 80.0223 108.153C76.3623 101.873 74.5323 91.7027 74.5323 91.7027C72.0523 72.0127 89.9823 77.7027 92.6923 81.8127C98.4323 90.6527 87.6323 106.813 83.9723 112.013C83.7754 112.277 83.7369 112.628 83.8718 112.928C84.0067 113.229 84.2938 113.434 84.6223 113.463C94.1323 113.123 100.272 104.743 100.272 104.743C104.012 115.033 99.8023 134.473 99.8023 134.473L99.3723 138.563L69.9123 135.623L69.4523 132.793Z" fill="white"/>
|
|
5
|
+
<path d="M90.2121 132.703C90.2068 135.463 88.2475 137.833 85.5375 138.357C82.8275 138.881 80.1259 137.412 79.0921 134.853C78.8219 134.182 78.6828 133.466 78.6821 132.743C78.6821 129.563 81.2721 123.643 84.4521 123.643C85.7743 123.783 86.9599 124.52 87.6721 125.643C88.0469 126.142 88.3813 126.67 88.6721 127.223C88.698 127.288 88.7281 127.351 88.7621 127.413C89.6281 129.048 90.1231 130.854 90.2121 132.703Z" fill="#A61426"/>
|
|
6
|
+
<path d="M89.8224 131.882C89.822 134.474 88.0962 136.749 85.6001 137.447C83.104 138.146 80.4481 137.097 79.1024 134.882C78.8322 134.211 78.693 133.495 78.6924 132.772C78.6924 129.592 81.2824 123.672 84.4624 123.672C85.7845 123.813 86.9702 124.549 87.6824 125.672C88.0571 126.171 88.3915 126.7 88.6824 127.252C88.7083 127.317 88.7383 127.381 88.7724 127.442C89.3938 128.844 89.7498 130.35 89.8224 131.882Z" fill="#D5192E"/>
|
|
7
|
+
<path d="M89.2124 130.993C89.2124 132.523 88.6045 133.99 87.5224 135.073C86.4403 136.155 84.9727 136.763 83.4424 136.763C81.7946 136.765 80.2265 136.054 79.1424 134.813C78.8722 134.142 78.7331 133.426 78.7324 132.703C78.7324 129.523 81.3224 123.603 84.5024 123.603C85.8246 123.743 87.0102 124.48 87.7224 125.603C88.6118 127.267 89.1207 129.108 89.2124 130.993Z" fill="#ED1D34"/>
|
|
8
|
+
<circle cx="78.2624" cy="58.3127" r="1.34" fill="white"/>
|
|
9
|
+
<circle cx="78.262" cy="58.3118" r="0.68" fill="black"/>
|
|
10
|
+
<ellipse cx="82.5535" cy="126.552" rx="1.51" ry="0.9" transform="rotate(-62.05 82.5535 126.552)" fill="#F47988"/>
|
|
11
|
+
</svg>
|
|
@@ -980,8 +980,8 @@ Click {{unsubscribe}} to unsubscribe
|
|
|
980
980
|
"base": Object {
|
|
981
981
|
"content": Object {
|
|
982
982
|
"whatsapp": Object {
|
|
983
|
-
"accessToken": "Bearer
|
|
984
|
-
"accountId": "
|
|
983
|
+
"accessToken": "Bearer abcd",
|
|
984
|
+
"accountId": "12345",
|
|
985
985
|
"buttonType": "CTA",
|
|
986
986
|
"buttons": Array [
|
|
987
987
|
Object {
|
|
@@ -73,3 +73,8 @@ export const GET_SENDER_DETAILS_FAILURE =
|
|
|
73
73
|
export const GET_CDN_TRANSFORMATION_CONFIG_REQUEST = 'app/v2Containers/Templates/GET_CDN_TRANSFORMATION_CONFIG_REQUEST';
|
|
74
74
|
export const GET_CDN_TRANSFORMATION_CONFIG_SUCCESS = 'app/v2Containers/Templates/GET_CDN_TRANSFORMATION_CONFIG_SUCCESS';
|
|
75
75
|
export const GET_CDN_TRANSFORMATION_CONFIG_FAILURE = 'app/v2Containers/Templates/GET_CDN_TRANSFORMATION_CONFIG_FAILURE';
|
|
76
|
+
|
|
77
|
+
export const ACCOUNT_MAPPING_ON_CHANNEL = {
|
|
78
|
+
whatsapp: 'selectedWhatsappAccount',
|
|
79
|
+
zalo: 'selectedZaloAccount',
|
|
80
|
+
};
|
|
@@ -21,6 +21,7 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
21
21
|
import find from 'lodash/find';
|
|
22
22
|
import map from 'lodash/map';
|
|
23
23
|
import { bindActionCreators } from 'redux';
|
|
24
|
+
import { Modal, Form} from 'antd';
|
|
24
25
|
import {
|
|
25
26
|
CapMenu,
|
|
26
27
|
CapDropdown,
|
|
@@ -96,16 +97,18 @@ import {
|
|
|
96
97
|
FACEBOOK as FACEBOOK_CHANNEL,
|
|
97
98
|
CREATE,
|
|
98
99
|
} from '../App/constants';
|
|
99
|
-
import {MAX_WHATSAPP_TEMPLATES, WARNING_WHATSAPP_TEMPLATES } from './constants';
|
|
100
|
+
import {MAX_WHATSAPP_TEMPLATES, WARNING_WHATSAPP_TEMPLATES , ACCOUNT_MAPPING_ON_CHANNEL} from './constants';
|
|
100
101
|
import { COPY_OF } from '../../containers/App/constants';
|
|
101
102
|
import {
|
|
103
|
+
TWILIO_CATEGORY_OPTIONS,
|
|
104
|
+
KARIX_GUPSHUP_CATEGORY_OPTIONS,
|
|
102
105
|
STATUS_OPTIONS,
|
|
103
106
|
CATEGORY,
|
|
104
107
|
WHATSAPP_CATEGORIES,
|
|
105
108
|
STATUS as WHATSAPP_STATUS,
|
|
106
109
|
WHATSAPP_STATUSES,
|
|
110
|
+
HOST_TWILIO,
|
|
107
111
|
HOST_GUPSHUP,
|
|
108
|
-
CATEGORY_OPTIONS_MAP,
|
|
109
112
|
} from '../Whatsapp/constants';
|
|
110
113
|
import { INAPP_LAYOUT_DETAILS } from '../InApp/constants';
|
|
111
114
|
import { ZALO_STATUS_OPTIONS, ZALO_STATUSES } from '../Zalo/constants';
|
|
@@ -123,6 +126,7 @@ import emailIllustration from '../Assets/images/emailIllustration.svg';
|
|
|
123
126
|
import smsIllustration from '../Assets/images/smsIllustration.svg';
|
|
124
127
|
import pushIllustration from '../Assets/images/pushIllustration.svg';
|
|
125
128
|
import whatsappIllustration from '../Assets/images/whatsappIllustration.png';
|
|
129
|
+
import whatsappOrZaloAccountIllustration from '../Assets/images/whatsappOrZaloAccountIllustration.svg';
|
|
126
130
|
import rcsIllustration from '../Assets/images/rcsIllustration.png';
|
|
127
131
|
import zaloillustration from '@capillarytech/cap-ui-library/assets/images/featureUiNotEnabledIllustration.svg';
|
|
128
132
|
import inAppIllustration from '@capillarytech/cap-ui-library/assets/images/featureUiNotEnabledIllustration.svg';
|
|
@@ -247,6 +251,26 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
247
251
|
this.delayTimer = 0;
|
|
248
252
|
}
|
|
249
253
|
|
|
254
|
+
// This function is to map the selected source account identifier and the connectionProperties data of domainPropertiesData object to get the hostName.
|
|
255
|
+
getHostName(selectedSourceAccountIdentifier, domainPropertiesData = []) {
|
|
256
|
+
if (!selectedSourceAccountIdentifier || isEmpty(domainPropertiesData)) {
|
|
257
|
+
this.setState({ hostName: '' });
|
|
258
|
+
return '';
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
const domainHostName = domainPropertiesData?.find(({ domainProperties }) => {
|
|
262
|
+
const {
|
|
263
|
+
connectionProperties: { account_sid, wabaId, userid, sourceAccountIdentifier, oa_id } = {},
|
|
264
|
+
} = domainProperties || {};
|
|
265
|
+
// If sourceAccountIdentifier is not present in the domainProperties object, then it will try to find in account_sid, wabaId, user_id.
|
|
266
|
+
// wabaId, user_id, account_sid are for Karix, Gupshup, and Twilio (Whatsapp) respectively and oa_id is for Zalo.
|
|
267
|
+
return [account_sid, wabaId, userid, oa_id, sourceAccountIdentifier].includes(selectedSourceAccountIdentifier);
|
|
268
|
+
})?.domainProperties?.hostName || '';
|
|
269
|
+
|
|
270
|
+
this.setState({ hostName: domainHostName });
|
|
271
|
+
return domainHostName;
|
|
272
|
+
}
|
|
273
|
+
|
|
250
274
|
componentWillMount() {
|
|
251
275
|
if (this.state.channel === '') {
|
|
252
276
|
let channel = '';
|
|
@@ -609,51 +633,65 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
609
633
|
if (!isEmpty(nextProps.Templates.templateDetails) && !isEqual(nextProps.Templates.templateDetails, this.props.Templates.templateDetails)) {
|
|
610
634
|
this.setState({ previewTemplate: nextProps.Templates.templateDetails });
|
|
611
635
|
}
|
|
612
|
-
const { weCrmAccounts: weCrmAccountsList = [], senderDetails
|
|
613
|
-
const weCrmChannels = [
|
|
636
|
+
const { weCrmAccounts: weCrmAccountsList = [], senderDetails = {} } = get(nextProps, 'Templates', {});
|
|
637
|
+
const weCrmChannels = [WHATSAPP_LOWERCASE, ZALO_LOWERCASE];
|
|
614
638
|
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
paramsDefault = {
|
|
619
|
-
name: this.state.searchText,
|
|
620
|
-
sortBy: this.state.sortBy,
|
|
621
|
-
};
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
const {name, sourceAccountIdentifier, configs } = weCrmAccountsList?.[0] || {};
|
|
639
|
+
// Keeping the wechat flow separate as it has different logic for setting the account. Currently we don't support wechat but still keeping the flow.
|
|
640
|
+
if (weCrmAccountsList?.length === 1 && this.state?.defaultAccount && selectedChannel === WECHAT_LOWERCASE && !isEmpty(senderDetails?.hostName)) {
|
|
641
|
+
const { sourceAccountIdentifier, configs } = weCrmAccountsList?.[0] || {};
|
|
625
642
|
const {
|
|
626
|
-
token,
|
|
627
643
|
wecrm_app_id,
|
|
628
644
|
wecrm_token
|
|
629
645
|
} = configs || {};
|
|
630
|
-
if (weCrmChannels.includes(selectedChannel)) {
|
|
631
|
-
if ([WHATSAPP_LOWERCASE, ZALO_LOWERCASE].includes(selectedChannel)) {
|
|
632
|
-
if (hostName === '') {
|
|
633
|
-
return;
|
|
634
|
-
}
|
|
635
646
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
paramsDefault.host = hostName || this.props.Templates?.senderDetails?.hostName || this.props.Templates?.selectedZaloAccount?.hostName || this.state.hostName;
|
|
643
|
-
}
|
|
644
|
-
} else {
|
|
645
|
-
paramsDefault.wecrmId = wecrm_app_id;
|
|
646
|
-
paramsDefault.wecrmToken = wecrm_token;
|
|
647
|
-
paramsDefault.originalId = sourceAccountIdentifier;
|
|
648
|
-
nextProps.actions.setWeChatAccount(
|
|
649
|
-
weCrmAccountsList[0],
|
|
650
|
-
);
|
|
651
|
-
}
|
|
652
|
-
|
|
647
|
+
const paramsDefault = {
|
|
648
|
+
wecrmId: wecrm_app_id,
|
|
649
|
+
wecrmToken: wecrm_token,
|
|
650
|
+
originalId: sourceAccountIdentifier,
|
|
651
|
+
name: this.state.searchText,
|
|
652
|
+
sortBy: this.state.sortBy,
|
|
653
653
|
}
|
|
654
|
+
nextProps.actions.setWeChatAccount(weCrmAccountsList[0]);
|
|
654
655
|
this.setState({ defaultAccount: false, activeMode: TEMPLATES_MODE, selectedAccount: weCrmAccountsList[0].name, hostName: weCrmAccountsList[0].hostName });
|
|
655
656
|
this.getAllTemplates({params: paramsDefault}, true);
|
|
656
657
|
}
|
|
658
|
+
|
|
659
|
+
if (weCrmAccountsList?.length && this.state?.defaultAccount && (weCrmChannels.includes(selectedChannel))) {
|
|
660
|
+
const isSingleAccount = weCrmAccountsList?.length === 1;
|
|
661
|
+
const selectedAccount = this.props.Templates[ACCOUNT_MAPPING_ON_CHANNEL[selectedChannel]] || {};
|
|
662
|
+
const hostName = this.getHostName(isSingleAccount ? weCrmAccountsList[0]?.sourceAccountIdentifier : selectedAccount?.sourceAccountIdentifier, senderDetails?.domainProperties);
|
|
663
|
+
|
|
664
|
+
if (!isEmpty(hostName)) {
|
|
665
|
+
const paramsDefault = {};
|
|
666
|
+
const {name, sourceAccountIdentifier, configs } = weCrmAccountsList?.[0] || {};
|
|
667
|
+
if (isSingleAccount) {
|
|
668
|
+
weCrmAccountsList[0].hostName = hostName;
|
|
669
|
+
} else {
|
|
670
|
+
selectedAccount.hostName = hostName;
|
|
671
|
+
}
|
|
672
|
+
nextProps.actions.setChannelAccount(selectedChannel?.toUpperCase(), isSingleAccount ? weCrmAccountsList[0] : selectedAccount);
|
|
673
|
+
if (selectedChannel === ZALO_LOWERCASE) {
|
|
674
|
+
paramsDefault.username = name;
|
|
675
|
+
paramsDefault.oa_id = sourceAccountIdentifier;
|
|
676
|
+
paramsDefault.token = configs?.token;
|
|
677
|
+
paramsDefault.host = hostName || this.props.Templates?.selectedZaloAccount?.hostName;
|
|
678
|
+
}
|
|
679
|
+
if (selectedChannel === WHATSAPP_LOWERCASE) {
|
|
680
|
+
paramsDefault.accountId = sourceAccountIdentifier;
|
|
681
|
+
paramsDefault.host = hostName || this.props.Templates?.selectedWhatsappAccount?.hostName;
|
|
682
|
+
paramsDefault.name = this.state.searchText;
|
|
683
|
+
paramsDefault.sortBy = this.state.sortBy;
|
|
684
|
+
}
|
|
685
|
+
this.setState({ defaultAccount: false });
|
|
686
|
+
/**
|
|
687
|
+
* Incase of multiple accounts, getAllTemplates is called on selecting the account. It's handled in onAccountSelect function.
|
|
688
|
+
* But for single account, onAccountSelect function won't get executed and getAllTemplates will be excuted.
|
|
689
|
+
*/
|
|
690
|
+
if (weCrmAccountsList?.length === 1) {
|
|
691
|
+
this.getAllTemplates({ params: paramsDefault }, true);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}
|
|
657
695
|
const zaloPreviewUrl = get(nextProps, 'Zalo.zaloTemplatePreviewData.versions.base.content.zalo.previewUrl', '');
|
|
658
696
|
if (zaloPreviewUrl && this.state.channel.toLowerCase() === ZALO_LOWERCASE) {
|
|
659
697
|
handlePreviewInNewTab(zaloPreviewUrl);
|
|
@@ -678,6 +716,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
678
716
|
params.sortBy = this.state.sortBy;
|
|
679
717
|
}
|
|
680
718
|
const selectedChannel = this.state.channel.toLowerCase();
|
|
719
|
+
const isZaloOrWhatsapp = [ZALO_LOWERCASE, WHATSAPP_LOWERCASE].includes(selectedChannel);
|
|
681
720
|
if (selectedChannel === 'wechat') {
|
|
682
721
|
params.wecrmId = this.props.Templates.weCrmAccounts[findIndex(this.props.Templates.weCrmAccounts, { name: value})].configs.wecrm_app_id;
|
|
683
722
|
params.wecrmToken = this.props.Templates.weCrmAccounts[findIndex(this.props.Templates.weCrmAccounts, { name: value})].configs.wecrm_token;
|
|
@@ -697,26 +736,41 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
697
736
|
} else {
|
|
698
737
|
this.setState({ selectedAccountError: false });
|
|
699
738
|
}
|
|
700
|
-
} else if ([LINE.toLowerCase(), RCS_LOWERCASE, ZALO_LOWERCASE].includes(selectedChannel)) {
|
|
739
|
+
} else if ([LINE.toLowerCase(), RCS_LOWERCASE, ZALO_LOWERCASE, WHATSAPP_LOWERCASE].includes(selectedChannel)) {
|
|
701
740
|
const setAcc = this.props?.Templates?.weCrmAccounts?.find((item) => item?.name === this.state.selectedAccount);
|
|
741
|
+
const { domainProperties = [] } = this.props?.Templates?.senderDetails || {};
|
|
742
|
+
let hostName = '';
|
|
743
|
+
if (isZaloOrWhatsapp) {
|
|
744
|
+
hostName = this.getHostName(setAcc?.sourceAccountIdentifier, domainProperties);
|
|
745
|
+
setAcc.hostName = hostName;
|
|
746
|
+
}
|
|
702
747
|
this.props.actions.setChannelAccount(selectedChannel?.toUpperCase(), setAcc);
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
748
|
+
|
|
749
|
+
const {
|
|
750
|
+
name = "",
|
|
751
|
+
sourceAccountIdentifier = "",
|
|
752
|
+
configs: { token = "" } = {},
|
|
753
|
+
} = setAcc || {};
|
|
754
|
+
|
|
755
|
+
if(selectedChannel === ZALO_LOWERCASE && hostName) {
|
|
709
756
|
params.username = name;
|
|
710
757
|
params.oa_id = sourceAccountIdentifier;
|
|
711
758
|
params.token = token;
|
|
712
759
|
params.isAccountSelection = true;
|
|
713
|
-
params.host =
|
|
760
|
+
params.host = hostName;
|
|
761
|
+
}
|
|
762
|
+
if (selectedChannel === WHATSAPP_LOWERCASE && hostName) {
|
|
763
|
+
params.accountId = sourceAccountIdentifier;
|
|
764
|
+
params.host = hostName;
|
|
714
765
|
}
|
|
715
766
|
}
|
|
716
767
|
|
|
717
|
-
this.setState({activeMode: TEMPLATES_MODE})
|
|
718
|
-
|
|
719
|
-
|
|
768
|
+
this.setState({ activeMode: TEMPLATES_MODE }, () => {
|
|
769
|
+
// Restrict getAllTemplates call only if selectedChannel is ZALO or WHATSAPP and hostName is empty
|
|
770
|
+
if (!(isZaloOrWhatsapp && !params?.host)) {
|
|
771
|
+
this.getAllTemplates({ params, resetPage: true });
|
|
772
|
+
}
|
|
773
|
+
});
|
|
720
774
|
});
|
|
721
775
|
}
|
|
722
776
|
onPaginationChange = () => {
|
|
@@ -794,6 +848,12 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
794
848
|
|
|
795
849
|
moment.locale(locale);
|
|
796
850
|
};
|
|
851
|
+
|
|
852
|
+
setWhatsappQueryParams = (queryParams, params) => {
|
|
853
|
+
queryParams.accountId = params?.accountId || this.props.Templates?.selectedWhatsappAccount?.sourceAccountIdentifier;
|
|
854
|
+
queryParams.host = params?.host || this.state?.hostName;
|
|
855
|
+
};
|
|
856
|
+
|
|
797
857
|
getAllTemplates = ({params, getNextPage, resetPage}, resetTemplates) => {
|
|
798
858
|
let queryParams = params || {};
|
|
799
859
|
let page = this.state.page;
|
|
@@ -822,6 +882,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
822
882
|
if (([MOBILE_PUSH_LOWERCASE, INAPP_LOWERCASE].includes(channel.toLowerCase())) && !isEmpty(this.props.Templates.selectedWeChatAccount)) {
|
|
823
883
|
queryParams.accountId = this.props.Templates?.selectedWeChatAccount?.id;
|
|
824
884
|
}
|
|
885
|
+
if (this.state?.channel?.toLowerCase() === WHATSAPP_LOWERCASE) {
|
|
886
|
+
this.setWhatsappQueryParams(queryParams, params);
|
|
887
|
+
}
|
|
825
888
|
this.props.actions.getAllTemplates(channel, queryParams,`${copyOf}`);
|
|
826
889
|
} else if ((resetPage || (page === 1 && this.state.templatesCount === 0) || page <= (this.state.templatesCount / this.state.perPageLimit))) {
|
|
827
890
|
if (getNextPage) {
|
|
@@ -871,6 +934,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
871
934
|
queryParams.token = token;
|
|
872
935
|
queryParams.host = hostName || this.props.Templates?.senderDetails?.hostName ||this.state.hostName;
|
|
873
936
|
}
|
|
937
|
+
if (this.state?.channel?.toLowerCase() === WHATSAPP_LOWERCASE) {
|
|
938
|
+
this.setWhatsappQueryParams(queryParams, params);
|
|
939
|
+
}
|
|
874
940
|
this.setState({ page, templatesCount }, () => {
|
|
875
941
|
queryParams.page = page;
|
|
876
942
|
queryParams.perPage = this.state.perPageLimit;
|
|
@@ -1017,7 +1083,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1017
1083
|
filteredTemplates = this.filterWechatTemplates(templates);
|
|
1018
1084
|
break;
|
|
1019
1085
|
case WHATSAPP:
|
|
1020
|
-
filteredTemplates = this.filterWhatsappTemplates(templates);
|
|
1086
|
+
filteredTemplates = this.state?.hostName ? this.filterWhatsappTemplates(templates) : [];
|
|
1021
1087
|
break;
|
|
1022
1088
|
case LINE:
|
|
1023
1089
|
filteredTemplates = this.filterLineTemplates(templates);
|
|
@@ -1378,16 +1444,16 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1378
1444
|
|
|
1379
1445
|
const accountId = get(this.props, 'Templates.selectedWeChatAccount.uuid');
|
|
1380
1446
|
const accounts = get(this.props, 'Templates.weCrmAccounts');
|
|
1381
|
-
const noWhatsappZaloTemplates = this.isFullMode() && isEmpty(templates);
|
|
1447
|
+
const noWhatsappZaloTemplates = this.isFullMode() && isEmpty(templates) || !this.state.hostName;
|
|
1382
1448
|
const noFilteredWhatsappZaloTemplates = this.isFullMode() && !isEmpty(templates) && isEmpty(filteredTemplates);
|
|
1383
|
-
const noApprovedWhatsappZaloTemplates = !this.isFullMode() && isEmpty(filteredTemplates)
|
|
1384
|
-
const showWhatsappIllustration = !isEmpty(this.props.Templates.selectedWhatsappAccount) && [WHATSAPP_LOWERCASE].includes(channelLowerCase);
|
|
1449
|
+
const noApprovedWhatsappZaloTemplates = !this.isFullMode() && isEmpty(filteredTemplates) && !isEmpty(this.state?.hostName);;
|
|
1450
|
+
const showWhatsappIllustration = (!isEmpty(this.props.Templates.selectedWhatsappAccount) && [WHATSAPP_LOWERCASE].includes(channelLowerCase)) || !this.state?.hostName ;
|
|
1385
1451
|
const showZaloIllustration = !isEmpty(this.props.Templates.selectedZaloAccount) && [ZALO_LOWERCASE].includes(channelLowerCase);
|
|
1386
1452
|
const showRcsIllustration = channelLowerCase === RCS_LOWERCASE && isEmpty(templates);
|
|
1387
1453
|
const showInAppIllustration = channelLowerCase === INAPP_LOWERCASE && isEmpty(templates);
|
|
1388
1454
|
const noLoaderAndSearchText = isEmpty(this.state.searchText) && !isLoading;
|
|
1389
1455
|
return (<div>
|
|
1390
|
-
{[WECHAT, MOBILE_PUSH, INAPP].includes(currentChannel) && this.showAccountName()}
|
|
1456
|
+
{[WECHAT, MOBILE_PUSH, INAPP, WHATSAPP, ZALO].includes(currentChannel) && this.showAccountName()}
|
|
1391
1457
|
{filterContent}
|
|
1392
1458
|
{[WHATSAPP, ZALO].includes(currentChannel) && this.selectedFilters()}
|
|
1393
1459
|
<CapCustomSkeleton loader={isLoading}>
|
|
@@ -1424,15 +1490,15 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1424
1490
|
isEmpty(filteredTemplates) &&
|
|
1425
1491
|
isEmpty(this.state.searchText) &&
|
|
1426
1492
|
<div style={this.isFullMode() ? { height: "calc(100vh - 325px)", overflow: 'auto'} : {}}>
|
|
1427
|
-
<CapIllustration buttonClassName={`create-new-${channelLowerCase}`} {...this.getChannelTypeIllustrationInfo(currentChannel)} />
|
|
1493
|
+
<CapIllustration buttonClassName={`create-new-${channelLowerCase}`} {...this.getChannelTypeIllustrationInfo(currentChannel, this.state?.hostName)} />
|
|
1428
1494
|
</div>
|
|
1429
1495
|
)
|
|
1430
1496
|
}
|
|
1431
1497
|
{(showWhatsappIllustration || showZaloIllustration) && (
|
|
1432
1498
|
noLoaderAndSearchText &&
|
|
1433
1499
|
<div style={this.isFullMode() ? { height: "calc(100vh - 325px)", overflow: 'auto' } : {}}>
|
|
1434
|
-
{noWhatsappZaloTemplates && <CapIllustration buttonClassName={`create-new-${channelLowerCase}`} {...this.getChannelTypeIllustrationInfo(currentChannel)} />}
|
|
1435
|
-
{noFilteredWhatsappZaloTemplates && this.whatsappZaloIllustrationText('noFilteredWhatsappZaloTemplatesTitle', 'noFilteredWhatsappZaloTemplatesDesc')}
|
|
1500
|
+
{noWhatsappZaloTemplates && <CapIllustration buttonClassName={`create-new-${channelLowerCase}`} {...this.getChannelTypeIllustrationInfo(currentChannel, isEmpty(this.state?.hostName))} />}
|
|
1501
|
+
{noFilteredWhatsappZaloTemplates && this.state?.hostName && this.whatsappZaloIllustrationText('noFilteredWhatsappZaloTemplatesTitle', 'noFilteredWhatsappZaloTemplatesDesc')}
|
|
1436
1502
|
{noApprovedWhatsappZaloTemplates && this.whatsappZaloIllustrationText('noApprovedWhatsappZaloTemplatesTitle', showWhatsappIllustration ? 'noApprovedWhatsappTemplatesDesc' : 'zaloDescIllustration')}
|
|
1437
1503
|
</div>
|
|
1438
1504
|
)
|
|
@@ -1577,6 +1643,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1577
1643
|
prepareWeChatPreviewData(template) {
|
|
1578
1644
|
if (template && template.versions && template.versions.base && !isEmpty(template.versions.base)) {
|
|
1579
1645
|
if (template.definition && template.definition.msgcontent && template.definition.msgcontent === "RICH_MEDIA_WECHAT") {
|
|
1646
|
+
console.log("prepareWeChatPreviewData", template, JSON.stringify(template), template.versions.base.mediaList, JSON.stringify(template.versions.base.mediaList));
|
|
1580
1647
|
return template.versions.base.mediaList;
|
|
1581
1648
|
}
|
|
1582
1649
|
return this.prepareWeChatMappedPreviewData(template.versions.base.content, template.versions.base.Tag, template.versions.base.data);
|
|
@@ -1836,6 +1903,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1836
1903
|
}
|
|
1837
1904
|
if (this.state.channel.toLowerCase() === MOBILE_PUSH_LOWERCASE) {
|
|
1838
1905
|
params.accountId = this.props.Templates.selectedWeChatAccount.id;
|
|
1906
|
+
} else if (this.state.channel.toLowerCase() === WHATSAPP_LOWERCASE) {
|
|
1907
|
+
params.accountId = this.props.Templates?.selectedWhatsappAccount?.sourceAccountIdentifier;
|
|
1908
|
+
params.host = this.state?.hostName;
|
|
1839
1909
|
}
|
|
1840
1910
|
this.delay(() => {
|
|
1841
1911
|
this.getAllTemplates({params, resetPage: true});
|
|
@@ -2439,7 +2509,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2439
2509
|
(rcsLoader !== undefined ? rcsLoader : false);
|
|
2440
2510
|
return isLoading;
|
|
2441
2511
|
}
|
|
2442
|
-
getChannelTypeIllustrationInfo = (type) => {
|
|
2512
|
+
getChannelTypeIllustrationInfo = (type, hostNameNotFound) => {
|
|
2443
2513
|
const { isFullMode, intl } = this.props;
|
|
2444
2514
|
const templateIntlMsg = intl.formatMessage(messages.template);
|
|
2445
2515
|
const templateText = isFullMode ? templateIntlMsg : '';
|
|
@@ -2465,16 +2535,28 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2465
2535
|
illustrationImage: pushIllustration,
|
|
2466
2536
|
title: <FormattedMessage {...messages.pushTitleIllustartion} values={{ template: templateText }} />,
|
|
2467
2537
|
};
|
|
2468
|
-
case WHATSAPP:
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2538
|
+
case WHATSAPP: {
|
|
2539
|
+
if (hostNameNotFound) {
|
|
2540
|
+
return {
|
|
2541
|
+
illustrationImage: whatsappOrZaloAccountIllustration,
|
|
2542
|
+
title: <FormattedMessage {...messages.whatsappAccountNotConfiguredTitle} />,
|
|
2543
|
+
description: <FormattedMessage {...messages.accountNotConfiguredDescription} />,
|
|
2544
|
+
descriptionPosition: 'bottom',
|
|
2545
|
+
descriptionClassName: 'illustration-desc zalo-illustration',
|
|
2546
|
+
buttonClassName: "zalo-illustration-button",
|
|
2547
|
+
};
|
|
2548
|
+
} else {
|
|
2549
|
+
return {
|
|
2550
|
+
buttonLabel: <FormattedMessage {...messages.newWhatsappTemplate} values={{ template: templateText }} />,
|
|
2551
|
+
onClick: this.createTemplate,
|
|
2552
|
+
illustrationImage: whatsappIllustration,
|
|
2553
|
+
title: <FormattedMessage {...messages.whatsappTitleIllustration} values={{ template: templateText }} />,
|
|
2554
|
+
description: <FormattedMessage {...messages.whatsappDescIllustration} />,
|
|
2555
|
+
descriptionPosition: 'bottom',
|
|
2556
|
+
descriptionClassName: 'illustration-desc',
|
|
2557
|
+
};
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2478
2560
|
case RCS:
|
|
2479
2561
|
return {
|
|
2480
2562
|
buttonLabel: <FormattedMessage {...messages.newRCSTemplate} values={{ template: templateText }} />,
|
|
@@ -2485,15 +2567,27 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2485
2567
|
descriptionPosition: 'bottom',
|
|
2486
2568
|
descriptionClassName: 'illustration-desc rcs-illustration',
|
|
2487
2569
|
};
|
|
2488
|
-
case ZALO:
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2570
|
+
case ZALO:{
|
|
2571
|
+
if (hostNameNotFound) {
|
|
2572
|
+
return {
|
|
2573
|
+
illustrationImage: whatsappOrZaloAccountIllustration,
|
|
2574
|
+
title: <FormattedMessage {...messages.zaloAccountNotConfiguredTitle} />,
|
|
2575
|
+
description: <FormattedMessage {...messages.accountNotConfiguredDescription} />,
|
|
2576
|
+
descriptionPosition: 'bottom',
|
|
2577
|
+
descriptionClassName: 'illustration-desc zalo-illustration',
|
|
2578
|
+
buttonClassName: "zalo-illustration-button",
|
|
2579
|
+
};
|
|
2580
|
+
} else {
|
|
2581
|
+
return {
|
|
2582
|
+
illustrationImage: zaloillustration,
|
|
2583
|
+
title: <FormattedMessage {...messages.zaloTitleIllustration} />,
|
|
2584
|
+
description: <FormattedMessage {...messages.zaloDescIllustration} />,
|
|
2585
|
+
descriptionPosition: 'bottom',
|
|
2586
|
+
descriptionClassName: 'illustration-desc zalo-illustration',
|
|
2587
|
+
buttonClassName: "zalo-illustration-button",
|
|
2588
|
+
};
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2497
2591
|
case INAPP:
|
|
2498
2592
|
return {
|
|
2499
2593
|
illustrationImage: inAppIllustration,
|
|
@@ -2555,15 +2649,14 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2555
2649
|
channel = channel.toUpperCase();
|
|
2556
2650
|
const { Templates: templates = {}, location = {} } = this.props;
|
|
2557
2651
|
const { query = {} } = location;
|
|
2558
|
-
const { weCrmAccounts = [], fetchingWeCrmAccounts = false, campaignSettings = {} } = templates;
|
|
2652
|
+
const { weCrmAccounts = [], fetchingWeCrmAccounts = false, campaignSettings = {}, senderDetails } = templates;
|
|
2559
2653
|
const isWechatChannel = channel === WECHAT;
|
|
2560
2654
|
const isMobilePushChannel = channel === MOBILE_PUSH;
|
|
2561
2655
|
const isInAppChannel = channel === INAPP;
|
|
2562
2656
|
const isFacebookChannel = channel === FACEBOOK;
|
|
2563
|
-
|
|
2564
|
-
if ([WECHAT, MOBILE_PUSH, INAPP, LINE, ZALO].includes(channel) && !isEmpty(weCrmAccounts) && !isFacebookChannel) {
|
|
2657
|
+
if ([WECHAT, MOBILE_PUSH, INAPP, LINE, ZALO, WHATSAPP].includes(channel) && !isEmpty(weCrmAccounts) && !isFacebookChannel) {
|
|
2565
2658
|
forEach(weCrmAccounts, (account) => {
|
|
2566
|
-
if ((isWechatChannel && account.configs && account.configs.is_wecrm_enabled) || [MOBILE_PUSH, INAPP, LINE, ZALO].includes(channel)) {
|
|
2659
|
+
if ((isWechatChannel && account.configs && account.configs.is_wecrm_enabled) || [MOBILE_PUSH, INAPP, LINE, ZALO, WHATSAPP].includes(channel)) {
|
|
2567
2660
|
if (query.type === 'embedded' && (!query.module || (query.module && query.module !== 'library'))) {
|
|
2568
2661
|
if (query.source_account_id && account.sourceAccountIdentifier === query.source_account_id) {
|
|
2569
2662
|
accountOptions.push(
|
|
@@ -2646,9 +2739,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2646
2739
|
break;
|
|
2647
2740
|
}
|
|
2648
2741
|
let showNoAccountHeader = isEmpty(weCrmAccounts) && !fetchingWeCrmAccounts;
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
}
|
|
2742
|
+
// Zalo and Whatsapp has dependencies on domainProperties to get the hostName. Show loader until the domainProperties are fetched.
|
|
2743
|
+
const isDomainPropertiesLoading = [WHATSAPP, ZALO].includes(channel) && senderDetails?.status === "REQUEST";
|
|
2652
2744
|
if (channel === FACEBOOK && !isEmpty(campaignSettings) ) {
|
|
2653
2745
|
const fbSetting = get(campaignSettings, 'accountSettings.socialAccountSettings.facebookAccountSettings', []);
|
|
2654
2746
|
const { orgUnitFacebookPageSettingsMap } = fbSetting[0] || {};
|
|
@@ -2667,7 +2759,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2667
2759
|
if (channel === WECHAT && !commonUtil.hasWechatFeatureEnabled()) {
|
|
2668
2760
|
showNoAccountHeader = true;
|
|
2669
2761
|
}
|
|
2670
|
-
return (<CapSkeleton loading={fetchingWeCrmAccounts} active paragraph={{ rows: 10 }}>
|
|
2762
|
+
return (<CapSkeleton loading={fetchingWeCrmAccounts || isDomainPropertiesLoading} active paragraph={{ rows: 10 }}>
|
|
2671
2763
|
{showNoAccountHeader ? <FormattedMessage {...noAccountHeader} /> :
|
|
2672
2764
|
<div style={{ overflowX: "auto", paddingBottom: CAP_SPACE_16 }}>
|
|
2673
2765
|
<CapHeader
|
|
@@ -2857,10 +2949,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2857
2949
|
}
|
|
2858
2950
|
}
|
|
2859
2951
|
|
|
2860
|
-
const getCategoryOptions = (hostName) => {
|
|
2861
|
-
return CATEGORY_OPTIONS_MAP[hostName];
|
|
2862
|
-
};
|
|
2863
|
-
|
|
2864
2952
|
const cmsTemplateSelectionContent = (
|
|
2865
2953
|
<CardGrid
|
|
2866
2954
|
className={""}
|
|
@@ -2874,7 +2962,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2874
2962
|
);
|
|
2875
2963
|
//TODO -> uncomment the following line
|
|
2876
2964
|
// const isfilterContentVisisble = !isEmpty(this.props.TemplatesList) || !isEmpty(this.state.searchText) || !isEmpty(this.props.Templates.templateError);
|
|
2877
|
-
|
|
2965
|
+
let isfilterContentVisisble = true;
|
|
2878
2966
|
const isWechatEmbedded = !this.props.isFullMode && channel.toUpperCase() === WECHAT;
|
|
2879
2967
|
const channelLowerCase = (channel || '').toLowerCase();
|
|
2880
2968
|
const isTraiDltFeature = this.checkDLTfeatureEnable();
|
|
@@ -2889,7 +2977,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2889
2977
|
className="create-new-link"
|
|
2890
2978
|
/>
|
|
2891
2979
|
)
|
|
2892
|
-
: this.state
|
|
2980
|
+
: this.state?.channel?.toLowerCase() === ZALO_LOWERCASE || (channelLowerCase === WHATSAPP_LOWERCASE && isEmpty(this.state?.hostName)) ? <></> : (
|
|
2893
2981
|
<CapButton
|
|
2894
2982
|
className={`create-new-${channelLowerCase} margin-l-8 margin-b-12`}
|
|
2895
2983
|
type={"primary"}
|
|
@@ -2903,7 +2991,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2903
2991
|
const isWhatsappCountExeeded = templatesCount >= MAX_WHATSAPP_TEMPLATES;
|
|
2904
2992
|
const showWhatsappCountWarning = templatesCount >= WARNING_WHATSAPP_TEMPLATES;
|
|
2905
2993
|
const whatsappCountExceedText = <FormattedMessage {...messages.whatsappMaxTemplates} values={{ maxCount: MAX_WHATSAPP_TEMPLATES }}/>;
|
|
2906
|
-
|
|
2994
|
+
if (([WHATSAPP_LOWERCASE, ZALO_LOWERCASE].includes(this.state?.channel?.toLocaleLowerCase()) && isEmpty(this.state?.hostName))) {
|
|
2995
|
+
isfilterContentVisisble = false;
|
|
2996
|
+
}
|
|
2907
2997
|
const filterContent = (( isfilterContentVisisble || [WECHAT, MOBILE_PUSH, INAPP].includes(this.state.channel.toUpperCase())) && <div className="action-container">
|
|
2908
2998
|
{isfilterContentVisisble && <CapInput.Search
|
|
2909
2999
|
className="search-text"
|
|
@@ -2932,7 +3022,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2932
3022
|
channel.toUpperCase() === ZALO && (
|
|
2933
3023
|
<div className="zalo-filters">
|
|
2934
3024
|
{
|
|
2935
|
-
this.props
|
|
3025
|
+
this.props?.isFullMode && this.state?.hostName ? (
|
|
2936
3026
|
<CapSelectFilter
|
|
2937
3027
|
placement="bottomLeft"
|
|
2938
3028
|
data={ZALO_STATUS_OPTIONS}
|
|
@@ -2951,7 +3041,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2951
3041
|
channel.toUpperCase() === WHATSAPP && (
|
|
2952
3042
|
<div className="whatsapp-filters">
|
|
2953
3043
|
{
|
|
2954
|
-
this.props
|
|
3044
|
+
this.props?.isFullMode && this.state?.hostName ? (
|
|
2955
3045
|
<CapSelectFilter
|
|
2956
3046
|
placement="bottomLeft"
|
|
2957
3047
|
data={STATUS_OPTIONS}
|
|
@@ -2963,16 +3053,20 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2963
3053
|
/>
|
|
2964
3054
|
) : null
|
|
2965
3055
|
}
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
3056
|
+
{this.state?.hostName ? (
|
|
3057
|
+
<CapSelectFilter
|
|
3058
|
+
placement="bottomLeft"
|
|
3059
|
+
data={this.state.hostName === HOST_TWILIO
|
|
3060
|
+
? TWILIO_CATEGORY_OPTIONS
|
|
3061
|
+
: KARIX_GUPSHUP_CATEGORY_OPTIONS}
|
|
3062
|
+
onSelect={this.setWhatsappCategory}
|
|
3063
|
+
selectedValue={this.state.selectedWhatsappCategory}
|
|
3064
|
+
placeholder="Category"
|
|
3065
|
+
showBadge
|
|
3066
|
+
width="105px"
|
|
3067
|
+
overlayStyle={{ overflowY: "hidden" }}
|
|
3068
|
+
/>
|
|
3069
|
+
) : null}
|
|
2976
3070
|
</div>
|
|
2977
3071
|
|
|
2978
3072
|
)
|
|
@@ -3045,7 +3139,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
3045
3139
|
}
|
|
3046
3140
|
<div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
|
|
3047
3141
|
{
|
|
3048
|
-
this.state
|
|
3142
|
+
this.state?.channel?.toLowerCase() === WHATSAPP_LOWERCASE && (isWhatsappCountExeeded)? (
|
|
3049
3143
|
<CapTooltip title={whatsappCountExceedText}>
|
|
3050
3144
|
<div className="button-disabled-tooltip-wrapper">
|
|
3051
3145
|
{createButton}
|
|
@@ -354,6 +354,18 @@ export default defineMessages({
|
|
|
354
354
|
id: `${scope}.whatsappDescIllustration`,
|
|
355
355
|
defaultMessage: 'These templates can be reused when creating a\nnew message content.',
|
|
356
356
|
},
|
|
357
|
+
"whatsappAccountNotConfiguredTitle": {
|
|
358
|
+
id: `${scope}.whatsappAccountNotConfiguredTitle`,
|
|
359
|
+
defaultMessage: 'Whatsapp account is not configured',
|
|
360
|
+
},
|
|
361
|
+
"accountNotConfiguredDescription": {
|
|
362
|
+
id: `${scope}.accountNotConfiguredDescription`,
|
|
363
|
+
defaultMessage: 'Please contact your Customer Success Manager to fix the issue.',
|
|
364
|
+
},
|
|
365
|
+
"zaloAccountNotConfiguredTitle": {
|
|
366
|
+
id: `${scope}.zaloAccountNotConfiguredTitle`,
|
|
367
|
+
defaultMessage: 'Zalo account is not configured',
|
|
368
|
+
},
|
|
357
369
|
"zaloTitleIllustration": {
|
|
358
370
|
id: `${scope}.zaloTitleIllustration`,
|
|
359
371
|
defaultMessage: 'There are no approved templates available',
|