@capillarytech/creatives-library 7.5.4 → 7.5.5
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/facebookEmptyPlaceholder.png +0 -0
- package/config/app.js +2 -0
- package/index.js +6 -0
- package/package.json +1 -1
- package/reducers.js +2 -1
- package/routes.js +5 -0
- package/services/api.js +34 -1
- package/utils/common.js +13 -1
- package/v2Components/CapImageUpload/index.js +260 -0
- package/v2Components/CapImageUpload/index.scss +32 -0
- package/v2Components/CapImageUpload/messages.js +49 -0
- package/v2Components/CapRadioCardCustom/index.js +66 -0
- package/v2Components/CapVideoUpload/index.js +299 -0
- package/v2Components/CapVideoUpload/index.scss +29 -0
- package/v2Components/CapVideoUpload/messages.js +54 -0
- package/v2Components/TemplatePreview/index.js +19 -2
- package/v2Containers/App/constants.js +21 -0
- package/v2Containers/Cap/messages.js +30 -0
- package/v2Containers/CapFacebookPreview/actions.js +31 -0
- package/v2Containers/CapFacebookPreview/constants.js +21 -0
- package/v2Containers/CapFacebookPreview/index.js +396 -0
- package/v2Containers/CapFacebookPreview/messages.js +138 -0
- package/v2Containers/CapFacebookPreview/reducer.js +37 -0
- package/v2Containers/CapFacebookPreview/sagas.js +99 -0
- package/v2Containers/CapFacebookPreview/selectors.js +25 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +55 -1
- package/v2Containers/CreativesContainer/index.js +19 -9
- package/v2Containers/Facebook/Advertisement/constant.js +12 -0
- package/v2Containers/Facebook/Advertisement/index.js +955 -0
- package/v2Containers/Facebook/Advertisement/index.scss +49 -0
- package/v2Containers/Facebook/Advertisement/messages.js +155 -0
- package/v2Containers/Facebook/Advertisement/video.js +0 -0
- package/v2Containers/Facebook/actions.js +62 -0
- package/v2Containers/Facebook/constants.js +25 -1
- package/v2Containers/Facebook/index.js +133 -107
- package/v2Containers/Facebook/reducer.js +95 -1
- package/v2Containers/Facebook/sagas.js +136 -0
- package/v2Containers/Facebook/selectors.js +10 -0
- package/v2Containers/Line/Container/Video/index.js +38 -41
- package/v2Containers/Templates/_templates.scss +26 -0
- package/v2Containers/Templates/actions.js +14 -1
- package/v2Containers/Templates/constants.js +8 -0
- package/v2Containers/Templates/index.js +117 -10
- package/v2Containers/Templates/messages.js +8 -4
- package/v2Containers/Templates/reducer.js +22 -0
- package/v2Containers/Templates/sagas.js +26 -1
- package/v2Containers/TemplatesV2/index.js +13 -13
- package/v2Containers/Viber/index.js +2 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@import '~@capillarytech/cap-ui-library/styles/_variables.scss';
|
|
2
|
+
|
|
3
|
+
$classPrefix: add-facebook-ad-section;
|
|
4
|
+
|
|
5
|
+
.#{$classPrefix} {
|
|
6
|
+
.cap-input-wrapper{
|
|
7
|
+
padding-bottom: 24px;
|
|
8
|
+
width: 460px;
|
|
9
|
+
}
|
|
10
|
+
.cap-tab-v2-wrapper {
|
|
11
|
+
.ant-tabs-bar.ant-tabs-top-bar {
|
|
12
|
+
padding: 0;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
.cap-header-facebook-ad{
|
|
16
|
+
position: fixed;
|
|
17
|
+
top: 27px;
|
|
18
|
+
z-index: 1000;
|
|
19
|
+
.title-desc-container{
|
|
20
|
+
padding-left: 10px;
|
|
21
|
+
}
|
|
22
|
+
.component-with-label{
|
|
23
|
+
display: inline-block
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
.extra-button-group {
|
|
27
|
+
button {
|
|
28
|
+
padding: 0;
|
|
29
|
+
margin-left: 6px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
.cap-image-upload-CAROUSEL{
|
|
33
|
+
.dragger-button.re-upload{
|
|
34
|
+
margin-top: 90px;
|
|
35
|
+
top: 0;
|
|
36
|
+
position: absolute;
|
|
37
|
+
right: 80;
|
|
38
|
+
color: $FONT_COLOR_05;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.facebook-ad-type-card{
|
|
42
|
+
.ant-card-body {
|
|
43
|
+
display:flex;
|
|
44
|
+
flex-direction: row-reverse;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
|
|
3
|
+
const messagePrefix = 'creatives.containersV2.Facebook.Advertisement';
|
|
4
|
+
|
|
5
|
+
export default defineMessages({
|
|
6
|
+
creativeName: {
|
|
7
|
+
id: `${messagePrefix}.creativeName`,
|
|
8
|
+
defaultMessage: 'Creative name',
|
|
9
|
+
},
|
|
10
|
+
AdvertisementType: {
|
|
11
|
+
id: `${messagePrefix}.AdvertisementType`,
|
|
12
|
+
defaultMessage: 'How you would like your ad to look?',
|
|
13
|
+
},
|
|
14
|
+
imageVideoTitle: {
|
|
15
|
+
id: `${messagePrefix}.imageVideoTitle`,
|
|
16
|
+
defaultMessage: 'Single image or video',
|
|
17
|
+
},
|
|
18
|
+
imageVideoDesc: {
|
|
19
|
+
id: `${messagePrefix}.imageVideoDesc`,
|
|
20
|
+
defaultMessage: 'Create an Ad with one image or video, or a slideshow with multiple images',
|
|
21
|
+
},
|
|
22
|
+
carouselTitle: {
|
|
23
|
+
id: `${messagePrefix}.carouselTitle`,
|
|
24
|
+
defaultMessage: 'Carousel',
|
|
25
|
+
},
|
|
26
|
+
carouselDesc: {
|
|
27
|
+
id: `${messagePrefix}.carouselDesc`,
|
|
28
|
+
defaultMessage: 'Create an Ad with 2 or more scrollable images or videos',
|
|
29
|
+
},
|
|
30
|
+
primaryText: {
|
|
31
|
+
id: `${messagePrefix}.primaryText`,
|
|
32
|
+
defaultMessage: 'Primary text',
|
|
33
|
+
},
|
|
34
|
+
primaryTextPlaceholder: {
|
|
35
|
+
id: `${messagePrefix}.primaryTextPlaceholder`,
|
|
36
|
+
defaultMessage: 'Enter text that clearly tells people about what you are promoting',
|
|
37
|
+
},
|
|
38
|
+
primaryTextToolTip: {
|
|
39
|
+
id: `${messagePrefix}.primaryTextToolTip`,
|
|
40
|
+
defaultMessage: 'Facebook recommends 125 characters or fewer.',
|
|
41
|
+
},
|
|
42
|
+
linkHeadline: {
|
|
43
|
+
id: `${messagePrefix}.linkHeadline`,
|
|
44
|
+
defaultMessage: 'Link headline',
|
|
45
|
+
},
|
|
46
|
+
linkHeadlineToolTip: {
|
|
47
|
+
id: `${messagePrefix}.linkHeadlineToolTip`,
|
|
48
|
+
defaultMessage: 'Headlines over 40 characters may be cut off.',
|
|
49
|
+
},
|
|
50
|
+
linkHeadlinePlaceHolder: {
|
|
51
|
+
id: `${messagePrefix}.linkHeadlinePlaceHolder`,
|
|
52
|
+
defaultMessage: 'Enter the short headline',
|
|
53
|
+
},
|
|
54
|
+
linkDesc: {
|
|
55
|
+
id: `${messagePrefix}.linkDesc`,
|
|
56
|
+
defaultMessage: 'Link description',
|
|
57
|
+
},
|
|
58
|
+
linkDescToolTip: {
|
|
59
|
+
id: `${messagePrefix}.linkDescToolTip`,
|
|
60
|
+
defaultMessage: 'Description over 40 characters may be cut off.',
|
|
61
|
+
},
|
|
62
|
+
linkDescPlaceHolder: {
|
|
63
|
+
id: `${messagePrefix}.linkDescPlaceHolder`,
|
|
64
|
+
defaultMessage: 'Enter the additional details',
|
|
65
|
+
},
|
|
66
|
+
webSiteLink: {
|
|
67
|
+
id: `${messagePrefix}.webSiteLink`,
|
|
68
|
+
defaultMessage: 'Website link',
|
|
69
|
+
},
|
|
70
|
+
websiteLinkPlaceHolder: {
|
|
71
|
+
id: `${messagePrefix}.websiteLinkPlaceHolder`,
|
|
72
|
+
defaultMessage: 'Enter the URL for the web page that you want people to visit',
|
|
73
|
+
},
|
|
74
|
+
displayLink: {
|
|
75
|
+
id: `${messagePrefix}.displayLink`,
|
|
76
|
+
defaultMessage: 'Display link',
|
|
77
|
+
},
|
|
78
|
+
displayLinkPlaceHolder: {
|
|
79
|
+
id: `${messagePrefix}.displayLinkPlaceHolder`,
|
|
80
|
+
defaultMessage: 'Enter the link that you want to show on your ad',
|
|
81
|
+
},
|
|
82
|
+
optional: {
|
|
83
|
+
id: `${messagePrefix}.optional`,
|
|
84
|
+
defaultMessage: '(Optional)',
|
|
85
|
+
},
|
|
86
|
+
callToAction: {
|
|
87
|
+
id: `${messagePrefix}.callToAction`,
|
|
88
|
+
defaultMessage: 'Call to action',
|
|
89
|
+
},
|
|
90
|
+
image: {
|
|
91
|
+
id: `${messagePrefix}.image`,
|
|
92
|
+
defaultMessage: 'Image',
|
|
93
|
+
},
|
|
94
|
+
video_slideshow: {
|
|
95
|
+
id: `${messagePrefix}.video_slideshow`,
|
|
96
|
+
defaultMessage: 'Video/Slideshow',
|
|
97
|
+
},
|
|
98
|
+
doneButtonLabel: {
|
|
99
|
+
id: `${messagePrefix}.doneButtonLabel`,
|
|
100
|
+
defaultMessage: 'Create',
|
|
101
|
+
},
|
|
102
|
+
creativesTemplatesEditName: {
|
|
103
|
+
id: `${messagePrefix}.creativesTemplatesEditName`,
|
|
104
|
+
defaultMessage: 'Edit name',
|
|
105
|
+
},
|
|
106
|
+
clickButtonLabel: {
|
|
107
|
+
id: `${messagePrefix}.clickButtonLabel`,
|
|
108
|
+
defaultMessage: 'Continue',
|
|
109
|
+
},
|
|
110
|
+
createNotification: {
|
|
111
|
+
id: `${messagePrefix}.createNotification`,
|
|
112
|
+
defaultMessage: 'Facebook template created successfully',
|
|
113
|
+
},
|
|
114
|
+
editNotification: {
|
|
115
|
+
id: `${messagePrefix}.editNotification`,
|
|
116
|
+
defaultMessage: 'Facebook template updated successfully',
|
|
117
|
+
},
|
|
118
|
+
duplicateTooltipLabel: {
|
|
119
|
+
id: `${messagePrefix}.duplicateTooltipLabel`,
|
|
120
|
+
defaultMessage: 'Duplicate',
|
|
121
|
+
},
|
|
122
|
+
shiftLeftTooltipLabel: {
|
|
123
|
+
id: `${messagePrefix}.shiftLeftTooltipLabel`,
|
|
124
|
+
defaultMessage: 'Shift Left',
|
|
125
|
+
},
|
|
126
|
+
shiftRightTooltipLabel: {
|
|
127
|
+
id: `${messagePrefix}.shiftRightTooltipLabel`,
|
|
128
|
+
defaultMessage: 'Shift Right',
|
|
129
|
+
},
|
|
130
|
+
deleteTooltipLabel: {
|
|
131
|
+
id: `${messagePrefix}.deleteTooltipLabel`,
|
|
132
|
+
defaultMessage: 'Delete',
|
|
133
|
+
},
|
|
134
|
+
addCard: {
|
|
135
|
+
id: `${messagePrefix}.addCard`,
|
|
136
|
+
defaultMessage: 'Add card',
|
|
137
|
+
},
|
|
138
|
+
inValidUrliErrorMessage: {
|
|
139
|
+
id: `${messagePrefix}.inValidUrliErrorMessage`,
|
|
140
|
+
defaultMessage: 'Website link is not valid',
|
|
141
|
+
},
|
|
142
|
+
newFacebookCreatives: {
|
|
143
|
+
id: `${messagePrefix}.newFacebookCreatives`,
|
|
144
|
+
defaultMessage: 'New Facebook creative',
|
|
145
|
+
},
|
|
146
|
+
facebookPage: {
|
|
147
|
+
id: `${messagePrefix}.facebookPage`,
|
|
148
|
+
defaultMessage: 'Facebook page',
|
|
149
|
+
},
|
|
150
|
+
callToActionMandatoryError: {
|
|
151
|
+
id: `${messagePrefix}.callToActionMandatoryError`,
|
|
152
|
+
defaultMessage: 'call to action is mandatory for Video Media. Please select call to action ',
|
|
153
|
+
},
|
|
154
|
+
})
|
|
155
|
+
;
|
|
File without changes
|
|
@@ -6,8 +6,70 @@
|
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
GET_MARKETING_OBJECTIVES,
|
|
9
|
+
UPLOAD_FB_AD_ASSET_REQUEST,
|
|
10
|
+
CREATE_FACEBOOK_AD_TEMPLATE_REQUEST,
|
|
11
|
+
EDIT_FACEBOOK_AD_TEMPLATE_REQUEST,
|
|
12
|
+
GET_FACEBOOK_AD_TEMPLATE_DETAILS_REQUEST,
|
|
13
|
+
CLEAR_FACEBOOK_AD_ASSET,
|
|
14
|
+
CLEAR_FACEBOOK_AD_CREATE_RESPONSE_REQUEST,
|
|
15
|
+
CLEAR_FACEBOOK_AD_DATA,
|
|
16
|
+
CLEAR_FACEBOOK_AD_EDIT_RESPONSE_REQUEST,
|
|
17
|
+
GET_ORG_OU_LIST_REQUEST,
|
|
9
18
|
} from './constants';
|
|
10
19
|
|
|
11
20
|
export const getMarketingObjectives = () => ({
|
|
12
21
|
type: GET_MARKETING_OBJECTIVES,
|
|
13
22
|
});
|
|
23
|
+
|
|
24
|
+
export const uploadFbAdAsset = (file, assetType, fileParams, templateType) => ({
|
|
25
|
+
type: UPLOAD_FB_AD_ASSET_REQUEST,
|
|
26
|
+
file,
|
|
27
|
+
assetType,
|
|
28
|
+
fileParams,
|
|
29
|
+
templateType,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const createTemplate = (template, callback) => ({
|
|
33
|
+
type: CREATE_FACEBOOK_AD_TEMPLATE_REQUEST,
|
|
34
|
+
template,
|
|
35
|
+
callback,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const getOrgOUs = (orgID) => ({
|
|
39
|
+
type: GET_ORG_OU_LIST_REQUEST,
|
|
40
|
+
orgID,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// FOR EDIT
|
|
44
|
+
|
|
45
|
+
export const editTemplate = (template, callback) => ({
|
|
46
|
+
type: EDIT_FACEBOOK_AD_TEMPLATE_REQUEST,
|
|
47
|
+
template,
|
|
48
|
+
callback,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export const getTemplateDetails = (id, callback) => ({
|
|
52
|
+
type: GET_FACEBOOK_AD_TEMPLATE_DETAILS_REQUEST,
|
|
53
|
+
id,
|
|
54
|
+
channel: 'FACEBOOK',
|
|
55
|
+
callback,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export const clearData = () => ({
|
|
59
|
+
type: CLEAR_FACEBOOK_AD_DATA,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export const clearEditResponse = () => ({
|
|
63
|
+
type: CLEAR_FACEBOOK_AD_EDIT_RESPONSE_REQUEST,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
export const clearCreateResponse = () => ({
|
|
68
|
+
type: CLEAR_FACEBOOK_AD_CREATE_RESPONSE_REQUEST,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export const clearFbAdAsset = (templateType) => ({
|
|
72
|
+
type: CLEAR_FACEBOOK_AD_ASSET,
|
|
73
|
+
templateType,
|
|
74
|
+
});
|
|
75
|
+
|
|
@@ -4,12 +4,36 @@
|
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
const prefix = 'app/Facebook';
|
|
7
|
+
const prefix = 'app/v2Containers/Facebook';
|
|
8
8
|
|
|
9
9
|
export const GET_MARKETING_OBJECTIVES = `${prefix}/GET_MARKETING_OBJECTIVES`;
|
|
10
10
|
export const SET_MARKETING_OBJECTIVES_SUCCESS = `${prefix}/SET_MARKETING_OBJECTIVES_SUCCESS`;
|
|
11
11
|
export const SET_MARKETING_OBJECTIVES_FAILURE = `${prefix}/SET_MARKETING_OBJECTIVES_FAILURE`;
|
|
12
|
+
export const UPLOAD_FB_AD_ASSET_REQUEST = `${prefix}/UPLOAD_ASSET_REQUEST`;
|
|
13
|
+
export const UPLOAD_FB_AD_ASSET_SUCCESS = `${prefix}/UPLOAD_ASSET_SUCCESS`;
|
|
14
|
+
export const UPLOAD_FB_AD_ASSET_FAILURE = `${prefix}/UPLOAD_ASSET_FAILURE`;
|
|
15
|
+
export const CREATE_FACEBOOK_AD_TEMPLATE_REQUEST = `${prefix}/CREATE_FACEBOOK_AD_TEMPLATE_REQUEST`;
|
|
16
|
+
export const CREATE_FACEBOOK_AD_TEMPLATE_SUCCESS = `${prefix}/CREATE_FACEBOOK_AD_TEMPLATE_SUCCESS`;
|
|
17
|
+
export const CREATE_FACEBOOK_AD_TEMPLATE_FAILURE = `${prefix}/CREATE_FACEBOOK_AD_TEMPLATE_FAILURE`;
|
|
12
18
|
|
|
19
|
+
|
|
20
|
+
export const GET_FACEBOOK_AD_TEMPLATE_DETAILS_REQUEST = `${prefix}/EDIT/CREATE_FACEBOOK_AD_TEMPLATE_DETAILS_REQUEST`;
|
|
21
|
+
export const GET_FACEBOOK_AD_TEMPLATE_DETAILS_SUCCESS = `${prefix}/EDIT/CREATE_FACEBOOK_AD_TEMPLATE_DETAILS_SUCCESS`;
|
|
22
|
+
export const GET_FACEBOOK_AD_TEMPLATE_DETAILS_FAILURE = `${prefix}/EDIT/CREATE_FACEBOOK_AD_TEMPLATE_DETAILS_FAILURE`;
|
|
23
|
+
|
|
24
|
+
export const EDIT_FACEBOOK_AD_TEMPLATE_REQUEST = `${prefix}/Edit/EDIT_FACEBOOK_AD_TEMPLATE_REQUEST`;
|
|
25
|
+
export const EDIT_FACEBOOK_AD_TEMPLATE_SUCCESS = `${prefix}/Edit/EDIT_FACEBOOK_AD_TEMPLATE_SUCCESS`;
|
|
26
|
+
export const EDIT_FACEBOOK_AD_TEMPLATE_FAILURE = `${prefix}/Edit/EDIT_FACEBOOK_AD_TEMPLATE_FAILURE`;
|
|
27
|
+
|
|
28
|
+
export const CLEAR_FACEBOOK_AD_EDIT_RESPONSE_REQUEST = `${prefix}/Edit/CLEAR_EDIT_RESPONSE_REQUEST`;
|
|
29
|
+
export const CLEAR_FACEBOOK_AD_DATA = `${prefix}/Edit/CLEAR_DATA`;
|
|
30
|
+
export const CLEAR_FACEBOOK_AD_CREATE_RESPONSE_REQUEST = `${prefix}/Create/CLEAR_EDIT_RESPONSE_REQUEST`;
|
|
31
|
+
export const CLEAR_FACEBOOK_AD_ASSET = `${prefix}/CLEAR_ASSET`;
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export const GET_ORG_OU_LIST_REQUEST = `${prefix}/GET_ORG_OU_LIST_REQUEST`;
|
|
35
|
+
export const GET_ORG_OU_LIST_SUCCESS = `${prefix}/GET_ORG_OU_LIST_SUCCESS`;
|
|
36
|
+
export const GET_ORG_OU_LIST_FAILURE = `${prefix}/GET_ORG_OU_LIST_FAILURE`;
|
|
13
37
|
// marketing objectives constants
|
|
14
38
|
|
|
15
39
|
export const VALUE_APP_INSTALLS = 'VALUE_APP_INSTALLS';
|
|
@@ -24,7 +24,8 @@ import styles, { CampaignDetailCapColumn } from './Facebook.style';
|
|
|
24
24
|
import * as actions from './actions';
|
|
25
25
|
import withStyles from '../../hoc/withStyles';
|
|
26
26
|
import MarketingObjective from '../../v2Components/MarketingObjective';
|
|
27
|
-
import { makeSelectMarketingObjectiveList } from './selectors';
|
|
27
|
+
import { makeSelectMarketingObjectiveList, makeSelectFbAd, makeSelectTemplate } from './selectors';
|
|
28
|
+
import Advertisement from './Advertisement';
|
|
28
29
|
import {
|
|
29
30
|
VALUE_APP_INSTALLS,
|
|
30
31
|
VALUE_BRAND_AWARENESS,
|
|
@@ -149,9 +150,7 @@ const getCategorizedMarketingObjectiveList = (marketingObjectivesList, formatMes
|
|
|
149
150
|
const Facebook = (props) => {
|
|
150
151
|
const {
|
|
151
152
|
className,
|
|
152
|
-
templateData
|
|
153
|
-
selectedMarketingObjective: fbMarketingObjectiveValue = VALUE_REACH,
|
|
154
|
-
} = {},
|
|
153
|
+
templateData,
|
|
155
154
|
cap: {
|
|
156
155
|
campaignDetails: {
|
|
157
156
|
name: fbCampaignValue,
|
|
@@ -179,13 +178,25 @@ const Facebook = (props) => {
|
|
|
179
178
|
marketingObjectiveList,
|
|
180
179
|
facebookActions,
|
|
181
180
|
intl,
|
|
181
|
+
isFullMode,
|
|
182
|
+
fbADData,
|
|
183
|
+
onCreateComplete,
|
|
184
|
+
params,
|
|
185
|
+
facebookTemplateData,
|
|
182
186
|
} = props;
|
|
183
|
-
|
|
187
|
+
const {
|
|
188
|
+
selectedMarketingObjective: fbMarketingObjectiveValue = VALUE_REACH,
|
|
189
|
+
} = templateData;
|
|
184
190
|
const [isDrawerVisible, setDrawerVisibility] = useState(false);
|
|
185
191
|
const [selectedMarketingObjective, setMarketingObjective] = useState(socialObjective || fbMarketingObjectiveValue);
|
|
186
192
|
|
|
187
193
|
useEffect(() => {
|
|
188
|
-
|
|
194
|
+
if (!isFullMode) {
|
|
195
|
+
facebookActions.getMarketingObjectives();
|
|
196
|
+
} else {
|
|
197
|
+
const orgId = window.localStorage.getItem('orgID');
|
|
198
|
+
facebookActions.getOrgOUs(orgId);
|
|
199
|
+
}
|
|
189
200
|
}, []);
|
|
190
201
|
|
|
191
202
|
const categorizedMarketingObjectiveList = getCategorizedMarketingObjectiveList(marketingObjectiveList, intl.formatMessage);
|
|
@@ -215,141 +226,156 @@ const Facebook = (props) => {
|
|
|
215
226
|
const onMarketingObjectiveSelect = (value) => setMarketingObjective(value);
|
|
216
227
|
|
|
217
228
|
return (
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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>
|
|
227
238
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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}
|
|
235
246
|
/>
|
|
236
|
-
|
|
237
|
-
|
|
247
|
+
</CapLabel>
|
|
248
|
+
</div>
|
|
238
249
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
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}
|
|
244
255
|
>
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
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}
|
|
256
267
|
>
|
|
257
|
-
|
|
258
|
-
|
|
268
|
+
<FormattedMessage {...messages.fbChange} />
|
|
269
|
+
</CapButton>
|
|
259
270
|
)}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
271
|
+
</CapHeading>
|
|
272
|
+
</CapRow>
|
|
273
|
+
</StyledCampaignDetailCapColumn>
|
|
263
274
|
))}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
275
|
+
</CapRow>
|
|
276
|
+
<CapDrawer
|
|
277
|
+
content={
|
|
278
|
+
<MarketingObjective
|
|
279
|
+
selectedMarketingObjective={selectedMarketingObjective}
|
|
280
|
+
onMarketingObjectiveSelect={onMarketingObjectiveSelect}
|
|
281
|
+
defaultmarketingObjective={socialObjective || fbMarketingObjectiveValue}
|
|
282
|
+
onSubmit={setDrawerVisibility}
|
|
283
|
+
marketingObjectiveList={categorizedMarketingObjectiveList}
|
|
273
284
|
/>
|
|
274
285
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
286
|
+
visible={isDrawerVisible}
|
|
287
|
+
width={380}
|
|
288
|
+
onClose={() => setDrawerVisibility(false)}
|
|
278
289
|
/>
|
|
279
|
-
|
|
290
|
+
</div>
|
|
280
291
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
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>
|
|
290
301
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
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"
|
|
301
312
|
/>
|
|
302
313
|
)}
|
|
303
314
|
/>
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
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>
|
|
316
327
|
))}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
328
|
+
</ul>
|
|
329
|
+
</CapColumn>
|
|
330
|
+
</CapRow>
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
<CapButton
|
|
335
|
+
className="facebook-confirm-button"
|
|
336
|
+
type="primary"
|
|
337
|
+
onClick={() =>
|
|
327
338
|
onFacebookSubmit({ channel: "FACEBOOK", selectedMarketingObjective, accountId })
|
|
328
339
|
}
|
|
329
340
|
>
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
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>
|
|
333
353
|
);
|
|
334
354
|
};
|
|
335
355
|
|
|
336
356
|
Facebook.propTypes = {
|
|
337
|
-
className: PropTypes.string
|
|
357
|
+
className: PropTypes.string,
|
|
338
358
|
templateData: PropTypes.object,
|
|
339
359
|
cap: PropTypes.object,
|
|
340
360
|
messageDetails: PropTypes.object,
|
|
341
|
-
onFacebookSubmit: PropTypes.func
|
|
361
|
+
onFacebookSubmit: PropTypes.func,
|
|
342
362
|
marketingObjectiveList: PropTypes.arrayOf(PropTypes.string),
|
|
343
|
-
facebookActions: PropTypes.func
|
|
344
|
-
intl: intlShape
|
|
363
|
+
facebookActions: PropTypes.func,
|
|
364
|
+
intl: intlShape,
|
|
365
|
+
isFullMode: PropTypes.boolean,
|
|
366
|
+
fbADData: PropTypes.object,
|
|
367
|
+
onCreateComplete: PropTypes.func,
|
|
345
368
|
};
|
|
346
369
|
|
|
347
370
|
Facebook.defaultProps = {
|
|
348
|
-
marketingObjectiveList: [],
|
|
371
|
+
marketingObjectiveList: [""],
|
|
372
|
+
|
|
349
373
|
};
|
|
350
374
|
|
|
351
375
|
const mapStateToProps = createStructuredSelector({
|
|
352
376
|
marketingObjectiveList: makeSelectMarketingObjectiveList(),
|
|
377
|
+
fbADData: makeSelectFbAd(),
|
|
378
|
+
facebookTemplateData: makeSelectTemplate(),
|
|
353
379
|
});
|
|
354
380
|
|
|
355
381
|
const mapDispatchToProps = (dispatch) => ({
|