@capillarytech/creatives-library 7.6.13 → 7.7.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/app.js +0 -5
- package/index.html +2 -2
- package/index.js +3 -3
- package/package.json +2 -2
- package/services/api.js +0 -2
- package/v2Components/TemplatePreview/index.js +0 -1
- package/v2Containers/App/constants.js +0 -11
- package/v2Containers/Cap/index.js +29 -23
- package/v2Containers/CapFacebookPreview/index.js +3 -5
- package/v2Containers/CreativesContainer/SlideBoxContent.js +1 -16
- package/v2Containers/CreativesContainer/index.js +12 -122
- package/v2Containers/Email/index.js +3 -14
- package/v2Containers/EmailWrapper/index.js +3 -10
- package/v2Containers/Facebook/Advertisement/index.js +36 -72
- package/v2Containers/Facebook/Advertisement/index.scss +1 -1
- package/v2Containers/Facebook/Facebook.style.js +1 -1
- package/v2Containers/Facebook/constants.js +0 -4
- package/v2Containers/Facebook/index.js +122 -198
- package/v2Containers/Facebook/messages.js +4 -24
- package/v2Containers/Line/Container/index.js +4 -32
- package/v2Containers/MobilePush/Create/index.js +4 -25
- package/v2Containers/MobilePush/Edit/index.js +5 -27
- package/v2Containers/MobilePush/Edit/sagas.js +1 -1
- package/v2Containers/MobilePush/commonMethods.js +1 -19
- package/v2Containers/Sms/Create/index.js +2 -14
- package/v2Containers/Sms/Edit/index.js +2 -15
- package/v2Containers/Templates/index.js +27 -43
- package/v2Containers/Templates/reducer.js +1 -1
- package/v2Containers/TemplatesV2/index.js +6 -23
- package/v2Containers/TemplatesV2/messages.js +0 -4
- package/v2Containers/Viber/index.js +3 -19
- package/v2Containers/WeChat/MapTemplates/index.js +3 -12
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +2 -11
- package/utils/gtmTrackers/gtmEvents/creativeDetails.js +0 -41
- package/utils/gtmTrackers/index.js +0 -17
- package/v2Components/TemplatePreview/assets/images/mobile.svg +0 -24
- package/v2Containers/Line/Create/_lineCreate.scss +0 -64
- package/v2Containers/Line/Create/actions.js +0 -94
- package/v2Containers/Line/Create/constants.js +0 -43
- package/v2Containers/Line/Create/index.js +0 -1132
- package/v2Containers/Line/Create/initialSchema.js +0 -378
- package/v2Containers/Line/Create/messages.js +0 -229
- package/v2Containers/Line/Create/reducer.js +0 -99
- package/v2Containers/Line/Create/sagas.js +0 -113
- package/v2Containers/Line/Create/selectors.js +0 -30
- package/v2Containers/Line/CreateWrapper/constants.js +0 -2
- package/v2Containers/Line/CreateWrapper/index.js +0 -117
- package/v2Containers/Line/CreateWrapper/messages.js +0 -55
- package/v2Containers/Line/Edit/_lineEdit.scss +0 -23
- package/v2Containers/Line/Edit/actions.js +0 -79
- package/v2Containers/Line/Edit/constants.js +0 -27
- package/v2Containers/Line/Edit/index.js +0 -1051
- package/v2Containers/Line/Edit/messages.js +0 -173
- package/v2Containers/Line/Edit/reducer.js +0 -83
- package/v2Containers/Line/Edit/sagas.js +0 -81
- package/v2Containers/Line/Edit/selectors.js +0 -29
- package/v2Containers/Line/Edit/tests/actions.test.js +0 -18
- package/v2Containers/Line/Edit/tests/index.test.js +0 -10
- package/v2Containers/Line/Edit/tests/reducer.test.js +0 -9
- package/v2Containers/Line/Edit/tests/sagas.test.js +0 -15
- package/v2Containers/Line/Edit/tests/selectors.test.js +0 -10
|
@@ -3,8 +3,6 @@ import React, { useState, useEffect, useCallback} from "react";
|
|
|
3
3
|
import { injectIntl, FormattedMessage, intlShape } from 'react-intl';
|
|
4
4
|
import { isUrl } from '../../Line/Container/Wrapper/utils';
|
|
5
5
|
import get from 'lodash/get';
|
|
6
|
-
import isEmpty from 'lodash/isEmpty';
|
|
7
|
-
|
|
8
6
|
import {
|
|
9
7
|
CapInput,
|
|
10
8
|
CapRadioCard,
|
|
@@ -84,12 +82,10 @@ export const Advertisement = (props) => {
|
|
|
84
82
|
actions,
|
|
85
83
|
fbADData = {},
|
|
86
84
|
onCreateComplete,
|
|
87
|
-
templateData
|
|
85
|
+
templateData,
|
|
88
86
|
params,
|
|
89
87
|
getFormSubscriptionData,
|
|
90
88
|
facebookTemplateData,
|
|
91
|
-
selectedMarketingObjective,
|
|
92
|
-
orgUnitId,
|
|
93
89
|
} = props;
|
|
94
90
|
const {
|
|
95
91
|
formatMessage,
|
|
@@ -132,7 +128,7 @@ export const Advertisement = (props) => {
|
|
|
132
128
|
orgUnitFacebookPageSettingsMap = {},
|
|
133
129
|
employeeAccessToken: accessToken = "",
|
|
134
130
|
accountId = "",
|
|
135
|
-
} = selectedFacebookAccount
|
|
131
|
+
} = selectedFacebookAccount;
|
|
136
132
|
const { pageAccessToken, pageId: pId } = orgUnitFacebookPageSettingsMap[pageId] || {};
|
|
137
133
|
videoData = {
|
|
138
134
|
accessToken,
|
|
@@ -162,7 +158,7 @@ export const Advertisement = (props) => {
|
|
|
162
158
|
}, [paramObj.id]);
|
|
163
159
|
|
|
164
160
|
useEffect(() => {
|
|
165
|
-
if (params
|
|
161
|
+
if ((params && params.id) || (templateData || {}).edit) {
|
|
166
162
|
const { FacebookAd = [], pageOrgUnitId: editPageId} = get(templateData, `versions.base.content`) || get(fbADData, `templateDetails.versions.base.content`) || {};
|
|
167
163
|
const editMessageTitle = (templateData || {}).name || get(fbADData, 'templateDetails.name');
|
|
168
164
|
const editFBContent = Object.values(FacebookAd);
|
|
@@ -221,7 +217,6 @@ export const Advertisement = (props) => {
|
|
|
221
217
|
}
|
|
222
218
|
}, [fbADData[`templateDetails`] || templateData]);
|
|
223
219
|
|
|
224
|
-
|
|
225
220
|
const CustomToolTip = useCallback((msg) => <CapTooltipWithInfo
|
|
226
221
|
infoIconProps={{svgProps: {width: 12, height: 12}, style: {marginLeft: 5}}}
|
|
227
222
|
title={msg}
|
|
@@ -354,7 +349,8 @@ export const Advertisement = (props) => {
|
|
|
354
349
|
}
|
|
355
350
|
messageData.push(data);
|
|
356
351
|
});
|
|
357
|
-
|
|
352
|
+
|
|
353
|
+
return {
|
|
358
354
|
versions: {
|
|
359
355
|
base: {
|
|
360
356
|
content: {
|
|
@@ -366,17 +362,12 @@ export const Advertisement = (props) => {
|
|
|
366
362
|
type: "FACEBOOK",
|
|
367
363
|
name: messageTitle,
|
|
368
364
|
};
|
|
369
|
-
if (!isFullMode) {
|
|
370
|
-
finalResponse = {...finalResponse, selectedMarketingObjective, accountId};
|
|
371
|
-
}
|
|
372
|
-
return finalResponse;
|
|
373
365
|
}, [carouselData,
|
|
374
366
|
pageId,
|
|
375
367
|
messageTitle,
|
|
376
368
|
primaryText,
|
|
377
369
|
callToAction,
|
|
378
|
-
displayLink
|
|
379
|
-
selectedMarketingObjective]);
|
|
370
|
+
displayLink]);
|
|
380
371
|
|
|
381
372
|
const onCreateFacebookAd = useCallback( () => {
|
|
382
373
|
actions.createTemplate(
|
|
@@ -452,7 +443,6 @@ export const Advertisement = (props) => {
|
|
|
452
443
|
updateMessageTitle(val);
|
|
453
444
|
}, [messageTitle]);
|
|
454
445
|
|
|
455
|
-
|
|
456
446
|
const isDisableDone = useCallback((isPreview) => {
|
|
457
447
|
let flag = false;
|
|
458
448
|
if (primaryText === "" ) {
|
|
@@ -502,7 +492,8 @@ export const Advertisement = (props) => {
|
|
|
502
492
|
selectedAd,
|
|
503
493
|
]
|
|
504
494
|
);
|
|
505
|
-
|
|
495
|
+
|
|
496
|
+
const isDisableContinue = () => messageTitle.trim() === "" || selectedAd === "";
|
|
506
497
|
|
|
507
498
|
const onClickContinue = useCallback(() => { updateStep('createFacebookAd'); }, [step]);
|
|
508
499
|
|
|
@@ -811,8 +802,8 @@ export const Advertisement = (props) => {
|
|
|
811
802
|
setPageId(value);
|
|
812
803
|
}, [pageId]);
|
|
813
804
|
|
|
814
|
-
const selectedFacebookAccount =
|
|
815
|
-
const {orgUnitFacebookPageSettingsMap = {}, employeeAccessToken: accessToken = "", accountId = "" } = selectedFacebookAccount
|
|
805
|
+
const selectedFacebookAccount = get(facebookTemplateData, 'selectedFacebookAccount', {});
|
|
806
|
+
const {orgUnitFacebookPageSettingsMap = {}, employeeAccessToken: accessToken = "", accountId = "" } = selectedFacebookAccount;
|
|
816
807
|
|
|
817
808
|
const getPageAccessOrgs = useCallback(() => {
|
|
818
809
|
const {status, data } = fbADData.orgOuData || {};
|
|
@@ -822,32 +813,14 @@ export const Advertisement = (props) => {
|
|
|
822
813
|
const orgName = (
|
|
823
814
|
proxyOrgList.find(({ orgID }) => orgID === Number(orgId)) || {}
|
|
824
815
|
).orgName;
|
|
825
|
-
if (
|
|
826
|
-
// !status is the case of library
|
|
827
|
-
//if org id is the parent org
|
|
828
|
-
if (orgUnitFacebookPageSettingsMap[-1] && !pageId) {
|
|
829
|
-
setPageId(-1);
|
|
830
|
-
}
|
|
831
|
-
if (orgUnitFacebookPageSettingsMap[-1]) {
|
|
832
|
-
pageAccessOrgsOptions.push({label: orgName, value: -1});
|
|
833
|
-
}
|
|
834
|
-
// if we are coming from default startegy and calling templates from facebook/index.js
|
|
835
|
-
if (!pageId && orgUnitId && orgUnitFacebookPageSettingsMap[orgUnitId]) {
|
|
836
|
-
setPageId(orgUnitId);
|
|
837
|
-
}
|
|
838
|
-
} else if (status === 'SUCCESS') {
|
|
816
|
+
if (status === 'SUCCESS') {
|
|
839
817
|
Object.keys(data).forEach((obj) => {
|
|
840
818
|
if ((orgUnitFacebookPageSettingsMap[data[obj]] || {}).pageAccessToken) {
|
|
841
|
-
pageAccessOrgsOptions.push({label: obj, value: data[obj]});
|
|
819
|
+
pageAccessOrgsOptions.push({label: data[obj] === -1 ? orgName : obj, value: data[obj]});
|
|
842
820
|
}
|
|
843
821
|
});
|
|
844
|
-
if (
|
|
845
|
-
pageAccessOrgsOptions.push({label: orgName, value: -1});
|
|
846
|
-
}
|
|
847
|
-
if (!pageId && !isEmpty(data)) {
|
|
822
|
+
if (!pageId) {
|
|
848
823
|
setPageId((pageAccessOrgsOptions[0] || {} ).value);
|
|
849
|
-
} else if (orgUnitFacebookPageSettingsMap[-1] && !pageId) {
|
|
850
|
-
setPageId(-1);
|
|
851
824
|
}
|
|
852
825
|
}
|
|
853
826
|
return pageAccessOrgsOptions;
|
|
@@ -856,7 +829,7 @@ export const Advertisement = (props) => {
|
|
|
856
829
|
const options = getPageAccessOrgs() || [];
|
|
857
830
|
const { data = {} } = fbADData.orgOuData || {};
|
|
858
831
|
const selectedPageName = Object.keys(data).find((key) => data[key] === pageId);
|
|
859
|
-
return ( (step === 'modeSelection'
|
|
832
|
+
return ( (step === 'modeSelection') ?
|
|
860
833
|
( <CapSpin spinning={adSpinLoader} className="add-facebook-ad-section">
|
|
861
834
|
<div style={{ position: 'fixed', top: '25px', zIndex: 1}}>
|
|
862
835
|
<CapHeader
|
|
@@ -865,27 +838,25 @@ export const Advertisement = (props) => {
|
|
|
865
838
|
className={"cap-header-facebook-ad"}
|
|
866
839
|
/>
|
|
867
840
|
</div>
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
></CapSelect>
|
|
888
|
-
</>}
|
|
841
|
+
<CapInput
|
|
842
|
+
id={`fbAd_input`}
|
|
843
|
+
onChange={onTextTitleChange}
|
|
844
|
+
className="text-template-title"
|
|
845
|
+
defaultValue={messageTitle || ''}
|
|
846
|
+
value={messageTitle || ''}
|
|
847
|
+
style={{marginBottom: 27, width: '762px'}}
|
|
848
|
+
size="default"
|
|
849
|
+
label={formatMessage(messages.creativeName)}
|
|
850
|
+
/>
|
|
851
|
+
{isFullMode && <CapSelect
|
|
852
|
+
label={formatMessage(messages.facebookPage)}
|
|
853
|
+
key={"select-facebook-page"}
|
|
854
|
+
onChange={onChangeFacebookPage}
|
|
855
|
+
options={options}
|
|
856
|
+
defaultValue={(options[0] || {} ).value}
|
|
857
|
+
value={pageId || (options[0] || {} ).value}
|
|
858
|
+
style={{marginBottom: 27, width: '372px'}}
|
|
859
|
+
></CapSelect>}
|
|
889
860
|
<CapHeading
|
|
890
861
|
type="h4"
|
|
891
862
|
style={{marginBottom: 11}}
|
|
@@ -909,15 +880,8 @@ export const Advertisement = (props) => {
|
|
|
909
880
|
</FbAdFooter>
|
|
910
881
|
</CapSpin> ) : (
|
|
911
882
|
<CapSpin spinning={spinLoader}>
|
|
912
|
-
{!isFullMode && isEmpty(templateData) && <div style={{ position: 'fixed', top: '25px', zIndex: 1}}>
|
|
913
|
-
<CapHeader
|
|
914
|
-
inline
|
|
915
|
-
title={formatMessage(messages.newFacebookCreatives)}
|
|
916
|
-
className={"cap-header-facebook-ad"}
|
|
917
|
-
/>
|
|
918
|
-
</div>}
|
|
919
883
|
<CapRow className="add-facebook-ad-section" >
|
|
920
|
-
|
|
884
|
+
<div className="cap-header-facebook-ad">
|
|
921
885
|
<CapHeading
|
|
922
886
|
type="h2"
|
|
923
887
|
className="truncate-text"
|
|
@@ -935,7 +899,7 @@ export const Advertisement = (props) => {
|
|
|
935
899
|
title={<FormattedMessage {...messages.creativesTemplatesEditName}/>}
|
|
936
900
|
onClick={onClickEditName}
|
|
937
901
|
/>}
|
|
938
|
-
</div>
|
|
902
|
+
</div>
|
|
939
903
|
<CapColumn span={12}>
|
|
940
904
|
{isFullMode && <><CapHeading
|
|
941
905
|
type="h4"
|
|
@@ -1010,8 +974,8 @@ Advertisement.propTypes = {
|
|
|
1010
974
|
facebookTemplateData: PropTypes.object,
|
|
1011
975
|
templateData: PropTypes.object,
|
|
1012
976
|
params: PropTypes.object,
|
|
1013
|
-
selectedMarketingObjective: PropTypes.any,
|
|
1014
977
|
|
|
1015
978
|
};
|
|
1016
979
|
|
|
1017
980
|
export default injectIntl(Advertisement);
|
|
981
|
+
|
|
@@ -47,7 +47,3 @@ export const VALUE_REACH = 'VALUE_REACH';
|
|
|
47
47
|
export const VALUE_VIDEO_VIEWS = 'VALUE_VIDEO_VIEWS';
|
|
48
48
|
export const VALUE_LINK_CLICKS = 'VALUE_LINK_CLICKS';
|
|
49
49
|
export const VALUE_POST_ENGAGEMENT = 'VALUE_POST_ENGAGEMENT';
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
export const AD_MANAGER = "AD_MANAGER";
|
|
53
|
-
export const CREATIVE = "CREATIVE";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
import PropTypes from "prop-types";
|
|
7
|
-
import React, { useState, useEffect
|
|
7
|
+
import React, { useState, useEffect } from "react";
|
|
8
8
|
import { injectIntl, FormattedMessage, intlShape } from "react-intl";
|
|
9
9
|
import {
|
|
10
10
|
CapHeading,
|
|
@@ -15,10 +15,7 @@ import {
|
|
|
15
15
|
CapDrawer,
|
|
16
16
|
CapCustomCard,
|
|
17
17
|
CapIcon,
|
|
18
|
-
CapRadioGroup,
|
|
19
|
-
CapTooltip,
|
|
20
18
|
} from '@capillarytech/cap-ui-library';
|
|
21
|
-
import Templates from '../Templates';
|
|
22
19
|
import { createStructuredSelector } from 'reselect';
|
|
23
20
|
import { connect } from 'react-redux';
|
|
24
21
|
import { bindActionCreators } from 'redux';
|
|
@@ -41,8 +38,6 @@ import {
|
|
|
41
38
|
VALUE_REACH,
|
|
42
39
|
VALUE_VIDEO_VIEWS,
|
|
43
40
|
VALUE_LINK_CLICKS,
|
|
44
|
-
AD_MANAGER,
|
|
45
|
-
CREATIVE,
|
|
46
41
|
} from './constants';
|
|
47
42
|
|
|
48
43
|
const StyledCampaignDetailCapColumn = withStyles(CapColumn, CampaignDetailCapColumn);
|
|
@@ -188,25 +183,12 @@ const Facebook = (props) => {
|
|
|
188
183
|
onCreateComplete,
|
|
189
184
|
params,
|
|
190
185
|
facebookTemplateData,
|
|
191
|
-
messageStrategy,
|
|
192
|
-
router,
|
|
193
|
-
handlePeviewTemplate,
|
|
194
|
-
renderNewCardGrid,
|
|
195
|
-
onSelectTemplate,
|
|
196
|
-
createNew,
|
|
197
|
-
fbAdManager,
|
|
198
|
-
getFormSubscriptionData,
|
|
199
|
-
showDisabledFBInfo,
|
|
200
|
-
orgUnitId,
|
|
201
186
|
} = props;
|
|
202
187
|
const {
|
|
203
188
|
selectedMarketingObjective: fbMarketingObjectiveValue = VALUE_REACH,
|
|
204
189
|
} = templateData || {};
|
|
205
190
|
const [isDrawerVisible, setDrawerVisibility] = useState(false);
|
|
206
191
|
const [selectedMarketingObjective, setMarketingObjective] = useState(socialObjective || fbMarketingObjectiveValue);
|
|
207
|
-
const [adManager, setAdManager] = useState(AD_MANAGER);
|
|
208
|
-
const [showTemplateList, setTemplateList] = useState(false);
|
|
209
|
-
|
|
210
192
|
|
|
211
193
|
useEffect(() => {
|
|
212
194
|
if (!isFullMode) {
|
|
@@ -243,188 +225,131 @@ const Facebook = (props) => {
|
|
|
243
225
|
|
|
244
226
|
const onMarketingObjectiveSelect = (value) => setMarketingObjective(value);
|
|
245
227
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
const onFacebookAdManagerContinue = useCallback(() => {
|
|
257
|
-
if (adManager === AD_MANAGER) {
|
|
258
|
-
onFacebookSubmit({ channel: "FACEBOOK", selectedMarketingObjective, accountId });
|
|
259
|
-
} else {
|
|
260
|
-
setTemplateList(true);
|
|
261
|
-
}
|
|
262
|
-
}, [
|
|
263
|
-
selectedMarketingObjective,
|
|
264
|
-
accountId,
|
|
265
|
-
adManager,
|
|
266
|
-
setAdManager,
|
|
267
|
-
setTemplateList,
|
|
268
|
-
showTemplateList,
|
|
269
|
-
]);
|
|
270
|
-
const query = {type: 'embedded', module: 'library'};
|
|
271
|
-
const location = {pathname: `/FACEBOOK`, search: '', query};
|
|
272
|
-
return (showTemplateList ? (
|
|
273
|
-
<Templates
|
|
274
|
-
key={"FACEBOOK"}
|
|
275
|
-
location={location}
|
|
276
|
-
route={{name: "FACEBOOK"}}
|
|
277
|
-
router={router}
|
|
278
|
-
isFullMode={isFullMode}
|
|
279
|
-
createNew={createNew}
|
|
280
|
-
onSelectTemplate={onSelectTemplate}
|
|
281
|
-
renderNewCardGrid={renderNewCardGrid}
|
|
282
|
-
handlePeviewTemplate={handlePeviewTemplate}
|
|
283
|
-
fbAdManager={CREATIVE}
|
|
284
|
-
/>
|
|
285
|
-
) :
|
|
286
|
-
(!isFullMode && fbAdManager !== CREATIVE && messageStrategy === "DEFAULT" ) ?
|
|
287
|
-
(<div className={className}>
|
|
288
|
-
|
|
289
|
-
<div className="is-scrollable-section" >
|
|
290
|
-
<div className="account-details-wrapper">
|
|
291
|
-
<div className="account-name-section">
|
|
292
|
-
<CapHeading type="h4">
|
|
293
|
-
<FormattedMessage {...messages.fbAccount} />
|
|
294
|
-
</CapHeading>
|
|
295
|
-
<CapHeading type="h3">{accountName}</CapHeading>
|
|
296
|
-
</div>
|
|
297
|
-
|
|
298
|
-
<div className="account-section-container">
|
|
299
|
-
<CapHeading type="h3">
|
|
300
|
-
<FormattedMessage {...messages.fbAdCampaignSetDetailsTitle} />
|
|
301
|
-
</CapHeading>
|
|
302
|
-
<CapLabel type="label1">
|
|
303
|
-
<FormattedMessage
|
|
304
|
-
{...messages.fbAdCampaignSetDetailsDescription}
|
|
305
|
-
/>
|
|
306
|
-
</CapLabel>
|
|
307
|
-
</div>
|
|
228
|
+
return (
|
|
229
|
+
!isFullMode ? (<div className={className}>
|
|
230
|
+
<div className="is-scrollable-section" >
|
|
231
|
+
<div className="account-details-wrapper">
|
|
232
|
+
<div className="account-name-section">
|
|
233
|
+
<CapHeading type="h4">
|
|
234
|
+
<FormattedMessage {...messages.fbAccount} />
|
|
235
|
+
</CapHeading>
|
|
236
|
+
<CapHeading type="h3">{accountName}</CapHeading>
|
|
237
|
+
</div>
|
|
308
238
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
<CapHeading type="h4">
|
|
320
|
-
{value}
|
|
321
|
-
{!socialRemoteCampaignId && onChange && (
|
|
322
|
-
<CapButton
|
|
323
|
-
type="flat"
|
|
324
|
-
className="marketingObjective-change-button facebook-marketing-objective-change"
|
|
325
|
-
onClick={onChange}
|
|
326
|
-
>
|
|
327
|
-
<FormattedMessage {...messages.fbChange} />
|
|
328
|
-
</CapButton>
|
|
329
|
-
)}
|
|
330
|
-
</CapHeading>
|
|
331
|
-
</CapRow>
|
|
332
|
-
</StyledCampaignDetailCapColumn>
|
|
333
|
-
))}
|
|
334
|
-
</CapRow>
|
|
335
|
-
<CapDrawer
|
|
336
|
-
content={
|
|
337
|
-
<MarketingObjective
|
|
338
|
-
selectedMarketingObjective={selectedMarketingObjective}
|
|
339
|
-
onMarketingObjectiveSelect={onMarketingObjectiveSelect}
|
|
340
|
-
defaultmarketingObjective={socialObjective || fbMarketingObjectiveValue}
|
|
341
|
-
onSubmit={setDrawerVisibility}
|
|
342
|
-
marketingObjectiveList={categorizedMarketingObjectiveList}
|
|
343
|
-
/>
|
|
344
|
-
}
|
|
345
|
-
visible={isDrawerVisible}
|
|
346
|
-
width={380}
|
|
347
|
-
onClose={() => setDrawerVisibility(false)}
|
|
348
|
-
/>
|
|
349
|
-
</div>
|
|
239
|
+
<div className="account-section-container">
|
|
240
|
+
<CapHeading type="h3">
|
|
241
|
+
<FormattedMessage {...messages.fbAdCampaignSetDetailsTitle} />
|
|
242
|
+
</CapHeading>
|
|
243
|
+
<CapLabel type="label1">
|
|
244
|
+
<FormattedMessage
|
|
245
|
+
{...messages.fbAdCampaignSetDetailsDescription}
|
|
246
|
+
/>
|
|
247
|
+
</CapLabel>
|
|
248
|
+
</div>
|
|
350
249
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
250
|
+
<CapRow span={12} type="flex">
|
|
251
|
+
{campaignDataList.map(({ label, value, onChange }, index) => (
|
|
252
|
+
<StyledCampaignDetailCapColumn
|
|
253
|
+
span={index % 2 === 0 ? 6 : 14}
|
|
254
|
+
key={label}
|
|
255
|
+
>
|
|
256
|
+
<CapRow>
|
|
257
|
+
<CapLabel type="label2">
|
|
258
|
+
<FormattedMessage {...messages[label]} />
|
|
259
|
+
</CapLabel>
|
|
260
|
+
<CapHeading type="h4">
|
|
261
|
+
{value}
|
|
262
|
+
{!socialRemoteCampaignId && onChange && (
|
|
263
|
+
<CapButton
|
|
264
|
+
type="flat"
|
|
265
|
+
className="marketingObjective-change-button facebook-marketing-objective-change"
|
|
266
|
+
onClick={onChange}
|
|
267
|
+
>
|
|
268
|
+
<FormattedMessage {...messages.fbChange} />
|
|
269
|
+
</CapButton>
|
|
270
|
+
)}
|
|
271
|
+
</CapHeading>
|
|
272
|
+
</CapRow>
|
|
273
|
+
</StyledCampaignDetailCapColumn>
|
|
274
|
+
))}
|
|
275
|
+
</CapRow>
|
|
276
|
+
<CapDrawer
|
|
277
|
+
content={
|
|
278
|
+
<MarketingObjective
|
|
279
|
+
selectedMarketingObjective={selectedMarketingObjective}
|
|
280
|
+
onMarketingObjectiveSelect={onMarketingObjectiveSelect}
|
|
281
|
+
defaultmarketingObjective={socialObjective || fbMarketingObjectiveValue}
|
|
282
|
+
onSubmit={setDrawerVisibility}
|
|
283
|
+
marketingObjectiveList={categorizedMarketingObjectiveList}
|
|
284
|
+
/>
|
|
285
|
+
}
|
|
286
|
+
visible={isDrawerVisible}
|
|
287
|
+
width={380}
|
|
288
|
+
onClose={() => setDrawerVisibility(false)}
|
|
363
289
|
/>
|
|
364
|
-
|
|
365
|
-
<div className="account-section-container">
|
|
366
|
-
<CapLabel type="label1">
|
|
367
|
-
<FormattedMessage {...messages.fbAdsDescription} />
|
|
368
|
-
</CapLabel>
|
|
369
|
-
</div>
|
|
290
|
+
</div>
|
|
370
291
|
|
|
292
|
+
<div className="ad-section">
|
|
293
|
+
<div className="account-section-container">
|
|
294
|
+
<CapHeading type="h3">
|
|
295
|
+
<FormattedMessage {...messages.fbAdsTitle} />
|
|
296
|
+
</CapHeading>
|
|
297
|
+
<CapLabel type="label1">
|
|
298
|
+
<FormattedMessage {...messages.fbAdsDescription} />
|
|
299
|
+
</CapLabel>
|
|
300
|
+
</div>
|
|
371
301
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
selectedMarketingObjective={selectedMarketingObjective}
|
|
424
|
-
fbAdManager={fbAdManager}
|
|
425
|
-
orgUnitId={orgUnitId}
|
|
426
|
-
/>
|
|
427
|
-
</div>
|
|
302
|
+
<div>
|
|
303
|
+
<CapRow span={12} type="flex">
|
|
304
|
+
<CapColumn span={6}>
|
|
305
|
+
<CapCustomCard
|
|
306
|
+
type="Facebook"
|
|
307
|
+
FBDynamicComponent={() => (
|
|
308
|
+
<CapIcon
|
|
309
|
+
size="l"
|
|
310
|
+
type="scenery"
|
|
311
|
+
className="facebook-dynamic-content"
|
|
312
|
+
/>
|
|
313
|
+
)}
|
|
314
|
+
/>
|
|
315
|
+
</CapColumn>
|
|
316
|
+
<CapColumn span={16}>
|
|
317
|
+
<ul className="parameter-list">
|
|
318
|
+
{adSetParameters.map((parameter, index) => (
|
|
319
|
+
<li key={parameter} className="parameter-list-item">
|
|
320
|
+
<CapLabel type="label2" className="parameter-index">
|
|
321
|
+
{index + 1}
|
|
322
|
+
</CapLabel>
|
|
323
|
+
<CapHeading type="h5">
|
|
324
|
+
<FormattedMessage {...messages[parameter]} />
|
|
325
|
+
</CapHeading>
|
|
326
|
+
</li>
|
|
327
|
+
))}
|
|
328
|
+
</ul>
|
|
329
|
+
</CapColumn>
|
|
330
|
+
</CapRow>
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
<CapButton
|
|
335
|
+
className="facebook-confirm-button"
|
|
336
|
+
type="primary"
|
|
337
|
+
onClick={() =>
|
|
338
|
+
onFacebookSubmit({ channel: "FACEBOOK", selectedMarketingObjective, accountId })
|
|
339
|
+
}
|
|
340
|
+
>
|
|
341
|
+
<FormattedMessage {...messages.fbConfirm} />
|
|
342
|
+
</CapButton>
|
|
343
|
+
</div>) : <div style={{height: '1200px'}}>
|
|
344
|
+
<Advertisement
|
|
345
|
+
isFullMode={isFullMode}
|
|
346
|
+
actions={facebookActions}
|
|
347
|
+
fbADData={fbADData}
|
|
348
|
+
onCreateComplete={onCreateComplete}
|
|
349
|
+
templateData={templateData}
|
|
350
|
+
params={params}
|
|
351
|
+
facebookTemplateData={facebookTemplateData}
|
|
352
|
+
/></div>
|
|
428
353
|
);
|
|
429
354
|
};
|
|
430
355
|
|
|
@@ -442,12 +367,11 @@ Facebook.propTypes = {
|
|
|
442
367
|
fbADData: PropTypes.object,
|
|
443
368
|
onCreateComplete: PropTypes.func,
|
|
444
369
|
facebookTemplateData: PropTypes.object,
|
|
445
|
-
messageStrategy: PropTypes.string,
|
|
446
|
-
getFormSubscriptionData: PropTypes.func,
|
|
447
370
|
};
|
|
448
371
|
|
|
449
372
|
Facebook.defaultProps = {
|
|
450
373
|
marketingObjectiveList: [""],
|
|
374
|
+
|
|
451
375
|
};
|
|
452
376
|
|
|
453
377
|
const mapStateToProps = createStructuredSelector({
|