@capillarytech/creatives-library 9.0.56-alpha.6 → 9.0.56-betaa.0
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/constants/unified.js +4 -2
- package/package.json +1 -1
- package/services/api.js +0 -20
- package/utils/common.js +12 -0
- package/utils/templateVarUtils.js +0 -32
- package/utils/tests/templateVarUtils.test.js +0 -44
- package/v2Components/CommonTestAndPreview/UnifiedPreview/index.js +0 -14
- package/v2Components/CommonTestAndPreview/actions.js +0 -13
- package/v2Components/CommonTestAndPreview/constants.js +0 -8
- package/v2Components/CommonTestAndPreview/index.js +2 -57
- package/v2Components/CommonTestAndPreview/reducer.js +0 -20
- package/v2Components/CommonTestAndPreview/sagas.js +0 -28
- package/v2Components/CommonTestAndPreview/selectors.js +0 -6
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/index.test.js +0 -106
- package/v2Components/CommonTestAndPreview/tests/actions.test.js +0 -15
- package/v2Components/CommonTestAndPreview/tests/constants.test.js +1 -9
- package/v2Components/CommonTestAndPreview/tests/index.test.js +0 -101
- package/v2Components/CommonTestAndPreview/tests/reducer.test.js +0 -41
- package/v2Components/CommonTestAndPreview/tests/sagas.test.js +0 -84
- package/v2Components/CommonTestAndPreview/tests/selectors.test.js +0 -12
- package/v2Components/FormBuilder/Functional/FormBuilderShell.js +320 -46
- package/v2Components/FormBuilder/Functional/channels/mobilepush/buildSubmitPayload.js +10 -0
- package/v2Components/FormBuilder/Functional/channels/mobilepush/config.js +82 -0
- package/v2Components/FormBuilder/Functional/channels/mobilepush/getEditorErrorDescriptor.js +74 -0
- package/v2Components/FormBuilder/Functional/channels/mobilepush/index.js +28 -0
- package/v2Components/FormBuilder/Functional/channels/mobilepush/modals.js +19 -0
- package/v2Components/FormBuilder/Functional/channels/mobilepush/runSubmitPipeline.js +45 -0
- package/v2Components/FormBuilder/Functional/channels/mobilepush/tests/getEditorErrorDescriptor.test.js +162 -0
- package/v2Components/FormBuilder/Functional/channels/mobilepush/tests/modals.test.js +37 -0
- package/v2Components/FormBuilder/Functional/channels/mobilepush/tests/runSubmitPipeline.test.js +70 -0
- package/v2Components/FormBuilder/Functional/channels/mobilepush/tests/validate.test.js +274 -0
- package/v2Components/FormBuilder/Functional/channels/mobilepush/validate.js +251 -0
- package/v2Components/FormBuilder/Functional/channels/registry.js +2 -0
- package/v2Components/FormBuilder/Functional/constants.js +43 -8
- package/v2Components/FormBuilder/Functional/core/schema/initializeFormState.js +175 -28
- package/v2Components/FormBuilder/Functional/core/store/formReducer.js +75 -6
- package/v2Components/FormBuilder/Functional/core/store/toLegacyFormData.js +10 -20
- package/v2Components/FormBuilder/Functional/layout/FieldSlot.js +9 -1
- package/v2Components/FormBuilder/Functional/layout/SchemaForm.js +20 -3
- package/v2Components/FormBuilder/Functional/layout/Section.js +6 -1
- package/v2Components/FormBuilder/Functional/layout/TabsContainer.js +89 -0
- package/v2Components/FormBuilder/Functional/renderers/mpushRenderers.js +440 -0
- package/v2Components/FormBuilder/Functional/tests/fieldSlot.test.js +9 -2
- package/v2Components/FormBuilder/Functional/tests/mpush.crossFlowParity.test.js +430 -0
- package/v2Components/FormBuilder/Functional/tests/mpush.ctaFlows.parity.test.js +282 -0
- package/v2Components/FormBuilder/Functional/tests/mpush.editContainer.parity.test.js +141 -0
- package/v2Components/FormBuilder/Functional/tests/mpush.engine.test.js +306 -0
- package/v2Components/FormBuilder/Functional/tests/mpush.shellEvents.test.js +151 -0
- package/v2Components/FormBuilder/Functional/tests/mpushRenderers.test.js +342 -0
- package/v2Components/FormBuilder/Functional/tests/schemaForm.test.js +17 -0
- package/v2Components/FormBuilder/Functional/tests/tabsContainer.test.js +110 -0
- package/v2Components/FormBuilder/index.js +34 -12
- package/v2Components/FormBuilder/tests/entryGate.test.js +94 -7
- package/v2Components/FormBuilder/tests/mpush.characterization.test.js +459 -0
- package/v2Components/TestAndPreviewSlidebox/index.js +0 -9
- package/v2Containers/CommunicationFlow/CommunicationFlow.js +75 -128
- package/v2Containers/CommunicationFlow/CommunicationFlow.scss +2 -30
- package/v2Containers/CommunicationFlow/CommunicationFlowCard.js +27 -58
- package/v2Containers/CommunicationFlow/Tests/CommunicationFlow.test.js +51 -471
- package/v2Containers/CommunicationFlow/Tests/CommunicationFlowCard.test.js +4 -40
- package/v2Containers/CommunicationFlow/constants.js +4 -67
- package/v2Containers/CommunicationFlow/index.js +23 -16
- package/v2Containers/CommunicationFlow/messages.js +3 -7
- package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/ChannelSelectionStep.js +10 -22
- package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/ChannelSelectionStep.scss +0 -4
- package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/Tests/ChannelSelectionStep.test.js +4 -112
- package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/DeliverySettingsSection.js +0 -3
- 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 +3 -2
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +5 -5
- package/v2Containers/CreativesContainer/tests/index.test.js +0 -12
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +19 -115
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +3 -27
- package/v2Containers/WebPush/Create/preview/WebPushPreview.js +12 -17
- package/v2Containers/WebPush/Create/preview/tests/WebPushPreview.test.js +0 -5
- package/v2Containers/Whatsapp/index.js +3 -8
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +34 -306
- package/v2Containers/mockdata.js +0 -25
- package/v2Containers/CommunicationFlow/Tests/constants.test.js +0 -85
|
@@ -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;
|
|
@@ -164,6 +164,7 @@ export class Creatives extends React.Component {
|
|
|
164
164
|
isFullMode: props.isFullMode,
|
|
165
165
|
useLocalTemplates,
|
|
166
166
|
});
|
|
167
|
+
|
|
167
168
|
this.state = {
|
|
168
169
|
isLoadingContent: true,
|
|
169
170
|
templateStep: 1, //modeSelection: for template name and (for email selecting upload or editor), and createTemplate to create template create based on modeSelection
|
|
@@ -412,7 +413,7 @@ export class Creatives extends React.Component {
|
|
|
412
413
|
this.setState({ isGetFormData: false });
|
|
413
414
|
};
|
|
414
415
|
|
|
415
|
-
mapCarouselDataToCreatives = (cards) =>
|
|
416
|
+
mapCarouselDataToCreatives = (cards) => cards.map((card) => {
|
|
416
417
|
const {
|
|
417
418
|
cardVarMapped, bodyTemplate, media, buttons, mediaType,
|
|
418
419
|
} = card || {};
|
|
@@ -2461,7 +2462,7 @@ export class Creatives extends React.Component {
|
|
|
2461
2462
|
)}
|
|
2462
2463
|
handleClose={this.handleCloseSlideBox}
|
|
2463
2464
|
show={showSlideBox}
|
|
2464
|
-
size="size-
|
|
2465
|
+
size="size-xl"
|
|
2465
2466
|
/>
|
|
2466
2467
|
</SlideBoxWrapper>
|
|
2467
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
|
`;
|
|
@@ -10,7 +10,6 @@ const {
|
|
|
10
10
|
whatsappGetCreativeData2,
|
|
11
11
|
whatsappGetTemplateData1,
|
|
12
12
|
whatsappGetTemplateData2,
|
|
13
|
-
whatsappGetTemplateDataNullCards,
|
|
14
13
|
rcsTemplates,
|
|
15
14
|
rcsEditTemplateData,
|
|
16
15
|
smsEditTemplateData,
|
|
@@ -78,17 +77,6 @@ describe('Test SlideBoxContent container', () => {
|
|
|
78
77
|
expect(handleCloseCreatives).toHaveBeenCalledWith(true);
|
|
79
78
|
});
|
|
80
79
|
|
|
81
|
-
it('does not throw when templateConfigs.cards is explicitly null (regression: CCS sends null rather than omitting the field on non-carousel WhatsApp templates, and mapCarouselDataToCreatives called .map() straight off it)', () => {
|
|
82
|
-
expect(() =>
|
|
83
|
-
renderFunction(
|
|
84
|
-
'WHATSAPP',
|
|
85
|
-
'editTemplate',
|
|
86
|
-
whatsappTemplates,
|
|
87
|
-
whatsappGetTemplateDataNullCards,
|
|
88
|
-
),
|
|
89
|
-
).not.toThrow();
|
|
90
|
-
});
|
|
91
|
-
|
|
92
80
|
it('it should clear the url, on channel change from new whatsapp to another', () => {
|
|
93
81
|
renderFunction(
|
|
94
82
|
'WHATSAPP',
|