@capillarytech/creatives-library 3.3.1 → 3.3.3

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.
Files changed (39) hide show
  1. package/config/app.js +2 -0
  2. package/containers/Cap/messsages.js +63 -0
  3. package/index.js +6 -0
  4. package/initialState.js +3 -0
  5. package/package.json +2 -1
  6. package/routes.js +6 -1
  7. package/services/api.js +25 -9
  8. package/translations/en.json +47 -0
  9. package/translations/zh.json +47 -0
  10. package/v2Components/Header/index.js +46 -0
  11. package/v2Components/Header/tests/index.test.js +10 -0
  12. package/v2Components/MarketingObjective/MarketingObjective.style.js +73 -0
  13. package/v2Components/MarketingObjective/index.js +107 -0
  14. package/v2Components/MarketingObjective/messages.js +23 -0
  15. package/v2Containers/App/constants.js +29 -0
  16. package/v2Containers/Cap/index.js +3 -0
  17. package/v2Containers/CreativesContainer/SlideBoxContent.js +18 -0
  18. package/v2Containers/CreativesContainer/constants.js +1 -0
  19. package/v2Containers/CreativesContainer/index.js +10 -1
  20. package/v2Containers/Email/index.js +7 -0
  21. package/v2Containers/EmailWrapper/index.js +15 -1
  22. package/v2Containers/Facebook/Facebook.style.js +75 -0
  23. package/v2Containers/Facebook/actions.js +13 -0
  24. package/v2Containers/Facebook/constants.js +24 -0
  25. package/v2Containers/Facebook/index.js +358 -0
  26. package/v2Containers/Facebook/messages.js +167 -0
  27. package/v2Containers/Facebook/reducer.js +31 -0
  28. package/v2Containers/Facebook/sagas.js +41 -0
  29. package/v2Containers/Facebook/selectors.js +20 -0
  30. package/v2Containers/MobilePush/Create/index.js +8 -0
  31. package/v2Containers/MobilePush/Edit/index.js +8 -0
  32. package/v2Containers/Sms/Create/index.js +6 -1
  33. package/v2Containers/Sms/Edit/index.js +6 -1
  34. package/v2Containers/Templates/index.js +9 -3
  35. package/v2Containers/TemplatesV2/_templatesV2.scss +5 -0
  36. package/v2Containers/TemplatesV2/index.js +53 -22
  37. package/v2Containers/TemplatesV2/messages.js +4 -0
  38. package/v2Containers/WeChat/MapTemplates/index.js +9 -1
  39. package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +9 -2
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',
@@ -0,0 +1,63 @@
1
+ import { defineMessages } from 'react-intl';
2
+ export default defineMessages({
3
+ "sms": {
4
+ id: 'reon.components.Cap.sms',
5
+ defaultMessage: 'SMS',
6
+ },
7
+ "wechat": {
8
+ id: 'reon.components.Cap.wechat',
9
+ defaultMessage: 'WeChat',
10
+ },
11
+ "gallery": {
12
+ id: 'reon.components.Cap.gallery',
13
+ defaultMessage: 'Gallery',
14
+ },
15
+ "creativesDashboard": {
16
+ id: 'reon.components.Cap.creativesDashboard',
17
+ defaultMessage: 'Creatives',
18
+ },
19
+ "creatives": {
20
+ id: 'reon.components.Cap.creatives',
21
+ defaultMessage: 'Creatives',
22
+ },
23
+ "campaigns": {
24
+ id: 'reon.components.Cap.campaigns',
25
+ defaultMessage: 'Campaigns',
26
+ },
27
+ "loyalty": {
28
+ id: 'reon.components.Cap.loyalty',
29
+ defaultMessage: 'Loyalty',
30
+ },
31
+ "member care": {
32
+ id: 'reon.components.Cap.memberCare',
33
+ defaultMessage: 'Member Care',
34
+ },
35
+ "workbench": {
36
+ id: 'reon.components.Cap.Workbench',
37
+ defaultMessage: 'WorkBench',
38
+ },
39
+ "store care": {
40
+ id: 'reon.components.Cap.storeCare',
41
+ defaultMessage: 'Store Care',
42
+ },
43
+ "store performance": {
44
+ id: 'reon.components.Cap.storePerformance',
45
+ defaultMessage: 'Store Performance',
46
+ },
47
+ "email": {
48
+ id: 'reon.components.Cap.email',
49
+ defaultMessage: 'Email',
50
+ },
51
+ "ebill": {
52
+ id: 'reon.components.Cap.ebill',
53
+ defaultMessage: 'Ebill',
54
+ },
55
+ "campaignsDashboard": {
56
+ id: 'reon.components.campaignsDashboard',
57
+ defaultMessage: 'Campaigns',
58
+ },
59
+ "campaignsHome": {
60
+ id: 'reon.components.campaignsHome',
61
+ defaultMessage: "Campaigns Home",
62
+ },
63
+ });
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.3.3",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -13,6 +13,7 @@
13
13
  "license": "LicenseRef-LICENSE",
14
14
  "dependencies": {
15
15
  "@babel/polyfill": "7.4.3",
16
+ "@capillarytech/cap-ui-utils": "1.0.6",
16
17
  "babel-cli": "^6.26.0",
17
18
  "chalk": "1.1.3",
18
19
  "jquery": "^3.3.1",
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,46 @@
1
+ /**
2
+ *
3
+ * Header
4
+ *
5
+ */
6
+
7
+ import PropTypes from 'prop-types';
8
+
9
+ import React from 'react';
10
+ // import styled from 'styled-components';
11
+ import { FormattedMessage } from 'react-intl';
12
+
13
+ import { CapRow, CapColumn, CapInput, CapButton } from '@capillarytech/cap-ui-library';
14
+ import messages from './messages';
15
+
16
+
17
+ function Header(props) {
18
+ return (
19
+ <div>
20
+ <CapRow className="template-form-header">
21
+ <CapColumn span={10}>
22
+ <CapInput id="template-name" placeholder="Enter template name*" defaultValue={props.templateName} type="input" onChange={props.templateNameHandler}/>
23
+ </CapColumn>
24
+ <CapColumn span={2} offset={8}>
25
+ <CapButton id="preview-button" type="cancel" onClick={props.previewHandler}> <FormattedMessage {...messages.preview} /> </CapButton>
26
+ </CapColumn>
27
+ <CapColumn span={2}>
28
+ <CapButton id="cancel-button" type="cancel" onClick={props.cancelHandler}> <FormattedMessage {...messages.cancel} /> </CapButton>
29
+ </CapColumn>
30
+ <CapColumn span={2}>
31
+ <CapButton id="save-button" type="primary" onClick={props.saveHandler}> <FormattedMessage {...messages.save} /> </CapButton>
32
+ </CapColumn>
33
+ </CapRow>
34
+ </div>
35
+ );
36
+ }
37
+
38
+ Header.propTypes = {
39
+ templateNameHandler: PropTypes.func,
40
+ previewHandler: PropTypes.func,
41
+ cancelHandler: PropTypes.func,
42
+ saveHandler: PropTypes.func,
43
+ templateName: PropTypes.string,
44
+ };
45
+
46
+ export default Header;
@@ -0,0 +1,10 @@
1
+ // import React from 'react';
2
+ // import { shallow } from 'enzyme';
3
+
4
+ // import Header from '../index';
5
+
6
+ describe('<Header />', () => {
7
+ it('Expect to have unit tests specified', () => {
8
+ expect(true).toEqual(false);
9
+ });
10
+ });
@@ -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));