@capillarytech/creatives-library 3.3.1 → 3.4.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/config/app.js CHANGED
@@ -4,6 +4,7 @@
4
4
  const config = {
5
5
  production: {
6
6
  api_endpoint: '/arya/api/v1/creatives',
7
+ campaigns_api_endpoint: '/iris/v2/campaigns',
7
8
  auth_endpoint: '/arya/api/v1/auth',
8
9
  arya_endpoint: '/arya/api/v1',
9
10
  login_url: 'auth/login',
@@ -14,6 +15,7 @@ const config = {
14
15
  },
15
16
  development: {
16
17
  api_endpoint: 'https://nightly.capillary.in/arya/api/v1/creatives',
18
+ campaigns_api_endpoint: 'https://nightly.capillary.in/iris/v2/campaigns',
17
19
  auth_endpoint: 'https://nightly.capillary.in/arya/api/v1/auth',
18
20
  arya_endpoint: 'https://nightly.capillary.in/arya/api/v1',
19
21
  subscription_api_endpoint: 'https://nightly.capillary.in/arya/api/v1/org-settings/subscription',
package/index.js CHANGED
@@ -39,6 +39,10 @@ import WeChatRichMediaEdit from './v2Containers/WeChat/RichmediaTemplates/Edit';
39
39
  import weChatRichMediaEditReducer from './v2Containers/WeChat/RichmediaTemplates/Edit/reducer';
40
40
  import weChatRichMediaEditSaga from './v2Containers/WeChat/RichmediaTemplates/Edit/sagas';
41
41
 
42
+ import Facebook from './v2Containers/Facebook';
43
+ import facebookReducer from './v2Containers/Facebook/reducer';
44
+ import facebookSaga from './v2Containers/Facebook/sagas';
45
+
42
46
  import MobilepushCreate from './v2Containers/MobilePush/Create';
43
47
  import mobilepushCreateReducer from './v2Containers/MobilePush/Create/reducer';
44
48
  import mobilepushCreateSaga from './v2Containers/MobilePush/Create/sagas';
@@ -81,6 +85,7 @@ const MobilePushEditContainer = {MobilepushEdit, mobilepushEditReducer, mobilepu
81
85
  const LineCreateContainer = {LineCreate, lineCreateReducer, lineCreateSaga};
82
86
  const LineEditContainer = {LineEdit, lineEditReducer, lineEditSaga};
83
87
  const TemplatesV2Container = {TemplatesV2, templateReducer, templateSaga};
88
+ const FacebookContainer = {Facebook, facebookReducer, facebookSaga};
84
89
 
85
90
  export {default as TagList} from './v2Containers/TagList/index';
86
91
  export {default as TagListSaga} from './v2Containers/TagList/sagas';
@@ -117,4 +122,5 @@ export { CapContainer,
117
122
  TemplatesV2Container,
118
123
  CreativesContainer,
119
124
  updateCharCount,
125
+ FacebookContainer,
120
126
  };
package/initialState.js CHANGED
@@ -42,5 +42,8 @@ export default {
42
42
  },
43
43
  creativesContainer: {
44
44
 
45
+ },
46
+ facebook: {
47
+
45
48
  },
46
49
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "3.3.1",
4
+ "version": "3.4.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
package/routes.js CHANGED
@@ -628,6 +628,8 @@ export default function createRoutes(store) {
628
628
  import('v2Containers/WeChat/RichmediaTemplates/Edit/reducer'),
629
629
  import('v2Containers/Assets/Gallery/reducer'),
630
630
  import('v2Containers/Assets/Gallery/sagas'),
631
+ import('v2Containers/Facebook/sagas'),
632
+ import('v2Containers/Facebook/reducer'),
631
633
  ]);
632
634
 
633
635
  const renderRoute = loadModule(cb);
@@ -635,7 +637,7 @@ export default function createRoutes(store) {
635
637
  importModules.then(([reducer,
636
638
  sagas, component,
637
639
  capReducer, capSagas,
638
- creativesContainerReducer,
640
+ creativesContainerReducer,
639
641
  smsCreateReducer, smsCreateSaga, smsEditReducer, smsEditSaga,
640
642
  emailReducer, emailSaga,
641
643
  callTaskReducer, callTaskSagas,
@@ -645,6 +647,7 @@ export default function createRoutes(store) {
645
647
  weChatRichmediaTemplatesCreateSagas, weChatRichmediaTemplatesCreateReducer,
646
648
  weChatRichmediaTemplatesEditSagas, weChatRichmediaTemplatesEditReducer,
647
649
  galleryReducer, gallerySagas,
650
+ facebookSagas, facebookReducer,
648
651
  ]) => {
649
652
  injectReducer('templates', reducer.default);
650
653
  injectReducer('cap', capReducer.default);
@@ -659,6 +662,7 @@ export default function createRoutes(store) {
659
662
  injectReducer('weChatRichmediaCreate', weChatRichmediaTemplatesCreateReducer.default);
660
663
  injectReducer('weChatRichmediaEdit', weChatRichmediaTemplatesEditReducer.default);
661
664
  injectReducer('gallery', galleryReducer.default);
665
+ injectReducer('facebook', facebookReducer.default);
662
666
  injectSagas(gallerySagas.default);
663
667
  injectSagas(sagas.default);
664
668
  injectSagas(capSagas.default);
@@ -671,6 +675,7 @@ export default function createRoutes(store) {
671
675
  injectSagas(weChatMapTemplatesSagas.default);
672
676
  injectSagas(weChatRichmediaTemplatesCreateSagas.default);
673
677
  injectSagas(weChatRichmediaTemplatesEditSagas.default);
678
+ injectSagas(facebookSagas.default);
674
679
  renderRoute(component);
675
680
  });
676
681
  importModules.catch(errorLoading);
package/services/api.js CHANGED
@@ -8,11 +8,13 @@ import pathConfig from '../config/path';
8
8
  import getSchema from './getSchema';
9
9
  import * as API from '../utils/ApiCaller';
10
10
  let API_ENDPOINT = config.development.api_endpoint;
11
+ let CAMPAIGNS_API_ENDPOINT = config.development.campaigns_api_endpoint;
11
12
  let API_AUTH_ENDPOINT = config.development.auth_endpoint;
12
13
  let ARYA_ENDPOINT = config.development.arya_endpoint;
13
14
  let SUBSCRIPTION_API_ENDPOINT = config.development.subscription_api_endpoint;
14
15
  if (process.env.NODE_ENV === 'production') {
15
16
  API_ENDPOINT = config.production.api_endpoint;
17
+ CAMPAIGNS_API_ENDPOINT = config.production.campaigns_api_endpoint;
16
18
  API_AUTH_ENDPOINT = config.production.auth_endpoint;
17
19
  ARYA_ENDPOINT = config.production.arya_endpoint;
18
20
  SUBSCRIPTION_API_ENDPOINT = config.production.subscription_api_endpoint;
@@ -75,7 +77,7 @@ function request(url, options) {
75
77
  .then(parseJSON);
76
78
  }
77
79
 
78
- function getAPICallObject(method, body, isFileUpload = false) {
80
+ function getAPICallObject(method, body, isFileUpload = false, loadCampaignHeaders = false) {
79
81
  const token = loadItem('token');
80
82
  const orgID = loadItem('orgID');
81
83
  const user = loadItem('user');
@@ -88,16 +90,24 @@ function getAPICallObject(method, body, isFileUpload = false) {
88
90
  };
89
91
  }
90
92
 
91
- if (user && user.refID) {
92
- headers['X-CAP-REMOTE-USER'] = user.refID;
93
- }
93
+ if (loadCampaignHeaders) {
94
+ headers['X-CAP-ORG'] = orgID;
94
95
 
95
- if (process.env.NODE_ENV !== 'production' && orgID !== undefined) {
96
- headers['X-CAP-API-AUTH-ORG-ID'] = orgID;
97
- }
96
+ if (token !== undefined) {
97
+ headers['X-CAP-CT'] = token;
98
+ }
99
+ } else {
100
+ if (user && user.refID) {
101
+ headers['X-CAP-REMOTE-USER'] = user.refID;
102
+ }
98
103
 
99
- if (process.env.NODE_ENV !== 'production' && token !== undefined) {
100
- headers.Authorization = `Bearer ${token}`;
104
+ if (process.env.NODE_ENV !== 'production' && orgID !== undefined) {
105
+ headers['X-CAP-API-AUTH-ORG-ID'] = orgID;
106
+ }
107
+
108
+ if (process.env.NODE_ENV !== 'production' && token !== undefined) {
109
+ headers.Authorization = `Bearer ${token}`;
110
+ }
101
111
  }
102
112
 
103
113
  const requestObj = {
@@ -339,3 +349,9 @@ export const getUnsubscribeUrl = () => {
339
349
  const url = `${SUBSCRIPTION_API_ENDPOINT}/unsubscribeUrl`;
340
350
  return request(url, getAPICallObject('POST', body));
341
351
  };
352
+
353
+ export const getMarketingObjectives = (channel) =>
354
+ request(
355
+ `${CAMPAIGNS_API_ENDPOINT}/socialObjectives?channel=${channel}`,
356
+ getAPICallObject('GET', null, false, true),
357
+ );
@@ -992,6 +992,48 @@
992
992
  "creatives.containersV2.EmailWrapper.useEditorDesc": "Create using in-built template",
993
993
  "creatives.containersV2.EmailWrapper.zipUpload": "Upload zip file",
994
994
  "creatives.containersV2.EmailWrapper.zipUploadDesc": "Upload compressed file (Zip) containing HTML & images",
995
+ "creatives.containersV2.Facebook.fbAccount": "Facebook Account",
996
+ "creatives.containersV2.Facebook.fbAdCampaignSetDetailsDescription": "Once this message is approved, a campaign and an ad set will be created on Facebook Ad Manager with the same name as the current campaign and message name.",
997
+ "creatives.containersV2.Facebook.fbAdCampaignSetDetailsTitle": "Ad campaign & ad set details",
998
+ "creatives.containersV2.Facebook.fbAdSetName": "Ad set name",
999
+ "creatives.containersV2.Facebook.fbAdsDescription": "You may create ads in Facebook Ad Manager under the below mentioned ad set. The performance of these ads will be reported here in Engage+.",
1000
+ "creatives.containersV2.Facebook.fbAdsDetailOne": "Only FB campaign & ad set creation is supported in Engage+",
1001
+ "creatives.containersV2.Facebook.fbAdsDetailThree": "You can create ads later in Facebook ad manager.",
1002
+ "creatives.containersV2.Facebook.fbAdsDetailTwo": "You can proceed with an empty content block",
1003
+ "creatives.containersV2.Facebook.fbAdsTitle": "Facebook ads",
1004
+ "creatives.containersV2.Facebook.fbAudience": "Audience",
1005
+ "creatives.containersV2.Facebook.fbCampaignName": "FB Campaign name",
1006
+ "creatives.containersV2.Facebook.fbChange": "Change",
1007
+ "creatives.containersV2.Facebook.fbConfirm": "Confirm",
1008
+ "creatives.containersV2.Facebook.fbMarketingObjective": "FB Marketing objective",
1009
+ "creatives.containersV2.Facebook.fbMarketingObjectiveAppInstallTitle": "App Installs",
1010
+ "creatives.containersV2.Facebook.fbMarketingObjectiveAppInstallsDescription": "Get more people to install your app.",
1011
+ "creatives.containersV2.Facebook.fbMarketingObjectiveAwareness": "Awareness",
1012
+ "creatives.containersV2.Facebook.fbMarketingObjectiveBrandAwarenessDescription": "Increase awareness for your brand by reaching people who are more likely to be interested in it.",
1013
+ "creatives.containersV2.Facebook.fbMarketingObjectiveBrandAwarenessTitle": "Brand awareness",
1014
+ "creatives.containersV2.Facebook.fbMarketingObjectiveCatalogSalesDescription": "Create ads that automatically show items from your catalog based on your target audience.",
1015
+ "creatives.containersV2.Facebook.fbMarketingObjectiveCatalogSalesTitle": "Catalog Sales",
1016
+ "creatives.containersV2.Facebook.fbMarketingObjectiveConsideration": "Consideration",
1017
+ "creatives.containersV2.Facebook.fbMarketingObjectiveConversionsDescription": "Drive valuable actions on your website, app or in Messenger.",
1018
+ "creatives.containersV2.Facebook.fbMarketingObjectiveConversionsTitle": "Conversions",
1019
+ "creatives.containersV2.Facebook.fbMarketingObjectiveEngagementDescription": "Get more post engagements",
1020
+ "creatives.containersV2.Facebook.fbMarketingObjectiveEngagementTitle": "Engagement",
1021
+ "creatives.containersV2.Facebook.fbMarketingObjectiveLeadGenerationDescription": "Drive more sales leads, such as email addresses, from people interested in your brand or business.",
1022
+ "creatives.containersV2.Facebook.fbMarketingObjectiveLeadGenerationTitle": "Lead Generation",
1023
+ "creatives.containersV2.Facebook.fbMarketingObjectiveMessagesDescription": "Get more people to send messages to your business in Messenger.",
1024
+ "creatives.containersV2.Facebook.fbMarketingObjectiveMessagesTitle": "Messages",
1025
+ "creatives.containersV2.Facebook.fbMarketingObjectiveReachDescription": "Show your ad to the maximum number of people.",
1026
+ "creatives.containersV2.Facebook.fbMarketingObjectiveReachTitle": "Reach",
1027
+ "creatives.containersV2.Facebook.fbMarketingObjectiveStoreTrafficDescription": "Drive visits to your physical stores by showing ads to people who are nearby.",
1028
+ "creatives.containersV2.Facebook.fbMarketingObjectiveStoreTrafficTitle": "Store Traffic",
1029
+ "creatives.containersV2.Facebook.fbMarketingObjectiveTrafficDescription": "Send more people to a destination such as a website, app or Messenger conversation.",
1030
+ "creatives.containersV2.Facebook.fbMarketingObjectiveTrafficTitle": "Traffic",
1031
+ "creatives.containersV2.Facebook.fbMarketingObjectiveVideoViewsDescription": "Get more people to view your video content.",
1032
+ "creatives.containersV2.Facebook.fbMarketingObjectiveVideoViewsTitle": "Video Views",
1033
+ "creatives.containersV2.Facebook.fbNoAudienceSelected": "Not Selected",
1034
+ "creatives.containersV2.FacebookMarketingObjective.fbMarketingObjectiveDescription": "Objectives help break reporting into a more granular level",
1035
+ "creatives.containersV2.FacebookMarketingObjective.fbMarketingObjectiveDone": "Done",
1036
+ "creatives.containersV2.FacebookMarketingObjective.fbMarketingObjectiveTitle": "Facebook Marketing Objective",
995
1037
  "creatives.containersV2.Line.Create.Campaigns": "Campaigns",
996
1038
  "creatives.containersV2.Line.Create.Creatives": "Creatives",
997
1039
  "creatives.containersV2.Line.Create.Image": "Image",
@@ -1318,6 +1360,7 @@
1318
1360
  "creatives.containersV2.TemplatesV2.creativesDesc": "These are pre-built templates which you could use to customize your message content.",
1319
1361
  "creatives.containersV2.TemplatesV2.edit": "Edit",
1320
1362
  "creatives.containersV2.TemplatesV2.email": "Email",
1363
+ "creatives.containersV2.TemplatesV2.facebook": "Facebook",
1321
1364
  "creatives.containersV2.TemplatesV2.gallery": "Gallery",
1322
1365
  "creatives.containersV2.TemplatesV2.header": "This is TemplatesV2 container !",
1323
1366
  "creatives.containersV2.TemplatesV2.pushNotification": "Push notification",
@@ -1387,6 +1430,8 @@
1387
1430
  "creatives.containersV2.richMedia.Create.delete": "delete",
1388
1431
  "creatives.containersV2.richMedia.Create.deleteContent": "Do you really want to delete? All your temporary changes will be lost!",
1389
1432
  "creatives.containersV2.richMedia.Create.emptyTemplateName": "Cannot leave template name empty",
1433
+ "creatives.containersV2.richMedia.Create.existingMedia": "Existing media",
1434
+ "creatives.containersV2.richMedia.Create.existingMediaHeader": "Rich media templates",
1390
1435
  "creatives.containersV2.richMedia.Create.fileContentFailed": "Failed to get File content",
1391
1436
  "creatives.containersV2.richMedia.Create.formEmpty": "Cannot leave form empty",
1392
1437
  "creatives.containersV2.richMedia.Create.header": "This is Create container !",
@@ -1404,6 +1449,7 @@
1404
1449
  "creatives.containersV2.richMedia.Create.resolutionText": "Resolution 360 x 200",
1405
1450
  "creatives.containersV2.richMedia.Create.sameTemplateExists": "Template with the same name exists",
1406
1451
  "creatives.containersV2.richMedia.Create.saveSuccess": "Template saved successfully",
1452
+ "creatives.containersV2.richMedia.Create.searchText": "Search Templates",
1407
1453
  "creatives.containersV2.richMedia.Create.somethingWentWrong": "Something went wrong!!",
1408
1454
  "creatives.containersV2.richMedia.Create.sourceIdentMissing": "Please provide source account identifier",
1409
1455
  "creatives.containersV2.richMedia.Create.sourceLinkEmpty": "Cannot leave source link field empty",
@@ -1421,6 +1467,7 @@
1421
1467
  "creatives.containersV2.richMedia.Create.visibility": "visibility",
1422
1468
  "creatives.containersV2.richMedia.Create.wrongFormatFile": "Wrong file upoaded. Please upload image file",
1423
1469
  "creatives.containersV2.richMedia.Create.wrongUrl": "Enter correct URL",
1470
+ "creatives.containersV2.richMedia.create.templateNameAlreadyExists": "Template name already exists",
1424
1471
  "customdatepicker.cancel": "Cancel",
1425
1472
  "customdatepicker.done": "Done",
1426
1473
  "reon.components.Cap.Workbench": "WorkBench",
@@ -992,6 +992,48 @@
992
992
  "creatives.containersV2.EmailWrapper.useEditorDesc": "",
993
993
  "creatives.containersV2.EmailWrapper.zipUpload": "",
994
994
  "creatives.containersV2.EmailWrapper.zipUploadDesc": "",
995
+ "creatives.containersV2.Facebook.fbAccount": "",
996
+ "creatives.containersV2.Facebook.fbAdCampaignSetDetailsDescription": "",
997
+ "creatives.containersV2.Facebook.fbAdCampaignSetDetailsTitle": "",
998
+ "creatives.containersV2.Facebook.fbAdSetName": "",
999
+ "creatives.containersV2.Facebook.fbAdsDescription": "",
1000
+ "creatives.containersV2.Facebook.fbAdsDetailOne": "",
1001
+ "creatives.containersV2.Facebook.fbAdsDetailThree": "",
1002
+ "creatives.containersV2.Facebook.fbAdsDetailTwo": "",
1003
+ "creatives.containersV2.Facebook.fbAdsTitle": "",
1004
+ "creatives.containersV2.Facebook.fbAudience": "",
1005
+ "creatives.containersV2.Facebook.fbCampaignName": "",
1006
+ "creatives.containersV2.Facebook.fbChange": "",
1007
+ "creatives.containersV2.Facebook.fbConfirm": "",
1008
+ "creatives.containersV2.Facebook.fbMarketingObjective": "",
1009
+ "creatives.containersV2.Facebook.fbMarketingObjectiveAppInstallTitle": "",
1010
+ "creatives.containersV2.Facebook.fbMarketingObjectiveAppInstallsDescription": "",
1011
+ "creatives.containersV2.Facebook.fbMarketingObjectiveAwareness": "",
1012
+ "creatives.containersV2.Facebook.fbMarketingObjectiveBrandAwarenessDescription": "",
1013
+ "creatives.containersV2.Facebook.fbMarketingObjectiveBrandAwarenessTitle": "",
1014
+ "creatives.containersV2.Facebook.fbMarketingObjectiveCatalogSalesDescription": "",
1015
+ "creatives.containersV2.Facebook.fbMarketingObjectiveCatalogSalesTitle": "",
1016
+ "creatives.containersV2.Facebook.fbMarketingObjectiveConsideration": "",
1017
+ "creatives.containersV2.Facebook.fbMarketingObjectiveConversionsDescription": "",
1018
+ "creatives.containersV2.Facebook.fbMarketingObjectiveConversionsTitle": "",
1019
+ "creatives.containersV2.Facebook.fbMarketingObjectiveEngagementDescription": "",
1020
+ "creatives.containersV2.Facebook.fbMarketingObjectiveEngagementTitle": "",
1021
+ "creatives.containersV2.Facebook.fbMarketingObjectiveLeadGenerationDescription": "",
1022
+ "creatives.containersV2.Facebook.fbMarketingObjectiveLeadGenerationTitle": "",
1023
+ "creatives.containersV2.Facebook.fbMarketingObjectiveMessagesDescription": "",
1024
+ "creatives.containersV2.Facebook.fbMarketingObjectiveMessagesTitle": "",
1025
+ "creatives.containersV2.Facebook.fbMarketingObjectiveReachDescription": "",
1026
+ "creatives.containersV2.Facebook.fbMarketingObjectiveReachTitle": "",
1027
+ "creatives.containersV2.Facebook.fbMarketingObjectiveStoreTrafficDescription": "",
1028
+ "creatives.containersV2.Facebook.fbMarketingObjectiveStoreTrafficTitle": "",
1029
+ "creatives.containersV2.Facebook.fbMarketingObjectiveTrafficDescription": "",
1030
+ "creatives.containersV2.Facebook.fbMarketingObjectiveTrafficTitle": "",
1031
+ "creatives.containersV2.Facebook.fbMarketingObjectiveVideoViewsDescription": "",
1032
+ "creatives.containersV2.Facebook.fbMarketingObjectiveVideoViewsTitle": "",
1033
+ "creatives.containersV2.Facebook.fbNoAudienceSelected": "",
1034
+ "creatives.containersV2.FacebookMarketingObjective.fbMarketingObjectiveDescription": "",
1035
+ "creatives.containersV2.FacebookMarketingObjective.fbMarketingObjectiveDone": "",
1036
+ "creatives.containersV2.FacebookMarketingObjective.fbMarketingObjectiveTitle": "",
995
1037
  "creatives.containersV2.Line.Create.Campaigns": "",
996
1038
  "creatives.containersV2.Line.Create.Creatives": "",
997
1039
  "creatives.containersV2.Line.Create.Image": "",
@@ -1318,6 +1360,7 @@
1318
1360
  "creatives.containersV2.TemplatesV2.creativesDesc": "",
1319
1361
  "creatives.containersV2.TemplatesV2.edit": "",
1320
1362
  "creatives.containersV2.TemplatesV2.email": "",
1363
+ "creatives.containersV2.TemplatesV2.facebook": "",
1321
1364
  "creatives.containersV2.TemplatesV2.gallery": "",
1322
1365
  "creatives.containersV2.TemplatesV2.header": "",
1323
1366
  "creatives.containersV2.TemplatesV2.pushNotification": "",
@@ -1387,6 +1430,8 @@
1387
1430
  "creatives.containersV2.richMedia.Create.delete": "",
1388
1431
  "creatives.containersV2.richMedia.Create.deleteContent": "",
1389
1432
  "creatives.containersV2.richMedia.Create.emptyTemplateName": "",
1433
+ "creatives.containersV2.richMedia.Create.existingMedia": "",
1434
+ "creatives.containersV2.richMedia.Create.existingMediaHeader": "",
1390
1435
  "creatives.containersV2.richMedia.Create.fileContentFailed": "",
1391
1436
  "creatives.containersV2.richMedia.Create.formEmpty": "",
1392
1437
  "creatives.containersV2.richMedia.Create.header": "",
@@ -1404,6 +1449,7 @@
1404
1449
  "creatives.containersV2.richMedia.Create.resolutionText": "",
1405
1450
  "creatives.containersV2.richMedia.Create.sameTemplateExists": "",
1406
1451
  "creatives.containersV2.richMedia.Create.saveSuccess": "",
1452
+ "creatives.containersV2.richMedia.Create.searchText": "",
1407
1453
  "creatives.containersV2.richMedia.Create.somethingWentWrong": "",
1408
1454
  "creatives.containersV2.richMedia.Create.sourceIdentMissing": "",
1409
1455
  "creatives.containersV2.richMedia.Create.sourceLinkEmpty": "",
@@ -1421,6 +1467,7 @@
1421
1467
  "creatives.containersV2.richMedia.Create.visibility": "",
1422
1468
  "creatives.containersV2.richMedia.Create.wrongFormatFile": "",
1423
1469
  "creatives.containersV2.richMedia.Create.wrongUrl": "",
1470
+ "creatives.containersV2.richMedia.create.templateNameAlreadyExists": "",
1424
1471
  "customdatepicker.cancel": "",
1425
1472
  "customdatepicker.done": "",
1426
1473
  "reon.components.Cap.Workbench": "",
@@ -0,0 +1,73 @@
1
+ import { css } from 'styled-components';
2
+ import {
3
+ CAP_SPACE_16,
4
+ CAP_PRIMARY,
5
+ CAP_G06,
6
+ } from '@capillarytech/cap-ui-library/styled/variables';
7
+
8
+ export default css`
9
+ .ant-radio-group.cap-radioCard-v2 {
10
+ .ant-radio-button-wrapper {
11
+ margin-left: 0;
12
+ margin-right: 0;
13
+ }
14
+
15
+ .icon-container {
16
+ background-color: transparent;
17
+
18
+ .anticon {
19
+ color: ${CAP_G06};
20
+ }
21
+
22
+ &.green-color {
23
+ background-color: transparent;
24
+
25
+ .anticon {
26
+ color: ${CAP_PRIMARY.base};
27
+ }
28
+ }
29
+ }
30
+ }
31
+
32
+ .radio-group-heading {
33
+ margin-top: ${CAP_SPACE_16};
34
+ }
35
+
36
+ .submit-button-section {
37
+ margin-top: ${CAP_SPACE_16};
38
+ }
39
+
40
+ .ant-radio-button-wrapper-checked {
41
+ &:not(.ant-radio-button-wrapper-disabled) {
42
+ box-shadow: none;
43
+ }
44
+ }
45
+
46
+ .ant-radio-group.cap-radioCard-v2 {
47
+ .ant-radio-button-wrapper-checked .radio-card-checked {
48
+ display: none;
49
+ }
50
+ }
51
+
52
+ .non-selected-radio-group {
53
+ .ant-radio-button-wrapper {
54
+ &:last-child {
55
+ display: none;
56
+ }
57
+ }
58
+ }
59
+
60
+ .selected-radio-group {
61
+ .ant-radio-button-wrapper-checked {
62
+ &:not(.ant-radio-button-wrapper-disabled) {
63
+ box-shadow: -1px 0 0 0 ${CAP_PRIMARY.base};
64
+ }
65
+ }
66
+
67
+ .ant-radio-group.cap-radioCard-v2 {
68
+ .ant-radio-button-wrapper-checked .radio-card-checked {
69
+ display: block;
70
+ }
71
+ }
72
+ }
73
+ `;
@@ -0,0 +1,107 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import PropTypes from 'prop-types';
3
+ import { injectIntl, FormattedMessage } from "react-intl";
4
+ import {
5
+ CapHeading,
6
+ CapRadioCard,
7
+ CapLabel,
8
+ CapButton,
9
+ CapSpin,
10
+ } from '@capillarytech/cap-ui-library';
11
+ import messages from './messages';
12
+ import styles from './MarketingObjective.style';
13
+ import withStyles from '../../hoc/withStyles';
14
+
15
+ const renderMarketingObjectiveList = ({
16
+ onMarketingObjectiveChange,
17
+ marketingObjectiveSelectedOption,
18
+ defaultmarketingObjective,
19
+ marketingObjectiveList = [],
20
+ }) => {
21
+ const marketingList = (marketingObjective) => {
22
+ const { label, panes = [] } = marketingObjective;
23
+ const selectedPaneExists = panes.some((item) => item.value === marketingObjectiveSelectedOption);
24
+ const modifiedPanes = !selectedPaneExists
25
+ ? [...panes, {
26
+ value: marketingObjectiveSelectedOption,
27
+ }]
28
+ : panes;
29
+ return (
30
+ <div key={label} className={selectedPaneExists ? 'selected-radio-group' : 'non-selected-radio-group'}>
31
+ <CapHeading type="h4" className="radio-group-heading">{label}</CapHeading>
32
+ <CapRadioCard
33
+ onChange={({ target: { value } }) => onMarketingObjectiveChange(value)}
34
+ panes={modifiedPanes}
35
+ cardWidth="324px"
36
+ cardHeight="auto"
37
+ selected={marketingObjectiveSelectedOption}
38
+ defaultValue={defaultmarketingObjective}
39
+ />
40
+ </div>
41
+ );
42
+ };
43
+
44
+ return marketingObjectiveList.map((marketinObjective) => marketingList(marketinObjective));
45
+ };
46
+
47
+ const MarketingObjective = ({
48
+ onMarketingObjectiveSelect,
49
+ selectedMarketingObjective,
50
+ defaultmarketingObjective,
51
+ onSubmit,
52
+ className,
53
+ marketingObjectiveList,
54
+ }) => {
55
+ const [marketingObjectiveSelectedOption, onMarketingObjectiveChange] = useState(selectedMarketingObjective || defaultmarketingObjective);
56
+
57
+ useEffect(() => {
58
+ [...document.querySelectorAll('.non-selected-radio-group .ant-radio-group')].forEach((node) => {
59
+ const paneToSelect = node.lastChild;
60
+ paneToSelect.click();
61
+ });
62
+ }, [marketingObjectiveSelectedOption]);
63
+
64
+ const onSubmitAction = () => {
65
+ onMarketingObjectiveSelect(marketingObjectiveSelectedOption);
66
+ onSubmit(false);
67
+ };
68
+
69
+ return (
70
+ <div className={className}>
71
+ <>
72
+ <CapHeading type="h3">
73
+ <FormattedMessage {...messages.fbMarketingObjectiveTitle} />
74
+ </CapHeading>
75
+ <CapLabel type="label1">
76
+ <FormattedMessage {...messages.fbMarketingObjectiveDescription} />
77
+ </CapLabel>
78
+ </>
79
+ <CapSpin spinning={!marketingObjectiveList.length}>
80
+ {renderMarketingObjectiveList({
81
+ onMarketingObjectiveChange,
82
+ marketingObjectiveSelectedOption,
83
+ defaultmarketingObjective,
84
+ marketingObjectiveList,
85
+ })}
86
+ </CapSpin>
87
+ <CapButton
88
+ type="primary"
89
+ className="submit-button-section"
90
+ onClick={() => onSubmitAction(false)}
91
+ >
92
+ <FormattedMessage {...messages.fbMarketingObjectiveDone} />
93
+ </CapButton>
94
+ </div>
95
+ );
96
+ };
97
+
98
+ MarketingObjective.propTypes = {
99
+ onMarketingObjectiveSelect: PropTypes.func,
100
+ selectedMarketingObjective: PropTypes.string,
101
+ defaultmarketingObjective: PropTypes.string,
102
+ onSubmit: PropTypes.func,
103
+ className: PropTypes.string,
104
+ marketingObjectiveList: PropTypes.arrayOf(PropTypes.object),
105
+ };
106
+
107
+ export default injectIntl(withStyles(MarketingObjective, styles));
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Marketing Objective Messages
3
+ *
4
+ * This contains all the text for the Facebook component.
5
+ */
6
+ import { defineMessages } from 'react-intl';
7
+
8
+ const messagePrefix = 'creatives.containersV2.FacebookMarketingObjective';
9
+
10
+ export default defineMessages({
11
+ fbMarketingObjectiveTitle: {
12
+ id: `${messagePrefix}.fbMarketingObjectiveTitle`,
13
+ defaultMessage: 'Facebook Marketing Objective',
14
+ },
15
+ fbMarketingObjectiveDescription: {
16
+ id: `${messagePrefix}.fbMarketingObjectiveDescription`,
17
+ defaultMessage: 'Objectives help break reporting into a more granular level',
18
+ },
19
+ fbMarketingObjectiveDone: {
20
+ id: `${messagePrefix}.fbMarketingObjectiveDone`,
21
+ defaultMessage: 'Done',
22
+ },
23
+ });
@@ -12,6 +12,7 @@ import MobilepushWrapper from '../MobilepushWrapper';
12
12
  import EmailPreviewV2 from '../../v2Components/EmailPreviewV2';
13
13
  import MobilePushPreview from '../../v2Components/MobilePushPreviewV2';
14
14
  import WechatWrapper from '../WeChat/Wrapper';
15
+ import Facebook from '../Facebook';
15
16
  import { RICH_MEDIA, MAP_TEMPLATE, CREATE } from '../WeChat/Wrapper/constants';
16
17
  import CallTask from '../CallTask';
17
18
  import MobliPushEdit from '../MobilePush/Edit';
@@ -30,6 +31,7 @@ function getWechatTemplateType(mode, templateData, weChatTemplateType = '') {
30
31
  }
31
32
  return weChatTemplateType;
32
33
  }
34
+
33
35
  function SlideBoxContent(props) {
34
36
  const {
35
37
  slidBoxContent,
@@ -67,6 +69,7 @@ function SlideBoxContent(props) {
67
69
  selectedWeChatAccount,
68
70
  weChatMaptemplateStep,
69
71
  onWeChatMaptemplateStepChange,
72
+ onFacebookSubmit,
70
73
  } = props;
71
74
  const type = messageDetails.type.toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
72
75
  const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
@@ -87,6 +90,7 @@ function SlideBoxContent(props) {
87
90
  let isMpushPreview = false;
88
91
  let isEditCallTask = false;
89
92
  let isEditMPush = false;
93
+ let isEditFacebook = false;
90
94
  const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL;
91
95
  if (templateData && channel) {
92
96
  channel = templateData.type;// for edit mode with template data
@@ -95,6 +99,7 @@ function SlideBoxContent(props) {
95
99
  isEditMPush = slidBoxContent === 'editTemplate' && channel === constants.MOBILE_PUSH;
96
100
  isEditEmailWithId = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && templateData._id;
97
101
  isEmailEditWithContent = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && !templateData._id;
102
+ isEditFacebook = slidBoxContent === 'editTemplate' && channel === constants.FACEBOOK;
98
103
  isPreview = slidBoxContent === 'preview' && channel === constants.SMS;
99
104
  isEmailPreview = slidBoxContent === 'preview' && channel === constants.EMAIL;
100
105
  isMpushPreview = slidBoxContent === 'preview' && channel === constants.MOBILE_PUSH;
@@ -116,6 +121,8 @@ function SlideBoxContent(props) {
116
121
  channelsToHide={channelsToHide}
117
122
  forwardedTags={forwardedTags}
118
123
  channelsToDisable={channelsToDisable}
124
+ messageDetails={messageDetails}
125
+ onFacebookSubmit={onFacebookSubmit}
119
126
  />
120
127
  )}
121
128
  {isPreview && (
@@ -302,6 +309,16 @@ function SlideBoxContent(props) {
302
309
  onValidationFail={onValidationFail}
303
310
  selectedOfferDetails={selectedOfferDetails}/>
304
311
  }
312
+ {
313
+ isEditFacebook && (
314
+ <Facebook
315
+ templateData={templateData}
316
+ messageDetails={messageDetails}
317
+ cap={cap}
318
+ onFacebookSubmit={onFacebookSubmit}
319
+ />
320
+ )
321
+ }
305
322
  </CreativesWrapper>
306
323
  );
307
324
  }
@@ -341,5 +358,6 @@ SlideBoxContent.propTypes = {
341
358
  selectedWeChatAccount: PropTypes.object,
342
359
  onWeChatMaptemplateStepChange: PropTypes.func,
343
360
  weChatMaptemplateStep: PropTypes.string,
361
+ onFacebookSubmit: PropTypes.func,
344
362
  };
345
363
  export default SlideBoxContent;
@@ -12,5 +12,6 @@ export const LINE = "LINE";
12
12
  export const CALL_TASK = "CALL_TASK";
13
13
  export const MOBILE_PUSH = "MOBILEPUSH";
14
14
  export const WECHAT = "WECHAT";
15
+ export const FACEBOOK = "FACEBOOK";
15
16
  export const SHOW_CONTANER_LOADER = "app/CreativesContainer/SHOW_CONTANER_LOADER";
16
17
  export const HIDE_CONTAINER_LOADER = "app/CreativesContainer/HIDE_CONTAINER_LOADER";
@@ -207,6 +207,14 @@ class Creatives extends React.Component {
207
207
  };
208
208
  break;
209
209
  }
210
+ case constants.FACEBOOK: {
211
+ creativesTemplateData = {
212
+ selectedMarketingObjective: templateData.selectedMarketingObjective,
213
+ edit: true,
214
+ type: channel,
215
+ };
216
+ break;
217
+ }
210
218
  default:
211
219
  break;
212
220
  }
@@ -465,7 +473,7 @@ class Creatives extends React.Component {
465
473
  }
466
474
  render() {
467
475
  const {slidBoxContent, isGetFormData, showSlideBox, templateData, currentChannel, emailCreateMode, templateStep, isLoadingContent, mobilePushCreateMode, isDiscardMessage, weChatTemplateType, weChatMaptemplateStep} = this.state;
468
- const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails} = this.props;
476
+ const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails, getCreativesData} = this.props;
469
477
  const mapTemplateCreate = slidBoxContent === 'createTemplate' && weChatTemplateType === MAP_TEMPLATE && templateStep !== 'modeSelection';
470
478
  /* TODO: Instead of passing down same props separately to each component down, write common function to these props and pass it accordingly */
471
479
  return (
@@ -530,6 +538,7 @@ class Creatives extends React.Component {
530
538
  weChatMaptemplateStep={weChatMaptemplateStep}
531
539
  selectedWeChatAccount={selectedWeChatAccount}
532
540
  onWeChatMaptemplateStepChange={this.onWeChatMaptemplateStepChange}
541
+ onFacebookSubmit={getCreativesData}
533
542
  />
534
543
  }
535
544
  footer={this.shouldShowFooter() &&