@capillarytech/creatives-library 8.0.125 → 8.0.127-alpha.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/config/app.js +6 -0
- package/containers/App/constants.js +1 -0
- package/index.html +3 -1
- package/initialReducer.js +2 -0
- package/package.json +1 -1
- package/services/api.js +94 -1
- package/services/tests/api.test.js +191 -0
- package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +8 -3
- package/tests/integration/TemplateCreation/api-response.js +5 -0
- package/tests/integration/TemplateCreation/msw-handler.js +42 -63
- package/utils/common.js +7 -0
- package/utils/commonUtils.js +2 -6
- package/utils/createPayload.js +272 -0
- package/utils/tests/createPayload.test.js +761 -0
- package/v2Components/CapImageUpload/index.js +59 -46
- package/v2Components/CapInAppCTA/index.js +1 -0
- package/v2Components/CapMpushCTA/constants.js +25 -0
- package/v2Components/CapMpushCTA/index.js +332 -0
- package/v2Components/CapMpushCTA/index.scss +95 -0
- package/v2Components/CapMpushCTA/messages.js +89 -0
- package/v2Components/CapTagList/index.js +177 -120
- package/v2Components/CapVideoUpload/constants.js +3 -0
- package/v2Components/CapVideoUpload/index.js +167 -110
- package/v2Components/CapVideoUpload/messages.js +16 -0
- package/v2Components/Carousel/index.js +15 -13
- package/v2Components/CustomerSearchSection/_customerSearch.scss +309 -0
- package/v2Components/CustomerSearchSection/constants.js +5 -0
- package/v2Components/CustomerSearchSection/index.js +367 -0
- package/v2Components/CustomerSearchSection/messages.js +20 -0
- package/v2Components/CustomerSearchSection/tests/utils.test.js +334 -0
- package/v2Components/CustomerSearchSection/utils.js +49 -0
- package/v2Components/ErrorInfoNote/style.scss +1 -0
- package/v2Components/MobilePushPreviewV2/index.js +37 -5
- package/v2Components/TemplatePreview/_templatePreview.scss +114 -72
- package/v2Components/TemplatePreview/assets/images/Android _ With date and time.svg +29 -0
- package/v2Components/TemplatePreview/assets/images/android.svg +9 -0
- package/v2Components/TemplatePreview/assets/images/iOS _ With date and time.svg +26 -0
- package/v2Components/TemplatePreview/assets/images/ios.svg +9 -0
- package/v2Components/TemplatePreview/index.js +178 -50
- package/v2Components/TemplatePreview/messages.js +4 -0
- package/v2Components/TestAndPreviewSlidebox/CustomValuesEditor.js +169 -0
- package/v2Components/TestAndPreviewSlidebox/LeftPanelContent.js +95 -0
- package/v2Components/TestAndPreviewSlidebox/PreviewSection.js +69 -0
- package/v2Components/TestAndPreviewSlidebox/SendTestMessage.js +68 -0
- package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +543 -0
- package/v2Components/TestAndPreviewSlidebox/actions.js +67 -0
- package/v2Components/TestAndPreviewSlidebox/constants.js +67 -0
- package/v2Components/TestAndPreviewSlidebox/index.js +592 -0
- package/v2Components/TestAndPreviewSlidebox/messages.js +147 -0
- package/v2Components/TestAndPreviewSlidebox/reducer.js +233 -0
- package/v2Components/TestAndPreviewSlidebox/sagas.js +258 -0
- package/v2Components/TestAndPreviewSlidebox/selectors.js +142 -0
- package/v2Components/TestAndPreviewSlidebox/tests/CustomValuesEditor.test.js +425 -0
- package/v2Components/TestAndPreviewSlidebox/tests/LeftPanelContent.test.js +400 -0
- package/v2Components/TestAndPreviewSlidebox/tests/SendTestMessage.test.js +448 -0
- package/v2Components/TestAndPreviewSlidebox/tests/actions.test.js +80 -0
- package/v2Components/TestAndPreviewSlidebox/tests/reducer.test.js +367 -0
- package/v2Components/TestAndPreviewSlidebox/tests/saga.rtl.test.js +192 -0
- package/v2Components/TestAndPreviewSlidebox/tests/saga.test.js +652 -0
- package/v2Components/TestAndPreviewSlidebox/tests/selector.test.js +182 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +22 -10
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +23 -2
- package/v2Containers/CreativesContainer/index.js +216 -136
- package/v2Containers/CreativesContainer/messages.js +4 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +21 -0
- package/v2Containers/Email/index.js +27 -2
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +10 -0
- package/v2Containers/EmailWrapper/index.js +6 -0
- package/v2Containers/InApp/constants.js +1 -0
- package/v2Containers/InApp/index.js +13 -13
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +3 -0
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +2 -0
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +2 -0
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +9 -0
- package/v2Containers/MobilePush/Create/index.js +1 -0
- package/v2Containers/MobilePush/commonMethods.js +7 -14
- package/v2Containers/MobilePushNew/actions.js +116 -0
- package/v2Containers/MobilePushNew/components/CtaButtons.js +170 -0
- package/v2Containers/MobilePushNew/components/MediaUploaders.js +754 -0
- package/v2Containers/MobilePushNew/components/PlatformContentFields.js +279 -0
- package/v2Containers/MobilePushNew/components/index.js +5 -0
- package/v2Containers/MobilePushNew/components/tests/CtaButtons.test.js +779 -0
- package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +2114 -0
- package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +343 -0
- package/v2Containers/MobilePushNew/constants.js +115 -0
- package/v2Containers/MobilePushNew/hooks/tests/usePlatformSync.test.js +1299 -0
- package/v2Containers/MobilePushNew/hooks/tests/useUpload.test.js +1223 -0
- package/v2Containers/MobilePushNew/hooks/usePlatformSync.js +246 -0
- package/v2Containers/MobilePushNew/hooks/useUpload.js +726 -0
- package/v2Containers/MobilePushNew/index.js +2280 -0
- package/v2Containers/MobilePushNew/index.scss +308 -0
- package/v2Containers/MobilePushNew/messages.js +226 -0
- package/v2Containers/MobilePushNew/reducer.js +160 -0
- package/v2Containers/MobilePushNew/sagas.js +198 -0
- package/v2Containers/MobilePushNew/selectors.js +55 -0
- package/v2Containers/MobilePushNew/tests/reducer.test.js +741 -0
- package/v2Containers/MobilePushNew/tests/sagas.test.js +863 -0
- package/v2Containers/MobilePushNew/tests/selectors.test.js +425 -0
- package/v2Containers/MobilePushNew/tests/utils.test.js +322 -0
- package/v2Containers/MobilePushNew/utils.js +33 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +23 -5
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +4 -0
- package/v2Containers/TagList/index.js +56 -10
- package/v2Containers/Templates/_templates.scss +101 -1
- package/v2Containers/Templates/index.js +147 -35
- package/v2Containers/Templates/messages.js +8 -0
- package/v2Containers/Templates/sagas.js +2 -0
- package/v2Containers/Whatsapp/constants.js +1 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +35 -0
- package/v2Containers/Email/tests/index.test.js +0 -35
|
@@ -14,6 +14,8 @@ exports[`Test SlideBoxContent container campaign message, add creative click rcs
|
|
|
14
14
|
currentChannel="RCS"
|
|
15
15
|
getFormData={[Function]}
|
|
16
16
|
handleClose={[Function]}
|
|
17
|
+
handleCloseTestAndPreview={[Function]}
|
|
18
|
+
handleTestAndPreview={[Function]}
|
|
17
19
|
hostName=""
|
|
18
20
|
loyaltyMetaData={
|
|
19
21
|
Object {
|
|
@@ -42,6 +44,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click rcs
|
|
|
42
44
|
setIsLoadingContent={[Function]}
|
|
43
45
|
showLiquidErrorInFooter={[Function]}
|
|
44
46
|
showTemplateName={[Function]}
|
|
47
|
+
showTestAndPreviewSlidebox={false}
|
|
45
48
|
slidBoxContent="templates"
|
|
46
49
|
templateData={
|
|
47
50
|
Object {
|
|
@@ -96,6 +99,8 @@ exports[`Test SlideBoxContent container campaign message, add creative click wha
|
|
|
96
99
|
currentChannel="WHATSAPP"
|
|
97
100
|
getFormData={[Function]}
|
|
98
101
|
handleClose={[Function]}
|
|
102
|
+
handleCloseTestAndPreview={[Function]}
|
|
103
|
+
handleTestAndPreview={[Function]}
|
|
99
104
|
hostName=""
|
|
100
105
|
loyaltyMetaData={
|
|
101
106
|
Object {
|
|
@@ -124,6 +129,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click wha
|
|
|
124
129
|
setIsLoadingContent={[Function]}
|
|
125
130
|
showLiquidErrorInFooter={[Function]}
|
|
126
131
|
showTemplateName={[Function]}
|
|
132
|
+
showTestAndPreviewSlidebox={false}
|
|
127
133
|
slidBoxContent="templates"
|
|
128
134
|
templateData={
|
|
129
135
|
Object {
|
|
@@ -178,6 +184,8 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
|
|
|
178
184
|
currentChannel="WHATSAPP"
|
|
179
185
|
getFormData={[Function]}
|
|
180
186
|
handleClose={[Function]}
|
|
187
|
+
handleCloseTestAndPreview={[Function]}
|
|
188
|
+
handleTestAndPreview={[Function]}
|
|
181
189
|
hostName=""
|
|
182
190
|
loyaltyMetaData={
|
|
183
191
|
Object {
|
|
@@ -206,6 +214,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
|
|
|
206
214
|
setIsLoadingContent={[Function]}
|
|
207
215
|
showLiquidErrorInFooter={[Function]}
|
|
208
216
|
showTemplateName={[Function]}
|
|
217
|
+
showTestAndPreviewSlidebox={false}
|
|
209
218
|
slidBoxContent="editTemplate"
|
|
210
219
|
templateStep="modeSelection"
|
|
211
220
|
weChatMaptemplateStep={0}
|
|
@@ -227,8 +236,10 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
|
|
|
227
236
|
onDiscard={[Function]}
|
|
228
237
|
onEditTemplate={[Function]}
|
|
229
238
|
onSave={[Function]}
|
|
239
|
+
onTestAndPreview={[Function]}
|
|
230
240
|
shouldShowContinueFooter={[Function]}
|
|
231
241
|
shouldShowDoneFooter={[Function]}
|
|
242
|
+
showTestAndPreviewButton={false}
|
|
232
243
|
slidBoxContent="editTemplate"
|
|
233
244
|
templateStep="modeSelection"
|
|
234
245
|
/>
|
|
@@ -270,6 +281,8 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
|
|
|
270
281
|
currentChannel="WHATSAPP"
|
|
271
282
|
getFormData={[Function]}
|
|
272
283
|
handleClose={[Function]}
|
|
284
|
+
handleCloseTestAndPreview={[Function]}
|
|
285
|
+
handleTestAndPreview={[Function]}
|
|
273
286
|
hostName=""
|
|
274
287
|
loyaltyMetaData={
|
|
275
288
|
Object {
|
|
@@ -298,6 +311,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
|
|
|
298
311
|
setIsLoadingContent={[Function]}
|
|
299
312
|
showLiquidErrorInFooter={[Function]}
|
|
300
313
|
showTemplateName={[Function]}
|
|
314
|
+
showTestAndPreviewSlidebox={false}
|
|
301
315
|
slidBoxContent="editTemplate"
|
|
302
316
|
templateStep="modeSelection"
|
|
303
317
|
weChatMaptemplateStep={0}
|
|
@@ -319,8 +333,10 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
|
|
|
319
333
|
onDiscard={[Function]}
|
|
320
334
|
onEditTemplate={[Function]}
|
|
321
335
|
onSave={[Function]}
|
|
336
|
+
onTestAndPreview={[Function]}
|
|
322
337
|
shouldShowContinueFooter={[Function]}
|
|
323
338
|
shouldShowDoneFooter={[Function]}
|
|
339
|
+
showTestAndPreviewButton={false}
|
|
324
340
|
slidBoxContent="editTemplate"
|
|
325
341
|
templateStep="modeSelection"
|
|
326
342
|
/>
|
|
@@ -362,6 +378,8 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
|
|
|
362
378
|
currentChannel="WHATSAPP"
|
|
363
379
|
getFormData={[Function]}
|
|
364
380
|
handleClose={[Function]}
|
|
381
|
+
handleCloseTestAndPreview={[Function]}
|
|
382
|
+
handleTestAndPreview={[Function]}
|
|
365
383
|
hostName=""
|
|
366
384
|
loyaltyMetaData={
|
|
367
385
|
Object {
|
|
@@ -390,6 +408,7 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
|
|
|
390
408
|
setIsLoadingContent={[Function]}
|
|
391
409
|
showLiquidErrorInFooter={[Function]}
|
|
392
410
|
showTemplateName={[Function]}
|
|
411
|
+
showTestAndPreviewSlidebox={false}
|
|
393
412
|
slidBoxContent="editTemplate"
|
|
394
413
|
templateStep="modeSelection"
|
|
395
414
|
weChatMaptemplateStep={0}
|
|
@@ -411,8 +430,10 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
|
|
|
411
430
|
onDiscard={[Function]}
|
|
412
431
|
onEditTemplate={[Function]}
|
|
413
432
|
onSave={[Function]}
|
|
433
|
+
onTestAndPreview={[Function]}
|
|
414
434
|
shouldShowContinueFooter={[Function]}
|
|
415
435
|
shouldShowDoneFooter={[Function]}
|
|
436
|
+
showTestAndPreviewButton={false}
|
|
416
437
|
slidBoxContent="editTemplate"
|
|
417
438
|
templateStep="modeSelection"
|
|
418
439
|
/>
|
|
@@ -42,6 +42,7 @@ import injectReducer from '../../utils/injectReducer';
|
|
|
42
42
|
import v2EmailReducer from './reducer';
|
|
43
43
|
import { v2EmailSagas } from './sagas';
|
|
44
44
|
import injectSaga from '../../utils/injectSaga';
|
|
45
|
+
import TestAndPreviewSlidebox from '../../v2Components/TestAndPreviewSlidebox';
|
|
45
46
|
|
|
46
47
|
export class Email extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
47
48
|
constructor(props) {
|
|
@@ -819,6 +820,18 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
819
820
|
// return response;
|
|
820
821
|
}
|
|
821
822
|
|
|
823
|
+
getTemplateContent = () => {
|
|
824
|
+
const { formData, currentTab } = this.state;
|
|
825
|
+
const currentTabData = formData[currentTab - 1];
|
|
826
|
+
const activeTab = currentTabData?.activeTab;
|
|
827
|
+
|
|
828
|
+
if (currentTabData && activeTab && currentTabData[activeTab]) {
|
|
829
|
+
return currentTabData[activeTab]['template-content'] || '';
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
return '';
|
|
833
|
+
}
|
|
834
|
+
|
|
822
835
|
setFormValidity = (isFormValid) => {
|
|
823
836
|
this.setState({isFormValid});
|
|
824
837
|
}
|
|
@@ -2660,7 +2673,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2660
2673
|
formData,
|
|
2661
2674
|
};
|
|
2662
2675
|
}, () => {
|
|
2663
|
-
this.setState({
|
|
2676
|
+
!this.props.showTestAndPreviewSlidebox && this.setState({
|
|
2664
2677
|
startValidation: true,
|
|
2665
2678
|
});
|
|
2666
2679
|
});
|
|
@@ -2674,7 +2687,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2674
2687
|
const previewHeader = (<h3>{this.props.intl.formatMessage(messages.h3emailPreview)}</h3>);
|
|
2675
2688
|
const imagePreviewHeader = (<h3>{this.props.intl.formatMessage(messages.h3imageSelection)}</h3>);
|
|
2676
2689
|
const imagePreviewContent = this.getImagePreviewContent();
|
|
2677
|
-
const { selectedOfferDetails, getDefaultTags, Email: { CmsSettings = {} } = {}, moduleType = '' } = this.props;
|
|
2690
|
+
const { selectedOfferDetails, getDefaultTags, Email: { CmsSettings = {} } = {}, moduleType = '', showTestAndPreviewSlidebox, handleTestAndPreview, handleCloseTestAndPreview } = this.props;
|
|
2678
2691
|
if (!this.props.currentOrgDetails || !this.props.currentOrgDetails.basic_details) {
|
|
2679
2692
|
return (<div>Loading...</div>);
|
|
2680
2693
|
}
|
|
@@ -2768,6 +2781,15 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2768
2781
|
size="size-xl"
|
|
2769
2782
|
/>
|
|
2770
2783
|
{this.state.showConfirmationModal && this.renderConfirmationModal()}
|
|
2784
|
+
{/* NEW: Test and Preview Slidebox */}
|
|
2785
|
+
<TestAndPreviewSlidebox
|
|
2786
|
+
show={showTestAndPreviewSlidebox}
|
|
2787
|
+
onClose={handleCloseTestAndPreview}
|
|
2788
|
+
formData={this.state.formData}
|
|
2789
|
+
beeInstance={this.beeInstance}
|
|
2790
|
+
content={this.getTemplateContent()}
|
|
2791
|
+
currentChannel={EMAIL}
|
|
2792
|
+
/>
|
|
2771
2793
|
</div>
|
|
2772
2794
|
);
|
|
2773
2795
|
}
|
|
@@ -2804,6 +2826,9 @@ Email.propTypes = {
|
|
|
2804
2826
|
onTestContentClicked: PropTypes.func,
|
|
2805
2827
|
moduleType: PropTypes.string,
|
|
2806
2828
|
showLiquidErrorInFooter: PropTypes.func,
|
|
2829
|
+
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
2830
|
+
handleTestAndPreview: PropTypes.func,
|
|
2831
|
+
handleCloseTestAndPreview: PropTypes.func,
|
|
2807
2832
|
};
|
|
2808
2833
|
|
|
2809
2834
|
const mapStateToProps = (state, props) => createStructuredSelector({
|
|
@@ -50,6 +50,10 @@ const useEmailWrapper = ({
|
|
|
50
50
|
// Props for CmsTemplates component
|
|
51
51
|
cmsTemplatesLoader,
|
|
52
52
|
currentOrgDetails,
|
|
53
|
+
// Props for Test and Preview Slidebox
|
|
54
|
+
showTestAndPreviewSlidebox,
|
|
55
|
+
handleTestAndPreview,
|
|
56
|
+
handleCloseTestAndPreview,
|
|
53
57
|
}) => {
|
|
54
58
|
// State management
|
|
55
59
|
const [templateName, setTemplateName] = useState('');
|
|
@@ -287,6 +291,9 @@ const useEmailWrapper = ({
|
|
|
287
291
|
moduleType,
|
|
288
292
|
eventContextTags,
|
|
289
293
|
isLoyaltyModule,
|
|
294
|
+
showTestAndPreviewSlidebox,
|
|
295
|
+
handleTestAndPreview,
|
|
296
|
+
handleCloseTestAndPreview,
|
|
290
297
|
}), [
|
|
291
298
|
setIsLoadingContent,
|
|
292
299
|
routeParams,
|
|
@@ -307,6 +314,9 @@ const useEmailWrapper = ({
|
|
|
307
314
|
moduleType,
|
|
308
315
|
eventContextTags,
|
|
309
316
|
isLoyaltyModule,
|
|
317
|
+
showTestAndPreviewSlidebox,
|
|
318
|
+
handleTestAndPreview,
|
|
319
|
+
handleCloseTestAndPreview,
|
|
310
320
|
]);
|
|
311
321
|
|
|
312
322
|
// Prepare props for CmsTemplatesComponent
|
|
@@ -58,6 +58,9 @@ const EmailWrapper = (props) => {
|
|
|
58
58
|
onPreviewContentClicked,
|
|
59
59
|
onTestContentClicked,
|
|
60
60
|
editor,
|
|
61
|
+
showTestAndPreviewSlidebox,
|
|
62
|
+
handleTestAndPreview,
|
|
63
|
+
handleCloseTestAndPreview,
|
|
61
64
|
} = props;
|
|
62
65
|
|
|
63
66
|
// Pass destructured props to the custom hook
|
|
@@ -107,6 +110,9 @@ const EmailWrapper = (props) => {
|
|
|
107
110
|
onPreviewContentClicked,
|
|
108
111
|
onTestContentClicked,
|
|
109
112
|
editor,
|
|
113
|
+
showTestAndPreviewSlidebox,
|
|
114
|
+
handleTestAndPreview,
|
|
115
|
+
handleCloseTestAndPreview,
|
|
110
116
|
});
|
|
111
117
|
|
|
112
118
|
// Render using the presentation component with data from the hook
|
|
@@ -46,10 +46,12 @@ import {
|
|
|
46
46
|
INITIAL_CTA_DATA,
|
|
47
47
|
IOS,
|
|
48
48
|
LAYOUT_RADIO_OPTIONS,
|
|
49
|
-
AI_CONTENT_BOT_DISABLED
|
|
49
|
+
AI_CONTENT_BOT_DISABLED,
|
|
50
50
|
} from "./constants";
|
|
51
51
|
import { INAPP, SMS } from "../CreativesContainer/constants";
|
|
52
|
-
import {
|
|
52
|
+
import {
|
|
53
|
+
ALL, TAG, EMBEDDED, DEFAULT, FULL, LIBRARY,
|
|
54
|
+
} from "../Whatsapp/constants";
|
|
53
55
|
import CapDeviceContent from "../../v2Components/CapDeviceContent";
|
|
54
56
|
import { getCdnUrl } from "../../utils/cdnTransformation";
|
|
55
57
|
import { getCtaObject, hasAnyErrors, getSingleTab } from "./utils";
|
|
@@ -297,14 +299,13 @@ export const InApp = (props) => {
|
|
|
297
299
|
|
|
298
300
|
const templateDescErrorHandler = (value) => {
|
|
299
301
|
let errorMessage = false;
|
|
300
|
-
const { unsupportedTags, isBraceError } =
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}) || {};
|
|
302
|
+
const { unsupportedTags, isBraceError } = validateTags({
|
|
303
|
+
content: value,
|
|
304
|
+
tagsParam: tags,
|
|
305
|
+
injectedTagsParams: injectedTags,
|
|
306
|
+
location,
|
|
307
|
+
tagModule: getDefaultTags,
|
|
308
|
+
}) || {};
|
|
308
309
|
if (value === '' && INAPP_MEDIA_TYPES.NONE) {
|
|
309
310
|
errorMessage = formatMessage(messages.emptyTemplateDescErrorMessage);
|
|
310
311
|
} else if (unsupportedTags?.length > 0) {
|
|
@@ -472,7 +473,7 @@ export const InApp = (props) => {
|
|
|
472
473
|
placeholder={formatMessage(globalMessages.templateNamePlaceholder)}
|
|
473
474
|
value={templateName}
|
|
474
475
|
size="default"
|
|
475
|
-
|
|
476
|
+
/>
|
|
476
477
|
</CapRow>
|
|
477
478
|
);
|
|
478
479
|
//create methods end
|
|
@@ -582,8 +583,7 @@ export const InApp = (props) => {
|
|
|
582
583
|
return false;
|
|
583
584
|
};
|
|
584
585
|
|
|
585
|
-
const getCtaPayload = (type) =>
|
|
586
|
-
(type === ANDROID ? ctaDataAndroid : ctaDataIos).map((cta) => {
|
|
586
|
+
const getCtaPayload = (type) => (type === ANDROID ? ctaDataAndroid : ctaDataIos).map((cta) => {
|
|
587
587
|
const { text, urlType, url } = cta;
|
|
588
588
|
return {
|
|
589
589
|
type: urlType,
|
|
@@ -2282,6 +2282,7 @@ new message content.",
|
|
|
2282
2282
|
"gallery": [Function],
|
|
2283
2283
|
"language": [Function],
|
|
2284
2284
|
"navigationConfig": [Function],
|
|
2285
|
+
"previewAndTest": [Function],
|
|
2285
2286
|
"tagList": [Function],
|
|
2286
2287
|
"templates": [Function],
|
|
2287
2288
|
},
|
|
@@ -5963,6 +5964,7 @@ new message content.",
|
|
|
5963
5964
|
"gallery": [Function],
|
|
5964
5965
|
"language": [Function],
|
|
5965
5966
|
"navigationConfig": [Function],
|
|
5967
|
+
"previewAndTest": [Function],
|
|
5966
5968
|
"tagList": [Function],
|
|
5967
5969
|
"templates": [Function],
|
|
5968
5970
|
},
|
|
@@ -9783,6 +9785,7 @@ new message content.",
|
|
|
9783
9785
|
"gallery": [Function],
|
|
9784
9786
|
"language": [Function],
|
|
9785
9787
|
"navigationConfig": [Function],
|
|
9788
|
+
"previewAndTest": [Function],
|
|
9786
9789
|
"tagList": [Function],
|
|
9787
9790
|
"templates": [Function],
|
|
9788
9791
|
},
|
|
@@ -2282,6 +2282,7 @@ new message content.",
|
|
|
2282
2282
|
"gallery": [Function],
|
|
2283
2283
|
"language": [Function],
|
|
2284
2284
|
"navigationConfig": [Function],
|
|
2285
|
+
"previewAndTest": [Function],
|
|
2285
2286
|
"tagList": [Function],
|
|
2286
2287
|
"templates": [Function],
|
|
2287
2288
|
},
|
|
@@ -21553,6 +21554,7 @@ new message content.",
|
|
|
21553
21554
|
"gallery": [Function],
|
|
21554
21555
|
"language": [Function],
|
|
21555
21556
|
"navigationConfig": [Function],
|
|
21557
|
+
"previewAndTest": [Function],
|
|
21556
21558
|
"tagList": [Function],
|
|
21557
21559
|
"templates": [Function],
|
|
21558
21560
|
},
|
|
@@ -2282,6 +2282,7 @@ new message content.",
|
|
|
2282
2282
|
"gallery": [Function],
|
|
2283
2283
|
"language": [Function],
|
|
2284
2284
|
"navigationConfig": [Function],
|
|
2285
|
+
"previewAndTest": [Function],
|
|
2285
2286
|
"tagList": [Function],
|
|
2286
2287
|
"templates": [Function],
|
|
2287
2288
|
},
|
|
@@ -34878,6 +34879,7 @@ new message content.",
|
|
|
34878
34879
|
"gallery": [Function],
|
|
34879
34880
|
"language": [Function],
|
|
34880
34881
|
"navigationConfig": [Function],
|
|
34882
|
+
"previewAndTest": [Function],
|
|
34881
34883
|
"tagList": [Function],
|
|
34882
34884
|
"templates": [Function],
|
|
34883
34885
|
},
|
|
@@ -2282,6 +2282,7 @@ new message content.",
|
|
|
2282
2282
|
"gallery": [Function],
|
|
2283
2283
|
"language": [Function],
|
|
2284
2284
|
"navigationConfig": [Function],
|
|
2285
|
+
"previewAndTest": [Function],
|
|
2285
2286
|
"tagList": [Function],
|
|
2286
2287
|
"templates": [Function],
|
|
2287
2288
|
},
|
|
@@ -11287,6 +11288,7 @@ new message content.",
|
|
|
11287
11288
|
"gallery": [Function],
|
|
11288
11289
|
"language": [Function],
|
|
11289
11290
|
"navigationConfig": [Function],
|
|
11291
|
+
"previewAndTest": [Function],
|
|
11290
11292
|
"tagList": [Function],
|
|
11291
11293
|
"templates": [Function],
|
|
11292
11294
|
},
|
|
@@ -20476,6 +20478,7 @@ new message content.",
|
|
|
20476
20478
|
"gallery": [Function],
|
|
20477
20479
|
"language": [Function],
|
|
20478
20480
|
"navigationConfig": [Function],
|
|
20481
|
+
"previewAndTest": [Function],
|
|
20479
20482
|
"tagList": [Function],
|
|
20480
20483
|
"templates": [Function],
|
|
20481
20484
|
},
|
|
@@ -29942,6 +29945,7 @@ new message content.",
|
|
|
29942
29945
|
"gallery": [Function],
|
|
29943
29946
|
"language": [Function],
|
|
29944
29947
|
"navigationConfig": [Function],
|
|
29948
|
+
"previewAndTest": [Function],
|
|
29945
29949
|
"tagList": [Function],
|
|
29946
29950
|
"templates": [Function],
|
|
29947
29951
|
},
|
|
@@ -41629,6 +41633,7 @@ new message content.",
|
|
|
41629
41633
|
"gallery": [Function],
|
|
41630
41634
|
"language": [Function],
|
|
41631
41635
|
"navigationConfig": [Function],
|
|
41636
|
+
"previewAndTest": [Function],
|
|
41632
41637
|
"tagList": [Function],
|
|
41633
41638
|
"templates": [Function],
|
|
41634
41639
|
},
|
|
@@ -53358,6 +53363,7 @@ new message content.",
|
|
|
53358
53363
|
"gallery": [Function],
|
|
53359
53364
|
"language": [Function],
|
|
53360
53365
|
"navigationConfig": [Function],
|
|
53366
|
+
"previewAndTest": [Function],
|
|
53361
53367
|
"tagList": [Function],
|
|
53362
53368
|
"templates": [Function],
|
|
53363
53369
|
},
|
|
@@ -61137,6 +61143,7 @@ new message content.",
|
|
|
61137
61143
|
"gallery": [Function],
|
|
61138
61144
|
"language": [Function],
|
|
61139
61145
|
"navigationConfig": [Function],
|
|
61146
|
+
"previewAndTest": [Function],
|
|
61140
61147
|
"tagList": [Function],
|
|
61141
61148
|
"templates": [Function],
|
|
61142
61149
|
},
|
|
@@ -69334,6 +69341,7 @@ new message content.",
|
|
|
69334
69341
|
"gallery": [Function],
|
|
69335
69342
|
"language": [Function],
|
|
69336
69343
|
"navigationConfig": [Function],
|
|
69344
|
+
"previewAndTest": [Function],
|
|
69337
69345
|
"tagList": [Function],
|
|
69338
69346
|
"templates": [Function],
|
|
69339
69347
|
},
|
|
@@ -77808,6 +77816,7 @@ new message content.",
|
|
|
77808
77816
|
"gallery": [Function],
|
|
77809
77817
|
"language": [Function],
|
|
77810
77818
|
"navigationConfig": [Function],
|
|
77819
|
+
"previewAndTest": [Function],
|
|
77811
77820
|
"tagList": [Function],
|
|
77812
77821
|
"templates": [Function],
|
|
77813
77822
|
},
|
|
@@ -239,6 +239,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
239
239
|
onLinkTypeChange = (eventTriggered, formData, field) => {
|
|
240
240
|
let schema = cloneDeep(this.state.schema);
|
|
241
241
|
const inputFields = get(schema, `containers[0].panes[${this.state.currentTab - 1}].sections[0].childSections[0].childSections[0].inputFields`);
|
|
242
|
+
|
|
242
243
|
forEach(inputFields, (inputField, fieldIndex) => {
|
|
243
244
|
if (inputField) {
|
|
244
245
|
forEach(inputField.cols, (col) => {
|
|
@@ -248,20 +248,13 @@ function getLinkTypeFields({inputFieldsArgs, fieldIndex, deepLinkOptions, formDa
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
function getContent(obj) {
|
|
251
|
-
const {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
IOS: {
|
|
259
|
-
title: iosTitle,
|
|
260
|
-
message: iosMessage
|
|
261
|
-
} = {}
|
|
262
|
-
} = {}
|
|
263
|
-
} = {}
|
|
264
|
-
} = obj;
|
|
251
|
+
const base = obj?.versions?.base || {};
|
|
252
|
+
const android = base.ANDROID || {};
|
|
253
|
+
const ios = base.IOS || {};
|
|
254
|
+
const androidTitle = android.title || '';
|
|
255
|
+
const androidMessage = android.message || '';
|
|
256
|
+
const iosTitle = ios.title || '';
|
|
257
|
+
const iosMessage = ios.message || '';
|
|
265
258
|
return `${androidTitle} ${androidMessage} ${iosTitle} ${iosMessage}`;
|
|
266
259
|
}
|
|
267
260
|
export {
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* Create actions
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as types from './constants';
|
|
8
|
+
|
|
9
|
+
export function createTemplate(template, callback) {
|
|
10
|
+
return {
|
|
11
|
+
type: types.CREATE_TEMPLATE_REQUEST,
|
|
12
|
+
template,
|
|
13
|
+
callback,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function clearCreateResponse() {
|
|
18
|
+
return {
|
|
19
|
+
type: types.CLEAR_CREATE_RESPONSE_REQUEST,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function defaultAction() {
|
|
24
|
+
return {
|
|
25
|
+
type: types.DEFAULT_ACTION,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function uploadAsset(file, assetType, fileParams, index = 0, mobilePushParams = {}) {
|
|
30
|
+
return {
|
|
31
|
+
type: types.UPLOAD_ASSET_REQUEST,
|
|
32
|
+
file,
|
|
33
|
+
assetType,
|
|
34
|
+
fileParams,
|
|
35
|
+
index,
|
|
36
|
+
mobilePushParams,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function getIosCtas(licenseCode) {
|
|
41
|
+
return {
|
|
42
|
+
type: types.GET_IOS_CTAS, licenseCode,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function clearAsset(index = undefined) {
|
|
47
|
+
return {
|
|
48
|
+
type: types.CLEAR_ASSET,
|
|
49
|
+
index,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function resetStore() {
|
|
54
|
+
return {
|
|
55
|
+
type: types.RESET_STORE,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function getTemplateDetails(id) {
|
|
60
|
+
return {
|
|
61
|
+
type: types.GET_TEMPLATE_DETAILS_REQUEST, id,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function editTemplate(template, callback) {
|
|
66
|
+
return {
|
|
67
|
+
type: types.EDIT_TEMPLATE_REQUEST, template, callback,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function clearEditResponse() {
|
|
72
|
+
return {
|
|
73
|
+
type: types.CLEAR_EDIT_RESPONSE_REQUEST,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function clearData() {
|
|
78
|
+
return {
|
|
79
|
+
type: types.CLEAR_DATA,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function getWeCrmAccounts(source) {
|
|
84
|
+
return {
|
|
85
|
+
type: types.GET_WECRM_ACCOUNTS_REQUEST, source,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function setWeChatAccount(weChatAccount) {
|
|
90
|
+
return {
|
|
91
|
+
type: types.SET_WECHAT_ACCOUNT,
|
|
92
|
+
weChatAccount,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function getMobilepushTemplatesList(channel, queryParams) {
|
|
97
|
+
return {
|
|
98
|
+
type: types.GET_MOBILEPUSH_TEMPLATES_LIST_REQUEST,
|
|
99
|
+
channel,
|
|
100
|
+
queryParams,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function setSelectedTemplate(templateData) {
|
|
105
|
+
return {
|
|
106
|
+
type: types.SET_SELECTED_TEMPLATE,
|
|
107
|
+
data: templateData,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function setTemplateDetails(templateDetails) {
|
|
112
|
+
return {
|
|
113
|
+
type: types.GET_TEMPLATE_DETAILS_SUCCESS,
|
|
114
|
+
data: templateDetails,
|
|
115
|
+
};
|
|
116
|
+
}
|