@capillarytech/creatives-library 7.7.25 → 7.8.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.
@@ -214,7 +214,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
214
214
  if (nextProps.isNewVersionFlow && !this.state.formData[this.state.currentTab - 1][this.state.formData[this.state.currentTab - 1].activeTab].tabKey) {
215
215
  this.resetTabKeys(nextProps.formData, nextProps.tabCount, false, true);
216
216
  }
217
- if (type === 'embedded' || (this.props?.schema?.channel || "").toUpperCase() === 'EMAIL') {
217
+ if (type === 'embedded' || this.props.schema.channel.toUpperCase() === 'EMAIL') {
218
218
  this.validateForm();
219
219
  }
220
220
  if ((this.props.schema && this.props.schema.channel && this.props.schema.channel.toUpperCase() === 'MOBILEPUSH')) {
@@ -2917,7 +2917,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2917
2917
  }
2918
2918
 
2919
2919
  const currentLang = ((!_.isEmpty(this.state.formData) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`]) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages) && this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex]) ? this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex] : this.props.baseLanguage) || 'en';
2920
- const content = this.state?.formData?.[`${this.state.currentTab - 1}`]?.[currentLang]?.['template-content'] || "";
2920
+ const content = (!_.isEmpty(this.state.formData) && this.state.formData[`${this.state.currentTab - 1}`][currentLang]['template-content'] ? this.state.formData[`${this.state.currentTab - 1}`][currentLang]['template-content'] : '');
2921
2921
 
2922
2922
  if (this.state.formData[`${this.state.currentTab - 1}`][currentLang].is_drag_drop) {
2923
2923
  // content = "";
@@ -872,15 +872,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
872
872
  const langIndex = formData[this.state.currentTab - 1].selectedLanguages.indexOf(langId);
873
873
 
874
874
  const temp = (schema.containers || {})[this.state.currentTab - 1];
875
- const isStyleExists= temp?.tabBarExtraContent?.sections?.[0]?.inputFields?.[0]?.cols?.[4]?.content?.sections?.[0]?.inputFields?.[2]?.cols?.[0]?.style;
876
875
  if (baseLanguage === langId && (apiLangId === "undefined" || apiLangId === formData[this.state.currentTab - 1].activeTab)) {
877
- if(isStyleExists){
878
- temp.tabBarExtraContent.sections[0].inputFields[0].cols[4].content.sections[0].inputFields[2].cols[0].style = {display: "none"};
879
- }
876
+ temp.tabBarExtraContent.sections[0].inputFields[0].cols[4].content.sections[0].inputFields[2].cols[0].style = {display: "none"};
880
877
  } else if (apiLangId === "undefined" || apiLangId === formData[this.state.currentTab - 1].activeTab) {
881
- if(isStyleExists){
882
- temp.tabBarExtraContent.sections[0].inputFields[0].cols[4].content.sections[0].inputFields[2].cols[0].style = {display: ""};
883
- }
878
+ temp.tabBarExtraContent.sections[0].inputFields[0].cols[4].content.sections[0].inputFields[2].cols[0].style = {display: ""};
884
879
  }
885
880
 
886
881
  if (nextProps.Email.CmsSettings.isDragDrop) {
@@ -2722,7 +2717,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2722
2717
  }
2723
2718
  formData.base = _.cloneDeep(formData[0]);
2724
2719
 
2725
- this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (data?.base?.is_drag_drop !== 0 )}, () => {
2720
+ this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (data.base.is_drag_drop !== 0 )}, () => {
2726
2721
  // this.setState({tabKey: ''});
2727
2722
  _.forEach(formData[0].selectedLanguages, (language) => {
2728
2723
  if (formData[0][language].is_drag_drop) {
@@ -517,13 +517,13 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
517
517
  mode: this.props.params.mode,
518
518
  };
519
519
  const android = {};
520
- Object.keys((formData[0] || {})).forEach((data) => {
520
+ Object.keys(formData[0]).forEach((data) => {
521
521
  if (!!formData[0][data] && data !== "tabKey") {
522
522
  android[data] = formData[0][data];
523
523
  }
524
524
  });
525
525
  const ios = {};
526
- Object.keys((formData[1] || {})).forEach((data) => {
526
+ Object.keys(formData[1]).forEach((data) => {
527
527
  if (!!formData[1][data] && data !== "tabKey") {
528
528
  ios[data] = formData[1][data];
529
529
  }
@@ -558,7 +558,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
558
558
  });
559
559
  } else {
560
560
  selectedAccount = accounts[0];
561
- formData['mobilepush-accounts'] = selectedAccount?.id;
561
+ formData['mobilepush-accounts'] = accounts[0].id;
562
562
  }
563
563
  this.props.actions.setWeChatAccount(selectedAccount);
564
564
  this.setState({formData, accountsOptions: accounts.map((acc) => ({key: acc.id, label: acc.name, value: acc.id}))});
@@ -573,7 +573,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
573
573
  obj.type = 'MOBILEPUSH';
574
574
  obj.name = formData['template-name'];
575
575
  obj.definition = {
576
- accountId: selectedWeChatAccount?.id,
576
+ accountId: selectedWeChatAccount.id,
577
577
  licenseCode: selectedWeChatAccount.sourceAccountIdentifier,
578
578
  };
579
579
  if (this.props.location.query && this.props.location.query.module !== 'dvs') {
@@ -611,9 +611,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
611
611
  setSelectedTemplateData(weChatData) {
612
612
  let schema = _.cloneDeep(this.state.baseSchema);
613
613
  const { intl: {formatMessage}} = this.props;
614
- if(schema?.standalone?.sections?.[0]?.childSections?.[1]?.childSections?.[0]?.childSections?.[1]?.inputFields){
615
- schema.standalone.sections[0].childSections[1].childSections[0].childSections[1].inputFields = []
616
- };
614
+ schema.standalone.sections[0].childSections[1].childSections[0].childSections[1].inputFields = [];
617
615
  if (_.isEmpty(weChatData)) {
618
616
  // schema.standalone.sections[0].childSections[1].childSections[0].childSections[1].inputFields = [];
619
617
  const formData=_.cloneDeep(this.state.formData);
@@ -780,16 +778,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
780
778
  type: "radioGroup",
781
779
  metaType: "text",
782
780
  datatype: "string",
783
- options: [
784
- {
785
- value: URL,
786
- label: formatMessage(messages.redirectOptionURL)
787
- },
788
- {
789
- value: MINI_PROGRAM,
790
- label: formatMessage(messages.redirectOptionMiniProgram)
791
- }
792
- ],
781
+ options: [formatMessage(messages.redirectOptionURL), formatMessage(messages.redirectOptionMiniProgram)],
793
782
  errorMessage: formatMessage(messages.redirectionOptionError),
794
783
  required: true,
795
784
  fluid: true,
@@ -880,8 +869,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
880
869
  if (!_.isEmpty(weCrmAccounts)) {
881
870
  _.forEach(weCrmAccounts, (account) => {
882
871
  if (account.configs && account.configs.is_wecrm_enabled) {
883
- const options = schema?.standalone?.sections[0]?.childSections[1]?.childSections[0]?.childSections[0]?.inputFields[0]?.options;
884
- options && options.push({
872
+ schema.standalone.sections[0].childSections[1].childSections[0].childSections[0].inputFields[0].options.push({
885
873
  key: account.uuid,
886
874
  label: account.name,
887
875
  value: account.name,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.7.25",
4
+ "version": "7.8.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
package/services/api.js CHANGED
@@ -32,16 +32,6 @@ function parseJSON(response) {
32
32
  return response.json();
33
33
  }
34
34
 
35
- function getUrlWithQueryParams({url, queryParams}) {
36
- let updatedUrl = url;
37
- Object.entries(queryParams).forEach(([key, value]) => {
38
- if (value !== undefined) {
39
- updatedUrl += `${key}=${key === 'name' ? encodeURIComponent(value) : value}&`;
40
- }
41
- });
42
- return updatedUrl;
43
- };
44
-
45
35
  // const loginUrl = (process.env.NODE_ENV === 'production') ?
46
36
  // config.production.login_url : config.development.login_url;
47
37
 
@@ -260,25 +250,20 @@ export const getTemplateDetails = ({id, channel}) => {
260
250
  return request(url, getAPICallObject('GET'));
261
251
  };
262
252
 
263
- export const getAllTemplates = ({channel, queryParams = {}}) => {
264
- const url = getUrlWithQueryParams({
265
- url: `${API_ENDPOINT}/templates/${channel}?`,
266
- queryParams,
267
- });
253
+ export const getAllTemplates = ({channel, queryParams}) => {
254
+ const url = `${API_ENDPOINT}/templates/${channel}?query=${encodeURIComponent(JSON.stringify(queryParams))}`;
268
255
  return request(url, getAPICallObject('GET'));
269
256
  };
270
257
 
271
258
  export const deleteTemplate = ({channel, id}) => {
259
+
272
260
  const url = `${API_ENDPOINT}/templates/${id}/${channel}`;
273
261
  return request(url, getAPICallObject('DELETE'));
274
262
  //return API.deleteResource(url);
275
263
  };
276
264
 
277
- export const getAllAssets = ({assetType, queryParams = {}}) => {
278
- const url = getUrlWithQueryParams({
279
- url: `${API_ENDPOINT}/assets/${assetType}?`,
280
- queryParams,
281
- });
265
+ export const getAllAssets = ({assetType, queryParams}) => {
266
+ const url = `${API_ENDPOINT}/assets/${assetType}?query=${JSON.stringify(queryParams)}`;
282
267
  // const url = `https://nightly.capillary.in/arya/api/v1/creatives/assets/${assetType}?query=${JSON.stringify(queryParams)}`;
283
268
  return API.get(url);
284
269
  }
@@ -1,16 +1,4 @@
1
1
  {
2
- "app.components.CapVideoUpload.dragAndDrop": "Drag and drop video here",
3
- "app.components.CapVideoUpload.fileFormat": "Format: MP4",
4
- "app.components.CapVideoUpload.imageReUpload": "Re upload",
5
- "app.components.CapVideoUpload.or": "OR",
6
- "app.components.CapVideoUpload.textMessageAddLabel": "How do you want to upload the image?",
7
- "app.components.CapVideoUpload.textMessageCreateNew": "Create new",
8
- "app.components.CapVideoUpload.textMessageORLabel": "OR",
9
- "app.components.CapVideoUpload.textMessageSelectTemplate": "Select template",
10
- "app.components.CapVideoUpload.uploadComputer": "Your computer",
11
- "app.components.CapVideoUpload.videoIncorrectSize": "This file format/size is not supported.",
12
- "app.components.CapVideoUpload.videoRatioDescription": "Video ratio: 9:16 to 16:9",
13
- "app.components.CapVideoUpload.videoSizeDescription": "File size: Up to {size}",
14
2
  "app.components.TemplatePreview.includesOptoutTag": "Includes optout tag",
15
3
  "app.components.TemplatePreview.optoutCharactersTotal": "Includes optout tag ({optoutUrlLength} characters)",
16
4
  "creatives.components.AccessForbidden.forbiddenDesc": "This page access has not been provided to you.",
@@ -102,17 +90,6 @@
102
90
  "creatives.components.WechatRichmediaTemplatePreview.select": "Select",
103
91
  "creatives.componentsV2.BreadCrumbs.header": "This is the BreadCrumbs component !",
104
92
  "creatives.componentsV2.CallTaskPreview.header": "This is the CallTaskPreview component !",
105
- "creatives.componentsV2.CapImageUpload.aspectRatio": "Aspect ratio: 1:1",
106
- "creatives.componentsV2.CapImageUpload.dragAndDrop": "Drag and drop image here",
107
- "creatives.componentsV2.CapImageUpload.format": "Format: JPG, PNG",
108
- "creatives.componentsV2.CapImageUpload.imageDimenstionDescription": "Dimensions: {width}px x {height}px",
109
- "creatives.componentsV2.CapImageUpload.imageGallery": "Gallery",
110
- "creatives.componentsV2.CapImageUpload.imageIncorrectSize": "Please upload the image with correct type, size and dimension",
111
- "creatives.componentsV2.CapImageUpload.imageReUpload": "Re upload",
112
- "creatives.componentsV2.CapImageUpload.or": "OR",
113
- "creatives.componentsV2.CapImageUpload.uploadComputer": "Your computer",
114
- "creatives.componentsV2.CapImageUpload.uploadGallery": "Gallery",
115
- "creatives.componentsV2.CapImageUpload.uploadImageDescription": "The relevant image that complements the message context.",
116
93
  "creatives.componentsV2.CapTagList.Cancel": "Cancel",
117
94
  "creatives.componentsV2.CapTagList.Ok": "Ok",
118
95
  "creatives.componentsV2.CapTagList.all": "All",
@@ -830,40 +807,6 @@
830
807
  "creatives.containersV2.Cap.storeCare": "Store Care",
831
808
  "creatives.containersV2.Cap.storePerformance": "Store Performance",
832
809
  "creatives.containersV2.Cap.wechat": "WeChat",
833
- "creatives.containersV2.CapFacebookPreview.audienceNetworkInstreamVideo": "Audience network instream video",
834
- "creatives.containersV2.CapFacebookPreview.audienceNetworkInstreamVideoMobile": "Audience network instream video mobile",
835
- "creatives.containersV2.CapFacebookPreview.audienceNetworkOutstreamVideo": "Audience network outstream video",
836
- "creatives.containersV2.CapFacebookPreview.audienceNetworkRewardedVideo": "Audience network rewarded video",
837
- "creatives.containersV2.CapFacebookPreview.desktopFeedStandard": "Desktop feed standard",
838
- "creatives.containersV2.CapFacebookPreview.facebookStoryMobile": "Facebook story mobile",
839
- "creatives.containersV2.CapFacebookPreview.generatePreview": "Generate preview",
840
- "creatives.containersV2.CapFacebookPreview.generatePreviewDisableToolTip": "Looks like either all the mandatory fields are not filled or there is no new change",
841
- "creatives.containersV2.CapFacebookPreview.generatePreviewError": "Error in generating preview",
842
- "creatives.containersV2.CapFacebookPreview.instagramExploreContextual": "Instagram explore contextual",
843
- "creatives.containersV2.CapFacebookPreview.instagramExploreImmersive": "Instagram explore immersive",
844
- "creatives.containersV2.CapFacebookPreview.instagramStandard": "Instagram standard",
845
- "creatives.containersV2.CapFacebookPreview.instagramStory": "Instagram story",
846
- "creatives.containersV2.CapFacebookPreview.instantArticleStandard": "Instant article standard",
847
- "creatives.containersV2.CapFacebookPreview.instreamVideoDesktop": "Instream video desktop",
848
- "creatives.containersV2.CapFacebookPreview.instreamVideoMobile": "Instream video mobile",
849
- "creatives.containersV2.CapFacebookPreview.marketplaceDesktop": "Marketplace desktop",
850
- "creatives.containersV2.CapFacebookPreview.marketplaceMobile": "Marketplace mobile",
851
- "creatives.containersV2.CapFacebookPreview.messengerMobileInboxMedia": "Messenger mobile inbox media",
852
- "creatives.containersV2.CapFacebookPreview.mobileBanner": "Mobile banner",
853
- "creatives.containersV2.CapFacebookPreview.mobileFeedBasic": "Mobile feed basic",
854
- "creatives.containersV2.CapFacebookPreview.mobileFeedStandard": "Mobile feed standard",
855
- "creatives.containersV2.CapFacebookPreview.mobileFullwidth": "Mobile fullwidth",
856
- "creatives.containersV2.CapFacebookPreview.mobileInterstitial": "Mobile interstitial",
857
- "creatives.containersV2.CapFacebookPreview.mobileMediumRectangle": "Mobile medium rectangle",
858
- "creatives.containersV2.CapFacebookPreview.mobileNative": "Mobile native",
859
- "creatives.containersV2.CapFacebookPreview.previewAdDesc": "Please add Media, Primary text & Website link & click on “Generate preview” to view preview.",
860
- "creatives.containersV2.CapFacebookPreview.previewBasedonAdPlacement": "Preview based on ad placement",
861
- "creatives.containersV2.CapFacebookPreview.refreshPreview": "Refresh preview",
862
- "creatives.containersV2.CapFacebookPreview.rightColumnStandard": "Right column standard",
863
- "creatives.containersV2.CapFacebookPreview.suggestedVideoDesktop": "Suggested video desktop",
864
- "creatives.containersV2.CapFacebookPreview.suggestedVideoMobile": "Suggested video mobile",
865
- "creatives.containersV2.CapFacebookPreview.videoNotePreview": "Facebook may take time to upload the video. Please try Refreshing.",
866
- "creatives.containersV2.CapFacebookPreview.watchFeedMobile": "Watch feed mobile",
867
810
  "creatives.containersV2.ChannelTemplates.header": "This is ChannelTemplates container !",
868
811
  "creatives.containersV2.Create.addLabel": "Add label",
869
812
  "creatives.containersV2.Create.alertMessage": "Alert",
@@ -1116,53 +1059,11 @@
1116
1059
  "creatives.containersV2.FTP.selectFtpServerDesc": "FTP not configured for this org. Please add FTP server",
1117
1060
  "creatives.containersV2.FTP.selectTag": "Select tag",
1118
1061
  "creatives.containersV2.FTP.unsupportedTagsValidationError": "Unsupported tags: {unsupportedTags}. Please remove them from this message.",
1119
- "creatives.containersV2.Facebook.Advertisement.AdvertisementType": "How you would like your ad to look?",
1120
- "creatives.containersV2.Facebook.Advertisement.addCard": "Add card",
1121
- "creatives.containersV2.Facebook.Advertisement.callToAction": "Call to action",
1122
- "creatives.containersV2.Facebook.Advertisement.callToActionMandatoryError": "call to action is mandatory for Video Media. Please select call to action",
1123
- "creatives.containersV2.Facebook.Advertisement.carouselDesc": "Create an Ad with 2 or more scrollable images or videos",
1124
- "creatives.containersV2.Facebook.Advertisement.carouselTitle": "Carousel",
1125
- "creatives.containersV2.Facebook.Advertisement.clickButtonLabel": "Continue",
1126
- "creatives.containersV2.Facebook.Advertisement.createNotification": "Facebook template created successfully",
1127
- "creatives.containersV2.Facebook.Advertisement.creativeName": "Creative name",
1128
- "creatives.containersV2.Facebook.Advertisement.creativesTemplatesEditName": "Edit name",
1129
- "creatives.containersV2.Facebook.Advertisement.deleteTooltipLabel": "Delete",
1130
- "creatives.containersV2.Facebook.Advertisement.displayLink": "Display link",
1131
- "creatives.containersV2.Facebook.Advertisement.displayLinkPlaceHolder": "Enter the link that you want to show on your ad",
1132
- "creatives.containersV2.Facebook.Advertisement.doneButtonLabel": "Done",
1133
- "creatives.containersV2.Facebook.Advertisement.duplicateTooltipLabel": "Duplicate",
1134
- "creatives.containersV2.Facebook.Advertisement.editNotification": "Facebook template updated successfully",
1135
- "creatives.containersV2.Facebook.Advertisement.facebookPage": "Facebook page",
1136
- "creatives.containersV2.Facebook.Advertisement.image": "Image",
1137
- "creatives.containersV2.Facebook.Advertisement.imageVideoDesc": "Create an Ad with one image or video",
1138
- "creatives.containersV2.Facebook.Advertisement.imageVideoTitle": "Single image or video",
1139
- "creatives.containersV2.Facebook.Advertisement.inValidUrliErrorMessage": "Website link is not valid",
1140
- "creatives.containersV2.Facebook.Advertisement.linkDesc": "Link description",
1141
- "creatives.containersV2.Facebook.Advertisement.linkDescPlaceHolder": "Enter the additional details",
1142
- "creatives.containersV2.Facebook.Advertisement.linkDescToolTip": "Description over 40 characters may be cut off.",
1143
- "creatives.containersV2.Facebook.Advertisement.linkHeadline": "Link headline",
1144
- "creatives.containersV2.Facebook.Advertisement.linkHeadlinePlaceHolder": "Enter the short headline",
1145
- "creatives.containersV2.Facebook.Advertisement.linkHeadlineToolTip": "Headlines over 40 characters may be cut off.",
1146
- "creatives.containersV2.Facebook.Advertisement.newFacebookCreatives": "New Facebook creative",
1147
- "creatives.containersV2.Facebook.Advertisement.optional": "(Optional)",
1148
- "creatives.containersV2.Facebook.Advertisement.primaryText": "Primary text",
1149
- "creatives.containersV2.Facebook.Advertisement.primaryTextPlaceholder": "Enter text that clearly tells people about what you are promoting",
1150
- "creatives.containersV2.Facebook.Advertisement.primaryTextToolTip": "Facebook recommends 125 characters or fewer.",
1151
- "creatives.containersV2.Facebook.Advertisement.shiftLeftTooltipLabel": "Shift Left",
1152
- "creatives.containersV2.Facebook.Advertisement.shiftRightTooltipLabel": "Shift Right",
1153
- "creatives.containersV2.Facebook.Advertisement.video_slideshow": "Video",
1154
- "creatives.containersV2.Facebook.Advertisement.webSiteLink": "Website link",
1155
- "creatives.containersV2.Facebook.Advertisement.websiteLinkPlaceHolder": "Enter the URL for the web page that you want people to visit",
1156
- "creatives.containersV2.Facebook.adManagerHeading": "Where do you want to create your Facebook ad creative?",
1157
- "creatives.containersV2.Facebook.capAdManagerHeading": "You can create Facebook ads creative in Engage+ Facebook ad Manager.",
1158
- "creatives.containersV2.Facebook.capFbAdManager": "Capillary Facebook ad manager",
1159
- "creatives.containersV2.Facebook.facebookDisableinfo": "Please integrate Facebook page ID & page name to enable this option.",
1160
1062
  "creatives.containersV2.Facebook.fbAccount": "Facebook Account",
1161
1063
  "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.",
1162
1064
  "creatives.containersV2.Facebook.fbAdCampaignSetDetailsTitle": "Ad campaign & ad set details",
1163
- "creatives.containersV2.Facebook.fbAdManager": "Facebook ad manager",
1164
1065
  "creatives.containersV2.Facebook.fbAdSetName": "Ad set name",
1165
- "creatives.containersV2.Facebook.fbAdsDescription": "Proceed with empty content block & you can create ads in Facebook Ad Manager under the mentioned ad set.",
1066
+ "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+.",
1166
1067
  "creatives.containersV2.Facebook.fbAdsDetailOne": "Only FB campaign & ad set creation is supported in Engage+",
1167
1068
  "creatives.containersV2.Facebook.fbAdsDetailThree": "You can create ads later in Facebook ad manager.",
1168
1069
  "creatives.containersV2.Facebook.fbAdsDetailTwo": "You can proceed with an empty content block",
@@ -1170,7 +1071,7 @@
1170
1071
  "creatives.containersV2.Facebook.fbAudience": "Audience",
1171
1072
  "creatives.containersV2.Facebook.fbCampaignName": "FB Campaign name",
1172
1073
  "creatives.containersV2.Facebook.fbChange": "Change",
1173
- "creatives.containersV2.Facebook.fbContinue": "Continue",
1074
+ "creatives.containersV2.Facebook.fbConfirm": "Confirm",
1174
1075
  "creatives.containersV2.Facebook.fbMarketingObjective": "FB Marketing objective",
1175
1076
  "creatives.containersV2.Facebook.fbMarketingObjectiveAppInstallTitle": "App Installs",
1176
1077
  "creatives.containersV2.Facebook.fbMarketingObjectiveAppInstallsDescription": "Get more people to install your app.",
@@ -1579,7 +1480,6 @@
1579
1480
  "creatives.containersV2.Templates.newTemplate": "New template",
1580
1481
  "creatives.containersV2.Templates.noAccountMessage": "Please select an account to proceed",
1581
1482
  "creatives.containersV2.Templates.noAccountsPresent": "Push notifications are not setup for your brand",
1582
- "creatives.containersV2.Templates.noAccountsPresentFacebook": "Please setup the Facebook account & Facebook page to start creating content in Capillary's FB content creator.",
1583
1483
  "creatives.containersV2.Templates.noAccountsPresentLine": "Line accounts are not setup for your brand",
1584
1484
  "creatives.containersV2.Templates.noAccountsPresentViber": "Viber accounts are not setup for your brand",
1585
1485
  "creatives.containersV2.Templates.noAccountsPresentWeChat": "Wechat accounts are not setup for your brand",
@@ -1627,7 +1527,6 @@
1627
1527
  "creatives.containersV2.TemplatesV2.edit": "Edit",
1628
1528
  "creatives.containersV2.TemplatesV2.email": "Email",
1629
1529
  "creatives.containersV2.TemplatesV2.facebook": "Facebook",
1630
- "creatives.containersV2.TemplatesV2.facebookDisableinfo": "Please integrate Facebook page ID & page name to enable this option.",
1631
1530
  "creatives.containersV2.TemplatesV2.gallery": "Gallery",
1632
1531
  "creatives.containersV2.TemplatesV2.header": "This is TemplatesV2 container !",
1633
1532
  "creatives.containersV2.TemplatesV2.line": "Line",
@@ -1684,7 +1583,6 @@
1684
1583
  "creatives.containersV2.WeChat.wechatCreateSuccess": "WeChat template mapped successfully",
1685
1584
  "creatives.containersV2.WeChat.wechatEditSuccess": "WeChat template edited successfully",
1686
1585
  "creatives.containersV2.appName": "App Name",
1687
- "creatives.containersV2.applyNow": "Apply now",
1688
1586
  "creatives.containersV2.areYouSureText": "Are you sure?",
1689
1587
  "creatives.containersV2.audience": "Audience",
1690
1588
  "creatives.containersV2.campaignsDashboard": "Campaigns",
@@ -1692,9 +1590,7 @@
1692
1590
  "creatives.containersV2.cancel": "Cancel",
1693
1591
  "creatives.containersV2.changeOk": "Ok, change",
1694
1592
  "creatives.containersV2.incentive": "Incentive",
1695
- "creatives.containersV2.learnMore": "Learn More",
1696
1593
  "creatives.containersV2.newOrgName": "{newOrgName}",
1697
- "creatives.containersV2.noCallToAction": "No call to action",
1698
1594
  "creatives.containersV2.orgChangeText": "Changing from <b>{oldOrgName}</b> to <b>{newOrgName}</b> will change the organisation for applications open in other tabs as well.<br/>Do you want to make the change to <b>{newOrgName}</b>?",
1699
1595
  "creatives.containersV2.orgChangedText": "Organization changed to",
1700
1596
  "creatives.containersV2.orgRefreshHeading": "Org refresh",
@@ -1766,9 +1662,6 @@
1766
1662
  "creatives.containersV2.richMedia.Create.wechatTitle": "Title",
1767
1663
  "creatives.containersV2.richMedia.Create.wrongFormatFile": "Wrong file upoaded. Please upload image file",
1768
1664
  "creatives.containersV2.richMedia.Create.wrongUrl": "Enter correct URL",
1769
- "creatives.containersV2.shopNow": "Shop Now",
1770
- "creatives.containersV2.signUp": "Sign Up",
1771
- "creatives.containersV2.subscribe": "Subscribe",
1772
1665
  "creatives.containersV2.viber.addLabels": "Add labels",
1773
1666
  "creatives.containersV2.viber.button": "Button",
1774
1667
  "creatives.containersV2.viber.buttonText": "Button text",
@@ -1804,7 +1697,6 @@
1804
1697
  "creatives.containersV2.viber.viberCreativeTitle": "Viber creative",
1805
1698
  "creatives.containersV2.viber.viberEditNotification": "Viber template updated successfully",
1806
1699
  "creatives.containersV2.viber.viberImageIncorrectSize": "Please upload the image with correct type, size and dimension",
1807
- "creatives.containersV2.watchMore": "Watch More",
1808
1700
  "customdatepicker.cancel": "Cancel",
1809
1701
  "customdatepicker.done": "Done",
1810
1702
  "reon.components.Cap.Workbench": "WorkBench",
@@ -1,16 +1,4 @@
1
1
  {
2
- "app.components.CapVideoUpload.dragAndDrop": "",
3
- "app.components.CapVideoUpload.fileFormat": "",
4
- "app.components.CapVideoUpload.imageReUpload": "",
5
- "app.components.CapVideoUpload.or": "",
6
- "app.components.CapVideoUpload.textMessageAddLabel": "",
7
- "app.components.CapVideoUpload.textMessageCreateNew": "",
8
- "app.components.CapVideoUpload.textMessageORLabel": "",
9
- "app.components.CapVideoUpload.textMessageSelectTemplate": "",
10
- "app.components.CapVideoUpload.uploadComputer": "",
11
- "app.components.CapVideoUpload.videoIncorrectSize": "",
12
- "app.components.CapVideoUpload.videoRatioDescription": "",
13
- "app.components.CapVideoUpload.videoSizeDescription": "",
14
2
  "app.components.TemplatePreview.includesOptoutTag": "",
15
3
  "app.components.TemplatePreview.optoutCharactersTotal": "",
16
4
  "creatives.components.AccessForbidden.forbiddenDesc": "",
@@ -102,17 +90,6 @@
102
90
  "creatives.components.WechatRichmediaTemplatePreview.select": "",
103
91
  "creatives.componentsV2.BreadCrumbs.header": "",
104
92
  "creatives.componentsV2.CallTaskPreview.header": "",
105
- "creatives.componentsV2.CapImageUpload.aspectRatio": "",
106
- "creatives.componentsV2.CapImageUpload.dragAndDrop": "",
107
- "creatives.componentsV2.CapImageUpload.format": "",
108
- "creatives.componentsV2.CapImageUpload.imageDimenstionDescription": "",
109
- "creatives.componentsV2.CapImageUpload.imageGallery": "",
110
- "creatives.componentsV2.CapImageUpload.imageIncorrectSize": "",
111
- "creatives.componentsV2.CapImageUpload.imageReUpload": "",
112
- "creatives.componentsV2.CapImageUpload.or": "",
113
- "creatives.componentsV2.CapImageUpload.uploadComputer": "",
114
- "creatives.componentsV2.CapImageUpload.uploadGallery": "",
115
- "creatives.componentsV2.CapImageUpload.uploadImageDescription": "",
116
93
  "creatives.componentsV2.CapTagList.Cancel": "",
117
94
  "creatives.componentsV2.CapTagList.Ok": "",
118
95
  "creatives.componentsV2.CapTagList.all": "",
@@ -830,40 +807,6 @@
830
807
  "creatives.containersV2.Cap.storeCare": "",
831
808
  "creatives.containersV2.Cap.storePerformance": "",
832
809
  "creatives.containersV2.Cap.wechat": "",
833
- "creatives.containersV2.CapFacebookPreview.audienceNetworkInstreamVideo": "",
834
- "creatives.containersV2.CapFacebookPreview.audienceNetworkInstreamVideoMobile": "",
835
- "creatives.containersV2.CapFacebookPreview.audienceNetworkOutstreamVideo": "",
836
- "creatives.containersV2.CapFacebookPreview.audienceNetworkRewardedVideo": "",
837
- "creatives.containersV2.CapFacebookPreview.desktopFeedStandard": "",
838
- "creatives.containersV2.CapFacebookPreview.facebookStoryMobile": "",
839
- "creatives.containersV2.CapFacebookPreview.generatePreview": "",
840
- "creatives.containersV2.CapFacebookPreview.generatePreviewDisableToolTip": "",
841
- "creatives.containersV2.CapFacebookPreview.generatePreviewError": "",
842
- "creatives.containersV2.CapFacebookPreview.instagramExploreContextual": "",
843
- "creatives.containersV2.CapFacebookPreview.instagramExploreImmersive": "",
844
- "creatives.containersV2.CapFacebookPreview.instagramStandard": "",
845
- "creatives.containersV2.CapFacebookPreview.instagramStory": "",
846
- "creatives.containersV2.CapFacebookPreview.instantArticleStandard": "",
847
- "creatives.containersV2.CapFacebookPreview.instreamVideoDesktop": "",
848
- "creatives.containersV2.CapFacebookPreview.instreamVideoMobile": "",
849
- "creatives.containersV2.CapFacebookPreview.marketplaceDesktop": "",
850
- "creatives.containersV2.CapFacebookPreview.marketplaceMobile": "",
851
- "creatives.containersV2.CapFacebookPreview.messengerMobileInboxMedia": "",
852
- "creatives.containersV2.CapFacebookPreview.mobileBanner": "",
853
- "creatives.containersV2.CapFacebookPreview.mobileFeedBasic": "",
854
- "creatives.containersV2.CapFacebookPreview.mobileFeedStandard": "",
855
- "creatives.containersV2.CapFacebookPreview.mobileFullwidth": "",
856
- "creatives.containersV2.CapFacebookPreview.mobileInterstitial": "",
857
- "creatives.containersV2.CapFacebookPreview.mobileMediumRectangle": "",
858
- "creatives.containersV2.CapFacebookPreview.mobileNative": "",
859
- "creatives.containersV2.CapFacebookPreview.previewAdDesc": "",
860
- "creatives.containersV2.CapFacebookPreview.previewBasedonAdPlacement": "",
861
- "creatives.containersV2.CapFacebookPreview.refreshPreview": "",
862
- "creatives.containersV2.CapFacebookPreview.rightColumnStandard": "",
863
- "creatives.containersV2.CapFacebookPreview.suggestedVideoDesktop": "",
864
- "creatives.containersV2.CapFacebookPreview.suggestedVideoMobile": "",
865
- "creatives.containersV2.CapFacebookPreview.videoNotePreview": "",
866
- "creatives.containersV2.CapFacebookPreview.watchFeedMobile": "",
867
810
  "creatives.containersV2.ChannelTemplates.header": "",
868
811
  "creatives.containersV2.Create.addLabel": "",
869
812
  "creatives.containersV2.Create.alertMessage": "",
@@ -1116,51 +1059,9 @@
1116
1059
  "creatives.containersV2.FTP.selectFtpServerDesc": "",
1117
1060
  "creatives.containersV2.FTP.selectTag": "",
1118
1061
  "creatives.containersV2.FTP.unsupportedTagsValidationError": "",
1119
- "creatives.containersV2.Facebook.Advertisement.AdvertisementType": "",
1120
- "creatives.containersV2.Facebook.Advertisement.addCard": "",
1121
- "creatives.containersV2.Facebook.Advertisement.callToAction": "",
1122
- "creatives.containersV2.Facebook.Advertisement.callToActionMandatoryError": "",
1123
- "creatives.containersV2.Facebook.Advertisement.carouselDesc": "",
1124
- "creatives.containersV2.Facebook.Advertisement.carouselTitle": "",
1125
- "creatives.containersV2.Facebook.Advertisement.clickButtonLabel": "",
1126
- "creatives.containersV2.Facebook.Advertisement.createNotification": "",
1127
- "creatives.containersV2.Facebook.Advertisement.creativeName": "",
1128
- "creatives.containersV2.Facebook.Advertisement.creativesTemplatesEditName": "",
1129
- "creatives.containersV2.Facebook.Advertisement.deleteTooltipLabel": "",
1130
- "creatives.containersV2.Facebook.Advertisement.displayLink": "",
1131
- "creatives.containersV2.Facebook.Advertisement.displayLinkPlaceHolder": "",
1132
- "creatives.containersV2.Facebook.Advertisement.doneButtonLabel": "",
1133
- "creatives.containersV2.Facebook.Advertisement.duplicateTooltipLabel": "",
1134
- "creatives.containersV2.Facebook.Advertisement.editNotification": "",
1135
- "creatives.containersV2.Facebook.Advertisement.facebookPage": "",
1136
- "creatives.containersV2.Facebook.Advertisement.image": "",
1137
- "creatives.containersV2.Facebook.Advertisement.imageVideoDesc": "",
1138
- "creatives.containersV2.Facebook.Advertisement.imageVideoTitle": "",
1139
- "creatives.containersV2.Facebook.Advertisement.inValidUrliErrorMessage": "",
1140
- "creatives.containersV2.Facebook.Advertisement.linkDesc": "",
1141
- "creatives.containersV2.Facebook.Advertisement.linkDescPlaceHolder": "",
1142
- "creatives.containersV2.Facebook.Advertisement.linkDescToolTip": "",
1143
- "creatives.containersV2.Facebook.Advertisement.linkHeadline": "",
1144
- "creatives.containersV2.Facebook.Advertisement.linkHeadlinePlaceHolder": "",
1145
- "creatives.containersV2.Facebook.Advertisement.linkHeadlineToolTip": "",
1146
- "creatives.containersV2.Facebook.Advertisement.newFacebookCreatives": "",
1147
- "creatives.containersV2.Facebook.Advertisement.optional": "",
1148
- "creatives.containersV2.Facebook.Advertisement.primaryText": "",
1149
- "creatives.containersV2.Facebook.Advertisement.primaryTextPlaceholder": "",
1150
- "creatives.containersV2.Facebook.Advertisement.primaryTextToolTip": "",
1151
- "creatives.containersV2.Facebook.Advertisement.shiftLeftTooltipLabel": "",
1152
- "creatives.containersV2.Facebook.Advertisement.shiftRightTooltipLabel": "",
1153
- "creatives.containersV2.Facebook.Advertisement.video_slideshow": "",
1154
- "creatives.containersV2.Facebook.Advertisement.webSiteLink": "",
1155
- "creatives.containersV2.Facebook.Advertisement.websiteLinkPlaceHolder": "",
1156
- "creatives.containersV2.Facebook.adManagerHeading": "",
1157
- "creatives.containersV2.Facebook.capAdManagerHeading": "",
1158
- "creatives.containersV2.Facebook.capFbAdManager": "",
1159
- "creatives.containersV2.Facebook.facebookDisableinfo": "",
1160
1062
  "creatives.containersV2.Facebook.fbAccount": "",
1161
1063
  "creatives.containersV2.Facebook.fbAdCampaignSetDetailsDescription": "",
1162
1064
  "creatives.containersV2.Facebook.fbAdCampaignSetDetailsTitle": "",
1163
- "creatives.containersV2.Facebook.fbAdManager": "",
1164
1065
  "creatives.containersV2.Facebook.fbAdSetName": "",
1165
1066
  "creatives.containersV2.Facebook.fbAdsDescription": "",
1166
1067
  "creatives.containersV2.Facebook.fbAdsDetailOne": "",
@@ -1170,7 +1071,7 @@
1170
1071
  "creatives.containersV2.Facebook.fbAudience": "",
1171
1072
  "creatives.containersV2.Facebook.fbCampaignName": "",
1172
1073
  "creatives.containersV2.Facebook.fbChange": "",
1173
- "creatives.containersV2.Facebook.fbContinue": "",
1074
+ "creatives.containersV2.Facebook.fbConfirm": "",
1174
1075
  "creatives.containersV2.Facebook.fbMarketingObjective": "",
1175
1076
  "creatives.containersV2.Facebook.fbMarketingObjectiveAppInstallTitle": "",
1176
1077
  "creatives.containersV2.Facebook.fbMarketingObjectiveAppInstallsDescription": "",
@@ -1579,7 +1480,6 @@
1579
1480
  "creatives.containersV2.Templates.newTemplate": "",
1580
1481
  "creatives.containersV2.Templates.noAccountMessage": "",
1581
1482
  "creatives.containersV2.Templates.noAccountsPresent": "",
1582
- "creatives.containersV2.Templates.noAccountsPresentFacebook": "",
1583
1483
  "creatives.containersV2.Templates.noAccountsPresentLine": "",
1584
1484
  "creatives.containersV2.Templates.noAccountsPresentViber": "",
1585
1485
  "creatives.containersV2.Templates.noAccountsPresentWeChat": "",
@@ -1627,7 +1527,6 @@
1627
1527
  "creatives.containersV2.TemplatesV2.edit": "",
1628
1528
  "creatives.containersV2.TemplatesV2.email": "",
1629
1529
  "creatives.containersV2.TemplatesV2.facebook": "",
1630
- "creatives.containersV2.TemplatesV2.facebookDisableinfo": "",
1631
1530
  "creatives.containersV2.TemplatesV2.gallery": "",
1632
1531
  "creatives.containersV2.TemplatesV2.header": "",
1633
1532
  "creatives.containersV2.TemplatesV2.line": "",
@@ -1684,7 +1583,6 @@
1684
1583
  "creatives.containersV2.WeChat.wechatCreateSuccess": "",
1685
1584
  "creatives.containersV2.WeChat.wechatEditSuccess": "",
1686
1585
  "creatives.containersV2.appName": "",
1687
- "creatives.containersV2.applyNow": "",
1688
1586
  "creatives.containersV2.areYouSureText": "",
1689
1587
  "creatives.containersV2.audience": "",
1690
1588
  "creatives.containersV2.campaignsDashboard": "",
@@ -1692,9 +1590,7 @@
1692
1590
  "creatives.containersV2.cancel": "",
1693
1591
  "creatives.containersV2.changeOk": "",
1694
1592
  "creatives.containersV2.incentive": "",
1695
- "creatives.containersV2.learnMore": "",
1696
1593
  "creatives.containersV2.newOrgName": "",
1697
- "creatives.containersV2.noCallToAction": "",
1698
1594
  "creatives.containersV2.orgChangeText": "",
1699
1595
  "creatives.containersV2.orgChangedText": "",
1700
1596
  "creatives.containersV2.orgRefreshHeading": "",
@@ -1766,9 +1662,6 @@
1766
1662
  "creatives.containersV2.richMedia.Create.wechatTitle": "",
1767
1663
  "creatives.containersV2.richMedia.Create.wrongFormatFile": "",
1768
1664
  "creatives.containersV2.richMedia.Create.wrongUrl": "",
1769
- "creatives.containersV2.shopNow": "",
1770
- "creatives.containersV2.signUp": "",
1771
- "creatives.containersV2.subscribe": "",
1772
1665
  "creatives.containersV2.viber.addLabels": "",
1773
1666
  "creatives.containersV2.viber.button": "",
1774
1667
  "creatives.containersV2.viber.buttonText": "",
@@ -1804,7 +1697,6 @@
1804
1697
  "creatives.containersV2.viber.viberCreativeTitle": "",
1805
1698
  "creatives.containersV2.viber.viberEditNotification": "",
1806
1699
  "creatives.containersV2.viber.viberImageIncorrectSize": "",
1807
- "creatives.containersV2.watchMore": "",
1808
1700
  "customdatepicker.cancel": "",
1809
1701
  "customdatepicker.done": "",
1810
1702
  "reon.components.Cap.Workbench": "",
@@ -31,12 +31,8 @@ const creativeDetails = ({
31
31
 
32
32
  const isLabelsUsed = (content = '') => {
33
33
  const tagRegex = /{{[(A-Z\w+(\s\w+)*$\(\)@!#$%^&*~.,/\\]+}}/g; // eslint-disable-line no-useless-escape
34
- const isContentString= typeof content === "string";
35
- if(isContentString){
36
- content = content.replaceAll('{{optout}}', '');
37
- content = content.replaceAll('{{unsubscribe}}', '');
38
- }
39
-
34
+ content = content.replaceAll('{{optout}}', '');
35
+ content = content.replaceAll('{{unsubscribe}}', '');
40
36
  const tags = [...content.matchAll(tagRegex)];
41
37
  return !!tags.length;
42
38
  };
@@ -5,17 +5,13 @@ const gtmEvents = require.context('./gtmEvents', true, /\.js$/, 'lazy');
5
5
  export const gtmPush = (eventType, eventObject) => {
6
6
  try {
7
7
  gtmEvents(`./${eventType}.js`)
8
- .then((event) => {
8
+ .then(event => {
9
9
  event.default(eventObject);
10
10
  })
11
- .catch((err) => {
12
- if (err) {
13
- Bugsnag.notify(err);
14
- }
11
+ .catch(err => {
12
+ Bugsnag.notify(err);
15
13
  });
16
14
  } catch (e) {
17
- if (e) {
18
- Bugsnag.notify(e);
19
- }
15
+ Bugsnag.notify(e);
20
16
  }
21
17
  };
@@ -85,12 +85,6 @@ function CapImageUpload(props) {
85
85
  };
86
86
  submitAction({file, type: 'image', fileParams}, incorrectFile);
87
87
  };
88
- img.onerror = () => {
89
- const fileParams = {
90
- error: true,
91
- };
92
- submitAction({fileParams}, incorrectFile);
93
- }
94
88
  if (e) {
95
89
  const event = e;
96
90
  event.target.value = null;
@@ -99,12 +93,13 @@ function CapImageUpload(props) {
99
93
 
100
94
  const submitAction = useCallback((data, incorrectFile) => {
101
95
  const {
102
- file,
103
- fileParams
104
- } = data || {};
105
- const { size } = file || {};
106
- const { height, width, error } = fileParams || {};
107
- if (incorrectFile || size > imgSize || height > imgHeight || width > imgWidth || error) {
96
+ file: {size},
97
+ fileParams: {
98
+ height,
99
+ width,
100
+ },
101
+ } = data;
102
+ if (incorrectFile || size > imgSize || height > imgHeight || width > imgWidth) {
108
103
  updateImageErrorMessage(formatMessage(messages.imageIncorrectSize));
109
104
  } else {
110
105
  updateImageErrorMessage('');
@@ -171,7 +166,6 @@ function CapImageUpload(props) {
171
166
  <CapUploader.CapDragger
172
167
  customRequest={capUploaderCustomRequest}
173
168
  className="form-builder-dragger"
174
- showUploadList={!isImageError}
175
169
  >
176
170
  <CapHeading className="dragger-title" type="h7">
177
171
  <FormattedMessage {...messages.dragAndDrop} />
@@ -204,7 +198,7 @@ function CapImageUpload(props) {
204
198
  <FormattedMessage {...messages.imageReUpload} />
205
199
  </CapButton>
206
200
  );
207
- }, [isImageError]);
201
+ }, []);
208
202
 
209
203
  return (
210
204
  <div style={style} className="cap-custom-image-upload">
@@ -2854,16 +2854,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2854
2854
  name={val.name ? val.name : `${val.id}-name`}
2855
2855
  disabled={val.disabled}
2856
2856
  >
2857
- {val.options.map((option, index) => {
2858
- const isMappedTemplateWechat = val.id === "template-redirect-options-radio";
2859
- return (
2860
- <CapRadio
2861
- value={ isMappedTemplateWechat ? option.value : option }
2862
- inductiveText={val.inductiveText && val.inductiveText[index]}>{ isMappedTemplateWechat ? option.label : option }
2863
- </CapRadio>
2864
- )
2865
- }
2866
- )}
2857
+ {val.options.map((option, index) => <CapRadio value={option} inductiveText={val.inductiveText && val.inductiveText[index]}>{option}</CapRadio>) }
2867
2858
 
2868
2859
  </CapRadioGroup>
2869
2860
  {/*{ifError ?*/}
@@ -11,7 +11,3 @@ export const GENERATE_PREVIEW_FAILURE = 'app/CapFacebookPreview/GET_PREVIEW_FAIL
11
11
 
12
12
  export const CLEAR_PREVIEW = 'app/CapFacebookPreview/CLEAR_PREVIEW';
13
13
 
14
- export const PREVIEW_NOT_REQUESTED = "PreviewNotRequested";
15
- export const FETCH_PREVIEW_REQUESTED = "PreviewRequested";
16
- export const FETCH_PREVIEW_SUCCESS = "PreviewRequestSuccess";
17
- export const FETCH_PREVIEW_FAILURE = "PreviewRequestFailure";
@@ -30,11 +30,6 @@ import {
30
30
  CAROUSEL,
31
31
  NO_CALL_TO_ACTION,
32
32
  } from '../../v2Containers/Facebook/Advertisement/constant';
33
- import {
34
- FETCH_PREVIEW_REQUESTED,
35
- FETCH_PREVIEW_SUCCESS,
36
- PREVIEW_NOT_REQUESTED,
37
- } from './constants';
38
33
  import './index.scss';
39
34
 
40
35
  export const CapFacebookPreview = (props) => {
@@ -60,10 +55,7 @@ export const CapFacebookPreview = (props) => {
60
55
  const [disableAfterPreviewGenerate, setDisableAfterPreviewGenerate] = useState(false);
61
56
  const [random, setRandom] = useState(0);
62
57
  const {pageAccessToken, pageId} = orgUnitFacebookPageSettingsMap;
63
- const {previewIframe = "", fetchPreviewStatus = PREVIEW_NOT_REQUESTED, previewIframeError = ""} = facebookPreviewData;
64
- const [previewLoaded, setPreviewLoaded] = useState(false);
65
- const [isRefreshing, setIsRefreshing] = useState(false);
66
- let isSpinning = false;
58
+ const {previewIframe = "", isFetchingPreview = false, previewIframeError = ""} = facebookPreviewData;
67
59
  const facebookAdOptions = [
68
60
  {
69
61
  value: "DESKTOP_FEED_STANDARD",
@@ -292,17 +284,9 @@ export const CapFacebookPreview = (props) => {
292
284
  };
293
285
 
294
286
  const resetIframe = () => {
295
- previewLoaded && setPreviewLoaded(false);
296
- !isRefreshing && setIsRefreshing(true);
297
287
  const r = random + 1;
298
288
  setRandom(r);
299
289
  };
300
- const unsetLoader = () => {
301
- setTimeout(function() {
302
- !previewLoaded && setPreviewLoaded(true);
303
- isRefreshing && setIsRefreshing(false);
304
- }.bind(this), 5000);
305
- }
306
290
  const getIframe = (iframe) => {
307
291
  const divTag = document.createElement('div');
308
292
  divTag.innerHTML = iframe;
@@ -311,16 +295,13 @@ export const CapFacebookPreview = (props) => {
311
295
  <iframe
312
296
  src={src}
313
297
  key={random}
314
- style={{ border: "none" }}
298
+ style={{border: "none"}}
315
299
  width={"600px"}
316
300
  scrolling="no"
317
301
  height={"1000px"}
318
302
  className="cap-facebook-ad-iframe"
319
- onLoad={
320
- unsetLoader()
321
- }
322
303
  />
323
- </>);
304
+ </>);
324
305
  };
325
306
 
326
307
  const showRefreshButton = () => {
@@ -359,80 +340,74 @@ export const CapFacebookPreview = (props) => {
359
340
  }
360
341
  }, [previewIframeError]);
361
342
  return (
362
- <>
363
- {isSpinning = (fetchPreviewStatus === FETCH_PREVIEW_REQUESTED) ||
364
- ((fetchPreviewStatus === FETCH_PREVIEW_SUCCESS) && !previewLoaded) ||
365
- isRefreshing}
366
- <CapSpin
367
- spinning={isSpinning}>
368
- <div style={{ display: 'inline-block' }}>
369
- <CapSelect
370
- label={formatMessage(messages.previewBasedonAdPlacement)}
371
- key={"select-previewBasedonAdPlacement"}
372
- onChange={onChangeAdPreviewFormat}
373
- style={{ width: '328px', paddingBottom: 16 }}
374
- options={adOptions}
375
- value={adPreviewFormat}
376
- >
377
- </CapSelect>
378
- </div>
379
- {!hideInfoText && <CapLabel
380
- type="label1"
381
- style={{ paddingBottom: 16, textAlign: 'left', width: 392 }}
343
+ <CapSpin spinning={isFetchingPreview}>
344
+ <div style={{display: 'inline-block'}}>
345
+ <CapSelect
346
+ label={formatMessage(messages.previewBasedonAdPlacement)}
347
+ key={"select-previewBasedonAdPlacement"}
348
+ onChange={onChangeAdPreviewFormat}
349
+ style={{width: '328px', paddingBottom: 16 }}
350
+ options={adOptions}
351
+ value={adPreviewFormat}
382
352
  >
383
- {formatMessage(messages.previewAdDesc)}
384
- </CapLabel>}
385
- <div style={{ marginBottom: 16 }}>
386
- {(disablePreviewButton || disableAfterPreviewGenerate) ?
387
- <CapTooltip title={formatMessage(messages.generatePreviewDisableToolTip)}>
388
- <div className="button-disabled-tooltip-wrapper">
389
- <CapButton
390
- type="secondary"
391
- disabled
353
+ </CapSelect>
354
+ </div>
355
+ {!hideInfoText && <CapLabel
356
+ type="label1"
357
+ style={{paddingBottom: 16, textAlign: 'left', width: 392}}
392
358
  >
393
- <FormattedMessage {...messages.generatePreview} />
394
- </CapButton>
395
- </div>
396
- </CapTooltip> :
397
- <CapButton
398
- type="secondary"
399
- onClick={generatePreview}
400
- >
401
- <FormattedMessage {...messages.generatePreview} />
402
- </CapButton>}
403
- {isRefreshButton && (<CapButton
404
- onClick={resetIframe}
359
+ {formatMessage(messages.previewAdDesc)}
360
+ </CapLabel>}
361
+ <div style={{marginBottom: 16}}>
362
+ {(disablePreviewButton || disableAfterPreviewGenerate) ?
363
+ <CapTooltip title={formatMessage(messages.generatePreviewDisableToolTip)}>
364
+ <div className="button-disabled-tooltip-wrapper">
365
+ <CapButton
366
+ type="secondary"
367
+ disabled
368
+ >
369
+ <FormattedMessage {...messages.generatePreview} />
370
+ </CapButton>
371
+ </div>
372
+ </CapTooltip> :
373
+ <CapButton
405
374
  type="secondary"
406
- style={{ marginLeft: 16 }}
407
- >
408
- {formatMessage(messages.refreshPreview)}
409
- </CapButton>)}
410
- </div>
411
- {isRefreshButton && <div style={{ marginBottom: 16 }}>
412
- <CapIcon
413
- type="info"
414
- svgProps={{
415
- width: 16,
416
- height: 16,
417
- }}
375
+ onClick={generatePreview}
418
376
  >
419
- </CapIcon>
420
- <CapLabel.CapLabelInline
421
- type="label1"
422
- size="s"
423
- style={{ marginBottom: 16, width: 392 }}
424
- >
425
- {formatMessage(messages.videoNotePreview)}
426
- </CapLabel.CapLabelInline>
427
- </div>}
428
- {previewIframe === "" ? <CapImage
429
- src={facebookEmptyPlaceholder}
430
- alt="default"
431
- width="316px"
432
- height="392px"
433
- /> : getIframe(previewIframe)}
434
- </CapSpin>
435
- </>
377
+ <FormattedMessage {...messages.generatePreview} />
378
+ </CapButton>}
379
+ {isRefreshButton && (<CapButton
380
+ onClick={resetIframe}
381
+ type="secondary"
382
+ style={{marginLeft: 16}}
383
+ >
384
+ {formatMessage(messages.refreshPreview)}
385
+ </CapButton>)}
386
+ </div>
387
+ {isRefreshButton && <div style={{marginBottom: 16}}>
388
+ <CapIcon
389
+ type="info"
390
+ svgProps={{
391
+ width: 16,
392
+ height: 16,
393
+ }}
394
+ >
395
+ </CapIcon>
396
+ <CapLabel.CapLabelInline
397
+ type="label1"
398
+ size="s"
399
+ style={{marginBottom: 16, width: 392}}
400
+ >
401
+ {formatMessage(messages.videoNotePreview)}
402
+ </CapLabel.CapLabelInline>
403
+ </div>}
404
+ {previewIframe === "" ? <CapImage
405
+ src={facebookEmptyPlaceholder}
406
+ alt="default"
407
+ width="316px"
408
+ height="392px"
409
+ /> : getIframe(previewIframe)}
410
+ </CapSpin>
436
411
  );
437
412
  };
438
413
 
@@ -6,38 +6,29 @@
6
6
 
7
7
  import { fromJS } from 'immutable';
8
8
  import get from 'lodash/get';
9
- import {
10
- GENERATE_PREVIEW_REQUEST,
11
- GENERATE_PREVIEW_SUCCESS,
12
- GENERATE_PREVIEW_FAILURE,
13
- CLEAR_PREVIEW,
14
- FETCH_PREVIEW_REQUESTED,
15
- FETCH_PREVIEW_SUCCESS,
16
- FETCH_PREVIEW_FAILURE,
17
- PREVIEW_NOT_REQUESTED,
18
- } from './constants';
9
+ import * as types from './constants';
19
10
 
20
11
  const initialState = fromJS({
21
- fetchPreviewStatus: PREVIEW_NOT_REQUESTED,
12
+ isFetchingPreview: false,
22
13
  previewIframe: "",
23
14
  previewIframeError: "",
24
15
  });
25
16
 
26
17
  function capFacebookPreviewReducer(state = initialState, action) {
27
18
  switch (action.type) {
28
- case GENERATE_PREVIEW_REQUEST:
29
- return state.set('fetchPreviewStatus', FETCH_PREVIEW_REQUESTED)
19
+ case types.GENERATE_PREVIEW_REQUEST:
20
+ return state.set('isFetchingPreview', true)
30
21
  .set('previewIframe', "")
31
22
  .set("previewIframeError", "");
32
- case GENERATE_PREVIEW_SUCCESS:
33
- return state.set('fetchPreviewStatus', FETCH_PREVIEW_SUCCESS)
23
+ case types.GENERATE_PREVIEW_SUCCESS:
24
+ return state.set('isFetchingPreview', false)
34
25
  .set('previewIframe', get(action, 'payload.fbPreview[0].body', ""));
35
- case GENERATE_PREVIEW_FAILURE:
36
- return state.set('fetchPreviewStatus', FETCH_PREVIEW_FAILURE)
26
+ case types.GENERATE_PREVIEW_FAILURE:
27
+ return state.set('isFetchingPreview', false)
37
28
  .set('previewIframe', "")
38
29
  .set("previewIframeError", get(action, 'payload.message', ""));
39
- case CLEAR_PREVIEW:
40
- return state.set('fetchPreviewStatus', PREVIEW_NOT_REQUESTED)
30
+ case types.CLEAR_PREVIEW:
31
+ return state.set('isFetchingPreview', false)
41
32
  .set('previewIframe', "")
42
33
  .set("previewIframeError", "");
43
34
  default:
@@ -578,7 +578,6 @@ function SlideBoxContent(props) {
578
578
  templateData={templateData}
579
579
  messageDetails={messageDetails}
580
580
  cap={cap}
581
- createNew={onCreateNew}
582
581
  onFacebookSubmit={onFacebookSubmit}
583
582
  onCreateComplete={onCreateComplete}
584
583
  isFullMode={isFullMode}
@@ -587,7 +586,6 @@ function SlideBoxContent(props) {
587
586
  }}
588
587
  getFormSubscriptionData={getFormData}
589
588
  fbAdManager={fbAdManager}
590
- onSelectTemplate={onSelectTemplate}
591
589
  />
592
590
  )
593
591
  }
@@ -91,7 +91,7 @@ class Creatives extends React.Component {
91
91
  this.setState({ slidBoxContent: 'preview', templateData });
92
92
  };
93
93
  onEditTemplate = () => {
94
- this.setState({ slidBoxContent: 'editTemplate', showSlideBox: true, templateNameExists: true });
94
+ this.setState({ slidBoxContent: 'editTemplate', showSlideBox: true });
95
95
  };
96
96
  onCreateNew = (fbAdManager) => {
97
97
  const data = { slidBoxContent: 'createTemplate', showSlideBox: true };
@@ -474,9 +474,9 @@ export const Advertisement = (props) => {
474
474
  if (webSiteLink === "" || errorMsg.websiteLinkErrorMsg ) {
475
475
  flag = true;
476
476
  }
477
- if (!imageData?.imageSrc && subType === IMAGE) {
477
+ if (Object.keys(imageData).length === 0 && subType === IMAGE) {
478
478
  flag = true;
479
- } else if (!videoData?.videoSrc && subType === VIDEO) {
479
+ } else if (Object.keys(videoData).length === 0 && subType === VIDEO) {
480
480
  flag = true;
481
481
  }
482
482
  subTypes.push(subType);
@@ -21,7 +21,7 @@ $classPrefix: add-facebook-ad-section;
21
21
  display: inline-block;
22
22
  }
23
23
  .cap-input-edit-name{
24
- width: 319px;
24
+ width: 500px;
25
25
  }
26
26
  .cap-link-edit-name{
27
27
  display: inline-block;
@@ -269,11 +269,7 @@ const Facebook = (props) => {
269
269
  ]);
270
270
  const query = {type: 'embedded', module: 'library'};
271
271
  const location = {pathname: `/FACEBOOK`, search: '', query};
272
-
273
- // fbAdManager ==cretaives only the case for default startegy and user selected "capillary ad manager"
274
- // below condition (fbAdManager !==CREATIVE) is for edit fb ad manager from campaign
275
- //-> select capillary ad manager-> select template
276
- return ((showTemplateList && fbAdManager !==CREATIVE) ? (
272
+ return (showTemplateList ? (
277
273
  <Templates
278
274
  key={"FACEBOOK"}
279
275
  location={location}
@@ -284,18 +280,11 @@ const Facebook = (props) => {
284
280
  onSelectTemplate={onSelectTemplate}
285
281
  renderNewCardGrid={renderNewCardGrid}
286
282
  handlePeviewTemplate={handlePeviewTemplate}
287
- fbAdManager={CREATIVE} // it means we are selecting capillary ad manager from campaign
283
+ fbAdManager={CREATIVE}
288
284
  />
289
285
  ) :
290
- (!isFullMode && ((fbAdManager !== CREATIVE && messageStrategy === "DEFAULT")
291
- || (templateData?.edit && templateData?.fbContentType !==CREATIVE && fbAdManager !== CREATIVE )) ) ?
292
-
293
- // not fullmode +
294
- // default strtaegy and not selected "capillary ad manager" from campaign message +
295
- //edit template && not coming from campaign message where user selected "capillary ad manager" (means edit "fb ad manager" from campaign) &&
296
- // & also we are not selecting capillary ad manager from campaign
297
-
298
- (<div className={className}>
286
+ (!isFullMode && (fbAdManager !== CREATIVE && messageStrategy === "DEFAULT" || (templateData?.edit && templateData?.fbContentType !==CREATIVE)) ) ?
287
+ (<div className={className}>
299
288
 
300
289
  <div className="is-scrollable-section" >
301
290
  <div className="account-details-wrapper">
@@ -346,7 +346,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
346
346
  });
347
347
  } else {
348
348
  selectedAccount = accounts[0];
349
- formData['mobilepush-accounts'] = selectedAccount?.id;
349
+ formData['mobilepush-accounts'] = accounts[0].id;
350
350
  }
351
351
  this.props.actions.setWeChatAccount(selectedAccount);
352
352
  this.setState({formData, accountsOptions: accounts.map((acc) => ({key: acc.id, label: acc.name, value: acc.id}))});
@@ -361,7 +361,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
361
361
  obj.type = 'MOBILEPUSH';
362
362
  obj.name = formData['template-name'];
363
363
  obj.definition = {
364
- accountId: selectedWeChatAccount?.id,
364
+ accountId: selectedWeChatAccount.id,
365
365
  licenseCode: selectedWeChatAccount.sourceAccountIdentifier,
366
366
  };
367
367
  if (this.props.location.query && this.props.location.query.module !== 'dvs') {
@@ -45,7 +45,7 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
45
45
  },
46
46
  {
47
47
  title: <FormattedMessage {...messages.text}/>,
48
- content: <WithNoImage height="216px" width={"224px"}/>,
48
+ content: <WithNoImage height="124px" width={"224px"}/>,
49
49
  value: 'text',
50
50
  // onClick: () => {
51
51
  // this.emailUploader.current.click();
@@ -32,7 +32,8 @@
32
32
  padding: $CAP_SPACE_16 $CAP_SPACE_12;
33
33
 
34
34
  .ant-card-meta-description {
35
- height: 222px;
35
+ height: 250px;
36
+ word-wrap: break-word;
36
37
  }
37
38
  }
38
39
 
@@ -40,9 +41,6 @@
40
41
  .ant-card-body {
41
42
  padding: $CAP_SPACE_24 0;
42
43
  }
43
- .ant-card-meta-description {
44
- height: 250px;
45
- }
46
44
  .ant-card-meta {
47
45
  padding: 0;
48
46
  }
@@ -1418,11 +1418,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1418
1418
  }
1419
1419
  }
1420
1420
  if (this.isEnabledInLibraryModule("callSelectFromProps")) {
1421
- let data =id;
1422
- if(this.props.fbAdManager){
1423
- data = this.selectTemplate(id)
1424
- }
1425
- this.props.onSelectTemplate(data, this.props.fbAdManager);
1421
+ this.props.onSelectTemplate(this.selectTemplate(id), this.props.fbAdManager);
1426
1422
  } else {
1427
1423
  timeTracker.startTimer(CHANNEL_EDIT_TRACK_MAPPING[this.state.channel.toLowerCase()]);
1428
1424
  if (this.state.channel.toLowerCase() === 'ebill') {
@@ -1437,6 +1433,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1437
1433
 
1438
1434
  selectTemplate = (id) => find(this.props.TemplatesList, {_id: id})
1439
1435
 
1436
+
1440
1437
  handlePreviewClick(template, modeType) {
1441
1438
  this.togglePreview();
1442
1439
  const templateInfo = cloneDeep(template);
@@ -158,11 +158,7 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
158
158
  );
159
159
 
160
160
  getFacebookComponent = () => {
161
- const { messageDetails, cap, onFacebookSubmit,
162
- messageStrategy,
163
- showDisabledFBInfo,
164
- orgUnitId,
165
- onSelectTemplate } = this.props;
161
+ const { messageDetails, cap, onFacebookSubmit, messageStrategy, showDisabledFBInfo, orgUnitId } = this.props;
166
162
  return (
167
163
  <Facebook
168
164
  {...this.props}
@@ -172,7 +168,6 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
172
168
  messageStrategy={messageStrategy}
173
169
  showDisabledFBInfo={showDisabledFBInfo}
174
170
  orgUnitId={orgUnitId}
175
- onSelectTemplate={onSelectTemplate}
176
171
  />
177
172
  );
178
173
  }
@@ -225,7 +220,7 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
225
220
  router={this.props.router}
226
221
  isFullMode={this.props.isFullMode}
227
222
  createNew={this.props.createNew}
228
- onSelectTemplate={(id) => this.props.onSelectTemplate(this.selectTemplate(id))}
223
+ onSelectTemplate={this.props.onSelectTemplate}
229
224
  renderNewCardGrid={this.getTemplateDataForGrid}
230
225
  handlePeviewTemplate={this.props.handlePeviewTemplate}
231
226
  messageStrategy={this.props.messageStrategy}
@@ -666,16 +666,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
666
666
  type: "radioGroup",
667
667
  metaType: "text",
668
668
  datatype: "string",
669
- options: [
670
- {
671
- value: URL,
672
- label: intl.formatMessage(messages.redirectOptionURL)
673
- },
674
- {
675
- value: MINI_PROGRAM,
676
- label: intl.formatMessage(messages.redirectOptionMiniProgram)
677
- }
678
- ],
669
+ options: [intl.formatMessage(messages.redirectOptionURL), intl.formatMessage(messages.redirectOptionMiniProgram)],
679
670
  errorMessage: intl.formatMessage(messages.redirectionOptionError),
680
671
  required: true,
681
672
  fluid: true,
@@ -773,8 +764,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
773
764
  if (!isEmpty(weCrmAccounts)) {
774
765
  forEach(weCrmAccounts, (account) => {
775
766
  if (account.configs && account.configs.is_wecrm_enabled) {
776
- const options = schema?.standalone?.sections[0]?.childSections[1]?.childSections[0]?.childSections[0]?.inputFields[0]?.options;
777
- options && options.push({
767
+ schema.standalone.sections[0].childSections[1].childSections[0].childSections[0].inputFields[0].options.push({
778
768
  key: account.uuid,
779
769
  label: account.name,
780
770
  value: account.name,