@capillarytech/creatives-library 7.17.92 → 7.17.93
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/containers/Ebill/index.js +0 -1
- package/containers/MobilePush/Edit/index.js +0 -1
- package/index.js +0 -6
- package/package.json +1 -1
- package/routes.js +0 -5
- package/services/api.js +0 -5
- package/v2Components/CapImageUpload/index.js +3 -10
- package/v2Components/CapImageUpload/messages.js +0 -4
- package/v2Components/FormBuilder/index.js +4 -3
- package/v2Components/MobilePushPreviewV2/index.js +23 -81
- package/v2Components/TemplatePreview/_templatePreview.scss +0 -448
- package/v2Components/TemplatePreview/index.js +375 -660
- package/v2Components/TemplatePreview/messages.js +0 -4
- package/v2Containers/App/constants.js +0 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +0 -43
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -4
- package/v2Containers/CreativesContainer/constants.js +0 -1
- package/v2Containers/CreativesContainer/index.js +27 -94
- package/v2Containers/CreativesContainer/messages.js +0 -4
- package/v2Containers/MobilePush/Edit/index.js +1 -3
- package/v2Containers/Templates/_templates.scss +0 -10
- package/v2Containers/Templates/index.js +23 -103
- package/v2Containers/Templates/messages.js +0 -20
- package/v2Containers/TemplatesV2/index.js +2 -8
- package/v2Containers/TemplatesV2/messages.js +0 -4
- package/v2Components/CapDeviceContent/index.js +0 -338
- package/v2Components/CapDeviceContent/index.scss +0 -115
- package/v2Components/CapDeviceContent/messages.js +0 -107
- package/v2Components/CapDeviceContent/tests/index.test.js +0 -75
- package/v2Components/CapInAppCTA/constants.js +0 -25
- package/v2Components/CapInAppCTA/index.js +0 -281
- package/v2Components/CapInAppCTA/index.scss +0 -93
- package/v2Components/CapInAppCTA/messages.js +0 -85
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_bottom.svg +0 -11
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_full.svg +0 -11
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_modal.svg +0 -11
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_top.svg +0 -11
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_bottom.svg +0 -6
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_full.svg +0 -18
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_modal.svg +0 -7
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_top.svg +0 -13
- package/v2Containers/InApp/actions.js +0 -64
- package/v2Containers/InApp/constants.js +0 -95
- package/v2Containers/InApp/index.js +0 -745
- package/v2Containers/InApp/index.scss +0 -47
- package/v2Containers/InApp/messages.js +0 -86
- package/v2Containers/InApp/reducer.js +0 -109
- package/v2Containers/InApp/sagas.js +0 -143
- package/v2Containers/InApp/selectors.js +0 -12
- package/v2Containers/InApp/tests/action.test.js +0 -53
- package/v2Containers/InApp/tests/index.test.js +0 -152
- package/v2Containers/InApp/tests/mockData.js +0 -897
- package/v2Containers/InApp/tests/reducer.test.js +0 -177
- package/v2Containers/InApp/tests/sagas.test.js +0 -391
|
@@ -956,7 +956,6 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
|
|
|
956
956
|
}
|
|
957
957
|
temp.injectedEvents = {};
|
|
958
958
|
_.forEach(col.supportedEvents, (event) => {
|
|
959
|
-
console.log('injected event for ', col, event, this.getMappedEvent(col.id, event));
|
|
960
959
|
temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
|
|
961
960
|
});
|
|
962
961
|
|
|
@@ -1779,7 +1779,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1779
1779
|
temp.content.appName = this.props.Templates.selectedWeChatAccount.name;
|
|
1780
1780
|
}
|
|
1781
1781
|
_.forEach(col.supportedEvents, (event) => {
|
|
1782
|
-
console.log('injected event for ', col, event, this.getMappedEvent(col.id, event));
|
|
1783
1782
|
temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
|
|
1784
1783
|
});
|
|
1785
1784
|
return true;
|
package/index.js
CHANGED
|
@@ -95,10 +95,6 @@ import Zalo from './v2Containers/Zalo';
|
|
|
95
95
|
import zaloReducer from './v2Containers/Zalo/reducer';
|
|
96
96
|
import zaloSaga from './v2Containers/Zalo/saga';
|
|
97
97
|
|
|
98
|
-
import InApp from './v2Containers/InApp';
|
|
99
|
-
import inAppReducer from './v2Containers/InApp/reducer';
|
|
100
|
-
import inAppSaga from './v2Containers/InApp/sagas';
|
|
101
|
-
|
|
102
98
|
import Rcs from './v2Containers/Rcs';
|
|
103
99
|
import rcsReducer from './v2Containers/Rcs/reducer';
|
|
104
100
|
import rcsSaga from './v2Containers/Rcs/sagas';
|
|
@@ -130,7 +126,6 @@ const SmsTraiContainer = {SmsTraiCreate, SmsTraiCreateReducer, SmsTraiCreateSaga
|
|
|
130
126
|
const WhatsappContainer = { Whatsapp, whatsappReducer, whatsappSaga };
|
|
131
127
|
const RcsContainer = { Rcs, rcsReducer, rcsSaga };
|
|
132
128
|
const ZaloContainer = { Zalo, zaloReducer, zaloSaga };
|
|
133
|
-
const InAppContainer = { InApp, inAppReducer, inAppSaga };
|
|
134
129
|
|
|
135
130
|
const GalleryContainer = {Gallery, galleryReducer, gallerySagas};
|
|
136
131
|
const FTPContainer = {FTP, FTPReducer, FTPSagas};
|
|
@@ -180,5 +175,4 @@ export { CapContainer,
|
|
|
180
175
|
WhatsappContainer,
|
|
181
176
|
RcsContainer,
|
|
182
177
|
ZaloContainer,
|
|
183
|
-
InAppContainer,
|
|
184
178
|
};
|
package/package.json
CHANGED
package/routes.js
CHANGED
|
@@ -665,8 +665,6 @@ export default function createRoutes(store) {
|
|
|
665
665
|
import('v2Containers/Whatsapp/reducer'),
|
|
666
666
|
import('v2Containers/Zalo/saga'),
|
|
667
667
|
import('v2Containers/Zalo/reducer'),
|
|
668
|
-
import('v2Containers/InApp/sagas'),
|
|
669
|
-
import('v2Containers/InApp/reducer'),
|
|
670
668
|
import('v2Containers/Rcs/sagas'),
|
|
671
669
|
import('v2Containers/Rcs/reducer'),
|
|
672
670
|
]);
|
|
@@ -694,7 +692,6 @@ export default function createRoutes(store) {
|
|
|
694
692
|
smsTraiSagas, smsTraiReducer,
|
|
695
693
|
whatsappSagas, whatsappReducer,
|
|
696
694
|
zaloSagas, zaloReducer,
|
|
697
|
-
inAppSagas, inAppReducer,
|
|
698
695
|
rcsSagas, rcsReducer,
|
|
699
696
|
]) => {
|
|
700
697
|
injectReducer('templates', reducer.default);
|
|
@@ -717,7 +714,6 @@ export default function createRoutes(store) {
|
|
|
717
714
|
injectReducer('smsTrai', smsTraiReducer.default);
|
|
718
715
|
injectReducer('whatsapp', whatsappReducer.default);
|
|
719
716
|
injectReducer('zalo', zaloReducer.default);
|
|
720
|
-
injectReducer('inapp', inAppReducer.default);
|
|
721
717
|
injectReducer('rcs', rcsReducer.default);
|
|
722
718
|
injectSagas(gallerySagas.default);
|
|
723
719
|
injectSagas(sagas.default);
|
|
@@ -739,7 +735,6 @@ export default function createRoutes(store) {
|
|
|
739
735
|
injectSagas(smsTraiSagas.default);
|
|
740
736
|
injectSagas(whatsappSagas.default);
|
|
741
737
|
injectSagas(zaloSagas.default);
|
|
742
|
-
injectSagas(inAppSagas.default);
|
|
743
738
|
injectSagas(rcsSagas.default);
|
|
744
739
|
renderRoute(component);
|
|
745
740
|
});
|
package/services/api.js
CHANGED
|
@@ -237,11 +237,6 @@ export const createMobilePushTemplate = ({template}) => {
|
|
|
237
237
|
return request(url, getAPICallObject('POST', template));
|
|
238
238
|
};
|
|
239
239
|
|
|
240
|
-
export const createInAppTemplate = ({payload}) => {
|
|
241
|
-
const url = `${API_ENDPOINT}/templates/INAPP`;
|
|
242
|
-
return request(url, getAPICallObject('POST', payload));
|
|
243
|
-
};
|
|
244
|
-
|
|
245
240
|
export const duplicateTemplate = ({id, channel}) => {
|
|
246
241
|
const url = `${API_ENDPOINT}/templates/duplicate/${id}/${channel}`;
|
|
247
242
|
return request(url, getAPICallObject('GET'));
|
|
@@ -20,7 +20,7 @@ import { injectIntl, FormattedMessage, intlShape} from 'react-intl';
|
|
|
20
20
|
import { isEmpty, get } from 'lodash';
|
|
21
21
|
import './index.scss';
|
|
22
22
|
import Gallery from '../../v2Containers/Assets/Gallery';
|
|
23
|
-
import { FACEBOOK,
|
|
23
|
+
import { FACEBOOK, RCS, WHATSAPP } from "../../v2Containers/CreativesContainer/constants";
|
|
24
24
|
|
|
25
25
|
import messages from './messages';
|
|
26
26
|
function CapImageUpload(props) {
|
|
@@ -252,7 +252,7 @@ function CapImageUpload(props) {
|
|
|
252
252
|
</CapHeadingSpan>
|
|
253
253
|
</>
|
|
254
254
|
)}
|
|
255
|
-
{
|
|
255
|
+
{channel !== WHATSAPP && (
|
|
256
256
|
<CapHeadingSpan type="label2" className="image-dimension">
|
|
257
257
|
<FormattedMessage {...messages.imageDimenstionDescription} values={{ width: imgWidth, height: imgHeight }} />
|
|
258
258
|
</CapHeadingSpan>
|
|
@@ -267,15 +267,8 @@ function CapImageUpload(props) {
|
|
|
267
267
|
<FormattedMessage {...messages.imageSize} />
|
|
268
268
|
</CapHeadingSpan>
|
|
269
269
|
)}
|
|
270
|
-
{
|
|
271
|
-
channel === INAPP && (
|
|
272
|
-
<CapHeadingSpan type="label2" className="image-size">
|
|
273
|
-
<FormattedMessage {...messages.whatsappImageSize} />
|
|
274
|
-
</CapHeadingSpan>
|
|
275
|
-
)
|
|
276
|
-
}
|
|
277
270
|
<CapHeadingSpan type="label2" className="image-format">
|
|
278
|
-
|
|
271
|
+
<FormattedMessage {...messages.format} />
|
|
279
272
|
</CapHeadingSpan>
|
|
280
273
|
</div>
|
|
281
274
|
</div>
|
|
@@ -42,10 +42,6 @@ export default defineMessages({
|
|
|
42
42
|
id: `${scope}.format`,
|
|
43
43
|
defaultMessage: 'Format: JPEG, JPG, PNG',
|
|
44
44
|
},
|
|
45
|
-
format2: {
|
|
46
|
-
id: `${scope}.format2`,
|
|
47
|
-
defaultMessage: 'Format: png, jpg, jpeg',
|
|
48
|
-
},
|
|
49
45
|
imageErrorDesc: {
|
|
50
46
|
id: `${scope}.imageErrorDesc`,
|
|
51
47
|
defaultMessage:
|
|
@@ -214,9 +214,10 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
214
214
|
this.setState({usingTabContainer: true});
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
//
|
|
218
|
-
|
|
219
|
-
|
|
217
|
+
//In Context of MPUSH currentTab represents whether its Android or IOS tab , 1 for Android and 2 for IOS
|
|
218
|
+
if (nextProps.currentTab && _.get(this.props, 'schema.channel') === MOBILE_PUSH) {
|
|
219
|
+
this.setState({currentTab: nextProps.currentTab});
|
|
220
|
+
}
|
|
220
221
|
} else if (!_.isEmpty(nextProps.formData) &&
|
|
221
222
|
( !this.state.usingTabContainer || (this.state.usingTabContainer && nextProps.tabKey !== ''))
|
|
222
223
|
&& !_.isEqual(nextProps.formData, this.state.formData) &&
|
|
@@ -11,9 +11,6 @@ import { CapTab, CapIcon } from '@capillarytech/cap-ui-library';
|
|
|
11
11
|
import { get, map, isEmpty} from 'lodash';
|
|
12
12
|
import TemplatePreview from '../TemplatePreview';
|
|
13
13
|
import '../PreviewSideBar/_previewsidebar.scss';
|
|
14
|
-
import { MOBILE_PUSH } from '../../v2Containers/CreativesContainer/constants';
|
|
15
|
-
import { INAPP } from '../../v2Containers/App/constants';
|
|
16
|
-
import { ANDROID, IOS } from '../../v2Containers/InApp/constants';
|
|
17
14
|
|
|
18
15
|
class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
19
16
|
constructor(props) {
|
|
@@ -34,85 +31,39 @@ class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react
|
|
|
34
31
|
}
|
|
35
32
|
this.state = {
|
|
36
33
|
device,
|
|
37
|
-
content: this.setContent(props.templateData, device
|
|
34
|
+
content: this.setContent(props.templateData, device),
|
|
38
35
|
};
|
|
39
36
|
}
|
|
40
37
|
|
|
41
|
-
setContent(templateData, device
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const androidContent = get(templateData, 'versions.base.content.ANDROID') || get(templateData, 'androidContent');
|
|
45
|
-
const iosContent = get(templateData, 'versions.base.content.IOS') || get(templateData, 'iosContent');
|
|
46
|
-
const androidPreviewContent = {
|
|
47
|
-
templateTitle: androidContent?.title,
|
|
48
|
-
templateMsg: androidContent?.message,
|
|
49
|
-
mediaPreview: { inAppImageSrcAndroid: androidContent?.expandableDetails?.imageUrl },
|
|
50
|
-
ctaData: androidContent?.expandableDetails?.buttons?.map((cta) => {
|
|
51
|
-
const { index, type, text, url = "", label } = cta;
|
|
52
|
-
const ctaObject = {
|
|
53
|
-
index,
|
|
54
|
-
text,
|
|
55
|
-
url,
|
|
56
|
-
urlType: type,
|
|
57
|
-
isSaved: true,
|
|
58
|
-
label,
|
|
59
|
-
};
|
|
60
|
-
return ctaObject;
|
|
61
|
-
}),
|
|
62
|
-
};
|
|
63
|
-
const iosPreviewContent = {
|
|
64
|
-
templateTitle: iosContent?.title,
|
|
65
|
-
templateMsg: iosContent?.message,
|
|
66
|
-
mediaPreview: { inAppImageSrcIos: iosContent?.expandableDetails?.imageUrl },
|
|
67
|
-
ctaData: iosContent?.expandableDetails?.buttons?.map((cta) => {
|
|
68
|
-
const { index, type, text, url = "", label } = cta;
|
|
69
|
-
const ctaObject = {
|
|
70
|
-
index,
|
|
71
|
-
text,
|
|
72
|
-
url,
|
|
73
|
-
urlType: type,
|
|
74
|
-
isSaved: true,
|
|
75
|
-
label,
|
|
76
|
-
};
|
|
77
|
-
return ctaObject;
|
|
78
|
-
}),
|
|
79
|
-
};
|
|
80
|
-
content = {
|
|
81
|
-
inAppPreviewContent: device === ANDROID.toLowerCase() ? androidPreviewContent : iosPreviewContent,
|
|
82
|
-
templateLayoutType: device === ANDROID.toLowerCase() ? androidContent?.bodyType : iosContent?.bodyType,
|
|
83
|
-
};
|
|
84
|
-
} else if (channel === MOBILE_PUSH) {
|
|
85
|
-
const androidContent = get(templateData, 'versions.base.ANDROID') || get(templateData, 'androidContent');
|
|
86
|
-
const iosContent = get(templateData, 'versions.base.IOS') || get(templateData, 'iosContent');
|
|
38
|
+
setContent(templateData, device) {
|
|
39
|
+
const androidContent = get(templateData, 'versions.base.ANDROID') || get(templateData, 'androidContent');
|
|
40
|
+
const iosContent = get(templateData, 'versions.base.IOS') || get(templateData, 'iosContent');
|
|
87
41
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
42
|
+
const data = device === "android" ? androidContent : iosContent;
|
|
43
|
+
const { title = '', message = '', expandableDetails: { ctas = [], image = '' } = {}} = data || {};
|
|
44
|
+
const content = {
|
|
45
|
+
header: title,
|
|
46
|
+
bodyText: message,
|
|
47
|
+
bodyImage: image,
|
|
48
|
+
actions: [],
|
|
49
|
+
appName: templateData?.appName,
|
|
50
|
+
};
|
|
51
|
+
if (ctas && ctas?.length) {
|
|
52
|
+
if (device === "android" ) {
|
|
53
|
+
content.actions = map(ctas, (cta) => ({label: cta?.actionText}));
|
|
54
|
+
} else {
|
|
55
|
+
content.actions = [{label: ctas[0]?.actionLabel}, {label: ctas[0]?.actionLabel2}];
|
|
103
56
|
}
|
|
104
57
|
}
|
|
105
58
|
return content;
|
|
106
59
|
}
|
|
107
60
|
getPreview(device) {
|
|
108
|
-
const deviceParam = device === ANDROID.toLowerCase() ? ANDROID : IOS;
|
|
109
61
|
return (
|
|
110
62
|
<TemplatePreview
|
|
111
|
-
device={
|
|
63
|
+
device={device}
|
|
112
64
|
channel={this.props.channel}
|
|
113
65
|
content={this.state.content || ''}
|
|
114
66
|
templateData={this.props.templateData}
|
|
115
|
-
templateLayoutType={this.state.content.templateLayoutType || ''}
|
|
116
67
|
/>
|
|
117
68
|
);
|
|
118
69
|
}
|
|
@@ -121,7 +72,7 @@ class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react
|
|
|
121
72
|
this.props.handleClose();
|
|
122
73
|
}
|
|
123
74
|
changeDevice(device) {
|
|
124
|
-
const content = this.setContent(this.props.templateData, device
|
|
75
|
+
const content = this.setContent(this.props.templateData, device);
|
|
125
76
|
this.setState({device, content });
|
|
126
77
|
}
|
|
127
78
|
goToEdit(e, path) {
|
|
@@ -129,18 +80,9 @@ class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react
|
|
|
129
80
|
}
|
|
130
81
|
render() {
|
|
131
82
|
const {templateData} = this.props;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if (this.props.channel === MOBILE_PUSH) {
|
|
136
|
-
hasAndroid = get(templateData, 'versions.base.ANDROID') || get(templateData, 'androidContent.title');
|
|
137
|
-
hasIos = get(templateData, 'versions.base.IOS') || get(templateData, 'iosContent.title');
|
|
138
|
-
hasBothAndroidAndIos = hasAndroid && hasIos;
|
|
139
|
-
} else if (this.props.channel === INAPP.toUpperCase()) {
|
|
140
|
-
hasAndroid = get(templateData, 'versions.base.content.ANDROID') || get(templateData, 'androidContent.title');
|
|
141
|
-
hasIos = get(templateData, 'versions.base.content.IOS') || get(templateData, 'iosContent.title');
|
|
142
|
-
hasBothAndroidAndIos = hasAndroid && hasIos;
|
|
143
|
-
}
|
|
83
|
+
const hasAndroid = get(templateData, 'versions.base.ANDROID') || get(templateData, 'androidContent.title');
|
|
84
|
+
const hasIos = get(templateData, 'versions.base.IOS') || get(templateData, 'iosContent.title');
|
|
85
|
+
const hasBothAndroidAndIos = hasAndroid && hasIos;
|
|
144
86
|
|
|
145
87
|
return (
|
|
146
88
|
<div>
|