@capillarytech/creatives-library 9.1.8-alpha.sprint-cap-214249.38 → 9.2.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 -0
- package/index.js +13 -0
- package/package.json +1 -1
- package/services/getSchema.js +4 -1
- package/services/tests/getSchema.test.js +2 -2
- package/translations/en.json +1 -0
- package/translations/ja-JP.json +1 -0
- package/translations/zh.json +1 -0
- package/utils/common.js +6 -0
- package/utils/createMobilePushPayload.js +33 -47
- package/utils/tagValidations.js +35 -4
- package/utils/templateVarUtils.js +49 -0
- package/utils/tests/createMobilePushPayload.test.js +8 -102
- package/utils/tests/tagValidations.test.js +48 -0
- package/utils/tests/templateVarUtils.test.js +89 -0
- package/v2Components/CapMpushCTA/index.js +9 -10
- package/v2Components/CapMpushCTA/index.scss +3 -29
- package/v2Components/CapTagList/TagFallbackPanel.js +124 -0
- package/v2Components/CapTagList/constants.js +5 -0
- package/v2Components/CapTagList/index.js +46 -7
- package/v2Components/CapTagList/messages.js +44 -0
- package/v2Components/CapTagList/style.scss +113 -1
- package/v2Components/CapTagList/tests/TagFallback.test.js +222 -0
- package/v2Components/CapTagList/utils.js +17 -0
- package/v2Components/CommonTestAndPreview/UnifiedPreview/MobilePushPreviewContent.js +13 -26
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +1 -13
- package/v2Components/CommonTestAndPreview/constants.js +3 -2
- package/v2Components/CommonTestAndPreview/index.js +62 -62
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/MobilePushPreviewContent.test.js +5 -79
- package/v2Components/CommonTestAndPreview/tests/index.test.js +0 -86
- package/v2Components/CommonTestAndPreview/tests/utils.test.js +102 -0
- package/v2Components/CommonTestAndPreview/utils.js +42 -3
- package/v2Components/FormBuilder/Classic.js +24 -14
- package/v2Components/FormBuilder/Functional/channels/mobilepush/config.js +1 -0
- package/v2Components/FormBuilder/Functional/channels/mobilepush/getEditorErrorDescriptor.js +1 -1
- package/v2Components/FormBuilder/Functional/channels/mobilepush/tests/validate.test.js +57 -0
- package/v2Components/FormBuilder/Functional/channels/mobilepush/validate.js +4 -4
- package/v2Components/FormBuilder/Functional/channels/sms/getEditorErrorDescriptor.js +3 -0
- package/v2Components/FormBuilder/Functional/channels/sms/tests/getEditorErrorDescriptor.test.js +5 -0
- package/v2Components/FormBuilder/Functional/channels/sms/tests/validate.test.js +6 -0
- package/v2Components/FormBuilder/Functional/channels/sms/validate.js +3 -1
- package/v2Components/FormBuilder/Functional/renderers/mpushRenderers.js +3 -0
- package/v2Components/FormBuilder/Functional/tests/manual.typingPerf.test.js +135 -0
- package/v2Components/FormBuilder/Functional/tests/mpush.crossFlowParity.test.js +1 -1
- package/v2Components/FormBuilder/Functional/tests/mpush.ctaFlows.parity.test.js +320 -0
- package/v2Components/FormBuilder/Functional/tests/mpush.editContainer.parity.test.js +148 -0
- package/v2Components/FormBuilder/Functional/tests/mpush.libraryValidity.parity.test.js +152 -0
- package/v2Components/FormBuilder/Functional/tests/mpush.shellEvents.test.js +1 -1
- package/v2Components/FormBuilder/Functional/tests/mpush.singlePlatform.test.js +1 -1
- package/v2Components/FormBuilder/Functional/tests/mpushRenderers.test.js +22 -0
- package/v2Components/FormBuilder/tests/mpush.characterization.test.js +2 -2
- package/v2Components/TemplatePreview/_templatePreview.scss +2 -12
- package/v2Components/TemplatePreview/index.js +17 -30
- package/v2Components/TemplatePreview/tests/index.test.js +0 -61
- package/v2Containers/Cap/index.js +3 -0
- package/v2Containers/Cap/messages.js +4 -0
- package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +1 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +151 -70
- package/v2Containers/CreativesContainer/index.js +6 -3
- package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +0 -29
- package/v2Containers/InApp/index.js +4 -1
- 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/Text/index.js +3 -1
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +16 -0
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +18 -0
- package/v2Containers/MobilePush/Create/_mobilePushCreate.scss +70 -0
- package/v2Containers/MobilePush/Create/actions.js +52 -0
- package/v2Containers/MobilePush/Create/constants.js +26 -0
- package/v2Containers/MobilePush/Create/index.js +2149 -0
- package/v2Containers/MobilePush/Create/messages.js +349 -0
- package/v2Containers/MobilePush/Create/reducer.js +72 -0
- package/v2Containers/MobilePush/Create/sagas.js +79 -0
- package/v2Containers/MobilePush/Create/selectors.js +29 -0
- package/v2Containers/MobilePush/Create/test/contentValidity.test.js +154 -0
- package/v2Containers/MobilePush/Create/test/saga.test.js +19 -0
- package/v2Containers/MobilePush/Create/test/stayOpenOnSave.test.js +80 -0
- package/v2Containers/MobilePush/Edit/_mobilePushCreate.scss +65 -0
- package/v2Containers/MobilePush/Edit/actions.js +94 -0
- package/v2Containers/MobilePush/Edit/constants.js +37 -0
- package/v2Containers/MobilePush/Edit/index.js +2407 -0
- package/v2Containers/MobilePush/Edit/messages.js +341 -0
- package/v2Containers/MobilePush/Edit/reducer.js +113 -0
- package/v2Containers/MobilePush/Edit/sagas.js +113 -0
- package/v2Containers/MobilePush/Edit/selectors.js +33 -0
- package/v2Containers/MobilePush/Edit/test/contentValidity.test.js +149 -0
- package/v2Containers/MobilePush/Edit/test/saga.test.js +255 -0
- package/v2Containers/MobilePush/Edit/test/stayOpenOnSave.test.js +60 -0
- package/v2Containers/MobilePush/commonMethods.js +333 -0
- package/v2Containers/MobilePush/eventsMap.js +130 -0
- package/v2Containers/MobilePush/tests/commonMethods.test.js +401 -0
- package/v2Containers/MobilePushNew/components/CtaButtons.js +47 -52
- package/v2Containers/MobilePushNew/components/MediaUploaders.js +192 -207
- package/v2Containers/MobilePushNew/components/PlatformContentFields.js +121 -116
- package/v2Containers/MobilePushNew/components/tests/CtaButtons.test.js +208 -30
- package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +72 -316
- package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +16 -45
- package/v2Containers/MobilePushNew/constants.js +0 -5
- package/v2Containers/MobilePushNew/hooks/tests/usePlatformSync.test.js +1 -63
- package/v2Containers/MobilePushNew/hooks/tests/useUpload.test.js +0 -52
- package/v2Containers/MobilePushNew/hooks/usePlatformSync.js +1 -38
- package/v2Containers/MobilePushNew/hooks/useUpload.js +39 -29
- package/v2Containers/MobilePushNew/index.js +192 -454
- package/v2Containers/MobilePushNew/index.scss +4 -188
- package/v2Containers/MobilePushNew/messages.js +6 -86
- package/v2Containers/MobilePushNew/tests/index.test.js +1 -450
- package/v2Containers/MobilePushNew/tests/utils.test.js +0 -25
- package/v2Containers/MobilePushNew/utils.js +0 -8
- package/v2Containers/MobilepushWrapper/_mobilepushWrapper.scss +22 -0
- package/v2Containers/MobilepushWrapper/index.js +178 -0
- package/v2Containers/MobilepushWrapper/messages.js +29 -0
- package/v2Containers/Rcs/index.js +8 -1
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +59 -0
- package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +4 -0
- package/v2Containers/SmsTrai/Edit/index.js +17 -7
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +42 -0
- package/v2Containers/Templates/_templates.scss +2 -10
- package/v2Containers/Templates/index.js +90 -84
- package/v2Containers/Templates/tests/index.test.js +0 -68
- package/v2Containers/Viber/index.js +3 -1
- package/v2Containers/WebPush/Create/utils/validation.js +6 -0
- package/v2Containers/WebPush/Create/utils/validation.test.js +50 -0
- package/v2Containers/Whatsapp/index.js +9 -5
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +2 -2
- package/v2Containers/Zalo/index.js +4 -1
- package/v2Components/CapMpushCTA/tests/index.test.js +0 -89
- /package/{v2Components/FormBuilder/Functional/tests/fixtures/mpushInitialSchema.js → v2Containers/MobilePush/initialSchema.js} +0 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Edit Messages
|
|
3
|
+
*
|
|
4
|
+
* This contains all the text for the Edit component.
|
|
5
|
+
*/
|
|
6
|
+
import { defineMessages } from 'react-intl';
|
|
7
|
+
|
|
8
|
+
export default defineMessages({
|
|
9
|
+
"imageUploadLabel": {
|
|
10
|
+
id: 'creatives.containersV2.MobilePush.Edit.ImageUploadLabel',
|
|
11
|
+
defaultMessage: 'Upload image',
|
|
12
|
+
},
|
|
13
|
+
"Enter template name*": {
|
|
14
|
+
id: 'creatives.containersV2.MobilePush.Edit.enterTemplateNameImportant',
|
|
15
|
+
defaultMessage: 'Enter template name*',
|
|
16
|
+
},
|
|
17
|
+
"Enter template name": {
|
|
18
|
+
id: 'creatives.containersV2.MobilePush.Edit.enterTemplateName',
|
|
19
|
+
defaultMessage: 'Enter template name',
|
|
20
|
+
},
|
|
21
|
+
"Template name cannot be empty": {
|
|
22
|
+
id: 'creatives.containersV2.MobilePush.Edit.templateCantEmpty',
|
|
23
|
+
defaultMessage: 'Template name cannot be empty',
|
|
24
|
+
},
|
|
25
|
+
"Discard Changes": {
|
|
26
|
+
id: 'creatives.containersV2.MobilePush.Edit.discardChanges',
|
|
27
|
+
defaultMessage: 'Discard changes',
|
|
28
|
+
},
|
|
29
|
+
"Cancel": {
|
|
30
|
+
id: 'creatives.containersV2.MobilePush.Edit.cancel',
|
|
31
|
+
defaultMessage: 'Cancel',
|
|
32
|
+
},
|
|
33
|
+
"Save": {
|
|
34
|
+
id: 'creatives.containersV2.MobilePush.Edit.save',
|
|
35
|
+
defaultMessage: 'Save',
|
|
36
|
+
},
|
|
37
|
+
"Select Mobilepush Account": {
|
|
38
|
+
id: 'creatives.containersV2.MobilePush.Edit.selectMobilePushAccount',
|
|
39
|
+
defaultMessage: 'Select mobilepush account',
|
|
40
|
+
},
|
|
41
|
+
"Account Id": {
|
|
42
|
+
id: 'creatives.containersV2.MobilePush.Edit.accountId',
|
|
43
|
+
defaultMessage: 'Account id',
|
|
44
|
+
},
|
|
45
|
+
"Select Mobilepush Template": {
|
|
46
|
+
id: 'creatives.containersV2.MobilePush.Edit.selectMobilePushTemplate',
|
|
47
|
+
defaultMessage: 'Select mobilepush template',
|
|
48
|
+
},
|
|
49
|
+
"Template": {
|
|
50
|
+
id: 'creatives.containersV2.MobilePush.Edit.template',
|
|
51
|
+
defaultMessage: 'Template',
|
|
52
|
+
},
|
|
53
|
+
"Android": {
|
|
54
|
+
id: 'creatives.containersV2.MobilePush.Edit.Android',
|
|
55
|
+
defaultMessage: 'Android',
|
|
56
|
+
},
|
|
57
|
+
"Copy Title and Content From IOS": {
|
|
58
|
+
id: 'creatives.containersV2.MobilePush.Edit.copyFromIos',
|
|
59
|
+
defaultMessage: 'Copy Title and Content From IOS',
|
|
60
|
+
},
|
|
61
|
+
"Title*": {
|
|
62
|
+
id: 'creatives.containersV2.MobilePush.Edit.titleLabel',
|
|
63
|
+
defaultMessage: 'Title*',
|
|
64
|
+
},
|
|
65
|
+
"Title": {
|
|
66
|
+
id: 'creatives.containersV2.MobilePush.Edit.title',
|
|
67
|
+
defaultMessage: 'Title',
|
|
68
|
+
},
|
|
69
|
+
"Please input message title name.": {
|
|
70
|
+
id: 'creatives.containersV2.MobilePush.Edit.titleNameInvalid',
|
|
71
|
+
defaultMessage: 'Please enter the message title',
|
|
72
|
+
},
|
|
73
|
+
"Template message has unsupported/missing tags!": {
|
|
74
|
+
id: 'creatives.containersV2.MobilePush.Edit.messageHasUnsupportedTag',
|
|
75
|
+
defaultMessage: 'Please check the message content for unsupported/missing tags',
|
|
76
|
+
},
|
|
77
|
+
"Tags": {
|
|
78
|
+
id: 'creatives.containersV2.MobilePush.Edit.Tags',
|
|
79
|
+
defaultMessage: 'Tags',
|
|
80
|
+
},
|
|
81
|
+
"Message*": {
|
|
82
|
+
id: 'creatives.containersV2.MobilePush.Edit.messageLabel',
|
|
83
|
+
defaultMessage: 'Message*',
|
|
84
|
+
},
|
|
85
|
+
"Message": {
|
|
86
|
+
id: 'creatives.containersV2.MobilePush.Edit.message',
|
|
87
|
+
defaultMessage: 'Message',
|
|
88
|
+
},
|
|
89
|
+
"Please input mobile push template content.": {
|
|
90
|
+
id: 'creatives.containersV2.MobilePush.Edit.inputMobilePushTemplateContent',
|
|
91
|
+
defaultMessage: 'Please enter the message content',
|
|
92
|
+
},
|
|
93
|
+
"addPrimaryCTA": {
|
|
94
|
+
id: 'creatives.containersV2.MobilePush.Edit.addPrimaryCTA',
|
|
95
|
+
defaultMessage: 'Add primary CTA',
|
|
96
|
+
},
|
|
97
|
+
"addSecondaryCTA": {
|
|
98
|
+
id: 'creatives.containersV2.MobilePush.Edit.addSecondaryCTA',
|
|
99
|
+
defaultMessage: 'Add secondary CTA',
|
|
100
|
+
},
|
|
101
|
+
"iOS": {
|
|
102
|
+
id: 'creatives.containersV2.MobilePush.Edit.iOS',
|
|
103
|
+
defaultMessage: 'iOS',
|
|
104
|
+
},
|
|
105
|
+
"Copy Title and Content From Android": {
|
|
106
|
+
id: 'creatives.containersV2.MobilePush.Edit.copyFromAndroid',
|
|
107
|
+
defaultMessage: 'Copy Title and Content From Android',
|
|
108
|
+
},
|
|
109
|
+
"Template title has unsupported/missing tags.": {
|
|
110
|
+
id: 'creatives.containersV2.MobilePush.Edit.titleHasUnsupportedTag',
|
|
111
|
+
defaultMessage: 'Please check the message content for unsupported/missing tags',
|
|
112
|
+
},
|
|
113
|
+
"Template name cannot be empty.": {
|
|
114
|
+
id: 'creatives.containersV2.MobilePush.Edit.templateNameNotEmpty',
|
|
115
|
+
defaultMessage: 'Please provide a template name ',
|
|
116
|
+
},
|
|
117
|
+
"Message title has unsupported/missing tags!": {
|
|
118
|
+
id: 'creatives.containersV2.MobilePush.Edit.messageTitleWithUnsupportedTag',
|
|
119
|
+
defaultMessage: 'Please check the message content for unsupported/missing tags',
|
|
120
|
+
},
|
|
121
|
+
"Image": {
|
|
122
|
+
id: 'creatives.containersV2.MobilePush.Edit.Image',
|
|
123
|
+
defaultMessage: 'Image',
|
|
124
|
+
},
|
|
125
|
+
"Max file size acceptable is 5mb": {
|
|
126
|
+
id: 'creatives.containersV2.MobilePush.Edit.maxUploadFileSize',
|
|
127
|
+
defaultMessage: 'Max file size acceptable is 5mb',
|
|
128
|
+
},
|
|
129
|
+
"Please upload Image": {
|
|
130
|
+
id: 'creatives.containersV2.MobilePush.Edit.pleaseUploadImage',
|
|
131
|
+
defaultMessage: 'Please upload image',
|
|
132
|
+
},
|
|
133
|
+
"Upload Image": {
|
|
134
|
+
id: 'creatives.containersV2.MobilePush.Edit.uploadImage',
|
|
135
|
+
defaultMessage: 'Upload image',
|
|
136
|
+
},
|
|
137
|
+
"MOBILEPUSH Template Edited Successfully": {
|
|
138
|
+
id: 'creatives.containersV2.MobilePush.Edit.templateEditedSuccessfully',
|
|
139
|
+
defaultMessage: 'MOBILEPUSH template edited successfully',
|
|
140
|
+
},
|
|
141
|
+
"somethingWentWrong": {
|
|
142
|
+
id: 'creatives.containersV2.MobilePush.Edit.somethingWentWrong',
|
|
143
|
+
defaultMessage: 'Something went wrong!!',
|
|
144
|
+
},
|
|
145
|
+
"Select DeepLink": {
|
|
146
|
+
id: 'creatives.containersV2.MobilePush.Edit.selectDeepLink',
|
|
147
|
+
defaultMessage: 'Select deepLink',
|
|
148
|
+
},
|
|
149
|
+
"External Link": {
|
|
150
|
+
id: 'creatives.containersV2.MobilePush.Edit.externalLink',
|
|
151
|
+
defaultMessage: 'External link',
|
|
152
|
+
},
|
|
153
|
+
"External Link cannot be empty": {
|
|
154
|
+
id: 'creatives.containersV2.MobilePush.Edit.externalLinkCantEmpty',
|
|
155
|
+
defaultMessage: 'External link cannot be empty',
|
|
156
|
+
},
|
|
157
|
+
"External Link cannot be empty.": {
|
|
158
|
+
id: 'creatives.containersV2.MobilePush.Edit.externalLinkCantEmpty1',
|
|
159
|
+
defaultMessage: 'External link cannot be empty.',
|
|
160
|
+
},
|
|
161
|
+
"Do you really want to go back? All your temporary changes will be lost!": {
|
|
162
|
+
id: 'creatives.containersV2.MobilePush.Edit.goBackConfirmation',
|
|
163
|
+
defaultMessage: "Going back will discard all the changes you've made. Continue?",
|
|
164
|
+
},
|
|
165
|
+
"Secondary CTA": {
|
|
166
|
+
id: 'creatives.containersV2.MobilePush.Edit.secondaryCTA',
|
|
167
|
+
defaultMessage: 'Secondary CTA',
|
|
168
|
+
},
|
|
169
|
+
"nameAndDescription": {
|
|
170
|
+
id: 'creatives.containersV2.MobilePush.Edit.nameAndDescription',
|
|
171
|
+
defaultMessage: 'Name and description',
|
|
172
|
+
},
|
|
173
|
+
"button1": {
|
|
174
|
+
id: 'creatives.containersV2.MobilePush.Edit.button1',
|
|
175
|
+
defaultMessage: 'Button 1',
|
|
176
|
+
},
|
|
177
|
+
"button2": {
|
|
178
|
+
id: 'creatives.containersV2.MobilePush.Edit.button2',
|
|
179
|
+
defaultMessage: 'Button 2',
|
|
180
|
+
},
|
|
181
|
+
"addAnotherCTA": {
|
|
182
|
+
id: 'creatives.containersV2.MobilePush.Edit.addAnotherCTA',
|
|
183
|
+
defaultMessage: 'Add another CTA',
|
|
184
|
+
},
|
|
185
|
+
"selectLinkType": {
|
|
186
|
+
id: 'creatives.containersV2.MobilePush.Edit.selectLinkType',
|
|
187
|
+
defaultMessage: 'Please select link type',
|
|
188
|
+
},
|
|
189
|
+
"Primary CTA": {
|
|
190
|
+
id: 'creatives.containersV2.MobilePush.Edit.primaryCTA',
|
|
191
|
+
defaultMessage: 'Primary CTA',
|
|
192
|
+
},
|
|
193
|
+
"Enter CTA Label here": {
|
|
194
|
+
id: 'creatives.containersV2.MobilePush.Edit.enterCTALabel',
|
|
195
|
+
defaultMessage: 'Enter CTA label here',
|
|
196
|
+
},
|
|
197
|
+
"CTA label cannot be empty.": {
|
|
198
|
+
id: 'creatives.containersV2.MobilePush.Edit.ctaLabelCantEmpty',
|
|
199
|
+
defaultMessage: 'CTA label cannot be empty.',
|
|
200
|
+
},
|
|
201
|
+
"selectDeeplink": {
|
|
202
|
+
id: 'creatives.containersV2.MobilePush.Edit.selectDeeplink',
|
|
203
|
+
defaultMessage: 'Select deeplink',
|
|
204
|
+
},
|
|
205
|
+
"selectADeeplink": {
|
|
206
|
+
id: 'creatives.containersV2.MobilePush.Edit.selectADeeplink',
|
|
207
|
+
defaultMessage: 'Select a deeplink',
|
|
208
|
+
},
|
|
209
|
+
"File size cannot be more than 5mb": {
|
|
210
|
+
id: 'creatives.containersV2.MobilePush.Edit.uploadFileSizeError',
|
|
211
|
+
defaultMessage: 'File size cannot be more than 5mb',
|
|
212
|
+
},
|
|
213
|
+
"valueCantEmpty": {
|
|
214
|
+
id: 'creatives.containersV2.MobilePush.Edit.valueCantEmpty',
|
|
215
|
+
defaultMessage: 'value cannot be empty.',
|
|
216
|
+
},
|
|
217
|
+
"deleteSecondCTAFirst": {
|
|
218
|
+
id: 'creatives.containersV2.MobilePush.Edit.deleteSecondCTAFirst',
|
|
219
|
+
defaultMessage: 'Please delete second Secondary cta First',
|
|
220
|
+
},
|
|
221
|
+
"Uploading Image...": {
|
|
222
|
+
id: 'creatives.containersV2.MobilePush.Edit.uploadingImage',
|
|
223
|
+
defaultMessage: 'Uploading image...',
|
|
224
|
+
},
|
|
225
|
+
"Campaigns": {
|
|
226
|
+
id: 'creatives.containersV2.MobilePush.Edit.Campaigns',
|
|
227
|
+
defaultMessage: 'Campaigns',
|
|
228
|
+
},
|
|
229
|
+
"Creatives": {
|
|
230
|
+
id: 'creatives.containersV2.MobilePush.Edit.Creatives',
|
|
231
|
+
defaultMessage: 'Creatives',
|
|
232
|
+
},
|
|
233
|
+
"Mobile Push": {
|
|
234
|
+
id: 'creatives.containersV2.MobilePush.Edit.mobilePush',
|
|
235
|
+
defaultMessage: 'Mobile Push',
|
|
236
|
+
},
|
|
237
|
+
"templateNotConfigured": {
|
|
238
|
+
id: 'creatives.containersV2.MobilePush.Edit.templateNotConfigured',
|
|
239
|
+
defaultMessage: 'Template not configured,',
|
|
240
|
+
},
|
|
241
|
+
"androidTemplateNotConfigured": {
|
|
242
|
+
id: 'creatives.containersV2.MobilePush.Edit.androidTemplateNotConfigured',
|
|
243
|
+
defaultMessage: 'Android template is not configured. Continue save?',
|
|
244
|
+
},
|
|
245
|
+
"iosTemplateNotConfigured": {
|
|
246
|
+
id: 'creatives.containersV2.MobilePush.Edit.iosTemplateNotConfigured',
|
|
247
|
+
defaultMessage: 'IOS template is not configured, save without IOS template',
|
|
248
|
+
},
|
|
249
|
+
"selectActionButton": {
|
|
250
|
+
id: 'creatives.containersV2.MobilePush.Edit.selectActionButton',
|
|
251
|
+
defaultMessage: 'Select action buttons',
|
|
252
|
+
},
|
|
253
|
+
"validationError": {
|
|
254
|
+
id: 'creatives.containersV2.MobilePush.Edit.validationError',
|
|
255
|
+
defaultMessage: 'Validation error',
|
|
256
|
+
},
|
|
257
|
+
"invalidIosMessage": {
|
|
258
|
+
id: 'creatives.containersV2.MobilePush.Edit.invalidIosMessage',
|
|
259
|
+
defaultMessage: 'Validation failed for IOS',
|
|
260
|
+
},
|
|
261
|
+
"invalidAndroidMessage": {
|
|
262
|
+
id: 'creatives.containersV2.MobilePush.Edit.invalidAndroidMessage',
|
|
263
|
+
defaultMessage: 'Validation failed for android',
|
|
264
|
+
},
|
|
265
|
+
"invalidTags": {
|
|
266
|
+
id: 'creatives.containersV2.MobilePush.Edit.invalidTags',
|
|
267
|
+
defaultMessage: 'Invalid tags',
|
|
268
|
+
},
|
|
269
|
+
"alertMessage": {
|
|
270
|
+
id: 'creatives.containersV2.MobilePush.Edit.alertMessage',
|
|
271
|
+
defaultMessage: 'Alert',
|
|
272
|
+
},
|
|
273
|
+
"cantCopyEmptyFieldValues": {
|
|
274
|
+
id: 'creatives.containersV2.MobilePush.Edit.cantCopyEmptyFieldValues',
|
|
275
|
+
defaultMessage: 'Cannot copy empty field values.',
|
|
276
|
+
},
|
|
277
|
+
"goBackTemporaryChangesLost": {
|
|
278
|
+
id: 'creatives.containersV2.MobilePush.Edit.goBackTemporaryChangesLost',
|
|
279
|
+
defaultMessage: "Do you really want to go back? All your temporary changes will be lost!",
|
|
280
|
+
},
|
|
281
|
+
"pleaseInput": {
|
|
282
|
+
id: 'creatives.containersV2.MobilePush.Edit.pleaseInput',
|
|
283
|
+
defaultMessage: "Please input",
|
|
284
|
+
},
|
|
285
|
+
"change": {
|
|
286
|
+
id: 'creatives.containersV2.MobilePush.Edit.change',
|
|
287
|
+
defaultMessage: "change",
|
|
288
|
+
},
|
|
289
|
+
"aPageWithMobileApp": {
|
|
290
|
+
id: 'creatives.containersV2.MobilePush.Edit.aPageWithMobileApp',
|
|
291
|
+
defaultMessage: 'A page within mobile app',
|
|
292
|
+
},
|
|
293
|
+
"anExternalWebPage": {
|
|
294
|
+
id: 'creatives.containersV2.MobilePush.Edit.anExternalWebPage',
|
|
295
|
+
defaultMessage: 'An external web page',
|
|
296
|
+
},
|
|
297
|
+
"Button label": {
|
|
298
|
+
id: 'creatives.containersV2.MobilePush.Edit.buttonLabel',
|
|
299
|
+
defaultMessage: 'Button label',
|
|
300
|
+
},
|
|
301
|
+
"Add labels": {
|
|
302
|
+
id: 'creatives.containersV2.addLabels',
|
|
303
|
+
defaultMessage: 'Add labels',
|
|
304
|
+
},
|
|
305
|
+
"Cover Image": {
|
|
306
|
+
id: `creatives.containersV2.MobilePush.Edit.coverImage`,
|
|
307
|
+
defaultMessage: 'Cover image',
|
|
308
|
+
},
|
|
309
|
+
"Maximum file size acceptable is 5 MB": {
|
|
310
|
+
id: 'creatives.containersV2.MobilePush.Edit.coverImageDescription',
|
|
311
|
+
defaultMessage: 'Maximum file size acceptable is 5 MB',
|
|
312
|
+
},
|
|
313
|
+
"Add action link to content": {
|
|
314
|
+
id: 'creatives.containersV2.MobilePush.Edit.addActionLinkToContent',
|
|
315
|
+
defaultMessage: 'Add action link to content',
|
|
316
|
+
},
|
|
317
|
+
"Add a hyperlink of the page which customer will be directed to": {
|
|
318
|
+
id: 'creatives.containersV2.MobilePush.Edit.addActionLinkToContentDescription',
|
|
319
|
+
defaultMessage: 'Add a hyperlink of the page which customer will be directed to',
|
|
320
|
+
},
|
|
321
|
+
"Add primary button to notification": {
|
|
322
|
+
id: 'creatives.containersV2.MobilePush.Edit.addPrimaryButtonToNotification',
|
|
323
|
+
defaultMessage: 'Add primary button to notification',
|
|
324
|
+
},
|
|
325
|
+
"Add secondary button to notification": {
|
|
326
|
+
id: 'creatives.containersV2.MobilePush.Edit.addSecondaryButtonToNotification',
|
|
327
|
+
defaultMessage: 'Add secondary button to notification',
|
|
328
|
+
},
|
|
329
|
+
"Add action buttons to notification": {
|
|
330
|
+
id: 'creatives.containersV2.MobilePush.Edit.addActionButtonsToNotification',
|
|
331
|
+
defaultMessage: 'Add action buttons to notification',
|
|
332
|
+
},
|
|
333
|
+
"This section is being revamped. Till then it will remain disabled.": {
|
|
334
|
+
id: 'creatives.containersV2.MobilePush.Edit.thisSectionDisabledHoverText',
|
|
335
|
+
defaultMessage: 'This section is being revamped. Till then it will remain disabled.',
|
|
336
|
+
},
|
|
337
|
+
"personalizationTokensErrorMessage": {
|
|
338
|
+
id: 'creatives.containersV2.MobilePush.Edit.personalizationTokensErrorMessage',
|
|
339
|
+
defaultMessage: 'Personalization tags are not supported for anonymous customers, please remove the tags.',
|
|
340
|
+
},
|
|
341
|
+
});
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* Create reducer
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { fromJS } from 'immutable';
|
|
8
|
+
import * as types from './constants';
|
|
9
|
+
|
|
10
|
+
const initialState = fromJS({
|
|
11
|
+
editTemplateInProgress: false,
|
|
12
|
+
editResponse: {},
|
|
13
|
+
getTemplateDetailsInProgress: false,
|
|
14
|
+
templateDetails: {},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
function editReducer(state = initialState, action) {
|
|
18
|
+
switch (action.type) {
|
|
19
|
+
case types.DEFAULT_ACTION:
|
|
20
|
+
return state;
|
|
21
|
+
case types.EDIT_TEMPLATE_REQUEST:
|
|
22
|
+
return state
|
|
23
|
+
.set('editTemplateInProgress', true)
|
|
24
|
+
.set('editTemplateError', false)
|
|
25
|
+
.set('editTemplateErrorMessage', fromJS(""));
|
|
26
|
+
case types.EDIT_TEMPLATE_SUCCESS:
|
|
27
|
+
return state.set('editTemplateInProgress', false)
|
|
28
|
+
.set('editResponse', action.data)
|
|
29
|
+
.set('editTemplateError', (action.statusCode !== undefined && action.statusCode > 300))
|
|
30
|
+
.set('editTemplateErrorMessage', fromJS(action.errorMsg));
|
|
31
|
+
case types.EDIT_TEMPLATE_FAILURE:
|
|
32
|
+
return state
|
|
33
|
+
.set('editTemplateInProgress', false)
|
|
34
|
+
.set('editTemplateError', true)
|
|
35
|
+
.set('editTemplateErrorMessage', fromJS(action.errorMsg));
|
|
36
|
+
case types.GET_TEMPLATE_DETAILS_REQUEST:
|
|
37
|
+
return state.set('getTemplateDetailsInProgress', true);
|
|
38
|
+
case types.GET_TEMPLATE_DETAILS_SUCCESS:
|
|
39
|
+
case types.SET_SELECTED_TEMPLATE:
|
|
40
|
+
return state.set('getTemplateDetailsInProgress', false)
|
|
41
|
+
.set('templateDetails', action.data);
|
|
42
|
+
case types.GET_TEMPLATE_DETAILS_FAILURE:
|
|
43
|
+
return state.set('getTemplateDetailsInProgress', false);
|
|
44
|
+
case types.CLEAR_EDIT_RESPONSE_REQUEST:
|
|
45
|
+
return state.set('editResponse', {});
|
|
46
|
+
case types.GET_IOS_CTAS:
|
|
47
|
+
return state
|
|
48
|
+
.set("getIosCtasSucccess", false)
|
|
49
|
+
.set("iosCtasLoading", true);
|
|
50
|
+
case types.GET_IOS_CTAS_SUCCESS:
|
|
51
|
+
return state
|
|
52
|
+
.set('getIosCtasSucccess', (action.statusCode !== undefined && action.statusCode !== '' && action.statusCode < 300))
|
|
53
|
+
.set('iosCtasLoading', false)
|
|
54
|
+
.set('iosCtasData', action.data);
|
|
55
|
+
case types.GET_IOS_CTAS_FAILURE:
|
|
56
|
+
return state
|
|
57
|
+
.set('getIosCtasSucccess', false)
|
|
58
|
+
.set('iosCtasLoading', false);
|
|
59
|
+
case types.UPLOAD_ASSET_REQUEST:
|
|
60
|
+
return state
|
|
61
|
+
.set('uploadAssetSuccess', false)
|
|
62
|
+
.set('assetUploading', true);
|
|
63
|
+
case types.UPLOAD_ASSET_SUCCESS:
|
|
64
|
+
return state
|
|
65
|
+
.set('uploadAssetSuccess', (action.statusCode !== undefined && action.statusCode !== '' && action.statusCode < 300))
|
|
66
|
+
.set('assetUploading', false)
|
|
67
|
+
.set('uploadedAssetData', action.data);
|
|
68
|
+
case types.UPLOAD_ASSET_FAILURE:
|
|
69
|
+
return state
|
|
70
|
+
.set('uploadAssetSuccess', false)
|
|
71
|
+
.set('assetUploading', false);
|
|
72
|
+
case types.CLEAR_DATA:
|
|
73
|
+
return state
|
|
74
|
+
.delete('uploadedAssetData')
|
|
75
|
+
.delete('metaEntities')
|
|
76
|
+
.delete('templateDetails')
|
|
77
|
+
.delete('iosCtasData');
|
|
78
|
+
case types.CLEAR_ASSET:
|
|
79
|
+
return state
|
|
80
|
+
.delete('uploadedAssetData');
|
|
81
|
+
case types.GET_WECRM_ACCOUNTS_REQUEST:
|
|
82
|
+
return state
|
|
83
|
+
.set('fetchingWeCrmAccounts', true)
|
|
84
|
+
.set('weCrmAccountFetchingError', false);
|
|
85
|
+
case types.GET_WECRM_ACCOUNTS_SUCCESS:
|
|
86
|
+
return state
|
|
87
|
+
.set('fetchingWeCrmAccounts', false)
|
|
88
|
+
.set('weCrmAccounts', fromJS(action.data));
|
|
89
|
+
case types.GET_WECRM_ACCOUNTS_FAILURE:
|
|
90
|
+
return state
|
|
91
|
+
.set('fetchingWeCrmAccounts', false)
|
|
92
|
+
.set('weCrmAccountFetchingError', true);
|
|
93
|
+
case types.SET_WECHAT_ACCOUNT:
|
|
94
|
+
return state
|
|
95
|
+
.set('selectedWeChatAccount', fromJS(action.weChatAccount))
|
|
96
|
+
.delete('mobilepushTemplates');
|
|
97
|
+
case types.GET_MOBILEPUSH_TEMPLATES_LIST_REQUEST:
|
|
98
|
+
return state
|
|
99
|
+
.set('fetchingDefaultTemplates', true);
|
|
100
|
+
case types.GET_MOBILEPUSH_TEMPLATES_LIST_SUCCESS:
|
|
101
|
+
return state
|
|
102
|
+
.set('fetchingDefaultTemplates', false)
|
|
103
|
+
.set('mobilepushTemplates', fromJS(action.data));
|
|
104
|
+
case types.GET_MOBILEPUSH_TEMPLATES_LIST_FAILURE:
|
|
105
|
+
return state
|
|
106
|
+
.set('fetchingDefaultTemplates', false)
|
|
107
|
+
.set('errorFetchingDefaultTempalte', true);
|
|
108
|
+
default:
|
|
109
|
+
return state;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export default editReducer;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {
|
|
2
|
+
call, put, takeLatest, all,
|
|
3
|
+
} from 'redux-saga/effects';
|
|
4
|
+
// import { schema, normalize } from 'normalizr';
|
|
5
|
+
import * as Api from '../../../services/api';
|
|
6
|
+
import * as types from './constants';
|
|
7
|
+
|
|
8
|
+
// Individual exports for testing
|
|
9
|
+
export function* editTemplate(template) {
|
|
10
|
+
let errorMsg;
|
|
11
|
+
try {
|
|
12
|
+
const result = yield call(Api.createMobilePushTemplate, template);
|
|
13
|
+
|
|
14
|
+
if (result.message || result.status.code === 500) {
|
|
15
|
+
errorMsg = result.message;
|
|
16
|
+
}
|
|
17
|
+
yield put( {
|
|
18
|
+
type: types.EDIT_TEMPLATE_SUCCESS, data: result.response, statusCode: result.status ? result.status.code : '', errorMsg,
|
|
19
|
+
});
|
|
20
|
+
yield call(template.callback, { templateId: result?.response?.templateId._id });
|
|
21
|
+
} catch (error) {
|
|
22
|
+
yield put({ type: types.EDIT_TEMPLATE_FAILURE, error, errorMsg });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function* getTemplateDetails(id) {
|
|
27
|
+
try {
|
|
28
|
+
const result = yield call(Api.getTemplateDetails, id);
|
|
29
|
+
// const sidebar = result.response.sidebar;
|
|
30
|
+
yield put({ type: types.GET_TEMPLATE_DETAILS_SUCCESS, data: result.response });
|
|
31
|
+
} catch (error) {
|
|
32
|
+
yield put({ type: types.GET_TEMPLATE_DETAILS_FAILURE, error });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export function* uploadAsset(file, assetType, fileParams, mode) {
|
|
36
|
+
try {
|
|
37
|
+
const result = yield call(Api.uploadFile, file, assetType, fileParams, mode);
|
|
38
|
+
yield put({ type: types.UPLOAD_ASSET_SUCCESS, data: result.response.asset, statusCode: result.status ? result.status.code : '' });
|
|
39
|
+
} catch (error) {
|
|
40
|
+
yield put({ type: types.UPLOAD_ASSET_FAILURE, error });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export function* getIosCtas(licenseCode) {
|
|
44
|
+
try {
|
|
45
|
+
const result = yield call(Api.getIosCtas, licenseCode);
|
|
46
|
+
yield put({ type: types.GET_IOS_CTAS_SUCCESS, data: result.response.metaEntities.data, statusCode: result.status ? result.status.code : '' });
|
|
47
|
+
} catch (error) {
|
|
48
|
+
yield put({ type: types.GET_IOS_CTAS_FAILURE, error });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function* getMobilepushTemplatesList(params) {
|
|
53
|
+
try {
|
|
54
|
+
const result = yield call(Api.getAllTemplates, {channel: params.channel, queryParams: params.queryParams});
|
|
55
|
+
yield put({ type: types.GET_MOBILEPUSH_TEMPLATES_LIST_SUCCESS, data: result.response.templates, templateData: result.response.mapped});
|
|
56
|
+
} catch (error) {
|
|
57
|
+
yield put({ type: types.GET_MOBILEPUSH_TEMPLATES_LIST_FAILURE, error });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function* fetchWeCrmAccounts(action) {
|
|
62
|
+
try {
|
|
63
|
+
const result = yield call(Api.fetchWeCrmAccounts, action.source);
|
|
64
|
+
yield put({
|
|
65
|
+
type: types.GET_WECRM_ACCOUNTS_SUCCESS,
|
|
66
|
+
data: result.response,
|
|
67
|
+
});
|
|
68
|
+
} catch (error) {
|
|
69
|
+
yield put({
|
|
70
|
+
type: types.GET_WECRM_ACCOUNTS_FAILURE,
|
|
71
|
+
data: error,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function* watchFetchWeCrmAccounts() {
|
|
77
|
+
yield takeLatest(types.GET_WECRM_ACCOUNTS_REQUEST, fetchWeCrmAccounts);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function* watchEditTemplate() {
|
|
81
|
+
yield takeLatest(types.EDIT_TEMPLATE_REQUEST, editTemplate);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function* watchGetTemplateDetails() {
|
|
85
|
+
yield takeLatest(types.GET_TEMPLATE_DETAILS_REQUEST, getTemplateDetails);
|
|
86
|
+
}
|
|
87
|
+
function* watchUploadAsset() {
|
|
88
|
+
yield takeLatest(types.UPLOAD_ASSET_REQUEST, uploadAsset);
|
|
89
|
+
}
|
|
90
|
+
function* watchGetIosCtas() {
|
|
91
|
+
yield takeLatest(types.GET_IOS_CTAS, getIosCtas);
|
|
92
|
+
}
|
|
93
|
+
function* watchMobilepushTemplatesList() {
|
|
94
|
+
yield takeLatest(types.GET_MOBILEPUSH_TEMPLATES_LIST_REQUEST, getMobilepushTemplatesList);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// All sagas to be loaded
|
|
98
|
+
export default [
|
|
99
|
+
watchEditTemplate, watchGetTemplateDetails, watchFetchWeCrmAccounts, watchMobilepushTemplatesList,
|
|
100
|
+
watchUploadAsset,
|
|
101
|
+
watchGetIosCtas,
|
|
102
|
+
];
|
|
103
|
+
|
|
104
|
+
export function* v2MobilePushEditSagas() {
|
|
105
|
+
yield all([
|
|
106
|
+
watchEditTemplate(),
|
|
107
|
+
watchGetTemplateDetails(),
|
|
108
|
+
watchFetchWeCrmAccounts(),
|
|
109
|
+
watchMobilepushTemplatesList(),
|
|
110
|
+
watchUploadAsset(),
|
|
111
|
+
watchGetIosCtas(),
|
|
112
|
+
]);
|
|
113
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createSelector } from 'reselect';
|
|
2
|
+
import { fromJS } from 'immutable';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Direct selector to the create state domain
|
|
6
|
+
*/
|
|
7
|
+
const selectMobilePushEditDomain = () => (state) => state.get('mobileEdit') || fromJS({}); // reducer injected as mobileEdit in library mode.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Other specific selectors
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Default selector used by Create
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const makeSelectEdit = () => createSelector(
|
|
20
|
+
selectMobilePushEditDomain(),
|
|
21
|
+
(substate) => substate.toJS()
|
|
22
|
+
);
|
|
23
|
+
const makeSelectEditResponse = () => createSelector(
|
|
24
|
+
selectMobilePushEditDomain(), (dimensionState) => dimensionState.get('editResponse')
|
|
25
|
+
);
|
|
26
|
+
const makeSelectTemplateDetailsResponse = () => createSelector(
|
|
27
|
+
makeSelectEdit(), (dimensionState) => dimensionState.templateDetails
|
|
28
|
+
);
|
|
29
|
+
const makeSelectIosCta = () => createSelector(makeSelectEdit(), (create) => create.getIosCtasSucccess && create.iosCtasData );
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
makeSelectEdit, makeSelectEditResponse, makeSelectTemplateDetailsResponse, makeSelectIosCta,
|
|
33
|
+
};
|