@capillarytech/creatives-library 7.6.1 → 7.6.2
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/assets/DeviceForEmail.png +0 -0
- package/components/CapTagList/index.js +5 -5
- package/components/Card/index.js +1 -1
- package/components/Ckeditor/index.js +5 -5
- package/components/CustomPopOver/index.js +3 -3
- package/components/Edmeditor/index.js +4 -4
- package/components/EmailPreview/index.js +1 -1
- package/components/PreviewSideBar/index.js +3 -3
- package/components/Sidebar/index.js +1 -1
- package/components/SmsTest/index.js +4 -4
- package/components/TemplatePreview/index.js +2 -2
- package/components/Toastr/index.js +1 -1
- package/config/app.js +2 -0
- package/containers/Assets/Gallery/index.js +2 -2
- package/containers/Assets/Gallery/sagas.js +1 -1
- package/containers/Cap/actions.js +2 -2
- package/containers/Cap/reducer.js +1 -1
- package/containers/Cap/sagas.js +3 -3
- package/containers/Cap/selectors.js +1 -1
- package/containers/Ebill/actions.js +1 -1
- package/containers/Ebill/index.js +34 -34
- package/containers/Ebill/sagas.js +3 -3
- package/containers/Email/actions.js +2 -2
- package/containers/Email/index.js +171 -171
- package/containers/Email/reducer.js +1 -1
- package/containers/Email/sagas.js +6 -6
- package/containers/LanguageProvider/actions.js +1 -1
- package/containers/Line/Create/actions.js +5 -5
- package/containers/Line/Create/index.js +37 -37
- package/containers/Line/Create/sagas.js +7 -7
- package/containers/Line/Edit/actions.js +3 -3
- package/containers/Line/Edit/index.js +24 -24
- package/containers/Line/Edit/sagas.js +4 -4
- package/containers/MobilePush/Create/actions.js +2 -2
- package/containers/MobilePush/Create/index.js +35 -35
- package/containers/MobilePush/Create/sagas.js +2 -2
- package/containers/MobilePush/Edit/actions.js +3 -3
- package/containers/MobilePush/Edit/index.js +32 -32
- package/containers/MobilePush/Edit/sagas.js +5 -5
- package/containers/Sms/Create/actions.js +2 -2
- package/containers/Sms/Create/index.js +57 -57
- package/containers/Sms/Create/sagas.js +2 -2
- package/containers/Sms/Edit/actions.js +3 -3
- package/containers/Sms/Edit/index.js +44 -44
- package/containers/Sms/Edit/sagas.js +3 -3
- package/containers/TagList/index.js +9 -9
- package/containers/Templates/actions.js +5 -5
- package/containers/Templates/index.js +44 -44
- package/containers/Templates/sagas.js +5 -5
- package/containers/WeChat/MapTemplates/actions.js +1 -1
- package/containers/WeChat/MapTemplates/index.js +34 -34
- package/containers/WeChat/MapTemplates/sagas.js +2 -2
- package/containers/WeChat/RichmediaTemplates/Create/index.js +9 -9
- package/containers/WeChat/RichmediaTemplates/Edit/actions.js +1 -1
- package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +1 -1
- package/index.js +6 -0
- package/package.json +1 -1
- package/reducers.js +2 -1
- package/routes.js +5 -0
- package/services/api.js +43 -14
- package/utils/authWrapper.js +2 -2
- package/utils/common.js +13 -1
- package/utils/smsCharCount.js +5 -5
- package/v2Components/CapTagList/index.js +1 -1
- package/v2Components/CapVideoUpload/index.js +14 -6
- package/v2Components/Card/index.js +1 -1
- package/v2Components/Ckeditor/index.js +5 -5
- package/v2Components/CustomPopOver/index.js +3 -3
- package/v2Components/Edmeditor/index.js +4 -4
- package/v2Components/EmailMobilePreview/index.js +4 -4
- package/v2Components/EmailPreviewV2/index.js +4 -4
- package/v2Components/FormBuilder/index.js +3 -3
- package/v2Components/PreviewSideBar/index.js +3 -3
- package/v2Components/SmsTest/index.js +4 -4
- package/v2Components/TemplatePreview/index.js +24 -3
- package/v2Components/Toastr/index.js +1 -1
- package/v2Containers/App/constants.js +21 -0
- package/v2Containers/Assets/Gallery/sagas.js +1 -1
- package/v2Containers/Cap/actions.js +1 -1
- package/v2Containers/Cap/index.js +2 -2
- package/v2Containers/Cap/messages.js +30 -0
- package/v2Containers/Cap/reducer.js +1 -1
- package/v2Containers/Cap/sagas.js +3 -3
- package/v2Containers/Cap/selectors.js +1 -1
- package/v2Containers/CapFacebookPreview/actions.js +3 -15
- package/v2Containers/CapFacebookPreview/constants.js +3 -11
- package/v2Containers/CapFacebookPreview/index.js +6 -6
- package/v2Containers/CapFacebookPreview/reducer.js +3 -9
- package/v2Containers/CapFacebookPreview/sagas.js +6 -65
- package/v2Containers/CreativesContainer/SlideBoxContent.js +64 -1
- package/v2Containers/CreativesContainer/index.js +19 -8
- package/v2Containers/Ebill/actions.js +1 -1
- package/v2Containers/Ebill/index.js +34 -34
- package/v2Containers/Ebill/sagas.js +3 -3
- package/v2Containers/Email/reducer.js +1 -1
- package/v2Containers/EmailWrapper/index.js +4 -4
- package/v2Containers/Facebook/Advertisement/index.js +38 -15
- package/v2Containers/Facebook/Advertisement/index.scss +9 -0
- package/v2Containers/Facebook/Advertisement/messages.js +2 -2
- package/v2Containers/Facebook/actions.js +63 -0
- package/v2Containers/Facebook/constants.js +25 -1
- package/v2Containers/Facebook/index.js +135 -107
- package/v2Containers/Facebook/reducer.js +98 -1
- package/v2Containers/Facebook/sagas.js +147 -0
- package/v2Containers/Facebook/selectors.js +10 -0
- package/v2Containers/LanguageProvider/actions.js +1 -1
- package/v2Containers/Line/Container/Video/index.js +38 -41
- package/v2Containers/Line/Container/actions.js +5 -5
- package/v2Containers/Line/Container/sagas.js +4 -4
- package/v2Containers/MobilePush/Create/actions.js +2 -2
- package/v2Containers/MobilePush/Create/index.js +1 -1
- package/v2Containers/MobilePush/Create/sagas.js +2 -2
- package/v2Containers/MobilePush/Edit/actions.js +3 -3
- package/v2Containers/MobilePush/Edit/index.js +26 -26
- package/v2Containers/MobilePush/Edit/sagas.js +5 -5
- package/v2Containers/Sms/Create/index.js +4 -4
- package/v2Containers/TagList/index.js +6 -6
- package/v2Containers/Templates/_templates.scss +26 -0
- package/v2Containers/Templates/actions.js +18 -5
- package/v2Containers/Templates/constants.js +8 -0
- package/v2Containers/Templates/index.js +139 -11
- package/v2Containers/Templates/messages.js +8 -4
- package/v2Containers/Templates/reducer.js +22 -0
- package/v2Containers/Templates/sagas.js +30 -5
- package/v2Containers/TemplatesV2/index.js +13 -13
- package/v2Containers/Viber/actions.js +2 -2
- package/v2Containers/Viber/index.js +2 -1
- package/v2Containers/Viber/sagas.js +2 -2
- package/v2Containers/WeChat/MapTemplates/actions.js +1 -1
- package/v2Containers/WeChat/MapTemplates/index.js +19 -19
- package/v2Containers/WeChat/MapTemplates/sagas.js +3 -3
- package/v2Containers/WeChat/RichmediaTemplates/Create/actions.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Edit/actions.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Edit/sagas.js +1 -1
|
@@ -188,11 +188,11 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
188
188
|
this.setState({templateData});
|
|
189
189
|
}
|
|
190
190
|
getEditorInstanse = (instance, id) => {
|
|
191
|
-
|
|
191
|
+
|
|
192
192
|
window.CKEDITOR.on( 'instanceReady', ( event ) => {
|
|
193
193
|
this.setState({editorInstanse: event.editor});
|
|
194
194
|
event.editor.on( 'focus', () => {
|
|
195
|
-
|
|
195
|
+
|
|
196
196
|
this.setState({editorInstanse: event.editor});
|
|
197
197
|
});
|
|
198
198
|
});
|
|
@@ -208,7 +208,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
208
208
|
this.setState({isFormValid});
|
|
209
209
|
}
|
|
210
210
|
getCurrentWindow(e) {
|
|
211
|
-
|
|
211
|
+
|
|
212
212
|
const response = {
|
|
213
213
|
action: e.action,
|
|
214
214
|
value: 'edit',
|
|
@@ -217,7 +217,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
217
217
|
parent.postMessage(JSON.stringify(response), '*');
|
|
218
218
|
}
|
|
219
219
|
getFormData(e) {
|
|
220
|
-
|
|
220
|
+
|
|
221
221
|
const message = {
|
|
222
222
|
mediaList: this.props.templateData.templateDetails.versions.base.mediaList,
|
|
223
223
|
media_id: this.props.templateData.templateDetails.versions.base.mediaId,
|
|
@@ -241,7 +241,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
241
241
|
value: data,
|
|
242
242
|
validity: this.state.isFormValid,
|
|
243
243
|
};
|
|
244
|
-
|
|
244
|
+
|
|
245
245
|
e.source.postMessage(JSON.stringify(response), e.origin);
|
|
246
246
|
}
|
|
247
247
|
injectMessages(elem) {
|
|
@@ -300,7 +300,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
300
300
|
// }
|
|
301
301
|
// }
|
|
302
302
|
moveToTemplates() {
|
|
303
|
-
|
|
303
|
+
|
|
304
304
|
const modalContent = {
|
|
305
305
|
title: this.props.intl.formatMessage(messages.modalTitle),
|
|
306
306
|
body: this.props.intl.formatMessage(messages.modalBody),
|
|
@@ -314,7 +314,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
314
314
|
this.setState({showModal: false});
|
|
315
315
|
}
|
|
316
316
|
showNext() {
|
|
317
|
-
|
|
317
|
+
|
|
318
318
|
const response = {
|
|
319
319
|
action: "showNext",
|
|
320
320
|
value: true,
|
|
@@ -322,7 +322,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
322
322
|
parent.postMessage(JSON.stringify(response), '*');
|
|
323
323
|
}
|
|
324
324
|
handleFrameTasks = (e) => {
|
|
325
|
-
|
|
325
|
+
|
|
326
326
|
const type = e.data;
|
|
327
327
|
if (typeof type === 'object') {
|
|
328
328
|
const action = type.action;
|
|
@@ -342,7 +342,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
342
342
|
this.getFormData(e);
|
|
343
343
|
break;
|
|
344
344
|
case "moveToTemplates":
|
|
345
|
-
|
|
345
|
+
|
|
346
346
|
this.moveToTemplates();
|
|
347
347
|
break;
|
|
348
348
|
default:
|
|
@@ -12,7 +12,7 @@ export function* getTemplateDetails({id, channel}) {
|
|
|
12
12
|
const params = {
|
|
13
13
|
id, channel,
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
const result = yield call(Api.getTemplateDetails, params);
|
|
17
17
|
// const sidebar = result.response.sidebar;
|
|
18
18
|
yield put({ type: types.GET_TEMPLATE_DETAILS_SUCCESS, data: result.response });
|
package/index.js
CHANGED
|
@@ -75,6 +75,10 @@ import viberSaga from './v2Containers/Viber/sagas';
|
|
|
75
75
|
|
|
76
76
|
import TemplatesV2 from './v2Containers/TemplatesV2/index';
|
|
77
77
|
|
|
78
|
+
import FacebookPreview from './v2Containers/CapFacebookPreview';
|
|
79
|
+
import FacebookPreviewReducer from './v2Containers/CapFacebookPreview/reducer';
|
|
80
|
+
import FacebookPreviewSaga from './v2Containers/CapFacebookPreview/sagas';
|
|
81
|
+
|
|
78
82
|
import CreativesContainer from './v2Containers/CreativesContainer';
|
|
79
83
|
import CreativesContainerReducer from './v2Containers/CreativesContainer/reducer';
|
|
80
84
|
import { updateCharCount } from './utils/smsCharCountV2';
|
|
@@ -101,6 +105,7 @@ const LineCreateContainer = {LineCreate, lineCreateReducer, lineCreateSaga};
|
|
|
101
105
|
const TemplatesV2Container = {TemplatesV2, templateReducer, templateSaga};
|
|
102
106
|
const FacebookContainer = {Facebook, facebookReducer, facebookSaga};
|
|
103
107
|
const ViberContainer = {Viber, viberReducer, viberSaga};
|
|
108
|
+
const FacebookPreviewContainer = { FacebookPreview, FacebookPreviewReducer, FacebookPreviewSaga };
|
|
104
109
|
|
|
105
110
|
const GalleryContainer = {Gallery, galleryReducer, gallerySagas};
|
|
106
111
|
const FTPContainer = {FTP, FTPReducer, FTPSagas};
|
|
@@ -145,4 +150,5 @@ export { CapContainer,
|
|
|
145
150
|
GalleryContainer,
|
|
146
151
|
FTPContainer,
|
|
147
152
|
ViberContainer,
|
|
153
|
+
FacebookPreviewContainer,
|
|
148
154
|
};
|
package/package.json
CHANGED
package/reducers.js
CHANGED
|
@@ -9,7 +9,7 @@ import { LOCATION_CHANGE } from 'react-router-redux';
|
|
|
9
9
|
|
|
10
10
|
import languageProviderReducer from 'v2Containers/LanguageProvider/reducer';
|
|
11
11
|
import beeEditorReducer from 'v2Containers/BeeEditor/reducer';
|
|
12
|
-
|
|
12
|
+
import CapFacebookPreviewReducer from 'v2Containers/CapFacebookPreview/reducer';
|
|
13
13
|
|
|
14
14
|
import capReducer from 'containers/Cap/reducer';
|
|
15
15
|
import appReducer from 'containers/App/reducer';
|
|
@@ -64,6 +64,7 @@ export default function createReducer(asyncReducers) {
|
|
|
64
64
|
email: emailReducer,
|
|
65
65
|
ebill: ebillReducer,
|
|
66
66
|
beeEditor: beeEditorReducer,
|
|
67
|
+
facebookPreview: CapFacebookPreviewReducer,
|
|
67
68
|
FTP: ftpReducer,
|
|
68
69
|
...asyncReducers,
|
|
69
70
|
});
|
package/routes.js
CHANGED
|
@@ -637,6 +637,8 @@ export default function createRoutes(store) {
|
|
|
637
637
|
import('v2Containers/Line/Container/reducer'),
|
|
638
638
|
import('v2Containers/Viber/sagas'),
|
|
639
639
|
import('v2Containers/Viber/reducer'),
|
|
640
|
+
import('v2Containers/CapFacebookPreview/sagas'),
|
|
641
|
+
import('v2Containers/CapFacebookPreview/reducer'),
|
|
640
642
|
]);
|
|
641
643
|
|
|
642
644
|
const renderRoute = loadModule(cb);
|
|
@@ -658,6 +660,7 @@ export default function createRoutes(store) {
|
|
|
658
660
|
facebookSagas, facebookReducer,
|
|
659
661
|
lineCreateSagas, lineCreateReducer,
|
|
660
662
|
viberSagas, viberReducer,
|
|
663
|
+
capFacebookPreviewSagas, capFacebookPreviewReducer,
|
|
661
664
|
]) => {
|
|
662
665
|
injectReducer('templates', reducer.default);
|
|
663
666
|
injectReducer('cap', capReducer.default);
|
|
@@ -675,6 +678,7 @@ export default function createRoutes(store) {
|
|
|
675
678
|
injectReducer('facebook', facebookReducer.default);
|
|
676
679
|
injectReducer('lineCreate', lineCreateReducer.default);
|
|
677
680
|
injectReducer('viber', viberReducer.default);
|
|
681
|
+
injectReducer('facebookPreview', capFacebookPreviewReducer.default);
|
|
678
682
|
injectSagas(gallerySagas.default);
|
|
679
683
|
injectSagas(sagas.default);
|
|
680
684
|
injectSagas(capSagas.default);
|
|
@@ -691,6 +695,7 @@ export default function createRoutes(store) {
|
|
|
691
695
|
injectSagas(facebookSagas.default);
|
|
692
696
|
injectSagas(lineCreateSagas.default);
|
|
693
697
|
injectSagas(viberSagas.default);
|
|
698
|
+
injectSagas(capFacebookPreviewSagas.default);
|
|
694
699
|
renderRoute(component);
|
|
695
700
|
});
|
|
696
701
|
importModules.catch(errorLoading);
|
package/services/api.js
CHANGED
|
@@ -11,12 +11,15 @@ import { GA } from '@capillarytech/cap-ui-utils';
|
|
|
11
11
|
let API_ENDPOINT = config.development.api_endpoint;
|
|
12
12
|
let EXPORT_API_ENDPOINT = config.development.exports_api_endpoint;
|
|
13
13
|
let CAMPAIGNS_API_ENDPOINT = config.development.campaigns_api_endpoint;
|
|
14
|
+
let CAMPAIGNS_API_ORG_ENDPOINT = config.development.campaigns_api_org_endpoint;
|
|
15
|
+
|
|
14
16
|
let API_AUTH_ENDPOINT = config.development.auth_endpoint;
|
|
15
17
|
let ARYA_ENDPOINT = config.development.arya_endpoint;
|
|
16
18
|
let SUBSCRIPTION_API_ENDPOINT = config.development.subscription_api_endpoint;
|
|
17
19
|
if (process.env.NODE_ENV === 'production') {
|
|
18
20
|
API_ENDPOINT = config.production.api_endpoint;
|
|
19
21
|
CAMPAIGNS_API_ENDPOINT = config.production.campaigns_api_endpoint;
|
|
22
|
+
CAMPAIGNS_API_ORG_ENDPOINT = config.production.campaigns_api_org_endpoint;
|
|
20
23
|
API_AUTH_ENDPOINT = config.production.auth_endpoint;
|
|
21
24
|
ARYA_ENDPOINT = config.production.arya_endpoint;
|
|
22
25
|
SUBSCRIPTION_API_ENDPOINT = config.production.subscription_api_endpoint;
|
|
@@ -84,7 +87,7 @@ function request(url, options) {
|
|
|
84
87
|
try {
|
|
85
88
|
requestCallerName = getCallerName();
|
|
86
89
|
} catch (e) {
|
|
87
|
-
|
|
90
|
+
|
|
88
91
|
}
|
|
89
92
|
const fetchUrl = url.indexOf('?') !== -1 ? `${url}&time=${Date.now()}` : `${url}?time=${Date.now()}`;
|
|
90
93
|
return fetch(fetchUrl, options)
|
|
@@ -187,30 +190,31 @@ export const getUserData = () => {
|
|
|
187
190
|
};
|
|
188
191
|
|
|
189
192
|
export const createTemplate = ({template}) => {
|
|
190
|
-
|
|
193
|
+
|
|
191
194
|
const url = `${API_ENDPOINT}/templates/SMS`;
|
|
192
195
|
return request(url, getAPICallObject('POST', template));
|
|
193
196
|
};
|
|
194
197
|
|
|
195
198
|
export const editTemplate = ({template}) => {
|
|
196
|
-
|
|
199
|
+
|
|
197
200
|
const url = `${API_ENDPOINT}/templates/SMS`;
|
|
198
201
|
return request(url, getAPICallObject('POST', template));
|
|
199
202
|
};
|
|
200
203
|
|
|
201
204
|
export const createWeChatTemplate = ({template}) => {
|
|
202
|
-
|
|
205
|
+
|
|
203
206
|
const url = `${API_ENDPOINT}/templates/WECHAT`;
|
|
204
207
|
return request(url, getAPICallObject('POST', template));
|
|
205
208
|
};
|
|
209
|
+
|
|
206
210
|
export const createMobilePushTemplate = ({template}) => {
|
|
207
|
-
|
|
211
|
+
|
|
208
212
|
const url = `${API_ENDPOINT}/templates/MOBILEPUSH`;
|
|
209
213
|
return request(url, getAPICallObject('POST', template));
|
|
210
214
|
};
|
|
211
215
|
|
|
212
216
|
export const duplicateTemplate = ({id, channel}) => {
|
|
213
|
-
|
|
217
|
+
|
|
214
218
|
const url = `${API_ENDPOINT}/templates/duplicate/${id}/${channel}`;
|
|
215
219
|
return request(url, getAPICallObject('GET'));
|
|
216
220
|
};
|
|
@@ -221,37 +225,36 @@ export const getFTPServers = () => {
|
|
|
221
225
|
};
|
|
222
226
|
|
|
223
227
|
export const editWeChatTemplate = ({template}) => {
|
|
224
|
-
|
|
228
|
+
|
|
225
229
|
const url = `${API_ENDPOINT}/templates/WECHAT`;
|
|
226
230
|
return request(url, getAPICallObject('POST', template));
|
|
227
231
|
};
|
|
228
232
|
|
|
229
233
|
export const createEmailTemplate = ({template}) => {
|
|
230
|
-
|
|
234
|
+
|
|
231
235
|
const url = `${API_ENDPOINT}/templates/EMAIL`;
|
|
232
236
|
return request(url, getAPICallObject('POST', template));
|
|
233
237
|
};
|
|
234
238
|
|
|
235
239
|
export const createEbillTemplate = ({template}) => {
|
|
236
|
-
|
|
240
|
+
|
|
237
241
|
const url = `${API_ENDPOINT}/templates/EBILL`;
|
|
238
242
|
return request(url, getAPICallObject('POST', template));
|
|
239
243
|
};
|
|
240
244
|
|
|
241
245
|
export const getTemplateDetails = ({id, channel}) => {
|
|
242
|
-
|
|
246
|
+
|
|
243
247
|
const url = `${API_ENDPOINT}/templates/${id}/${channel ? channel.toUpperCase() : 'SMS'}`;
|
|
244
248
|
return request(url, getAPICallObject('GET'));
|
|
245
249
|
};
|
|
246
250
|
|
|
247
251
|
export const getAllTemplates = ({channel, queryParams}) => {
|
|
248
|
-
console.log('in api.js', channel, queryParams);
|
|
249
252
|
const url = `${API_ENDPOINT}/templates/${channel}?query=${encodeURIComponent(JSON.stringify(queryParams))}`;
|
|
250
253
|
return request(url, getAPICallObject('GET'));
|
|
251
254
|
};
|
|
252
255
|
|
|
253
256
|
export const deleteTemplate = ({channel, id}) => {
|
|
254
|
-
|
|
257
|
+
|
|
255
258
|
const url = `${API_ENDPOINT}/templates/${id}/${channel}`;
|
|
256
259
|
return request(url, getAPICallObject('DELETE'));
|
|
257
260
|
//return API.deleteResource(url);
|
|
@@ -347,7 +350,7 @@ export const getCmsData = (cmsType, projectId, langId) => {
|
|
|
347
350
|
};
|
|
348
351
|
|
|
349
352
|
export const getEdmTemplates = () => {
|
|
350
|
-
|
|
353
|
+
|
|
351
354
|
const url = `${API_ENDPOINT}/templates/email/default`;
|
|
352
355
|
return request(url, getAPICallObject('GET'));
|
|
353
356
|
};
|
|
@@ -360,7 +363,7 @@ export const getDefaultBeeTemplates = () => {
|
|
|
360
363
|
// All about line
|
|
361
364
|
|
|
362
365
|
export const createLineTemplate = ({template}) => {
|
|
363
|
-
|
|
366
|
+
|
|
364
367
|
const url = `${API_ENDPOINT}/templates/LINE`;
|
|
365
368
|
return request(url, getAPICallObject('POST', template));
|
|
366
369
|
};
|
|
@@ -370,6 +373,11 @@ export const createViberTemplate = ({template}) => {
|
|
|
370
373
|
return request(url, getAPICallObject('POST', template));
|
|
371
374
|
};
|
|
372
375
|
|
|
376
|
+
export const createFacebookADTemplate = ({template}) => {
|
|
377
|
+
const url = `${API_ENDPOINT}/templates/FACEBOOK`;
|
|
378
|
+
return request(url, getAPICallObject('POST', template));
|
|
379
|
+
};
|
|
380
|
+
|
|
373
381
|
export const getLocizMessage = async (locale) => {
|
|
374
382
|
const appName = 'creatives_v2';
|
|
375
383
|
const url = `${ARYA_ENDPOINT}/translations/${appName}/${locale}`;
|
|
@@ -403,3 +411,24 @@ export const createCustomRow = (data) => {
|
|
|
403
411
|
const url = `${API_ENDPOINT}/cms/saveRows`;
|
|
404
412
|
return request(url, getAPICallObject('POST', data));
|
|
405
413
|
};
|
|
414
|
+
|
|
415
|
+
export const getFacebookPreview = ({previewData}) => {
|
|
416
|
+
const url = `${API_ENDPOINT}/facebook/getPreview`;
|
|
417
|
+
return request(url, getAPICallObject('POST', previewData));
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
export const getOrgOUs = ({ orgID }) => {
|
|
422
|
+
const url = `${ARYA_ENDPOINT}/org/${orgID}/oulist`;
|
|
423
|
+
return request(url, getAPICallObject('GET'));
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
export const getOrgLevelCampaignSettings = () => {
|
|
427
|
+
const url = `${CAMPAIGNS_API_ORG_ENDPOINT}/settings`;
|
|
428
|
+
return request(url, getAPICallObject('GET', null, false, true));
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
export const getFacebookVideoId = ({videoUrl, accessToken, actId, pageAccessToken, pageId}) => {
|
|
432
|
+
const url = `${API_ENDPOINT}/facebook/getFacebookVideoId`;
|
|
433
|
+
return request(url, getAPICallObject('POST', {videoUrl, accessToken, actId, pageAccessToken, pageId}));
|
|
434
|
+
};
|
package/utils/authWrapper.js
CHANGED
|
@@ -10,10 +10,10 @@ const getIsLoggedIn = () => {
|
|
|
10
10
|
let isLoggedIn = false;
|
|
11
11
|
if (process.env.NODE_ENV === "production" && JSON.parse(window.localStorage.getItem('isLoggedIn'))) {
|
|
12
12
|
isLoggedIn = true;
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
} else if (localStorage.getItem("token")) {
|
|
15
15
|
isLoggedIn = true;
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
}
|
|
18
18
|
return isLoggedIn;
|
|
19
19
|
};
|
package/utils/common.js
CHANGED
|
@@ -49,7 +49,7 @@ export function getTreeStructuredTags({tagsList, userLocale = 'en', offerDetails
|
|
|
49
49
|
name: tag.label[userLocale] || tag.label.en,
|
|
50
50
|
value: tag.value,
|
|
51
51
|
};
|
|
52
|
-
} else if (tag['tag-header'] && mainTags[tag.value]) {
|
|
52
|
+
} else if (tag['tag-header'] && mainTags[tag.value]) {
|
|
53
53
|
// to check it this tag header is already available in mainTags object,
|
|
54
54
|
//If yes, it will concat the subtag
|
|
55
55
|
mainTags[tag.value].subtags = _.concat(mainTags[tag.value].subtags, tag.subtags);
|
|
@@ -215,3 +215,15 @@ function getSubTags(subtagsParam) {
|
|
|
215
215
|
});
|
|
216
216
|
return result;
|
|
217
217
|
}
|
|
218
|
+
|
|
219
|
+
export const bytes2Size = (bytes, decimals = 2) => {
|
|
220
|
+
if (bytes === 0) return '0 Bytes';
|
|
221
|
+
|
|
222
|
+
const k = 1024;
|
|
223
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
224
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
225
|
+
|
|
226
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
227
|
+
|
|
228
|
+
return `${Math.ceil((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
|
|
229
|
+
};
|
package/utils/smsCharCount.js
CHANGED
|
@@ -174,7 +174,7 @@ let updateSmsData = (chars) => {
|
|
|
174
174
|
msgContent = msgContent.replace(/\r/g, " ").replace(/\f/g, " ");
|
|
175
175
|
|
|
176
176
|
const matches = msgContent.split("");
|
|
177
|
-
|
|
177
|
+
|
|
178
178
|
let use7bit = true;
|
|
179
179
|
let length7bit = 0;
|
|
180
180
|
let length16bit = 0;
|
|
@@ -255,7 +255,7 @@ function _camp1(s) {
|
|
|
255
255
|
try {
|
|
256
256
|
return i18n.dgettext("camp1", s) !== '' ? this.i18n.dgettext("camp1", s) : s;
|
|
257
257
|
} catch (err) {
|
|
258
|
-
|
|
258
|
+
|
|
259
259
|
return s;
|
|
260
260
|
}
|
|
261
261
|
}
|
|
@@ -328,7 +328,7 @@ export function updateCharCount(boxVal) {
|
|
|
328
328
|
|
|
329
329
|
// let unicodeFlag = 0;
|
|
330
330
|
// let extraChars = 0;
|
|
331
|
-
|
|
331
|
+
|
|
332
332
|
let msgCount = 0;
|
|
333
333
|
const lenCount = smsCharCount(boxVal);
|
|
334
334
|
const len = lenCount[0];
|
|
@@ -337,9 +337,9 @@ export function updateCharCount(boxVal) {
|
|
|
337
337
|
const totalChars = lenCount[2].total_chars;
|
|
338
338
|
const charset = lenCount[2].charset;
|
|
339
339
|
if (!charset && totalChars > 1000) {
|
|
340
|
-
|
|
340
|
+
|
|
341
341
|
} else if (charset && totalChars > 500) {
|
|
342
|
-
|
|
342
|
+
|
|
343
343
|
}
|
|
344
344
|
|
|
345
345
|
// return `${len} characters = ${msgCount} Messages*, Characters left: ${charLeft}`;
|
|
@@ -139,7 +139,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
139
139
|
supportedTagsString += `${supportedTag} ,`;
|
|
140
140
|
});
|
|
141
141
|
supportedTagsString = supportedTagsString.replace(/,\s*$/, "");
|
|
142
|
-
|
|
142
|
+
|
|
143
143
|
if (_.has(val, 'subtags')) {
|
|
144
144
|
const temp = this.renderTags(val.subtags);
|
|
145
145
|
list.push((
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
CapError,
|
|
18
18
|
CapUploader,
|
|
19
19
|
CapSpin,
|
|
20
|
+
CapNotification,
|
|
20
21
|
} from '@capillarytech/cap-ui-library';
|
|
21
22
|
import {bytes2Size} from '../../utils/common';
|
|
22
23
|
import './index.scss';
|
|
@@ -48,6 +49,7 @@ function CapVideoUpload(props) {
|
|
|
48
49
|
previewUrl,
|
|
49
50
|
videoHeight,
|
|
50
51
|
videoWidth,
|
|
52
|
+
videoId,
|
|
51
53
|
} = uploadedAssetList;
|
|
52
54
|
|
|
53
55
|
const [isTemplateDrawerRequired, updateTemplateDrawerRequirement] = useState(false);
|
|
@@ -82,11 +84,14 @@ function CapVideoUpload(props) {
|
|
|
82
84
|
const metaVideoSrc = get(videoData, `uploadedAssetDataVideo_${index}.metaInfo.secure_file_path`, '');
|
|
83
85
|
const previewImgUrl = get(videoData, `uploadedAssetDataVideo_${index}.metaInfo.video_file_path_preview`, '');
|
|
84
86
|
const metaVideoName = get(videoData, `uploadedAssetDataVideo_${index}.metaInfo.name`, '');
|
|
87
|
+
const metaVideoId = get(videoData, `uploadedAssetDataVideo_${index}.videoIdResponse.fbVideo.id`, '');
|
|
88
|
+
|
|
85
89
|
if (metaVideoSrc && videoSrc === "") {
|
|
86
90
|
onVideoUploadUpdateAssestList(index, {
|
|
87
91
|
previewUrl: previewImgUrl,
|
|
88
92
|
videoSrc: metaVideoSrc,
|
|
89
93
|
videoName: metaVideoName,
|
|
94
|
+
videoId: metaVideoId,
|
|
90
95
|
},
|
|
91
96
|
);
|
|
92
97
|
}
|
|
@@ -100,6 +105,7 @@ function CapVideoUpload(props) {
|
|
|
100
105
|
}
|
|
101
106
|
}, [videoData[`assetUploadingVideo_${index}`]]);
|
|
102
107
|
|
|
108
|
+
|
|
103
109
|
useEffect(() => {
|
|
104
110
|
if (!isEmpty(uploadedAssetList)) {
|
|
105
111
|
const {
|
|
@@ -184,12 +190,13 @@ function CapVideoUpload(props) {
|
|
|
184
190
|
onVideoUploadUpdateAssestList(
|
|
185
191
|
index,
|
|
186
192
|
{
|
|
187
|
-
previewUrl,
|
|
188
|
-
videoName,
|
|
189
|
-
videoHeight,
|
|
190
|
-
videoWidth,
|
|
191
|
-
videoSrc,
|
|
192
|
-
videoDuration,
|
|
193
|
+
previewUrl: "",
|
|
194
|
+
videoName: "",
|
|
195
|
+
videoHeight: "",
|
|
196
|
+
videoWidth: "",
|
|
197
|
+
videoSrc: "",
|
|
198
|
+
videoDuration: "",
|
|
199
|
+
videoId: "",
|
|
193
200
|
}
|
|
194
201
|
);
|
|
195
202
|
};
|
|
@@ -204,6 +211,7 @@ function CapVideoUpload(props) {
|
|
|
204
211
|
index,
|
|
205
212
|
{
|
|
206
213
|
videoSrc,
|
|
214
|
+
videoId,
|
|
207
215
|
videoName,
|
|
208
216
|
videoHeight: metaVideoHeight,
|
|
209
217
|
videoWidth: metaVideoWidth,
|
|
@@ -33,7 +33,7 @@ class CustomCard extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
handleMouseHover(data) {
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
this.setState({isHovering: data});
|
|
38
38
|
this.props.onHover(!this.state.isHovering, this.props.id);
|
|
39
39
|
}
|
|
@@ -166,7 +166,7 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
|
|
|
166
166
|
// setTimeout(() => {
|
|
167
167
|
// this.editorInstance.name = this.id;
|
|
168
168
|
// }, 5000);
|
|
169
|
-
|
|
169
|
+
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
|
|
@@ -183,7 +183,7 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
|
|
|
183
183
|
onLoad() {
|
|
184
184
|
if (this.unmounting) return;
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
|
|
187
187
|
if (!window.CKEDITOR) {
|
|
188
188
|
console.error("CKEditor not found");
|
|
189
189
|
return;
|
|
@@ -191,13 +191,13 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
|
|
|
191
191
|
|
|
192
192
|
let html = this.props.content;
|
|
193
193
|
html = html.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"");
|
|
194
|
-
|
|
194
|
+
|
|
195
195
|
this.editorInstance = window.CKEDITOR.appendTo(
|
|
196
196
|
this.node,
|
|
197
197
|
this.state.config,
|
|
198
198
|
html
|
|
199
199
|
);
|
|
200
|
-
|
|
200
|
+
|
|
201
201
|
|
|
202
202
|
if (this.props.getEditorInstanse) {
|
|
203
203
|
this.props.getEditorInstanse(this.editorInstance, this.props.id);
|
|
@@ -248,7 +248,7 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
|
|
|
248
248
|
};
|
|
249
249
|
|
|
250
250
|
render() {
|
|
251
|
-
|
|
251
|
+
|
|
252
252
|
return (
|
|
253
253
|
<div id={this.props.id} style={{borderRight: "1px solid #000 !important"}}>
|
|
254
254
|
<div className={this.props.activeClass} ref={(node) => (this.node = node)}/>
|
|
@@ -17,17 +17,17 @@ import messages from './messages';
|
|
|
17
17
|
|
|
18
18
|
class CustomPopOver extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
19
19
|
componentWillMount() {
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
componentWillReceiveProps(nextProps) {
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
renderPopoverContent() {
|
|
28
28
|
const elem = [];
|
|
29
29
|
_.forEach(this.props.popOverList, (content, index) => {
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
if (this.props.excludeList.indexOf(content.iso_code) === -1) {
|
|
32
32
|
elem.push(
|
|
33
33
|
<p style={{ cursor: "pointer"}} key={index} onClick={() => this.props.handlePopOverClick(content)}>{content.language}</p>
|
|
@@ -25,13 +25,13 @@ class Edmeditor extends React.Component { // eslint-disable-line react/prefer-st
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
componentDidMount() {
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
componentWillReceiveProps(nextProps) {
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
// if (!_.isEqual(nextProps.content, this.props.content)) {
|
|
34
|
-
//
|
|
34
|
+
//
|
|
35
35
|
// this.editorInstance.content = nextProps.content;
|
|
36
36
|
// }
|
|
37
37
|
}
|
|
@@ -41,7 +41,7 @@ class Edmeditor extends React.Component { // eslint-disable-line react/prefer-st
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
render() {
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
return (
|
|
46
46
|
this.props.edmSrc ?
|
|
47
47
|
(<iframe id={this.props.id} className={this.props.activeClass} src={this.props.edmSrc} height="460" width="100%" style={{height: "calc(100vh - 180px)"}}></iframe>)
|
|
@@ -17,15 +17,15 @@ import moment from 'moment';
|
|
|
17
17
|
import EmailPreviewV2 from '../EmailPreviewV2';
|
|
18
18
|
import messages from '../EmailPreviewV2/messages';
|
|
19
19
|
import './index.scss';
|
|
20
|
-
import mobileBody from '../../assets/
|
|
20
|
+
import mobileBody from '../../assets/DeviceForEmail.png';
|
|
21
21
|
import { removeLinksFromHtmlContent } from './../../utils/common';
|
|
22
22
|
import {selectTemplateContent} from '../../containers/Templates/selectors';
|
|
23
23
|
import * as templateActions from '../../containers/Templates/actions';
|
|
24
24
|
|
|
25
25
|
const deviceAspectRatio = {
|
|
26
26
|
mobile: {
|
|
27
|
-
height: "
|
|
28
|
-
width: "
|
|
27
|
+
height: "541",
|
|
28
|
+
width: "340",
|
|
29
29
|
},
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -95,7 +95,7 @@ class EmailMobilePreview extends React.Component {
|
|
|
95
95
|
)}
|
|
96
96
|
<div className={"shell align-center"}>
|
|
97
97
|
|
|
98
|
-
<img src={mobileBody} alt="capillary" width="
|
|
98
|
+
<img src={mobileBody} alt="capillary" width="386" />
|
|
99
99
|
<div className={`${messageContainerName} ${emailSubjectLabel ? 'with-subject' : ''}`}>
|
|
100
100
|
{emailSubjectLabel}
|
|
101
101
|
<iframe srcDoc={copyContent} {...deviceAspectRatio.mobile} >
|
|
@@ -18,7 +18,7 @@ import moment from 'moment';
|
|
|
18
18
|
import messages from './messages';
|
|
19
19
|
import './_emailPreviewV2.scss';
|
|
20
20
|
import tabletBody from '../../assets/iPad.svg';
|
|
21
|
-
import mobileBody from '../../assets/
|
|
21
|
+
import mobileBody from '../../assets/DeviceForEmail.png';
|
|
22
22
|
import { removeLinksFromHtmlContent } from './../../utils/common';
|
|
23
23
|
|
|
24
24
|
import {selectTemplateContent} from '../../v2Containers/Templates/selectors';
|
|
@@ -34,8 +34,8 @@ const deviceAspectRatio = {
|
|
|
34
34
|
width: "450",
|
|
35
35
|
}),
|
|
36
36
|
mobile: (emailSubject) => ({
|
|
37
|
-
height: emailSubject ? "
|
|
38
|
-
width: "
|
|
37
|
+
height: emailSubject ? "541" : "511",
|
|
38
|
+
width: "340",
|
|
39
39
|
}),
|
|
40
40
|
};
|
|
41
41
|
const devices = {
|
|
@@ -127,7 +127,7 @@ class EmailPreviewV2 extends React.Component {
|
|
|
127
127
|
tab: <StyledCapIcon type="mobile" active={currentDevice === 'mobile'} />,
|
|
128
128
|
content: (<div className="email-preview-container">
|
|
129
129
|
<div className="shell align-center">
|
|
130
|
-
<img src={mobileBody} alt="capillary" width="
|
|
130
|
+
<img src={mobileBody} alt="capillary" width="386" />
|
|
131
131
|
{iframeDiv}
|
|
132
132
|
</div>
|
|
133
133
|
</div>),
|