@capillarytech/creatives-library 2.0.61 → 2.0.63
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/app.js +1 -1
- package/assets/NoImage1.js +50 -0
- package/assets/WithImage1.js +57 -0
- package/components/FormBuilder/_formBuilder.scss +8 -3
- package/components/FormBuilder/index.js +94 -64
- package/components/PreviewSideBar/_previewsidebar.scss +1 -1
- package/components/TemplatePreview/_templatePreview.scss +1 -1
- package/containers/CreativesContainer/SlideBoxContent.js +1 -1
- package/containers/CreativesContainer/index.js +1 -1
- package/containers/MobilePush/Create/_mobilePushCreate.scss +13 -0
- package/containers/MobilePush/Create/actions.js +6 -0
- package/containers/MobilePush/Create/constants.js +1 -0
- package/containers/MobilePush/Create/index.js +626 -1128
- package/containers/MobilePush/Create/messages.js +5 -1
- package/containers/MobilePush/Create/reducer.js +2 -0
- package/containers/MobilePush/Create/selectors.js +3 -3
- package/containers/MobilePush/Edit/_mobilePushCreate.scss +10 -0
- package/containers/MobilePush/Edit/index.js +375 -1106
- package/containers/MobilePush/Edit/messages.js +4 -0
- package/containers/MobilePush/Edit/reducer.js +2 -1
- package/containers/MobilePush/Edit/selectors.js +3 -1
- package/containers/MobilePush/commonMethods.js +249 -0
- package/containers/MobilePush/eventsMap.js +127 -0
- package/containers/MobilePush/initialSchema.js +1751 -0
- package/containers/MobilepushWrapper/_mobilepushWrapper.scss +18 -0
- package/containers/MobilepushWrapper/index.js +7 -4
- package/containers/Sms/Create/_smsCreate.scss +1 -1
- package/containers/TemplatesV2/index.js +7 -8
- package/global-styles.js +1 -0
- package/index.html +2 -0
- package/package.json +1 -1
- package/services/api.js +3 -0
|
@@ -246,4 +246,8 @@ export default defineMessages({
|
|
|
246
246
|
id: 'app.containers.MobilePush.Edit.iosTemplateNotConfigured',
|
|
247
247
|
defaultMessage: 'IOS template is not configured, Save without IOS template',
|
|
248
248
|
},
|
|
249
|
+
"selectActionButton": {
|
|
250
|
+
id: 'app.containers.MobilePush.Create.mobilePush',
|
|
251
|
+
defaultMessage: 'Select action buttons',
|
|
252
|
+
},
|
|
249
253
|
});
|
|
@@ -73,7 +73,8 @@ function editReducer(state = initialState, action) {
|
|
|
73
73
|
return state
|
|
74
74
|
.delete('uploadedAssetData')
|
|
75
75
|
.delete('metaEntities')
|
|
76
|
-
.delete('templateDetails')
|
|
76
|
+
.delete('templateDetails')
|
|
77
|
+
.delete('iosCtasData');
|
|
77
78
|
case types.CLEAR_ASSET:
|
|
78
79
|
return state
|
|
79
80
|
.delete('uploadedAssetData');
|
|
@@ -25,6 +25,8 @@ const makeSelectEditResponse = () => createSelector(
|
|
|
25
25
|
const makeSelectTemplateDetailsResponse = () => createSelector(
|
|
26
26
|
selectMobilePushEditDomain(), (dimensionState) => dimensionState.get('templateDetails')
|
|
27
27
|
);
|
|
28
|
+
const makeSelectIosCta = () => createSelector(makeSelectEdit(), (create) => create.getIosCtasSucccess && create.iosCtasData );
|
|
29
|
+
|
|
28
30
|
export {
|
|
29
|
-
makeSelectEdit, makeSelectEditResponse, makeSelectTemplateDetailsResponse,
|
|
31
|
+
makeSelectEdit, makeSelectEditResponse, makeSelectTemplateDetailsResponse, makeSelectIosCta,
|
|
30
32
|
};
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import {get, filter, cloneDeep} from 'lodash';
|
|
2
|
+
|
|
3
|
+
function getPrimaryCtaFields({inputFields, fieldIndex, deepLinkOptions}) {
|
|
4
|
+
const newInputFields = cloneDeep(inputFields);
|
|
5
|
+
newInputFields.splice(fieldIndex + 1, 0, {
|
|
6
|
+
rowClassName: 'mobile-push-row',
|
|
7
|
+
identifier: `cta-deeplink${this.state.currentTab > 1 ? this.state.currentTab : ''}`,
|
|
8
|
+
|
|
9
|
+
cols: [
|
|
10
|
+
{
|
|
11
|
+
id: `cta-deeplink${this.state.currentTab > 1 ? this.state.currentTab : ''}`,
|
|
12
|
+
type: "radioGroup", //Resembles component to be used
|
|
13
|
+
metaType: "text",
|
|
14
|
+
datatype: "string",
|
|
15
|
+
options: ["Deeplink", "External Link"],
|
|
16
|
+
inductiveText: ["A page within mobile app", "An external web page"],
|
|
17
|
+
value: "Deeplink",
|
|
18
|
+
required: true,
|
|
19
|
+
width: 18,
|
|
20
|
+
offset: 1,
|
|
21
|
+
errorMessage: "Please select link type",
|
|
22
|
+
fluid: true,
|
|
23
|
+
styling: "semantic",
|
|
24
|
+
order: 1,
|
|
25
|
+
customComponent: false,
|
|
26
|
+
supportedEvents: ["onChange"],
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
],
|
|
30
|
+
});
|
|
31
|
+
newInputFields.splice(fieldIndex + 2, 0, {
|
|
32
|
+
rowClassName: 'mobile-push-row',
|
|
33
|
+
id: 'cta-deeplink-select-section',
|
|
34
|
+
identifier: `cta-deeplink${this.state.currentTab > 1 ? this.state.currentTab : ''}-select`,
|
|
35
|
+
|
|
36
|
+
cols: [
|
|
37
|
+
|
|
38
|
+
{
|
|
39
|
+
id: `cta-deeplink${this.state.currentTab > 1 ? this.state.currentTab : ''}-select`,
|
|
40
|
+
placeholder: "Select DeepLink",
|
|
41
|
+
type: "select", //Resembles component to be used
|
|
42
|
+
options: deepLinkOptions,
|
|
43
|
+
metaType: "text",
|
|
44
|
+
datatype: "string",
|
|
45
|
+
required: true,
|
|
46
|
+
errorMessage: "Select a deeplink",
|
|
47
|
+
fluid: true,
|
|
48
|
+
width: 18,
|
|
49
|
+
offset: 1,
|
|
50
|
+
style: {
|
|
51
|
+
width: '100%',
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
marginBottom: '16px',
|
|
55
|
+
},
|
|
56
|
+
styling: "semantic",
|
|
57
|
+
order: 1,
|
|
58
|
+
customComponent: false,
|
|
59
|
+
supportedEvents: [
|
|
60
|
+
'onSelect',
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
});
|
|
65
|
+
return newInputFields;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function getSecondaryCtaFields({inputFields, fieldIndex, deepLinkOptions}) {
|
|
69
|
+
const inputId = `secondary-cta-${get(inputFields[fieldIndex], 'cols[0]').fieldsCount}`;
|
|
70
|
+
const newInputFields = cloneDeep(inputFields);
|
|
71
|
+
newInputFields.splice(fieldIndex + 1, 0, {
|
|
72
|
+
rowClassName: 'mobile-push-row',
|
|
73
|
+
cols: [
|
|
74
|
+
|
|
75
|
+
{
|
|
76
|
+
id: `${inputId}-label`,
|
|
77
|
+
label: "Button label",
|
|
78
|
+
type: "input", //Resembles component to be used
|
|
79
|
+
metaType: "text",
|
|
80
|
+
datatype: "string",
|
|
81
|
+
required: true,
|
|
82
|
+
width: 18,
|
|
83
|
+
offset: 1,
|
|
84
|
+
placeholder: "Enter CTA Label here",
|
|
85
|
+
fluid: true,
|
|
86
|
+
styling: "semantic",
|
|
87
|
+
order: 1,
|
|
88
|
+
customComponent: false,
|
|
89
|
+
errorMessage: "CTA label cannot be empty.",
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
],
|
|
93
|
+
});
|
|
94
|
+
newInputFields.splice(fieldIndex + 2, 0, {
|
|
95
|
+
rowClassName: 'mobile-push-row',
|
|
96
|
+
identifier: `cta-deeplink-${inputId}`,
|
|
97
|
+
cols: [
|
|
98
|
+
|
|
99
|
+
{
|
|
100
|
+
id: `cta-deeplink-${inputId}`,
|
|
101
|
+
type: "radioGroup", //Resembles component to be used
|
|
102
|
+
metaType: "text",
|
|
103
|
+
datatype: "string",
|
|
104
|
+
options: ["Deeplink", "External Link"],
|
|
105
|
+
inductiveText: ["A page within mobile app", "An external web page"],
|
|
106
|
+
value: "Deeplink",
|
|
107
|
+
required: true,
|
|
108
|
+
width: 18,
|
|
109
|
+
offset: 1,
|
|
110
|
+
errorMessage: "Please select link type",
|
|
111
|
+
fluid: true,
|
|
112
|
+
styling: "semantic",
|
|
113
|
+
order: 1,
|
|
114
|
+
|
|
115
|
+
customComponent: false,
|
|
116
|
+
supportedEvents: ["onChange"],
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
});
|
|
120
|
+
newInputFields.splice(fieldIndex + 3, 0, {
|
|
121
|
+
rowClassName: 'mobile-push-row',
|
|
122
|
+
id: 'cta-deeplink-select-section',
|
|
123
|
+
identifier: `cta-deeplink-${inputId}-select`,
|
|
124
|
+
cols: [
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
{
|
|
128
|
+
id: `cta-deeplink-${inputId}-select`,
|
|
129
|
+
placeholder: "Select DeepLink",
|
|
130
|
+
type: "select", //Resembles component to be used
|
|
131
|
+
options: deepLinkOptions,
|
|
132
|
+
errorMessage: "Select a deeplink",
|
|
133
|
+
metaType: "text",
|
|
134
|
+
datatype: "string",
|
|
135
|
+
required: true,
|
|
136
|
+
fluid: true,
|
|
137
|
+
width: 18,
|
|
138
|
+
offset: 1,
|
|
139
|
+
style: {
|
|
140
|
+
width: '100%',
|
|
141
|
+
marginBottom: '16px',
|
|
142
|
+
},
|
|
143
|
+
styling: "semantic",
|
|
144
|
+
order: 1,
|
|
145
|
+
customComponent: false,
|
|
146
|
+
supportedEvents: [
|
|
147
|
+
'onSelect',
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
});
|
|
152
|
+
return newInputFields;
|
|
153
|
+
}
|
|
154
|
+
function getLinkTypeFields({inputFieldsArgs, fieldIndex, deepLinkOptions, formData, field}) {
|
|
155
|
+
const inputFields = cloneDeep(inputFieldsArgs);
|
|
156
|
+
const deeplinks = this.props.Templates.selectedWeChatAccount && this.props.Templates.selectedWeChatAccount.configs && !!this.props.Templates.selectedWeChatAccount.configs.deeplink ? this.props.Templates.selectedWeChatAccount.configs.deeplink : '[]';
|
|
157
|
+
const deeplinkValue = formData[this.state.currentTab - 1][field.id];
|
|
158
|
+
const componentIndex = fieldIndex + 1;
|
|
159
|
+
const inputId = deeplinkValue && deeplinkValue.toLowerCase() === "deeplink" ? `${field.id}-select` : `${field.id}-text`;
|
|
160
|
+
if ( deeplinkValue && deeplinkValue.toLowerCase() === "deeplink" && (fieldIndex === inputFields.length - 1 || inputFields[componentIndex].id !== "cta-deeplink-select-section")) {
|
|
161
|
+
const deleteCount = get(inputFields, `[${componentIndex}].id`) === "cta-external-link" ? 1 : 0;
|
|
162
|
+
inputFields.splice(componentIndex, deleteCount, {
|
|
163
|
+
rowClassName: 'mobile-push-row',
|
|
164
|
+
id: 'cta-deeplink-select-section',
|
|
165
|
+
identifier: inputId,
|
|
166
|
+
cols: [
|
|
167
|
+
|
|
168
|
+
{
|
|
169
|
+
id: inputId,
|
|
170
|
+
placeholder: "Select DeepLink",
|
|
171
|
+
type: "select", //Resembles component to be used
|
|
172
|
+
options: deepLinkOptions,
|
|
173
|
+
metaType: "text",
|
|
174
|
+
datatype: "string",
|
|
175
|
+
errorMessage: "Select a deeplink",
|
|
176
|
+
required: true,
|
|
177
|
+
fluid: true,
|
|
178
|
+
width: 18,
|
|
179
|
+
offset: 1,
|
|
180
|
+
style: {
|
|
181
|
+
width: '100%',
|
|
182
|
+
|
|
183
|
+
marginBottom: '16px',
|
|
184
|
+
},
|
|
185
|
+
styling: "semantic",
|
|
186
|
+
order: 1,
|
|
187
|
+
customComponent: false,
|
|
188
|
+
supportedEvents: [
|
|
189
|
+
'onSelect',
|
|
190
|
+
],
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
});
|
|
194
|
+
} else if ( deeplinkValue && deeplinkValue.toLowerCase() === "external link") {
|
|
195
|
+
const row = {
|
|
196
|
+
rowClassName: 'mobile-push-row',
|
|
197
|
+
id: 'cta-external-link',
|
|
198
|
+
identifier: inputId,
|
|
199
|
+
|
|
200
|
+
cols: [
|
|
201
|
+
|
|
202
|
+
{
|
|
203
|
+
id: inputId,
|
|
204
|
+
placeholder: "External Link",
|
|
205
|
+
type: "input", //Resembles component to be used
|
|
206
|
+
metaType: "text",
|
|
207
|
+
datatype: "string",
|
|
208
|
+
errorMessage: "External Link cannot be empty",
|
|
209
|
+
required: true,
|
|
210
|
+
fluid: true,
|
|
211
|
+
width: 18,
|
|
212
|
+
offset: 1,
|
|
213
|
+
style: {
|
|
214
|
+
width: '100%',
|
|
215
|
+
|
|
216
|
+
marginBottom: '16px',
|
|
217
|
+
},
|
|
218
|
+
styling: "semantic",
|
|
219
|
+
order: 1,
|
|
220
|
+
customComponent: false,
|
|
221
|
+
standalone: false,
|
|
222
|
+
},
|
|
223
|
+
],
|
|
224
|
+
};
|
|
225
|
+
if (!inputFields[fieldIndex + 1] || inputFields[componentIndex].id === "cta-deeplink-select-section") {
|
|
226
|
+
inputFields[componentIndex] = row;
|
|
227
|
+
if (inputFields[componentIndex + 1] && inputFields[componentIndex + 1].id === "show-cta-deeplink-keys-label") {
|
|
228
|
+
inputFields.splice(componentIndex + 1, 1);
|
|
229
|
+
}
|
|
230
|
+
if (inputFields[componentIndex + 1] && inputFields[componentIndex + 1].id === "cta-deeplink-keys") {
|
|
231
|
+
let configkeys = filter(JSON.parse(deeplinks), (dl) => dl.link === formData[this.state.currentTab - 1][`${field.id}-select`]);
|
|
232
|
+
if (configkeys[0]) {
|
|
233
|
+
configkeys = configkeys[0].keys;
|
|
234
|
+
}
|
|
235
|
+
if (configkeys.length) {
|
|
236
|
+
//inputFields = inputFields.slice(0, componentIndex + 1).concat(inputFields.slice( componentIndex + 1 + configkeys.length, inputFields.length));
|
|
237
|
+
|
|
238
|
+
inputFields.splice(componentIndex + 1, configkeys.length);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
} else {
|
|
242
|
+
inputFields.splice(componentIndex, 0, row);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return inputFields;
|
|
246
|
+
}
|
|
247
|
+
export {
|
|
248
|
+
getPrimaryCtaFields, getSecondaryCtaFields, getLinkTypeFields,
|
|
249
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
const getEventsMap = (context) => ({
|
|
2
|
+
"template-name": {
|
|
3
|
+
onChange: context.onTemplateNameChange,
|
|
4
|
+
},
|
|
5
|
+
"cta-deeplink-secondary-cta-0": {
|
|
6
|
+
onChange: context.onLinkTypeChange,
|
|
7
|
+
},
|
|
8
|
+
"cta-deeplink-secondary-cta-1": {
|
|
9
|
+
onChange: context.onLinkTypeChange,
|
|
10
|
+
},
|
|
11
|
+
"cta-deeplink-secondary-cta-12": {
|
|
12
|
+
onChange: context.onLinkTypeChange,
|
|
13
|
+
},
|
|
14
|
+
"cta-deeplink-delete": {
|
|
15
|
+
onDelete: context.deletePrimaryCTA,
|
|
16
|
+
},
|
|
17
|
+
"cta-deeplink2-delete": {
|
|
18
|
+
onDelete: context.deletePrimaryCTA,
|
|
19
|
+
},
|
|
20
|
+
"secondary-cta-0-delete": {
|
|
21
|
+
onDelete: context.deleteSecondaryCTA,
|
|
22
|
+
},
|
|
23
|
+
"secondary-cta-1-delete": {
|
|
24
|
+
onDelete: context.deleteSecondaryCTA,
|
|
25
|
+
},
|
|
26
|
+
"secondary-cta-1-delete-ios": {
|
|
27
|
+
onDelete: context.deleteSecondaryCtaIos,
|
|
28
|
+
},
|
|
29
|
+
"discard-button": {
|
|
30
|
+
discardValues: context.discardValues,
|
|
31
|
+
},
|
|
32
|
+
"cancel-button": {
|
|
33
|
+
cancelTemplate: context.cancelTemplate,
|
|
34
|
+
},
|
|
35
|
+
"copy-android-content": {
|
|
36
|
+
onClick: context.copyAndroidContent,
|
|
37
|
+
},
|
|
38
|
+
"copy-iphone-content": {
|
|
39
|
+
onClick: context.copyIphoneContent,
|
|
40
|
+
},
|
|
41
|
+
"save-button": {
|
|
42
|
+
saveFormData: context.saveFormData,
|
|
43
|
+
},
|
|
44
|
+
"message-editor": {
|
|
45
|
+
onChange: context.onTemplateContentChange,
|
|
46
|
+
},
|
|
47
|
+
"message-editor2": {
|
|
48
|
+
onChange: context.onTemplateContentChange,
|
|
49
|
+
},
|
|
50
|
+
"message-tagList": {
|
|
51
|
+
onTagSelect: context.onTagSelect,
|
|
52
|
+
},
|
|
53
|
+
"message-tagList2": {
|
|
54
|
+
onTagSelect: context.onTagSelect,
|
|
55
|
+
},
|
|
56
|
+
"title-tagList": {
|
|
57
|
+
onTagSelect: context.onTagSelect,
|
|
58
|
+
},
|
|
59
|
+
"title-tagList2": {
|
|
60
|
+
onTagSelect: context.onTagSelect,
|
|
61
|
+
},
|
|
62
|
+
"pane": {
|
|
63
|
+
onTabChange: context.onTabChange,
|
|
64
|
+
},
|
|
65
|
+
"cta-deeplink": {
|
|
66
|
+
onChange: context.onLinkTypeChange,
|
|
67
|
+
},
|
|
68
|
+
"cta-deeplink2": {
|
|
69
|
+
onChange: context.onLinkTypeChange,
|
|
70
|
+
},
|
|
71
|
+
"cta-deeplink-secondary-cta-1-select": {
|
|
72
|
+
onSelect: context.showCtaKeys,
|
|
73
|
+
},
|
|
74
|
+
"cta-deeplink-secondary-cta-0-select": {
|
|
75
|
+
onSelect: context.showCtaKeys,
|
|
76
|
+
},
|
|
77
|
+
"cta-deeplink-secondary-cta-1-select2": {
|
|
78
|
+
onSelect: context.showCtaKeys,
|
|
79
|
+
},
|
|
80
|
+
"cta-deeplink-select": {
|
|
81
|
+
onSelect: context.showCtaKeys,
|
|
82
|
+
},
|
|
83
|
+
"cta-deeplink2-select": {
|
|
84
|
+
onSelect: context.showCtaKeys,
|
|
85
|
+
},
|
|
86
|
+
"add-pri-cta": {
|
|
87
|
+
addPrimaryCta: context.addPrimaryCta,
|
|
88
|
+
},
|
|
89
|
+
"add-pri-cta-ios": {
|
|
90
|
+
addPrimaryCta: context.addPrimaryCta,
|
|
91
|
+
},
|
|
92
|
+
"add-sec-cta": {
|
|
93
|
+
addSecondaryCta: context.addSecondoryCta,
|
|
94
|
+
},
|
|
95
|
+
"add-sec-cta-2": {
|
|
96
|
+
addSecondaryCta: context.addSecondoryCta,
|
|
97
|
+
},
|
|
98
|
+
"add-sec-cta-ios": {
|
|
99
|
+
addSecondaryCtaIos: context.addSecondoryCtaIos,
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
"image-upload-android": {
|
|
103
|
+
onUpload: context.uploadImage,
|
|
104
|
+
},
|
|
105
|
+
"image-upload-ios": {
|
|
106
|
+
onUpload: context.uploadImage,
|
|
107
|
+
},
|
|
108
|
+
"secondary-cta-1-table": {
|
|
109
|
+
onRowClick: context.selectCtaIos,
|
|
110
|
+
},
|
|
111
|
+
"cta-deeplink-select-show-keys": {
|
|
112
|
+
onShowCtaKeys: context.showCtaKeys,
|
|
113
|
+
},
|
|
114
|
+
"cta-deeplink-secondary-cta-0-select-show-keys": {
|
|
115
|
+
onShowCtaKeys: context.showCtaKeys,
|
|
116
|
+
},
|
|
117
|
+
"cta-deeplink-secondary-cta-1-select-show-keys": {
|
|
118
|
+
onShowCtaKeys: context.showCtaKeys,
|
|
119
|
+
},
|
|
120
|
+
"wechat-template": {
|
|
121
|
+
onSelect: context.onTemplateChange,
|
|
122
|
+
},
|
|
123
|
+
"mobilepush-template": {
|
|
124
|
+
onSelect: context.onTemplateChange,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
export default getEventsMap;
|