@capillarytech/creatives-library 9.0.55-alpha.2 → 9.0.55
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/.vscode/settings.json +3 -0
- package/constants/unified.js +1 -0
- package/package.json +1 -1
- package/services/api.js +0 -12
- package/utils/common.js +4 -0
- package/v2Components/CommonTestAndPreview/UnifiedPreview/index.js +0 -13
- package/v2Components/CommonTestAndPreview/constants.js +0 -2
- package/v2Components/CommonTestAndPreview/index.js +4 -1
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/index.test.js +0 -106
- package/v2Components/CommonTestAndPreview/tests/constants.test.js +1 -9
- package/v2Containers/CommunicationFlow/CommunicationFlow.js +56 -109
- package/v2Containers/CommunicationFlow/CommunicationFlow.scss +1 -1
- package/v2Containers/CommunicationFlow/CommunicationFlowCard.js +6 -22
- package/v2Containers/CommunicationFlow/Tests/CommunicationFlow.test.js +49 -421
- package/v2Containers/CommunicationFlow/Tests/CommunicationFlowCard.test.js +2 -18
- package/v2Containers/CommunicationFlow/constants.js +4 -63
- package/v2Containers/CommunicationFlow/index.js +20 -15
- package/v2Containers/CommunicationFlow/messages.js +0 -4
- package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/SenderDetails.js +0 -6
- package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/Tests/SenderDetails.test.js +0 -25
- package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/Tests/deliverySettingsConfig.test.js +4 -11
- package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/deliverySettingsConfig.js +5 -19
- package/v2Containers/CreativesContainer/index.js +7 -1
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +5 -5
- package/v2Containers/Rcs/constants.js +1 -0
- package/v2Containers/Rcs/index.js +10 -1
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +120 -12
- package/v2Containers/Rcs/tests/index.test.js +121 -0
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +3 -3
- package/v2Containers/Templates/index.js +26 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +34 -34
- package/v2Containers/CommunicationFlow/Tests/constants.test.js +0 -85
|
@@ -38,68 +38,9 @@ export const CHANNEL_PRIORITY = 'CHANNEL_PRIORITY';
|
|
|
38
38
|
export const AB_TEST = 'AB_TEST';
|
|
39
39
|
export const SINGLE_TEMPLATE = 'SINGLE_TEMPLATE';
|
|
40
40
|
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// Mirrors CCS SingleChannelStrategy field names exactly (per Cap Notify API design samples and real create responses); kept separate from the legacy messageMeta CHANNEL_CONTENT_KEY_MAP/CHANNEL_DELIVERY_KEY_MAP.
|
|
45
|
-
export const CCS_CHANNEL_CONTENT_KEY_MAP = {
|
|
46
|
-
SMS: 'smsMessageContent',
|
|
47
|
-
EMAIL: 'emailMessageContent',
|
|
48
|
-
WHATSAPP: 'whatsappMessageContent',
|
|
49
|
-
// CCS's channel enum value for mobile push is 'PUSH' (verified against real create responses), even though the content/delivery keys stay 'mpush*'.
|
|
50
|
-
PUSH: 'mpushMessageContent',
|
|
51
|
-
INAPP: 'inAppMessageContent',
|
|
52
|
-
ANDROID: 'androidMessageContent',
|
|
53
|
-
IOS: 'iosMessageContent',
|
|
54
|
-
ZALO: 'zaloMessageContent',
|
|
55
|
-
VIBER: 'viberMessageContent',
|
|
56
|
-
LINE: 'lineMessageContent',
|
|
57
|
-
WEBPUSH: 'webPushMessageContent',
|
|
58
|
-
RCS: 'rcsMessageContent',
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// contentItem.templateData uses legacy messageMeta field names, so transform mismatched channel fields before sending to CCS; for EMAIL, map legacy `emailSubject`/`emailBody` to CCS's `messageSubject`/`messageBody`.
|
|
62
|
-
export const CCS_CONTENT_TRANSFORMS = {
|
|
63
|
-
EMAIL: (templateData = {}) => ({
|
|
64
|
-
messageSubject: templateData.emailSubject,
|
|
65
|
-
messageBody: templateData.emailBody || templateData.emailHtml,
|
|
66
|
-
}),
|
|
67
|
-
// SMS: legacy stores text as `messageBody`, while CCS expects `message`; map the field explicitly to avoid CCS returning smsMessageContent.message as null.
|
|
68
|
-
SMS: (templateData = {}) => ({
|
|
69
|
-
message: templateData.messageBody || '',
|
|
70
|
-
}),
|
|
71
|
-
// WEBPUSH: the legacy editor nests data under messageContent.content; flatten it to CCS's { messageSubject, accountId, content } shape and drop the legacy-only `offers` field.
|
|
72
|
-
WEBPUSH: (templateData = {}) => {
|
|
73
|
-
const inner = templateData.messageContent?.content || templateData;
|
|
74
|
-
return {
|
|
75
|
-
messageSubject: inner.messageSubject,
|
|
76
|
-
accountId: inner.accountId,
|
|
77
|
-
content: inner.content,
|
|
78
|
-
};
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const CCS_CHANNEL_DELIVERY_KEY_MAP = {
|
|
83
|
-
SMS: 'smsDeliverySettings',
|
|
84
|
-
EMAIL: 'emailDeliverySettings',
|
|
85
|
-
WHATSAPP: 'whatsappDeliverySettings',
|
|
86
|
-
PUSH: 'mpushDeliverySettings',
|
|
87
|
-
INAPP: 'inAppDeliverySettings',
|
|
88
|
-
ANDROID: 'androidDeliverySettings',
|
|
89
|
-
IOS: 'iosDeliverySettings',
|
|
90
|
-
ZALO: 'zaloDeliverySettings',
|
|
91
|
-
VIBER: 'viberDeliverySettings',
|
|
92
|
-
LINE: 'lineDeliverySettings',
|
|
93
|
-
WEBPUSH: 'webPushDeliverySettings',
|
|
94
|
-
RCS: 'rcsDeliverySettings',
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
// The UI uses `MOBILEPUSH`, while CCS uses `PUSH` for the channel enum (verified against real create responses); normalize this value before building the CCS payload, while retaining the `mpush*` content/delivery keys. All other channel identifiers pass through unchanged.
|
|
98
|
-
export const CCS_CHANNEL_NAME_MAP = {
|
|
99
|
-
MOBILEPUSH: 'PUSH',
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
// Channel config — single source of truth for CreativesContainer and TemplatesV2; paneKey is the TemplatesV2 defaultPanes key used by channelsToHide, and channelProp is the CreativesContainer channel prop that must match pane.key for the tab to be active.
|
|
41
|
+
// Channel config - single source of truth for CreativesContainer and TemplatesV2
|
|
42
|
+
// paneKey: TemplatesV2 defaultPanes object key (for channelsToHide)
|
|
43
|
+
// channelProp: CreativesContainer channel prop (must match pane.key for tab to be active)
|
|
103
44
|
export const CHANNELS = [
|
|
104
45
|
{
|
|
105
46
|
value: 'SMS',
|
|
@@ -291,4 +232,4 @@ export const INCENTIVE_TYPES = [
|
|
|
291
232
|
{
|
|
292
233
|
value: 'badges', label: <FormattedMessage {...messages.badges} />, isActive: false, disabled: false,
|
|
293
234
|
},
|
|
294
|
-
];
|
|
235
|
+
];
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import CommunicationFlow from './CommunicationFlow';
|
|
12
|
+
import { hasSupportEngagementModule } from '../../utils/common';
|
|
12
13
|
|
|
13
14
|
const CommunicationFlowContainer = ({
|
|
14
15
|
config,
|
|
@@ -17,16 +18,22 @@ const CommunicationFlowContainer = ({
|
|
|
17
18
|
onCancel,
|
|
18
19
|
onChange,
|
|
19
20
|
...otherProps
|
|
20
|
-
}) =>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
}) => {
|
|
22
|
+
if (!hasSupportEngagementModule()) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<CommunicationFlow
|
|
28
|
+
config={config}
|
|
29
|
+
initialData={initialData}
|
|
30
|
+
onSave={onSave}
|
|
31
|
+
onCancel={onCancel}
|
|
32
|
+
onChange={onChange}
|
|
33
|
+
{...otherProps}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
30
37
|
|
|
31
38
|
CommunicationFlowContainer.propTypes = {
|
|
32
39
|
config: PropTypes.shape({
|
|
@@ -80,13 +87,11 @@ CommunicationFlowContainer.propTypes = {
|
|
|
80
87
|
controls: PropTypes.array,
|
|
81
88
|
}),
|
|
82
89
|
}),
|
|
83
|
-
context: PropTypes.object, // ouId, campaignId, programId
|
|
84
|
-
//
|
|
85
|
-
useCCS: PropTypes.bool, // If false, skips the CCS createCommDefinition call on save. Defaults to true.
|
|
90
|
+
context: PropTypes.object, // ouId, campaignId, programId, etc.
|
|
91
|
+
useCCS: PropTypes.bool, // If false, skips CCS bulk-claim-approve on save. Defaults to true.
|
|
86
92
|
}).isRequired,
|
|
87
93
|
initialData: PropTypes.object, // for edit/preview mode
|
|
88
|
-
onSave: PropTypes.func.isRequired, // (data) => void - called when user saves
|
|
89
|
-
// ({id, referenceId, version, status}) is present when the CCS create succeeded
|
|
94
|
+
onSave: PropTypes.func.isRequired, // (data) => void - called when user saves
|
|
90
95
|
onCancel: PropTypes.func.isRequired, // () => void - called when user cancels
|
|
91
96
|
onChange: PropTypes.func, // (data) => void - optional, called on data changes
|
|
92
97
|
};
|
|
@@ -363,8 +363,4 @@ export default {
|
|
|
363
363
|
id: `${prefix}.senderNotConfiguredError`,
|
|
364
364
|
defaultMessage: 'Selected domain gateway id is not correct. Please change the domain id or contact the gateway team to register them with Capillary.',
|
|
365
365
|
},
|
|
366
|
-
duplicateReferenceIdError: {
|
|
367
|
-
id: `${prefix}.duplicateReferenceIdError`,
|
|
368
|
-
defaultMessage: 'This reference ID is already in use in your organization. Please use a different reference ID.',
|
|
369
|
-
},
|
|
370
366
|
};
|
|
@@ -29,7 +29,6 @@ import {
|
|
|
29
29
|
getEmailDefaultsForDomainId,
|
|
30
30
|
getSmsDefaultsForDomainId,
|
|
31
31
|
getRcsAccountName,
|
|
32
|
-
getEmailDomainGatewayMapIdByDomainId,
|
|
33
32
|
} from './deliverySettingsConfig';
|
|
34
33
|
import messages from '../../messages';
|
|
35
34
|
import './SenderDetails.scss';
|
|
@@ -152,11 +151,6 @@ const SenderDetails = ({
|
|
|
152
151
|
saveValues.whatsappDomainId = matchedDomain?.domainProperties?.id ?? matchedDomain?.domainId ?? matchedDomain?.id;
|
|
153
152
|
}
|
|
154
153
|
}
|
|
155
|
-
// Include EMAIL domainGatewayMapId derived from the selected domain for persistence -
|
|
156
|
-
// CCS needs it alongside domainId, but it's not a user-facing field.
|
|
157
|
-
if (entity && fieldValues.emailDomain != null && fieldValues.emailDomain !== '') {
|
|
158
|
-
saveValues.emailDomainGatewayMapId = getEmailDomainGatewayMapIdByDomainId(entity, fieldValues.emailDomain);
|
|
159
|
-
}
|
|
160
154
|
onSave(saveValues);
|
|
161
155
|
}
|
|
162
156
|
onClose();
|
package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/Tests/SenderDetails.test.js
CHANGED
|
@@ -83,7 +83,6 @@ const ENTITIES = {
|
|
|
83
83
|
emailTwoDomains: {
|
|
84
84
|
EMAIL: [
|
|
85
85
|
{
|
|
86
|
-
id: 'gwmap-a',
|
|
87
86
|
domainProperties: {
|
|
88
87
|
id: 'em-a',
|
|
89
88
|
domainName: 'Mail Alpha',
|
|
@@ -102,7 +101,6 @@ const ENTITIES = {
|
|
|
102
101
|
},
|
|
103
102
|
},
|
|
104
103
|
{
|
|
105
|
-
id: 'gwmap-b',
|
|
106
104
|
domainProperties: {
|
|
107
105
|
id: 'em-b',
|
|
108
106
|
domainName: 'Mail Beta',
|
|
@@ -324,29 +322,6 @@ describe('SenderDetails', () => {
|
|
|
324
322
|
});
|
|
325
323
|
});
|
|
326
324
|
|
|
327
|
-
it('persists emailDomainGatewayMapId derived from the selected email domain on save', async () => {
|
|
328
|
-
const { onSave } = renderSenderDetails({
|
|
329
|
-
channels: ['EMAIL'],
|
|
330
|
-
preloadedDomainProperties: ENTITIES.emailTwoDomains,
|
|
331
|
-
});
|
|
332
|
-
const root = document.querySelector('.sender-details');
|
|
333
|
-
await waitFor(() => expect(within(root).getByText('Mail Alpha')).toBeInTheDocument());
|
|
334
|
-
|
|
335
|
-
await openSelectAndChoose(root, 0, 'Mail Beta');
|
|
336
|
-
await waitFor(() => expect(within(root).getByText('beta@other.com')).toBeInTheDocument());
|
|
337
|
-
|
|
338
|
-
const saveBtn = within(root).getByRole('button', { name: /save changes/i });
|
|
339
|
-
await waitFor(() => expect(saveBtn).not.toBeDisabled());
|
|
340
|
-
fireEvent.click(saveBtn);
|
|
341
|
-
|
|
342
|
-
expect(onSave).toHaveBeenCalledWith(
|
|
343
|
-
expect.objectContaining({
|
|
344
|
-
emailDomain: 'em-b',
|
|
345
|
-
emailDomainGatewayMapId: 'gwmap-b',
|
|
346
|
-
}),
|
|
347
|
-
);
|
|
348
|
-
});
|
|
349
|
-
|
|
350
325
|
it('resets email domain row back to the first gateway', async () => {
|
|
351
326
|
renderSenderDetails({
|
|
352
327
|
channels: ['EMAIL'],
|
|
@@ -438,7 +438,6 @@ describe('deliverySettingsConfig — user-facing flows', () => {
|
|
|
438
438
|
smsDomain: 'd1',
|
|
439
439
|
smsSenderId: 'g1',
|
|
440
440
|
emailDomain: 'ed',
|
|
441
|
-
emailDomainGatewayMapId: 'gwmap-1',
|
|
442
441
|
emailSenderId: 'mail@x.com',
|
|
443
442
|
emailSenderName: 'N',
|
|
444
443
|
emailReplyToId: 'r@x.com',
|
|
@@ -456,10 +455,9 @@ describe('deliverySettingsConfig — user-facing flows', () => {
|
|
|
456
455
|
SMS: { domainId: 'd1', gsmSenderId: 'g1' },
|
|
457
456
|
EMAIL: {
|
|
458
457
|
domainId: 'ed',
|
|
459
|
-
|
|
460
|
-
senderId: 'mail@x.com',
|
|
458
|
+
senderEmail: 'mail@x.com',
|
|
461
459
|
senderLabel: 'N',
|
|
462
|
-
|
|
460
|
+
senderReplyTo: 'r@x.com',
|
|
463
461
|
},
|
|
464
462
|
WHATSAPP: { domainId: 'wd', senderMobNum: '+w' },
|
|
465
463
|
RCS: { senderMobNum: '+r', rcsSender: '+r' },
|
|
@@ -474,10 +472,9 @@ describe('deliverySettingsConfig — user-facing flows', () => {
|
|
|
474
472
|
SMS: { domainId: 'd', gsmSenderId: 'g' },
|
|
475
473
|
EMAIL: {
|
|
476
474
|
domainId: 'ed',
|
|
477
|
-
|
|
478
|
-
senderId: 'e@e.com',
|
|
475
|
+
senderEmail: 'e@e.com',
|
|
479
476
|
senderLabel: 'L',
|
|
480
|
-
|
|
477
|
+
senderReplyTo: 'r@e.com',
|
|
481
478
|
},
|
|
482
479
|
WHATSAPP: { senderMobNum: '+w', domainId: 'wid' },
|
|
483
480
|
RCS: { rcsSender: '+r' },
|
|
@@ -489,10 +486,6 @@ describe('deliverySettingsConfig — user-facing flows', () => {
|
|
|
489
486
|
smsDomain: 'd',
|
|
490
487
|
smsSenderId: 'g',
|
|
491
488
|
emailDomain: 'ed',
|
|
492
|
-
emailDomainGatewayMapId: 'gwmap-2',
|
|
493
|
-
emailSenderId: 'e@e.com',
|
|
494
|
-
emailSenderName: 'L',
|
|
495
|
-
emailReplyToId: 'r@e.com',
|
|
496
489
|
whatsappDomainId: 'wid',
|
|
497
490
|
viberSenderId: 'vx',
|
|
498
491
|
});
|
|
@@ -181,12 +181,6 @@ const getEmailDomainValue = (entity) => {
|
|
|
181
181
|
return emailData.domainProperties?.id ?? emailData.domainId ?? emailData.id ?? '';
|
|
182
182
|
};
|
|
183
183
|
|
|
184
|
-
// CCS's domainGatewayMapId is the domainProperties API's outer `id`, distinct from domainProperties.id (the numeric domainId); it identifies the domain-gateway mapping for the selected domain.
|
|
185
|
-
const getEmailDomainGatewayMapIdByDomainId = (entity, domainId) => {
|
|
186
|
-
const domainEntry = getEmailDomainById(entity, domainId);
|
|
187
|
-
return domainEntry?.id ?? '';
|
|
188
|
-
};
|
|
189
|
-
|
|
190
184
|
/** Domain name for summary display (parseEntityForDisplay) */
|
|
191
185
|
const getEmailDomainNameForDisplay = (entity) => {
|
|
192
186
|
const emailData = getEmailData(entity);
|
|
@@ -268,8 +262,6 @@ const getEmailDefaultsForDomain = (domainData) => {
|
|
|
268
262
|
* context.fieldValues has current form state (e.g. selected emailDomain)
|
|
269
263
|
* Aligned with adiona-ui/cap-campaigns-v2: default = contactInfo item with default:true, or first
|
|
270
264
|
*/
|
|
271
|
-
export { getEmailDomainGatewayMapIdByDomainId };
|
|
272
|
-
|
|
273
265
|
export const getDefaultValueForField = (fieldKey, entity, context = {}) => {
|
|
274
266
|
if (!entity) return '';
|
|
275
267
|
const fieldValues = context?.fieldValues || {};
|
|
@@ -582,10 +574,7 @@ export const parseEntityForDisplay = (entity, context = {}) => {
|
|
|
582
574
|
senderDetails: entity,
|
|
583
575
|
smsSenderId: getSmsSenderIdValue(entity),
|
|
584
576
|
smsDomain: getSmsDomainValue(entity),
|
|
585
|
-
// emailDomain here is the domain NAME (for display only) - buildChannelSettingFromFieldValues needs the numeric domainId/domainGatewayMapId, sourced separately below.
|
|
586
577
|
emailDomain: getEmailDomainNameForDisplay(entity),
|
|
587
|
-
emailDomainId: getEmailDomainValue(entity),
|
|
588
|
-
emailDomainGatewayMapId: getEmailDomainGatewayMapIdByDomainId(entity, getEmailDomainValue(entity)),
|
|
589
578
|
emailSenderId: getEmailSenderIdValue(entity),
|
|
590
579
|
viberSenderId: getSenderIdFromContactInfo(entity, 'VIBER'),
|
|
591
580
|
zaloSenderId: getSenderIdFromContactInfo(entity, 'ZALO'),
|
|
@@ -611,12 +600,10 @@ export const buildChannelSettingFromFieldValues = (fieldValues = {}) => {
|
|
|
611
600
|
}
|
|
612
601
|
if (fieldValues.emailDomain != null || fieldValues.emailSenderId != null || fieldValues.emailSenderName != null || fieldValues.emailReplyToId != null) {
|
|
613
602
|
channelSetting.EMAIL = {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
domainGatewayMapId: fieldValues.emailDomainGatewayMapId,
|
|
617
|
-
senderId: fieldValues.emailSenderId,
|
|
603
|
+
domainId: fieldValues.emailDomain,
|
|
604
|
+
senderEmail: fieldValues.emailSenderId,
|
|
618
605
|
senderLabel: fieldValues.emailSenderName,
|
|
619
|
-
|
|
606
|
+
senderReplyTo: fieldValues.emailReplyToId,
|
|
620
607
|
};
|
|
621
608
|
}
|
|
622
609
|
if (fieldValues.whatsappSenderNumber != null || fieldValues.whatsappAccount != null) {
|
|
@@ -686,10 +673,9 @@ export const parseChannelSettingForDisplay = (channelSetting = {}) => {
|
|
|
686
673
|
}
|
|
687
674
|
if (channelSetting.EMAIL) {
|
|
688
675
|
out.emailDomain = channelSetting.EMAIL.domainId;
|
|
689
|
-
out.
|
|
690
|
-
out.emailSenderId = channelSetting.EMAIL.senderId;
|
|
676
|
+
out.emailSenderId = channelSetting.EMAIL.senderEmail;
|
|
691
677
|
out.emailSenderName = channelSetting.EMAIL.senderLabel;
|
|
692
|
-
out.emailReplyToId = channelSetting.EMAIL.
|
|
678
|
+
out.emailReplyToId = channelSetting.EMAIL.senderReplyTo;
|
|
693
679
|
}
|
|
694
680
|
if (channelSetting.WHATSAPP) {
|
|
695
681
|
out.whatsappSenderNumber = channelSetting.WHATSAPP.senderMobNum;
|
|
@@ -1441,7 +1441,12 @@ export class Creatives extends React.Component {
|
|
|
1441
1441
|
cardType = "",
|
|
1442
1442
|
cardSettings = {},
|
|
1443
1443
|
accountId = "",
|
|
1444
|
+
vfTemplateId: vfTemplateIdFromPayload,
|
|
1444
1445
|
} = get(versions, 'base.content.RCS.rcsContent', {});
|
|
1446
|
+
const { templateId: rootTemplateId = '' } = versions || {};
|
|
1447
|
+
const vfTemplateId = vfTemplateIdFromPayload
|
|
1448
|
+
|| get(this.state.templateData, 'versions.base.content.RCS.rcsContent.vfTemplateId', '')
|
|
1449
|
+
|| rootTemplateId;
|
|
1445
1450
|
const firstCardFromSubmit = Array.isArray(cardContentFromSubmit)
|
|
1446
1451
|
? cardContentFromSubmit[0]
|
|
1447
1452
|
: null;
|
|
@@ -1469,6 +1474,7 @@ export class Creatives extends React.Component {
|
|
|
1469
1474
|
creativeName: name,
|
|
1470
1475
|
rcsContent,
|
|
1471
1476
|
accountId,
|
|
1477
|
+
...(vfTemplateId && { templateId: vfTemplateId }),
|
|
1472
1478
|
...(includeRootRcsCardVarMappedOnConsumerPayload
|
|
1473
1479
|
? { rcsCardVarMapped: cardVarMappedFromFirstRcsCard }
|
|
1474
1480
|
: {}),
|
|
@@ -2456,7 +2462,7 @@ export class Creatives extends React.Component {
|
|
|
2456
2462
|
)}
|
|
2457
2463
|
handleClose={this.handleCloseSlideBox}
|
|
2458
2464
|
show={showSlideBox}
|
|
2459
|
-
size="size-
|
|
2465
|
+
size="size-xl"
|
|
2460
2466
|
/>
|
|
2461
2467
|
</SlideBoxWrapper>
|
|
2462
2468
|
);
|
|
@@ -89,7 +89,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click rcs
|
|
|
89
89
|
/>
|
|
90
90
|
}
|
|
91
91
|
show={true}
|
|
92
|
-
size="size-
|
|
92
|
+
size="size-xl"
|
|
93
93
|
/>
|
|
94
94
|
</CreativesSlideBoxWrapper>
|
|
95
95
|
`;
|
|
@@ -183,7 +183,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click wha
|
|
|
183
183
|
/>
|
|
184
184
|
}
|
|
185
185
|
show={true}
|
|
186
|
-
size="size-
|
|
186
|
+
size="size-xl"
|
|
187
187
|
/>
|
|
188
188
|
</CreativesSlideBoxWrapper>
|
|
189
189
|
`;
|
|
@@ -320,7 +320,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
|
|
|
320
320
|
/>
|
|
321
321
|
}
|
|
322
322
|
show={false}
|
|
323
|
-
size="size-
|
|
323
|
+
size="size-xl"
|
|
324
324
|
/>
|
|
325
325
|
</CreativesSlideBoxWrapper>
|
|
326
326
|
`;
|
|
@@ -457,7 +457,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
|
|
|
457
457
|
/>
|
|
458
458
|
}
|
|
459
459
|
show={false}
|
|
460
|
-
size="size-
|
|
460
|
+
size="size-xl"
|
|
461
461
|
/>
|
|
462
462
|
</CreativesSlideBoxWrapper>
|
|
463
463
|
`;
|
|
@@ -594,7 +594,7 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
|
|
|
594
594
|
/>
|
|
595
595
|
}
|
|
596
596
|
show={false}
|
|
597
|
-
size="size-
|
|
597
|
+
size="size-xl"
|
|
598
598
|
/>
|
|
599
599
|
</CreativesSlideBoxWrapper>
|
|
600
600
|
`;
|
|
@@ -358,6 +358,8 @@ export const Rcs = (props) => {
|
|
|
358
358
|
const [accessToken, setAccessToken] = useState('');
|
|
359
359
|
const [hostName, setHostName] = useState('');
|
|
360
360
|
const [accountName, setAccountName] = useState('');
|
|
361
|
+
const [botId, setBotId] = useState('');
|
|
362
|
+
const [vfTemplateId, setVfTemplateId] = useState('');
|
|
361
363
|
const isHostInfoBip = hostName === HOST_INFOBIP;
|
|
362
364
|
const isHostIcs = hostName === HOST_ICS;
|
|
363
365
|
|
|
@@ -381,12 +383,14 @@ export const Rcs = (props) => {
|
|
|
381
383
|
setHostName(accountObj.hostName || '');
|
|
382
384
|
setAccountName(accountObj.name || '');
|
|
383
385
|
setRcsAccount(accountObj.id || '');
|
|
386
|
+
setBotId(accountObj.connectionProperties?.agentid || '');
|
|
384
387
|
} else {
|
|
385
388
|
setAccountId('');
|
|
386
389
|
setWecrmAccountId('');
|
|
387
390
|
setAccessToken('');
|
|
388
391
|
setHostName('');
|
|
389
392
|
setAccountName('');
|
|
393
|
+
setBotId('');
|
|
390
394
|
}
|
|
391
395
|
}, [accountData.selectedRcsAccount]);
|
|
392
396
|
|
|
@@ -1387,6 +1391,8 @@ export const Rcs = (props) => {
|
|
|
1387
1391
|
const rcsAccountId = get(details, 'versions.base.content.RCS.rcsContent.accountId', '');
|
|
1388
1392
|
setRcsAccount(rcsAccountId);
|
|
1389
1393
|
}
|
|
1394
|
+
const storedVfTemplateId = get(details, 'versions.base.content.RCS.rcsContent.vfTemplateId', '');
|
|
1395
|
+
if (storedVfTemplateId) setVfTemplateId(storedVfTemplateId);
|
|
1390
1396
|
|
|
1391
1397
|
applySmsFallbackHydration({
|
|
1392
1398
|
details,
|
|
@@ -2710,6 +2716,7 @@ const onTitleAddVar = () => {
|
|
|
2710
2716
|
|
|
2711
2717
|
const createPayload = () => {
|
|
2712
2718
|
const isSlotMappingMode = isEditFlow || !isFullMode;
|
|
2719
|
+
const resolvedVfTemplateId = vfTemplateId || get(rcsHydrationDetails, 'versions.base.content.RCS.rcsContent.vfTemplateId', '');
|
|
2713
2720
|
const alignment = isMediaTypeImage
|
|
2714
2721
|
? RCS_IMAGE_DIMENSIONS[selectedDimension]?.alignment
|
|
2715
2722
|
: RCS_VIDEO_THUMBNAIL_DIMENSIONS[selectedDimension]?.alignment;
|
|
@@ -2824,7 +2831,8 @@ const onTitleAddVar = () => {
|
|
|
2824
2831
|
}
|
|
2825
2832
|
],
|
|
2826
2833
|
contentType: isFullMode ? templateType : RICHCARD,
|
|
2827
|
-
...(isFullMode && {accountId
|
|
2834
|
+
...(isFullMode && {accountId, accessToken, accountName, hostName, botId}),
|
|
2835
|
+
...(resolvedVfTemplateId && { vfTemplateId: resolvedVfTemplateId }),
|
|
2828
2836
|
},
|
|
2829
2837
|
...smsFallbackPayloadContent,
|
|
2830
2838
|
},
|
|
@@ -2964,6 +2972,7 @@ const onTitleAddVar = () => {
|
|
|
2964
2972
|
accountName,
|
|
2965
2973
|
hostName,
|
|
2966
2974
|
smsRegister,
|
|
2975
|
+
vfTemplateId,
|
|
2967
2976
|
]);
|
|
2968
2977
|
|
|
2969
2978
|
/**
|