@capillarytech/creatives-library 7.17.37-beta.0 → 7.17.38
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/index.js
CHANGED
|
@@ -124,8 +124,8 @@ const ViberContainer = {Viber, viberReducer, viberSaga};
|
|
|
124
124
|
const FacebookPreviewContainer = { FacebookPreview, facebookPreviewReducer, facebookPreviewSaga };
|
|
125
125
|
const SmsTraiContainer = {SmsTraiCreate, SmsTraiCreateReducer, SmsTraiCreateSaga};
|
|
126
126
|
const WhatsappContainer = { Whatsapp, whatsappReducer, whatsappSaga };
|
|
127
|
+
const zaloContainer = { Zalo, zaloReducer, zaloSaga };
|
|
127
128
|
const RcsContainer = { Rcs, rcsReducer, rcsSaga };
|
|
128
|
-
const ZaloContainer = { Zalo, zaloReducer, zaloSaga };
|
|
129
129
|
|
|
130
130
|
const GalleryContainer = {Gallery, galleryReducer, gallerySagas};
|
|
131
131
|
const FTPContainer = {FTP, FTPReducer, FTPSagas};
|
|
@@ -173,6 +173,6 @@ export { CapContainer,
|
|
|
173
173
|
FacebookPreviewContainer,
|
|
174
174
|
SmsTraiContainer,
|
|
175
175
|
WhatsappContainer,
|
|
176
|
+
zaloContainer,
|
|
176
177
|
RcsContainer,
|
|
177
|
-
ZaloContainer,
|
|
178
178
|
};
|
package/package.json
CHANGED
|
@@ -896,6 +896,9 @@ export class Creatives extends React.Component {
|
|
|
896
896
|
handleCloseSlideBox = () => {
|
|
897
897
|
const { currentChannel = '', slidBoxContent = '' } = this.state;
|
|
898
898
|
const reloadTemplates = currentChannel === constants.WHATSAPP && slidBoxContent === 'editTemplate';
|
|
899
|
+
if (window.location.search.includes('?channel=whatsapp&mode=create')) {
|
|
900
|
+
window.history.pushState({}, null, '/creatives/ui/v2');
|
|
901
|
+
}
|
|
899
902
|
this.setState((prevState) => ({
|
|
900
903
|
...prevState,
|
|
901
904
|
templateData: undefined,
|
|
@@ -295,3 +295,78 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
|
|
|
295
295
|
/>
|
|
296
296
|
</CreativesContainer__SlideBoxWrapper>
|
|
297
297
|
`;
|
|
298
|
+
|
|
299
|
+
exports[`Test SlideBoxContent container it should clear the url, on channel change from new whatsapp to another 1`] = `
|
|
300
|
+
<CreativesContainer__SlideBoxWrapper
|
|
301
|
+
className="add-creatives-section creatives-library-mode "
|
|
302
|
+
>
|
|
303
|
+
<CapSlideBox
|
|
304
|
+
closeIconPosition="right"
|
|
305
|
+
closeIconSize="m"
|
|
306
|
+
closeIconType="close"
|
|
307
|
+
content={
|
|
308
|
+
<SlideBoxContent
|
|
309
|
+
currentChannel="WHATSAPP"
|
|
310
|
+
getFormData={[Function]}
|
|
311
|
+
handleClose={[Function]}
|
|
312
|
+
onCallTaskSubmit={[Function]}
|
|
313
|
+
onChannelChange={[Function]}
|
|
314
|
+
onCreateComplete={[MockFunction]}
|
|
315
|
+
onCreateNew={[Function]}
|
|
316
|
+
onCreateNextStep={[Function]}
|
|
317
|
+
onEmailModeChange={[Function]}
|
|
318
|
+
onEnterTemplateName={[Function]}
|
|
319
|
+
onFTPSubmit={[MockFunction]}
|
|
320
|
+
onFacebookSubmit={[MockFunction]}
|
|
321
|
+
onMobilepushModeChange={[Function]}
|
|
322
|
+
onPreviewTemplate={[Function]}
|
|
323
|
+
onRemoveTemplateName={[Function]}
|
|
324
|
+
onResetStep={[Function]}
|
|
325
|
+
onSelectTemplate={[Function]}
|
|
326
|
+
onShowTemplates={[Function]}
|
|
327
|
+
onValidationFail={[Function]}
|
|
328
|
+
onWeChatMaptemplateStepChange={[Function]}
|
|
329
|
+
onWechatTemplateChange={[Function]}
|
|
330
|
+
saveMessage={[Function]}
|
|
331
|
+
setIsLoadingContent={[Function]}
|
|
332
|
+
showTemplateName={[Function]}
|
|
333
|
+
slidBoxContent="editTemplate"
|
|
334
|
+
templateStep="modeSelection"
|
|
335
|
+
weChatMaptemplateStep={0}
|
|
336
|
+
weChatTemplateType=""
|
|
337
|
+
/>
|
|
338
|
+
}
|
|
339
|
+
footer={
|
|
340
|
+
<SlideBoxFooter
|
|
341
|
+
currentChannel="WHATSAPP"
|
|
342
|
+
onCreateNextStep={[Function]}
|
|
343
|
+
onDiscard={[Function]}
|
|
344
|
+
onEditTemplate={[Function]}
|
|
345
|
+
onSave={[Function]}
|
|
346
|
+
shouldShowContinueFooter={[Function]}
|
|
347
|
+
shouldShowDoneFooter={[Function]}
|
|
348
|
+
slidBoxContent="editTemplate"
|
|
349
|
+
templateStep="modeSelection"
|
|
350
|
+
/>
|
|
351
|
+
}
|
|
352
|
+
handleClose={[Function]}
|
|
353
|
+
header={
|
|
354
|
+
<SlideBoxHeader
|
|
355
|
+
channel="WHATSAPP"
|
|
356
|
+
isLoadingContent={true}
|
|
357
|
+
onShowTemplates={[Function]}
|
|
358
|
+
onWeChatMaptemplateStepChange={[Function]}
|
|
359
|
+
showPrefix={true}
|
|
360
|
+
slidBoxContent="editTemplate"
|
|
361
|
+
templateNameRenderProp={[Function]}
|
|
362
|
+
templateStep="modeSelection"
|
|
363
|
+
weChatMaptemplateStep={0}
|
|
364
|
+
weChatTemplateType=""
|
|
365
|
+
/>
|
|
366
|
+
}
|
|
367
|
+
position="right"
|
|
368
|
+
show={false}
|
|
369
|
+
size="size-xl"
|
|
370
|
+
/>
|
|
371
|
+
</CreativesContainer__SlideBoxWrapper>
|
|
372
|
+
`;
|
|
@@ -74,6 +74,22 @@ describe('Test SlideBoxContent container', () => {
|
|
|
74
74
|
expect(handleCloseCreatives).toHaveBeenCalledWith(true);
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
+
it('it should clear the url, on channel change from new whatsapp to another', () => {
|
|
78
|
+
renderFunction(
|
|
79
|
+
'WHATSAPP',
|
|
80
|
+
'editTemplate',
|
|
81
|
+
whatsappTemplates,
|
|
82
|
+
whatsappGetTemplateData1,
|
|
83
|
+
);
|
|
84
|
+
delete window.location;
|
|
85
|
+
window.location = new URL('http://127.0.0.1:3030/creatives/ui/v2?channel=whatsapp&mode=create');
|
|
86
|
+
renderedComponent.instance().onEditTemplate();
|
|
87
|
+
renderedComponent.find('CapSlideBox').props().content.props.handleClose();
|
|
88
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
89
|
+
expect(handleCloseCreatives).toHaveBeenCalledTimes(1);
|
|
90
|
+
expect(handleCloseCreatives).toHaveBeenCalledWith(true);
|
|
91
|
+
});
|
|
92
|
+
|
|
77
93
|
it('campaign message, whatsapp edit all data', () => {
|
|
78
94
|
renderFunction(
|
|
79
95
|
'WHATSAPP',
|