@capillarytech/creatives-library 7.6.11 → 7.6.13

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 (55) hide show
  1. package/app.js +5 -0
  2. package/index.html +2 -2
  3. package/package.json +2 -2
  4. package/services/api.js +2 -0
  5. package/utils/gtmTrackers/gtmEvents/creativeDetails.js +41 -0
  6. package/utils/gtmTrackers/index.js +17 -0
  7. package/v2Components/TemplatePreview/assets/images/mobile.svg +24 -0
  8. package/v2Components/TemplatePreview/index.js +1 -0
  9. package/v2Containers/App/constants.js +11 -0
  10. package/v2Containers/Cap/index.js +23 -29
  11. package/v2Containers/CapFacebookPreview/index.js +5 -3
  12. package/v2Containers/CreativesContainer/SlideBoxContent.js +7 -7
  13. package/v2Containers/CreativesContainer/index.js +9 -9
  14. package/v2Containers/Email/index.js +14 -3
  15. package/v2Containers/EmailWrapper/index.js +10 -3
  16. package/v2Containers/Facebook/Advertisement/index.js +4 -4
  17. package/v2Containers/Facebook/Advertisement/index.scss +1 -1
  18. package/v2Containers/Facebook/index.js +6 -6
  19. package/v2Containers/Line/Container/index.js +32 -4
  20. package/v2Containers/Line/Create/_lineCreate.scss +64 -0
  21. package/v2Containers/Line/Create/actions.js +94 -0
  22. package/v2Containers/Line/Create/constants.js +43 -0
  23. package/v2Containers/Line/Create/index.js +1132 -0
  24. package/v2Containers/Line/Create/initialSchema.js +378 -0
  25. package/v2Containers/Line/Create/messages.js +229 -0
  26. package/v2Containers/Line/Create/reducer.js +99 -0
  27. package/v2Containers/Line/Create/sagas.js +113 -0
  28. package/v2Containers/Line/Create/selectors.js +30 -0
  29. package/v2Containers/Line/CreateWrapper/constants.js +2 -0
  30. package/v2Containers/Line/CreateWrapper/index.js +117 -0
  31. package/v2Containers/Line/CreateWrapper/messages.js +55 -0
  32. package/v2Containers/Line/Edit/_lineEdit.scss +23 -0
  33. package/v2Containers/Line/Edit/actions.js +79 -0
  34. package/v2Containers/Line/Edit/constants.js +27 -0
  35. package/v2Containers/Line/Edit/index.js +1051 -0
  36. package/v2Containers/Line/Edit/messages.js +173 -0
  37. package/v2Containers/Line/Edit/reducer.js +83 -0
  38. package/v2Containers/Line/Edit/sagas.js +81 -0
  39. package/v2Containers/Line/Edit/selectors.js +29 -0
  40. package/v2Containers/Line/Edit/tests/actions.test.js +18 -0
  41. package/v2Containers/Line/Edit/tests/index.test.js +10 -0
  42. package/v2Containers/Line/Edit/tests/reducer.test.js +9 -0
  43. package/v2Containers/Line/Edit/tests/sagas.test.js +15 -0
  44. package/v2Containers/Line/Edit/tests/selectors.test.js +10 -0
  45. package/v2Containers/MobilePush/Create/index.js +25 -4
  46. package/v2Containers/MobilePush/Edit/index.js +27 -5
  47. package/v2Containers/MobilePush/Edit/sagas.js +1 -1
  48. package/v2Containers/MobilePush/commonMethods.js +19 -1
  49. package/v2Containers/Sms/Create/index.js +14 -2
  50. package/v2Containers/Sms/Edit/index.js +15 -2
  51. package/v2Containers/Templates/index.js +19 -17
  52. package/v2Containers/TemplatesV2/index.js +4 -4
  53. package/v2Containers/Viber/index.js +19 -3
  54. package/v2Containers/WeChat/MapTemplates/index.js +12 -3
  55. package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +11 -2
@@ -651,6 +651,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
651
651
  pageId: content.pageId}}
652
652
  accountId={content.accountId}
653
653
  accessToken={content.accessToken}
654
+ defaultGeneratePreview
654
655
  />
655
656
  </div>
656
657
  )}
@@ -19,6 +19,8 @@ export const TRACK_CREATE_MPUSH = 'createMpush';
19
19
  export const TRACK_CREATE_WECHAT = 'createWeChat';
20
20
  export const TRACK_CREATE_IMAGE = 'createImage';
21
21
  export const TRACK_CREATE_LINE = 'createLine';
22
+ export const TRACK_CREATE_VIBER = 'createViber';
23
+ export const TRACK_CREATE_FACEBOOK = 'createFacebook';
22
24
 
23
25
  export const CREATE = 'create';
24
26
  export const EDIT = 'edit';
@@ -33,6 +35,8 @@ export const TRACK_EDIT_MPUSH = 'editMpush';
33
35
  export const TRACK_EDIT_WECHAT = 'editWeChat';
34
36
  export const TRACK_EDIT_IMAGE = 'editImage';
35
37
  export const TRACK_EDIT_LINE = 'editLine';
38
+ export const TRACK_EDIT_VIBER = 'editViber';
39
+ export const TRACK_EDIT_FACEBOOK = 'editFacebook';
36
40
 
37
41
  export const CHANNEL_CREATE_TRACK_MAPPING = {
38
42
  sms: TRACK_CREATE_SMS,
@@ -41,6 +45,8 @@ export const CHANNEL_CREATE_TRACK_MAPPING = {
41
45
  wechat: TRACK_CREATE_WECHAT,
42
46
  gallery: TRACK_CREATE_IMAGE,
43
47
  line: TRACK_CREATE_LINE,
48
+ viber: TRACK_CREATE_VIBER,
49
+ facebook: TRACK_CREATE_FACEBOOK
44
50
  };
45
51
 
46
52
  export const CHANNEL_EDIT_TRACK_MAPPING = {
@@ -50,6 +56,8 @@ export const CHANNEL_EDIT_TRACK_MAPPING = {
50
56
  wechat: TRACK_EDIT_WECHAT,
51
57
  gallery: TRACK_EDIT_IMAGE,
52
58
  line: TRACK_EDIT_LINE,
59
+ viber: TRACK_EDIT_VIBER,
60
+ facebook: TRACK_EDIT_FACEBOOK
53
61
  };
54
62
  export const GTM_TRACKING_ID = 'UA-110024621-2';
55
63
  export const BEE_PLUGIN = 'BEE_PLUGIN';
@@ -75,3 +83,6 @@ export const FB_AD_CALL_TO_ACTION = {
75
83
  SUBSCRIBE,
76
84
  WATCH_MORE,
77
85
  };
86
+
87
+
88
+ export const CREATIVES = 'creatives';
@@ -77,13 +77,11 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
77
77
  if (!userData.accessiblePermissions.includes(CREATIVES_UI_VIEW)) {
78
78
  this.setState({ isCreativesAccessible: false });
79
79
  }
80
- this.setDimensionData();
80
+ const userGtmData = this.getUserGtmData();
81
+ this.setDimensionData(userGtmData);
82
+ gtm.push({...userGtmData, event: 'userAuthenticated'});
81
83
  });
82
84
  this.props.actions.getTopbarMenuData();
83
- if (this.props.Global.user) {
84
- const userGtmData = this.getUserGtmData();
85
- gtm.push(userGtmData);
86
- }
87
85
  if (this.props.Global.orgID !== undefined) {
88
86
  gtm.push({orgId: this.props.Global.orgID});
89
87
  }
@@ -133,18 +131,6 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
133
131
  if (nextPropsUser && user && nextProps.Global.isLoggedIn && nextProps.Global.isLoggedIn !== this.props.Global.isLoggedIn) {
134
132
  this.props.appActions.getSidebar();
135
133
  }
136
-
137
- if (nextProps.Global.user && this.props.Global.user && (nextProps.Global.user.refID !== this.props.Global.user.refID)) {
138
- const userGtmData = this.getUserGtmData(nextProps);
139
- gtm.push(userGtmData);
140
- }
141
-
142
- if (nextProps.Global.isLoggedIn && nextProps.Global.isLoggedIn !== this.props.Global.isLoggedIn) {
143
- if (nextProps.Global.orgID !== undefined && !_.isEqual(nextProps.Global.orgID, this.props.Global.orgID)) {
144
- const userGtmData = this.getUserGtmData(nextProps);
145
- gtm.push(userGtmData);
146
- }
147
- }
148
134
  }
149
135
 
150
136
  componentDidUpdate(prevProps) {
@@ -182,26 +168,34 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
182
168
  logNewTab();
183
169
  }
184
170
 
185
- setDimensionData() {
186
- const userGtmData = this.getUserGtmData();
171
+ setDimensionData(userGtmData) {
187
172
  Object.values(userGtmData).forEach((value, index) => {
188
173
  GA.setCustomDimension({ [`dimension${index + 1}`]: value });
189
174
  });
190
175
  }
191
176
  getUserGtmData(props) {
192
177
  const selectedProps = props || this.props;
193
- const { user: userData } = selectedProps.Global;
178
+ const { user: userData, orgID} = selectedProps?.Global || {};
194
179
  if (userData) {
195
- const userName = userData.attributes.USERNAME;
196
- const userEmail = userData.attributes.EMAIL;
197
- const orgObj = _.find(userData.proxyOrgList, {orgID: selectedProps.Global.orgID});
180
+ const {
181
+ attributes: {
182
+ USERNAME : userName,
183
+ EMAIL : userEmail
184
+ } = {},
185
+ proxyOrgList,
186
+ isCapUser,
187
+ refID
188
+ } = userData;
189
+ const {
190
+ orgName
191
+ } = _.find(proxyOrgList, {orgID});
198
192
  const gtmData = {
199
- isCapUser: userData.isCapUser,
200
- orgId: selectedProps.Global.orgID,
201
- orgName: orgObj && orgObj.orgName,
202
- userId: userData.refID,
203
- userName: userName && userName.value,
204
- userEmail: userEmail && userEmail.value,
193
+ isCapUser: isCapUser,
194
+ orgId: orgID,
195
+ orgName,
196
+ userId: refID,
197
+ userName: userName?.value,
198
+ userEmail: userEmail?.value,
205
199
  };
206
200
  return gtmData;
207
201
  }
@@ -45,6 +45,7 @@ export const CapFacebookPreview = (props) => {
45
45
  orgUnitFacebookPageSettingsMap = {},
46
46
  accessToken,
47
47
  accountId,
48
+ defaultGeneratePreview,
48
49
  } = props;
49
50
  const {
50
51
  formatMessage,
@@ -294,11 +295,10 @@ export const CapFacebookPreview = (props) => {
294
295
  <iframe
295
296
  src={src}
296
297
  key={random}
297
- scrolling="yes"
298
298
  style={{border: "none"}}
299
299
  width={width}
300
+ scrolling="yes"
300
301
  height={height}
301
- loading="lazy"
302
302
  />
303
303
  </>);
304
304
  };
@@ -317,6 +317,9 @@ export const CapFacebookPreview = (props) => {
317
317
 
318
318
  useEffect(() => {
319
319
  facebookPreviewActions.clearPreview();
320
+ if (defaultGeneratePreview) {
321
+ generatePreview();
322
+ }
320
323
  }, []);
321
324
 
322
325
  useEffect(() => {
@@ -335,7 +338,6 @@ export const CapFacebookPreview = (props) => {
335
338
  setDisableAfterPreviewGenerate(false);
336
339
  }
337
340
  }, [previewIframeError]);
338
-
339
341
  return (
340
342
  <CapSpin spinning={isFetchingPreview}>
341
343
  <div style={{display: 'inline-block'}}>
@@ -138,8 +138,8 @@ function SlideBoxContent(props) {
138
138
  onFTPSubmit,
139
139
  campaignSettings,
140
140
  messageStrategy,
141
- fbAdManger,
142
- showDisableInfoForFacebook,
141
+ fbAdManager,
142
+ showDisabledFBInfo,
143
143
  orgUnitId,
144
144
  } = props;
145
145
  const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
@@ -339,7 +339,7 @@ function SlideBoxContent(props) {
339
339
  FTPMode="create"
340
340
  selectedOfferDetails={selectedOfferDetails}
341
341
  messageStrategy={messageStrategy}
342
- showDisableInfoForFacebook={showDisableInfoForFacebook}
342
+ showDisabledFBInfo={showDisabledFBInfo}
343
343
  orgUnitId={orgUnitId}
344
344
  />
345
345
  )}
@@ -566,7 +566,7 @@ function SlideBoxContent(props) {
566
566
  createNew
567
567
  getFormSubscriptionData={getFormData}
568
568
  messageStrategy={messageStrategy}
569
- fbAdManger={fbAdManger}
569
+ fbAdManager={fbAdManager}
570
570
  onSelectTemplate={onSelectTemplate}
571
571
  orgUnitId={orgUnitId}
572
572
  />
@@ -585,7 +585,7 @@ function SlideBoxContent(props) {
585
585
  id: templateData._id,
586
586
  }}
587
587
  getFormSubscriptionData={getFormData}
588
- fbAdManger={fbAdManger}
588
+ fbAdManager={fbAdManager}
589
589
  />
590
590
  )
591
591
  }
@@ -699,8 +699,8 @@ SlideBoxContent.propTypes = {
699
699
  selectedAccount: PropTypes.object,
700
700
  onFTPSubmit: PropTypes.func,
701
701
  messageStrategy: PropTypes.string,
702
- fbAdManger: PropTypes.string,
703
- showDisableInfoForFacebook: PropTypes.boolean,
702
+ fbAdManager: PropTypes.string,
703
+ showDisabledFBInfo: PropTypes.boolean,
704
704
  orgUnitId: PropTypes.any,
705
705
  };
706
706
  export default SlideBoxContent;
@@ -76,10 +76,10 @@ class Creatives extends React.Component {
76
76
  this.setState({templateNameExists: false});
77
77
  }
78
78
 
79
- onSelectTemplate = (template, fbAdManger) => {
79
+ onSelectTemplate = (template, fbAdManager) => {
80
80
  const data = {slidBoxContent: 'editTemplate', templateData: template};
81
- if (fbAdManger) {
82
- data.fbAdManger = fbAdManger;
81
+ if (fbAdManager) {
82
+ data.fbAdManager = fbAdManager;
83
83
  }
84
84
  this.setState(data);
85
85
  };
@@ -93,10 +93,10 @@ class Creatives extends React.Component {
93
93
  onEditTemplate = () => {
94
94
  this.setState({ slidBoxContent: 'editTemplate', showSlideBox: true });
95
95
  };
96
- onCreateNew = (fbAdManger) => {
96
+ onCreateNew = (fbAdManager) => {
97
97
  const data = { slidBoxContent: 'createTemplate', showSlideBox: true };
98
- if (fbAdManger) {
99
- data.fbAdManger = fbAdManger;
98
+ if (fbAdManager) {
99
+ data.fbAdManager = fbAdManager;
100
100
  }
101
101
  this.setState(data);
102
102
  };
@@ -438,7 +438,7 @@ class Creatives extends React.Component {
438
438
  break;
439
439
  case constants.FACEBOOK: {
440
440
  if (template.value) {
441
- const FacebookAd = template.value.versions.base.content.FacebookAd;
441
+ const FacebookAd = template?.value?.versions?.base?.content?.FacebookAd;
442
442
  const type = FacebookAd[0].type;
443
443
  const {accountId} = this.props.Templates.selectedFacebookAccount || template.value || {};
444
444
  const facebookCreativeList = [];
@@ -726,7 +726,7 @@ class Creatives extends React.Component {
726
726
  campaignSettings={this.props.Templates.campaignSettings}
727
727
  location={this.props.location}
728
728
  messageDetails={this.props.messageDetails}
729
- showDisableInfoForFacebook={this.props.showDisableInfoForFacebook}
729
+ showDisabledFBInfo={this.props.showDisabledFBInfo}
730
730
  getFormData={this.getFormData}
731
731
  onCallTaskSubmit={this.onCallTaskSubmit}
732
732
  onCreateNew={this.onCreateNew}
@@ -742,7 +742,7 @@ class Creatives extends React.Component {
742
742
  onEnterTemplateName={this.onEnterTemplateName}
743
743
  onRemoveTemplateName={this.onRemoveTemplateName}
744
744
  onResetStep={this.resetStep}
745
- fbAdManger={this.state.fbAdManger}
745
+ fbAdManager={this.state.fbAdManager}
746
746
  cap={cap}
747
747
  setIsLoadingContent={this.setIsLoadingContent}
748
748
  onMobilepushModeChange={this.onMobilepushModeChange}
@@ -31,8 +31,9 @@ import * as creativesContainerActions from '../CreativesContainer/actions';
31
31
  import withCreatives from '../../hoc/withCreatives';
32
32
  import { EMAIL } from '../CreativesContainer/constants';
33
33
  import { GA } from '@capillarytech/cap-ui-utils';
34
- import { TRACK_CREATE_EMAIL, TRACK_EDIT_EMAIL, BEE_PLUGIN } from '../App/constants';
34
+ import { TRACK_CREATE_EMAIL, TRACK_EDIT_EMAIL, BEE_PLUGIN, CREATE, EDIT } from '../App/constants';
35
35
  import { FONT_COLOR_05 } from '@capillarytech/cap-ui-library/styled/variables';
36
+ import { gtmPush } from '../../utils/gtmTrackers';
36
37
  const {CapCustomCardList} = CapCustomCard;
37
38
  export class Email extends React.Component { // eslint-disable-line react/prefer-stateless-function
38
39
  constructor(props) {
@@ -656,8 +657,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
656
657
  });
657
658
  }
658
659
  onUpdateTemplateComplete = (createResponse) => {
659
- const {isEdit, formData = {} } = this.state || {};
660
+ const {isEdit, formData = {} } = _.cloneDeep(this.state) || {};
660
661
  const base = formData.base || {};
662
+ const { activeTab } = base;
661
663
  const isDragDrop = _.get(base[base.activeTab], 'is_drag_drop');
662
664
  let editorType = '';
663
665
  if ( isDragDrop === true && this.checkBeeEditorAllowedForLibrary()) {
@@ -665,12 +667,21 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
665
667
  } else if (isDragDrop === false && !this.checkBeeEditorAllowedForLibrary()) {
666
668
  editorType = 'ckEditor';
667
669
  }
668
- GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_EMAIL : TRACK_CREATE_EMAIL, {
670
+ const timeTaken = GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_EMAIL : TRACK_CREATE_EMAIL, {
669
671
  category: 'Creatives',
670
672
  action: isEdit ? TRACK_EDIT_EMAIL : TRACK_CREATE_EMAIL,
671
673
  label: `using ${editorType}`,
672
674
  });
673
675
  if (createResponse && createResponse.templateId) {
676
+ gtmPush('creativeDetails', {
677
+ id: createResponse.templateId._id || createResponse.templateId,
678
+ name: formData['template-name'],
679
+ channel: EMAIL,
680
+ timeTaken,
681
+ content: base?.[activeTab]?.['template-content'],
682
+ mode: isEdit ? EDIT : CREATE
683
+ });
684
+
674
685
  // this.resetSchema();
675
686
  let message;
676
687
  if (isEdit) {
@@ -27,6 +27,8 @@ import Email from '../Email';
27
27
  import CmsTemplatesComponent from '../../v2Components/CmsTemplatesComponent';
28
28
  import messages from './messages';
29
29
  import { CHANNEL_CREATE_TRACK_MAPPING } from '../App/constants';
30
+ import { gtmPush } from '../../utils/gtmTrackers';
31
+ import { EMAIL } from '../CreativesContainer/constants';
30
32
 
31
33
  const CapRadioCardWithLabel = ComponentWithLabelHOC(CapRadioCard);
32
34
  const { timeTracker } = GA;
@@ -116,13 +118,18 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
116
118
  };
117
119
  CapNotification.error(message);
118
120
  }
119
- stopTimerGA=() => {
121
+ stopTimerGA = () => {
120
122
  // stop timer
121
- timeTracker.stopTimer(CHANNEL_CREATE_TRACK_MAPPING.email, {
123
+ const timeTaken = timeTracker.stopTimer(CHANNEL_CREATE_TRACK_MAPPING.email, {
122
124
  category: 'Creatives',
123
125
  action: 'Create',
124
126
  label: 'uploadZip',
125
127
  });
128
+ gtmPush('creativeDetails', {
129
+ channel: EMAIL,
130
+ timeTaken,
131
+ mode: 'uploadZip'
132
+ });
126
133
  }
127
134
  handleFileUpload = (file = {}) => {
128
135
  const { templatesActions, intl, showNextStep, isUploading } = this.props;
@@ -133,8 +140,8 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
133
140
 
134
141
  if (supportedZipFormats.indexOf(fileExtension.toLowerCase()) !== -1) {
135
142
  templatesActions.handleZipUpload(file.originFileObj, () => { //handle upload success
143
+ this.stopTimerGA();
136
144
  this.setState({ modeContent: { file } }, showNextStep);
137
- stopTimerGA();
138
145
  }, this.handleZipUploadError);
139
146
  } else if (fileExtension === 'html' || fileExtension === 'htm') {
140
147
  const reader = new FileReader();
@@ -89,7 +89,6 @@ export const Advertisement = (props) => {
89
89
  getFormSubscriptionData,
90
90
  facebookTemplateData,
91
91
  selectedMarketingObjective,
92
- fbAdManger,
93
92
  orgUnitId,
94
93
  } = props;
95
94
  const {
@@ -163,7 +162,7 @@ export const Advertisement = (props) => {
163
162
  }, [paramObj.id]);
164
163
 
165
164
  useEffect(() => {
166
- if ((params && params.id) || templateData?.edit) {
165
+ if (params?.id || templateData?.edit) {
167
166
  const { FacebookAd = [], pageOrgUnitId: editPageId} = get(templateData, `versions.base.content`) || get(fbADData, `templateDetails.versions.base.content`) || {};
168
167
  const editMessageTitle = (templateData || {}).name || get(fbADData, 'templateDetails.name');
169
168
  const editFBContent = Object.values(FacebookAd);
@@ -222,6 +221,7 @@ export const Advertisement = (props) => {
222
221
  }
223
222
  }, [fbADData[`templateDetails`] || templateData]);
224
223
 
224
+
225
225
  const CustomToolTip = useCallback((msg) => <CapTooltipWithInfo
226
226
  infoIconProps={{svgProps: {width: 12, height: 12}, style: {marginLeft: 5}}}
227
227
  title={msg}
@@ -452,6 +452,7 @@ export const Advertisement = (props) => {
452
452
  updateMessageTitle(val);
453
453
  }, [messageTitle]);
454
454
 
455
+
455
456
  const isDisableDone = useCallback((isPreview) => {
456
457
  let flag = false;
457
458
  if (primaryText === "" ) {
@@ -501,7 +502,6 @@ export const Advertisement = (props) => {
501
502
  selectedAd,
502
503
  ]
503
504
  );
504
-
505
505
  const isDisableContinue = () => isFullMode ? (messageTitle.trim() === "" || selectedAd === "") : ( selectedAd === "");
506
506
 
507
507
  const onClickContinue = useCallback(() => { updateStep('createFacebookAd'); }, [step]);
@@ -812,7 +812,7 @@ export const Advertisement = (props) => {
812
812
  }, [pageId]);
813
813
 
814
814
  const selectedFacebookAccount = templateData?.edit ? templateData?.selectedFacebookAccount : facebookTemplateData?.selectedFacebookAccount;
815
- const {orgUnitFacebookPageSettingsMap = {}, employeeAccessToken: accessToken = "", accountId = "" } = selectedFacebookAccount;
815
+ const {orgUnitFacebookPageSettingsMap = {}, employeeAccessToken: accessToken = "", accountId = "" } = selectedFacebookAccount || {};
816
816
 
817
817
  const getPageAccessOrgs = useCallback(() => {
818
818
  const {status, data } = fbADData.orgOuData || {};
@@ -30,7 +30,7 @@ $classPrefix: add-facebook-ad-section;
30
30
 
31
31
  .cap-header-facebook-ad{
32
32
  position: fixed;
33
- top: 27px;
33
+ top: 58px;
34
34
  z-index: 1000;
35
35
  .title-desc-container{
36
36
  padding-left: 10px;
@@ -194,9 +194,9 @@ const Facebook = (props) => {
194
194
  renderNewCardGrid,
195
195
  onSelectTemplate,
196
196
  createNew,
197
- fbAdManger,
197
+ fbAdManager,
198
198
  getFormSubscriptionData,
199
- showDisableInfoForFacebook,
199
+ showDisabledFBInfo,
200
200
  orgUnitId,
201
201
  } = props;
202
202
  const {
@@ -244,7 +244,7 @@ const Facebook = (props) => {
244
244
  const onMarketingObjectiveSelect = (value) => setMarketingObjective(value);
245
245
 
246
246
  const radioOptions = [{
247
- label: showDisableInfoForFacebook ? <CapTooltip title={intl.formatMessage(messages.facebookDisableinfo)}>{intl.formatMessage(messages.capFbAdManager)}</CapTooltip> : intl.formatMessage(messages.capFbAdManager), value: CREATIVE, disabled: showDisableInfoForFacebook,
247
+ label: showDisabledFBInfo ? <CapTooltip title={intl.formatMessage(messages.facebookDisableinfo)}>{intl.formatMessage(messages.capFbAdManager)}</CapTooltip> : intl.formatMessage(messages.capFbAdManager), value: CREATIVE, disabled: showDisabledFBInfo,
248
248
  }, {
249
249
  label: intl.formatMessage(messages.fbAdManager), value: AD_MANAGER,
250
250
  }];
@@ -280,10 +280,10 @@ const Facebook = (props) => {
280
280
  onSelectTemplate={onSelectTemplate}
281
281
  renderNewCardGrid={renderNewCardGrid}
282
282
  handlePeviewTemplate={handlePeviewTemplate}
283
- fbAdManger={CREATIVE}
283
+ fbAdManager={CREATIVE}
284
284
  />
285
285
  ) :
286
- (!isFullMode && fbAdManger !== CREATIVE && messageStrategy === "DEFAULT" ) ?
286
+ (!isFullMode && fbAdManager !== CREATIVE && messageStrategy === "DEFAULT" ) ?
287
287
  (<div className={className}>
288
288
 
289
289
  <div className="is-scrollable-section" >
@@ -421,7 +421,7 @@ const Facebook = (props) => {
421
421
  messageStrategy={messageStrategy}
422
422
  getFormSubscriptionData={getFormSubscriptionData}
423
423
  selectedMarketingObjective={selectedMarketingObjective}
424
- fbAdManger={fbAdManger}
424
+ fbAdManager={fbAdManager}
425
425
  orgUnitId={orgUnitId}
426
426
  />
427
427
  </div>
@@ -18,11 +18,11 @@ import CapIcon from '@capillarytech/cap-ui-library/CapIcon';
18
18
  import CapHeader from '@capillarytech/cap-ui-library/CapHeader';
19
19
  // GA
20
20
  import { GA } from '@capillarytech/cap-ui-utils';
21
- import { TRACK_CREATE_LINE, TRACK_EDIT_LINE } from '../../App/constants';
21
+ import { CREATE, EDIT, TRACK_CREATE_LINE, TRACK_EDIT_LINE } from '../../App/constants';
22
22
 
23
23
  import LineWrapper from './Wrapper';
24
24
  import messages from './messages';
25
- import { TEXT, IMAGE, IMAGE_MAP, IMAGE_CAROUSEL, MAX_LINE_WRAPPER_LIMIT, MAX_LINE_WRAPPER_LIMIT_FULL_MODE, DEFAULT_VIDEO_URI } from './constants';
25
+ import { TEXT, IMAGE, IMAGE_MAP, IMAGE_CAROUSEL, MAX_LINE_WRAPPER_LIMIT, MAX_LINE_WRAPPER_LIMIT_FULL_MODE, DEFAULT_VIDEO_URI, VIDEO, TEMPLATE } from './constants';
26
26
  import { FONT_COLOR_05 } from '@capillarytech/cap-ui-library/styled/variables';
27
27
 
28
28
  import { makeSelectMetaEntities, setInjectedTags } from '../../Cap/selectors';
@@ -32,6 +32,8 @@ import {makeSelectCreateLine, makeSelectLine } from './selectors';
32
32
  import * as compActions from './actions';
33
33
  import * as templateActionsConfig from '../../Templates/actions';
34
34
  import withCreatives from '../../../hoc/withCreatives';
35
+ import { gtmPush } from '../../../utils/gtmTrackers';
36
+ import { LINE } from '../../CreativesContainer/constants';
35
37
 
36
38
  const { stopTimer } = GA.timeTracker;
37
39
 
@@ -348,6 +350,19 @@ export const LineContainer = ({
348
350
  }
349
351
  }
350
352
 
353
+ const formatFSPayload = (lineWrapperContents) => {
354
+ const [ {
355
+ messageTitle,
356
+ messageContent: content,
357
+ type,
358
+ } = {}] = lineWrapperContents;
359
+ return {
360
+ name: messageTitle,
361
+ content,
362
+ imageAdded: [IMAGE, IMAGE_MAP, IMAGE_CAROUSEL, TEMPLATE].includes(type),
363
+ videoAdded: type === VIDEO
364
+ }
365
+ }
351
366
  const formatSubmitPayload = (lineWrapperContents) => {
352
367
  const [ {
353
368
  messageTitle,
@@ -561,11 +576,17 @@ export const LineContainer = ({
561
576
  createCallback(errorMessage);
562
577
  if (!errorMessage) {
563
578
  // stop timer for create line
564
- stopTimer(TRACK_CREATE_LINE, {
579
+ const timeTaken = stopTimer(TRACK_CREATE_LINE, {
565
580
  category: 'Creatives',
566
581
  action: TRACK_CREATE_LINE,
567
582
  label: getLineType(lineWrapperContents),
568
583
  });
584
+ gtmPush('creativeDetails', Object.assign({
585
+ id: resp.templateId,
586
+ channel: LINE,
587
+ mode: CREATE,
588
+ timeTaken,
589
+ }, formatFSPayload(lineWrapperContents)));
569
590
  onCreateComplete();
570
591
  }
571
592
  }
@@ -604,11 +625,18 @@ export const LineContainer = ({
604
625
  editCallback(errorMessage);
605
626
  if (!errorMessage) {
606
627
  // stop timer for edit line
607
- stopTimer(TRACK_EDIT_LINE, {
628
+ const timeTaken = stopTimer(TRACK_EDIT_LINE, {
608
629
  category: 'Creatives',
609
630
  action: TRACK_EDIT_LINE,
610
631
  label: getLineType(lineWrapperContents),
611
632
  });
633
+ gtmPush('creativeDetails', Object.assign({
634
+ id: resp.templateId._id,
635
+ channel: LINE,
636
+ mode: EDIT,
637
+ timeTaken,
638
+ }, formatFSPayload(lineWrapperContents)));
639
+
612
640
  onCreateComplete();
613
641
  }
614
642
  });
@@ -0,0 +1,64 @@
1
+ @import '~@capillarytech/cap-ui-library/styles/_variables.scss';
2
+
3
+ .line-row{
4
+ margin-bottom: 16px;
5
+ }
6
+ .slidebox-content-container {
7
+ overflow-x: hidden;
8
+ }
9
+ .line-image {
10
+ position: relative;
11
+ }
12
+ .image-container {
13
+ display: flex;
14
+ & > div {
15
+ min-width: 516px;
16
+ }
17
+ border-radius: 5px;
18
+ .image-placeholder{
19
+ line-height: 150px;
20
+ }
21
+ img {
22
+ object-fit: cover;
23
+ max-width: 100%;
24
+ max-height: 100%;
25
+ height: auto !important;
26
+ width: auto !important;
27
+ }
28
+ }
29
+
30
+ .pagination-container.gallery-upload {
31
+ height: calc(100vh - 60px);
32
+
33
+ .cap-custom-card-list-col {
34
+ max-width: 156px;
35
+ max-height: 156px;
36
+ display: inline-block;
37
+ margin-left: $CAP_SPACE_04;
38
+ margin-right: $CAP_SPACE_04;
39
+ }
40
+
41
+ .ant-card-body {
42
+ padding-top: 0;
43
+
44
+ .ant-card-meta-description img {
45
+ height: 80px;
46
+ width: auto;
47
+ }
48
+ }
49
+ }
50
+
51
+ .gallery-image {
52
+ height: 156px;
53
+ width: 156px;
54
+ border-radius: 4px;
55
+ margin: 3px;
56
+ }
57
+
58
+ .sms-text {
59
+ img {
60
+ display: block;
61
+ max-width: 100%;
62
+ object-fit: cover;
63
+ }
64
+ }