@capillarytech/creatives-library 7.12.120 → 7.13.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/package.json +1 -2
  2. package/routes.js +0 -1
  3. package/services/api.js +1 -6
  4. package/v2Components/FormBuilder/index.js +13 -18
  5. package/v2Components/NewCallTask/index.js +1 -3
  6. package/v2Components/TemplatePreview/index.js +2 -1
  7. package/v2Containers/CallTask/index.js +2 -4
  8. package/v2Containers/Cap/actions.js +1 -0
  9. package/v2Containers/CreativesContainer/SlideBoxContent.js +4 -0
  10. package/v2Containers/CreativesContainer/actions.js +1 -1
  11. package/v2Containers/CreativesContainer/index.js +2 -6
  12. package/v2Containers/CreativesContainer/tests/index.test.js +0 -4
  13. package/v2Containers/Email/index.js +1 -4
  14. package/v2Containers/Facebook/Advertisement/index.js +4 -4
  15. package/v2Containers/Line/Container/Image/index.js +4 -5
  16. package/v2Containers/Line/Container/ImageCarousel/index.js +5 -6
  17. package/v2Containers/Line/Container/ImageMap/index.js +1 -2
  18. package/v2Containers/MobilePush/Create/index.js +8 -5
  19. package/v2Containers/MobilePush/Edit/index.js +4 -4
  20. package/v2Containers/MobilePush/initialSchema.js +0 -4
  21. package/v2Containers/MobilepushWrapper/index.js +1 -0
  22. package/v2Containers/Rcs/index.js +1 -2
  23. package/v2Containers/Templates/actions.js +0 -6
  24. package/v2Containers/Templates/constants.js +0 -4
  25. package/v2Containers/Templates/sagas.js +0 -25
  26. package/v2Containers/TemplatesV2/index.js +1 -5
  27. package/v2Containers/Viber/index.js +2 -11
  28. package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +1 -3
  29. package/v2Containers/Whatsapp/index.js +2 -4
  30. package/utils/cdnTransformation.js +0 -419
  31. package/utils/tests/__snapshots__/cdnTransformation.test.js.snap +0 -298
  32. package/utils/tests/cdnTransformation.mockdata.js +0 -301
  33. package/utils/tests/cdnTransformation.test.js +0 -305
  34. package/v2Components/FormBuilder/tests/index.test.js +0 -41
  35. package/v2Components/FormBuilder/tests/mockData.js +0 -120
  36. package/v2Components/NewCallTask/tests/index.test.js +0 -36
  37. package/v2Components/NewCallTask/tests/mockData.js +0 -20
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.12.120",
4
+ "version": "7.13.05",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -24,7 +24,6 @@
24
24
  "jest-date-mock": "^1.0.8",
25
25
  "jquery": "^3.3.1",
26
26
  "load-script": "^1.0.0",
27
- "node-html-parser": "^5.4.2-0",
28
27
  "normalizr": "^3.2.3",
29
28
  "papaparse": "^5.3.1",
30
29
  "pre-push": "^0.1.2",
package/routes.js CHANGED
@@ -13,7 +13,6 @@ import * as emailSagas from 'containers/Email/sagas';
13
13
  import * as templateSagas from 'containers/Templates/sagas';
14
14
  import * as lineSagas from 'containers/Line/Create/sagas';
15
15
  import * as languageSaga from './v2Containers/LanguageProvider/sagas';
16
-
17
16
  import pathConfig from './config/path';
18
17
 
19
18
  import {updateCharCount} from './utils/smsCharCountV2';
package/services/api.js CHANGED
@@ -484,9 +484,4 @@ export const createWhatsappTemplate = ({ payload }) => {
484
484
  export const getSenderDetails = (channel, orgUnitId) => {
485
485
  const url = `${CAMPAIGNS_API_ORG_ENDPOINT}/meta/domainProperties?channel=${channel}`;
486
486
  return request(url, getAPICallObject('GET', null, false, true, orgUnitId));
487
- };
488
-
489
- export const getCdnTransformationConfig = () => {
490
- const url = `${API_ENDPOINT}/common/getCdnTransformationConfig`;
491
- return request(url, getAPICallObject('GET'));
492
- }
487
+ };
@@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
11
11
  import React from 'react';
12
12
  import _ from 'lodash';
13
13
  import { Tabs, Table, Modal} from 'antd';
14
- import { CapSpin, CapDrawer, CapButton, CapInput, CapPopover, CapImage, CapCheckbox, CapRadio, CapSelect, CapTable, CapRow, CapColumn, CapNotification, CapUploader, CapHeading, CapIcon, CapTooltip} from '@capillarytech/cap-ui-library';
14
+ import { CapSpin, CapDrawer, CapButton, CapInput, CapPopover, CapImage, CapCheckbox, CapRadio, CapSelect, CapTable, CapRow, CapColumn, CapNotification, CapUploader, CapHeading, CapIcon} from '@capillarytech/cap-ui-library';
15
15
  import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
16
16
  import LabelHOC from '@capillarytech/cap-ui-library/assets/HOCs/ComponentWithLabelHOC';
17
17
  import { CAP_SPACE_12, CAP_SPACE_08, FONT_COLOR_05, FONT_COLOR_04 } from '@capillarytech/cap-ui-library/styled/variables';
@@ -2800,28 +2800,22 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2800
2800
  break;
2801
2801
  case "checkbox":
2802
2802
  ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
2803
- const { disabled , hoverText } = val || {};
2804
2803
  if (styling === 'semantic') {
2805
2804
  columns.push(
2806
2805
  <CapColumn key="input" span={val.width} offset={val.offset}>
2807
- <CapTooltip
2808
- title={ disabled && hoverText ? hoverText : '' }
2809
- placement="topLeft"
2806
+ <CapCheckbox
2807
+ key={val.id}
2808
+ className={`${ifError ? 'error' : ''}`}
2809
+ errorMessage={val.errorMessage && ifError ? val.errorMessage : ''}
2810
+ onChange={(e) => this.updateFormData(e.target.checked, val, val.submitAction)}
2811
+ checked={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
2812
+ defaultChecked={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
2813
+ style={val.style ? val.style : {}}
2814
+ disabled={val.disabled}
2815
+ inductiveText={val.inductiveText}
2810
2816
  >
2811
- <CapCheckbox
2812
- key={val.id}
2813
- className={`${ifError ? 'error' : ''}`}
2814
- errorMessage={val.errorMessage && ifError ? val.errorMessage : ''}
2815
- onChange={(e) => this.updateFormData(e.target.checked, val, val.submitAction)}
2816
- checked={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
2817
- defaultChecked={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
2818
- style={val.style ? val.style : {}}
2819
- disabled={val.disabled}
2820
- inductiveText={val.inductiveText}
2821
- >
2822
2817
  {val.label}
2823
- </CapCheckbox>
2824
- </CapTooltip>
2818
+ </CapCheckbox>
2825
2819
  </CapColumn>
2826
2820
  );
2827
2821
  }
@@ -3092,6 +3086,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
3092
3086
  onTestContentClicked={this.props.onTestContentClicked}
3093
3087
  templateDataRaw={this.props.templateData}
3094
3088
  module={this.props.location.query.module}
3089
+ hideTestAndPreviewBtnJourney={this.props.hideTestAndPreviewBtnJourney}
3095
3090
  >
3096
3091
  </TemplatePreview>
3097
3092
  </CapColumn>
@@ -99,7 +99,7 @@ class NewCallTask extends React.Component { // eslint-disable-line react/prefer-
99
99
  };
100
100
 
101
101
  render() {
102
- const { intl, isLoading, metaEntities, selectedOfferDetails , injectedTags} = this.props;
102
+ const { intl, isLoading, metaEntities, selectedOfferDetails } = this.props;
103
103
  const { formatMessage } = intl;
104
104
  const { subject, messageBody, description, callTaskActionType } = this.state;
105
105
  const tags = metaEntities && metaEntities.tags ? metaEntities.tags.standard : [];
@@ -125,7 +125,6 @@ class NewCallTask extends React.Component { // eslint-disable-line react/prefer-
125
125
  tags={tags}
126
126
  onTagSelect={this.onTagSelect}
127
127
  selectedOfferDetails={selectedOfferDetails}
128
- injectedTags={injectedTags}
129
128
  />
130
129
  <CapInput.TextArea
131
130
  setInputRef={this.setInputRef}
@@ -178,7 +177,6 @@ NewCallTask.propTypes = {
178
177
  selectedOfferDetails: PropTypes.array,
179
178
  messageDetails: PropTypes.object,
180
179
  mode: PropTypes.string,
181
- injectedTags: PropTypes.object,
182
180
  };
183
181
 
184
182
  export default injectIntl(NewCallTask);
@@ -160,6 +160,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
160
160
  intl,
161
161
  templateData,
162
162
  rcsIosPreview,
163
+ hideTestAndPreviewBtnJourney
163
164
  } = this.props;
164
165
  const { formatMessage } = intl;
165
166
  const { buttonText, imageURL, rcsPreviewContent, messageContent: viberMessageContent } = content || {};
@@ -193,7 +194,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
193
194
  const disablePreviewAndTest = this.props.channel === 'MOBILEPUSH' ? !this.props.content.header : (this.props.channel === 'SMS' ? !this.props.content : false);
194
195
  const showTestAndPreview = showTestAndPreviewIcon &&
195
196
  channel !== WECHAT &&
196
- ['outbound', 'library'].includes(module);
197
+ ['outbound', 'library'].includes(module) && !hideTestAndPreviewBtnJourney;
197
198
 
198
199
  const renderLineMultiText = (content) => {
199
200
  let textCount = 0;
@@ -16,7 +16,7 @@ import {
16
16
  } from '@capillarytech/cap-ui-library';
17
17
  import { injectIntl, intlShape } from 'react-intl';
18
18
  import { createStructuredSelector } from 'reselect';
19
- import { makeSelectMetaEntities, isLoadingMetaEntities, setInjectedTags } from '../Cap/selectors';
19
+ import { makeSelectMetaEntities, isLoadingMetaEntities } from '../Cap/selectors';
20
20
  import * as globalActions from '../Cap/actions';
21
21
  import * as actions from "./actions";
22
22
  import makeSelectCallTask from './selectors';
@@ -71,7 +71,7 @@ export class CallTask extends React.Component { // eslint-disable-line react/pre
71
71
  };
72
72
  }
73
73
  render() {
74
- const { intl, onCallTaskSubmit, templateData, loadingMetaEntities, metaEntities, selectedOfferDetails, messageDetails, injectedTags } = this.props;
74
+ const { intl, onCallTaskSubmit, templateData, loadingMetaEntities, metaEntities, selectedOfferDetails, messageDetails } = this.props;
75
75
  const { formatMessage } = intl;
76
76
  const { mode } = this.state;
77
77
  return (
@@ -85,7 +85,6 @@ export class CallTask extends React.Component { // eslint-disable-line react/pre
85
85
  onCallTaskSubmit={onCallTaskSubmit}
86
86
  selectedOfferDetails={selectedOfferDetails}
87
87
  messageDetails={messageDetails}
88
- injectedTags={injectedTags || {}}
89
88
  />
90
89
  :
91
90
  <div>
@@ -145,7 +144,6 @@ const mapStateToProps = createStructuredSelector({
145
144
  CallTask: makeSelectCallTask(),
146
145
  metaEntities: makeSelectMetaEntities(),
147
146
  loadingMetaEntities: isLoadingMetaEntities(),
148
- injectedTags: setInjectedTags(),
149
147
  });
150
148
 
151
149
  function mapDispatchToProps(dispatch) {
@@ -73,3 +73,4 @@ export function clearTopbarMenuData() {
73
73
  type: types.CLEAR_TOPBAR_MENU_DATA,
74
74
  };
75
75
  }
76
+
@@ -147,6 +147,7 @@ export function SlideBoxContent(props) {
147
147
  orgUnitId,
148
148
  smsRegister,
149
149
  enableNewChannels,
150
+ hideTestAndPreviewBtnJourney
150
151
  } = props;
151
152
  const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
152
153
  const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
@@ -407,6 +408,7 @@ export function SlideBoxContent(props) {
407
408
  orgUnitId={orgUnitId}
408
409
  smsRegister={smsRegister}
409
410
  enableNewChannels={enableNewChannels}
411
+ hideTestAndPreviewBtnJourney={hideTestAndPreviewBtnJourney}
410
412
  />
411
413
  )}
412
414
  {isPreview && (
@@ -602,6 +604,7 @@ export function SlideBoxContent(props) {
602
604
  onPreviewContentClicked={onPreviewContentClicked}
603
605
  onTestContentClicked={onTestContentClicked}
604
606
  type={type}
607
+ hideTestAndPreviewBtnJourney={hideTestAndPreviewBtnJourney}
605
608
  />
606
609
  }
607
610
  {isCreateMPush &&
@@ -628,6 +631,7 @@ export function SlideBoxContent(props) {
628
631
  onValidationFail={onValidationFail}
629
632
  selectedOfferDetails={selectedOfferDetails}
630
633
  onPreviewContentClicked={onPreviewContentClicked}
634
+ hideTestAndPreviewBtnJourney={hideTestAndPreviewBtnJourney}
631
635
  onTestContentClicked={onTestContentClicked}/>
632
636
  }
633
637
  {
@@ -24,4 +24,4 @@ export function hideCreativesContanerLoader() {
24
24
  return {
25
25
  type: HIDE_CONTAINER_LOADER,
26
26
  };
27
- }
27
+ }
@@ -33,7 +33,6 @@ import { CREATIVE } from '../Facebook/constants';
33
33
  import { LOYALTY } from '../App/constants';
34
34
  import { WHATSAPP_STATUSES } from '../Whatsapp/constants';
35
35
 
36
- import { updateImagesInHtml } from '../../utils/cdnTransformation';
37
36
 
38
37
  const classPrefix = 'add-creatives-section';
39
38
  const CREATIVES_CONTAINER = 'creativesContainer';
@@ -77,9 +76,6 @@ export class Creatives extends React.Component {
77
76
 
78
77
  componentDidMount() {
79
78
  GA.timeTracker.startTimer(CREATIVES_CONTAINER);
80
- if(!this.props?.isFullMode){
81
- this.props?.templateActions.getCdnTransformationConfig();
82
- }
83
79
  }
84
80
 
85
81
  onEnterTemplateName = () => {
@@ -499,8 +495,7 @@ export class Creatives extends React.Component {
499
495
  if (!html_content) {
500
496
  emailBase = templateRecords.base;
501
497
  }
502
- const newHtmlContent = updateImagesInHtml(html_content);
503
- templateData = {...templateData, ...emailBase, emailBody: newHtmlContent, emailSubject: (emailBase && emailBase.subject) ? emailBase.subject : ''};
498
+ templateData = {...templateData, ...emailBase, emailBody: html_content, emailSubject: (emailBase && emailBase.subject) ? emailBase.subject : ''};
504
499
  delete templateData.html_content;
505
500
  delete templateData.subject;
506
501
  }
@@ -1107,6 +1102,7 @@ export class Creatives extends React.Component {
1107
1102
  messageStrategy={this.props.strategy}
1108
1103
  orgUnitId={this.props.orgUnitId}
1109
1104
  enableNewChannels={enableNewChannels}
1105
+ hideTestAndPreviewBtnJourney={this.props.hideTestAndPreviewBtnJourney}
1110
1106
  />
1111
1107
  }
1112
1108
  footer={this.shouldShowFooter() &&
@@ -26,7 +26,6 @@ jest.mock('../../../v2Components/FormBuilder', () => ({
26
26
  describe('Test SlideBoxContent container', () => {
27
27
  const handleCloseCreatives = jest.fn();
28
28
  const getCreativesData = jest.fn();
29
- const getCdnTransformationConfig = jest.fn();
30
29
  let renderedComponent;
31
30
 
32
31
  beforeEach(() => {
@@ -42,9 +41,6 @@ describe('Test SlideBoxContent container', () => {
42
41
  templateData={templateData}
43
42
  handleCloseCreatives={handleCloseCreatives}
44
43
  getCreativesData={getCreativesData}
45
- templateActions={{
46
- getCdnTransformationConfig
47
- }}
48
44
  />,
49
45
  );
50
46
  };
@@ -35,8 +35,6 @@ import { TRACK_CREATE_EMAIL, TRACK_EDIT_EMAIL, BEE_PLUGIN, CREATE, EDIT } from '
35
35
  import { FONT_COLOR_05 } from '@capillarytech/cap-ui-library/styled/variables';
36
36
  import { gtmPush } from '../../utils/gtmTrackers';
37
37
  const {CapCustomCardList} = CapCustomCard;
38
- import {transformEmailTemplates} from '../../utils/cdnTransformation';
39
-
40
38
  export class Email extends React.Component { // eslint-disable-line react/prefer-stateless-function
41
39
  constructor(props) {
42
40
  super(props);
@@ -2440,8 +2438,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2440
2438
 
2441
2439
  // if (saveCount === 0) {
2442
2440
 
2443
- const newEmail = transformEmailTemplates(obj);
2444
- this.props.actions.createTemplate(newEmail, this.onUpdateTemplateComplete);
2441
+ this.props.actions.createTemplate(obj, this.onUpdateTemplateComplete);
2445
2442
  // } else {
2446
2443
  // this.setState({saveObj: obj, targetSaveCount: saveCount, mode: "save", saveEdmDataMode: 'save'}, () => {
2447
2444
  // _.forEach(data.selectedLanguages, (language, langIndex) => {
@@ -7,7 +7,7 @@ import isEmpty from 'lodash/isEmpty';
7
7
  import { connect } from "react-redux";
8
8
  import { createStructuredSelector } from "reselect";
9
9
  import { selectCurrentOrgDetails } from "../../Cap/selectors";
10
- import { getCdnUrl } from '../../../utils/cdnTransformation';
10
+
11
11
  import {
12
12
  CapInput,
13
13
  CapRadioCard,
@@ -197,7 +197,7 @@ export const Advertisement = (props) => {
197
197
  };
198
198
  if (obj.subType === IMAGE) {
199
199
  data.imageData = {
200
- imageSrc: getCdnUrl({url: obj.imgSrc, channelName: 'FACEBOOK', channelSubType: 'IMAGE'}),
200
+ imageSrc: obj.imgSrc,
201
201
  };
202
202
  }
203
203
  if (obj.subType === VIDEO) {
@@ -336,7 +336,7 @@ export const Advertisement = (props) => {
336
336
  };
337
337
  }
338
338
  if (obj.subType === IMAGE) {
339
- data.imgSrc = getCdnUrl({url: obj.imageData.imageSrc, channelName: 'FACEBOOK', channelSubType: 'IMAGE'});
339
+ data.imgSrc = obj.imageData.imageSrc;
340
340
  } else {
341
341
  const {
342
342
  videoSrc,
@@ -1033,4 +1033,4 @@ const mapStateToProps = (state, props) =>
1033
1033
  : selectCurrentOrgDetails(),
1034
1034
  });
1035
1035
 
1036
- export default connect(mapStateToProps, null)(injectIntl(Advertisement));
1036
+ export default connect(mapStateToProps, null)(injectIntl(Advertisement));
@@ -15,7 +15,6 @@ import Gallery from '../../../Assets/Gallery';
15
15
  import style from './style';
16
16
  import { CAP_G06, CAP_G09 } from '@capillarytech/cap-ui-library/styled/variables';
17
17
  import withStyles from '../../../../hoc/withStyles';
18
- import { getCdnUrl } from '../../../../utils/cdnTransformation';
19
18
 
20
19
  import messages from './messages';
21
20
  import {
@@ -74,7 +73,7 @@ export const LineImage = ({
74
73
  if (imageSrc && (isFullMode ? messageTitle: true) && imagePreview) {
75
74
  updateMessageState({
76
75
  isError: !imageSrc || !(isFullMode ? messageTitle : true) || isImageError || errorMessageTitle,
77
- originalContentUrl: getCdnUrl({url: imageSrc, channelName: 'LINE', channelSubType: 'IMAGE'}),
76
+ originalContentUrl: imageSrc,
78
77
  previewImageUrl: imagePreview,
79
78
  messageTitle,
80
79
  index,
@@ -113,7 +112,7 @@ export const LineImage = ({
113
112
 
114
113
  updateMessageState({
115
114
  isError: !imgSrc || !(isFullMode ? messageTitle : true) || errorMessageTitle,
116
- originalContentUrl: getCdnUrl({url: imgSrc, channelName: 'LINE', channelSubType: 'IMAGE'}),
115
+ originalContentUrl: imgSrc,
117
116
  previewImageUrl: imgPreview,
118
117
  messageTitle,
119
118
  index,
@@ -156,7 +155,7 @@ export const LineImage = ({
156
155
  }
157
156
  updateMessageState({
158
157
  isError: !imageSrc || !(isFullMode ? value : true) || isImageError || !value,
159
- originalContentUrl: getCdnUrl({url: imageSrc, channelName: 'LINE', channelSubType: 'IMAGE'}),
158
+ originalContentUrl: imageSrc,
160
159
  previewImageUrl: imagePreview,
161
160
  messageTitle: value,
162
161
  index,
@@ -413,7 +412,7 @@ export const LineImage = ({
413
412
  updateImagePreview(imagePreview);
414
413
  updateMessageState({
415
414
  isError: !image || !(isFullMode ? messageTitle : true) || isImageError || errorMessageTitle,
416
- originalContentUrl: getCdnUrl({url: image, channelName: 'LINE', channelSubType: 'IMAGE'}),
415
+ originalContentUrl: image,
417
416
  previewImageUrl: imagePreview,
418
417
  messageTitle,
419
418
  index,
@@ -15,7 +15,6 @@ import LineDrawer from '../Drawer';
15
15
  import style from './style';
16
16
  import { CAP_G06, FONT_COLOR_01, FONT_COLOR_02, CAP_SPACE_08, CAP_WHITE, CAP_SPACE_24, CAP_SPACE_04 } from '@capillarytech/cap-ui-library/styled/variables';
17
17
  import withStyles from '../../../../hoc/withStyles';
18
- import { getCdnUrl } from '../../../../utils/cdnTransformation';
19
18
 
20
19
  import LineImageCarouselContent from './Content';
21
20
 
@@ -104,7 +103,7 @@ export const LineImageCarousel = (props) => {
104
103
  } = content || {};
105
104
  validCarouselImages.push({
106
105
  activeIndex: index,
107
- originalContentUrl: getCdnUrl({url: url, channelName: 'LINE', channelSubType: 'CARD'}),
106
+ originalContentUrl: url,
108
107
  aspectRatio,
109
108
  selectedActionType: buttonType ? (buttonType === MESSAGE_ACTION_TYPE ? TEXT_ACTION_TYPE : URL_ACTION_TYPE) : '',
110
109
  actionContent: text || uri,
@@ -128,7 +127,7 @@ export const LineImageCarousel = (props) => {
128
127
 
129
128
  validCarouselImages.push({
130
129
  activeIndex: index,
131
- originalContentUrl: getCdnUrl({url: imageUrl, channelName: 'LINE', channelSubType: 'CARD'}),
130
+ originalContentUrl: imageUrl,
132
131
  selectedActionType: type ? (type === MESSAGE_ACTION_TYPE ? TEXT_ACTION_TYPE : URL_ACTION_TYPE) : '',
133
132
  actionContent: text || uri,
134
133
  actionLabel: label,
@@ -161,7 +160,7 @@ export const LineImageCarousel = (props) => {
161
160
  ? isErrorIndex
162
161
  : ((!originalContentUrl || !selectedActionType || actionContentErrorMessage || actionLabelErrorMessage || !actionContent) && activeIndex);
163
162
  columns.push({
164
- imageUrl: getCdnUrl({url: originalContentUrl, channelName: 'LINE', channelSubType: 'CARD'}),
163
+ imageUrl: originalContentUrl,
165
164
  aspectRatio,
166
165
  action: {
167
166
  type: selectedActionType ? (selectedActionType === TEXT_ACTION_TYPE ? MESSAGE_ACTION_TYPE : URL_ACTION_TYPE) : '',
@@ -456,7 +455,7 @@ export const LineImageCarousel = (props) => {
456
455
  } = content || {};
457
456
  validCarouselImages.push({
458
457
  activeIndex: index,
459
- originalContentUrl: getCdnUrl({url: url, channelName: 'LINE', channelSubType: 'CARD'}),
458
+ originalContentUrl: url,
460
459
  aspectRatio,
461
460
  selectedActionType: buttonType ? (buttonType === MESSAGE_ACTION_TYPE ? TEXT_ACTION_TYPE : URL_ACTION_TYPE) : '',
462
461
  actionContent: text || uri,
@@ -481,7 +480,7 @@ export const LineImageCarousel = (props) => {
481
480
 
482
481
  validCarouselImages.push({
483
482
  activeIndex: index,
484
- originalContentUrl: getCdnUrl({url: imageUrl, channelName: 'LINE', channelSubType: 'CARD'}),
483
+ originalContentUrl: imageUrl,
485
484
  selectedActionType: type ? (type === MESSAGE_ACTION_TYPE ? TEXT_ACTION_TYPE : URL_ACTION_TYPE) : '',
486
485
  actionContent: text || uri,
487
486
  actionLabel: label,
@@ -39,7 +39,6 @@ import {
39
39
  } from '../constants';
40
40
 
41
41
  const { CapIconAvatar } = CapIcon;
42
- import { getCdnUrl } from '../../../../utils/cdnTransformation';
43
42
 
44
43
  export const LineImageMap = ({
45
44
  className,
@@ -115,7 +114,7 @@ export const LineImageMap = ({
115
114
  if (imageSrc && (isFullMode ? messageTitle: true) && imageMapTemplate && actionLinks) {
116
115
  updateMessageState({
117
116
  isError: !imageSrc || !(isFullMode ? messageTitle : true) || !imageMapTemplate || (isImageError && errorMessageTitle) || errorTitle || !altText,
118
- baseUrl: getCdnUrl({url: imageSrc, channelName: 'LINE', channelSubType: 'RICH_MESSAGE'}),
117
+ baseUrl: imageSrc,
119
118
  messageTitle,
120
119
  index,
121
120
  type: IMAGE_MAP,
@@ -31,7 +31,6 @@ import { GA } from '@capillarytech/cap-ui-utils';
31
31
  import { CREATE, TRACK_CREATE_MPUSH } from '../../App/constants';
32
32
  import { MOBILE_PUSH } from '../../CreativesContainer/constants';
33
33
  import { getContent } from '../commonMethods';
34
- import { getCdnUrl } from '../../../utils/cdnTransformation'
35
34
 
36
35
  const PrefixWrapper = styled.div`
37
36
  margin-right: 16px;
@@ -465,7 +464,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
465
464
  const secondaryCta2 = !!android['cta-deeplink-secondary-cta-1-select'] || !!android['secondary-cta-1-label'];
466
465
  const imageLink = android.image;
467
466
  if (imageLink) {
468
- obj.versions.base.ANDROID.expandableDetails.image = getCdnUrl({url: imageLink, channelName: 'MOBILE_PUSH'});
467
+ obj.versions.base.ANDROID.expandableDetails.image = imageLink;
469
468
  obj.versions.base.ANDROID.expandableDetails.style = "BIG_PICTURE";
470
469
  }
471
470
  if (secondaryCta1 || secondaryCta2 ) {
@@ -539,7 +538,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
539
538
  const imageLinkIos = ios.image;
540
539
  const secondaryCtaIos = !!ios['cta-deeplink-secondary-cta-1-select'] || !!ios['secondary-cta-1-label'];
541
540
  if (imageLinkIos) {
542
- obj.versions.base.IOS.expandableDetails.image = getCdnUrl({url: imageLinkIos, channelName: 'MOBILE_PUSH'});
541
+ obj.versions.base.IOS.expandableDetails.image = imageLinkIos;
543
542
  obj.versions.base.IOS.expandableDetails.style = "BIG_PICTURE";
544
543
  }
545
544
  if (secondaryCtaIos) {
@@ -1321,7 +1320,10 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
1321
1320
  duration: 2,
1322
1321
  });
1323
1322
  } else {
1324
- this.props.actions.uploadAsset(data.file, data.type, data.fileParams);
1323
+ const name = data.file.name.split('.');
1324
+ const blob = data.file.slice(0, -1, 'image');
1325
+ const newFile = new File([blob], `${name[0]}${Date.now()}.${name[1]}`, {type: 'image'});
1326
+ this.props.actions.uploadAsset(newFile, data.type, data.fileParams);
1325
1327
  }
1326
1328
  };
1327
1329
  selectCtaIos = (selectedConfig) => {
@@ -1737,6 +1739,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
1737
1739
  onPreviewContentClicked={this.props.onPreviewContentClicked}
1738
1740
  onTestContentClicked={this.props.onTestContentClicked}
1739
1741
  templateData={this.props.templateData}
1742
+ hideTestAndPreviewBtnJourney={this.props.hideTestAndPreviewBtnJourney}
1740
1743
  />
1741
1744
  </CapColumn>
1742
1745
  {this.props.iosCtasData && this.state.showIosCtaTable &&
@@ -1850,4 +1853,4 @@ export default withCreatives({
1850
1853
  mapStateToProps,
1851
1854
  mapDispatchToProps,
1852
1855
  userAuth: false,
1853
- });
1856
+ });
@@ -33,7 +33,6 @@ import {getPrimaryCtaFields, getSecondaryCtaFields, getLinkTypeFields, getConten
33
33
  import { GA } from '@capillarytech/cap-ui-utils';
34
34
  import { EDIT, TRACK_EDIT_MPUSH } from '../../App/constants';
35
35
  import { MOBILE_PUSH } from '../../CreativesContainer/constants';
36
- import { getCdnUrl } from '../../../utils/cdnTransformation';
37
36
 
38
37
  const PrefixWrapper = styled.div`
39
38
  margin-right: 16px;
@@ -422,7 +421,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
422
421
  }
423
422
  const imageLink = android.image;
424
423
  if (imageLink) {
425
- obj.versions.base.ANDROID.expandableDetails.image = getCdnUrl({url: imageLink, channelName: 'MOBILE_PUSH'});
424
+ obj.versions.base.ANDROID.expandableDetails.image = imageLink;
426
425
  obj.versions.base.ANDROID.expandableDetails.style = "BIG_PICTURE";
427
426
  }
428
427
  if (obj.versions.base.ANDROID && obj.versions.base.ANDROID.cta) {
@@ -493,7 +492,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
493
492
  }
494
493
  const imageLinkIos = ios.image;
495
494
  if (imageLinkIos) {
496
- obj.versions.base.IOS.expandableDetails.image = getCdnUrl({url: imageLinkIos, channelName: 'MOBILE_PUSH'});
495
+ obj.versions.base.IOS.expandableDetails.image = imageLinkIos;
497
496
  obj.versions.base.IOS.expandableDetails.style = "BIG_PICTURE";
498
497
  }
499
498
  if (obj.versions.base.IOS && obj.versions.base.IOS.cta) {
@@ -1821,6 +1820,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
1821
1820
  onPreviewContentClicked={this.props.onPreviewContentClicked}
1822
1821
  onTestContentClicked={this.props.onTestContentClicked}
1823
1822
  templateData={this.props.templateData}
1823
+ hideTestAndPreviewBtnJourney={this.props.hideTestAndPreviewBtnJourney}
1824
1824
  />}
1825
1825
  </CapColumn>
1826
1826
  {this.props.iosCtasData && this.state.showIosCtaTable &&
@@ -1941,4 +1941,4 @@ export default withCreatives({
1941
1941
  mapStateToProps,
1942
1942
  mapDispatchToProps,
1943
1943
  userAuth: false,
1944
- });
1944
+ });
@@ -782,8 +782,6 @@ export const response = {
782
782
  supportedEvents: [
783
783
  "addSecondaryCtaIos",
784
784
  ],
785
- disabled: true,
786
- hoverText: "This section is being revamped. Till then it will remain disabled.",
787
785
  },
788
786
  ],
789
787
  },
@@ -1692,8 +1690,6 @@ export const response = {
1692
1690
  supportedEvents: [
1693
1691
  "addSecondaryCtaIos",
1694
1692
  ],
1695
- disabled: true,
1696
- hoverText: "This section is being revamped. Till then it will remain disabled.",
1697
1693
  },
1698
1694
  ],
1699
1695
  },
@@ -115,6 +115,7 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
115
115
  onPreviewContentClicked={onPreviewContentClicked}
116
116
  onTestContentClicked={onTestContentClicked}
117
117
  templateData={templateData}
118
+ hideTestAndPreviewBtnJourney={this.props.hideTestAndPreviewBtnJourney}
118
119
  />
119
120
 
120
121
 
@@ -81,7 +81,6 @@ import Templates from '../Templates';
81
81
  import SmsTraiEdit from '../SmsTrai/Edit';
82
82
  import TagList from '../TagList';
83
83
  import { validateTags } from '../../utils/tagValidations';
84
- import { getCdnUrl } from '../../utils/cdnTransformation';
85
84
  const { Group: CapCheckboxGroup } = CapCheckbox;
86
85
  export const Rcs = (props) => {
87
86
  const {
@@ -901,7 +900,7 @@ export const Rcs = (props) => {
901
900
  ...(suggestions.length > 0 && { suggestions }),
902
901
  ...(!isMediaTypeNone && {
903
902
  media: {
904
- mediaUrl: getCdnUrl({url: rcsImageSrc, channelName: 'RCS'}),
903
+ mediaUrl: rcsImageSrc,
905
904
  height: MEDIUM,
906
905
  },
907
906
  }),
@@ -150,9 +150,3 @@ export function getSenderDetails(data = {}) {
150
150
  ...data,
151
151
  };
152
152
  }
153
-
154
- export function getCdnTransformationConfig() {
155
- return {
156
- type: types.GET_CDN_TRANSFORMATION_CONFIG_REQUEST,
157
- }
158
- }
@@ -68,7 +68,3 @@ export const GET_SENDER_DETAILS_SUCCESS =
68
68
  'app/v2Containers/Templates/GET_SENDER_DETAILS_SUCCESS';
69
69
  export const GET_SENDER_DETAILS_FAILURE =
70
70
  'app/v2Containers/Templates/GET_SENDER_DETAILS_FAILURE';
71
-
72
- export const GET_CDN_TRANSFORMATION_CONFIG_REQUEST = 'app/v2Containers/Templates/GET_CDN_TRANSFORMATION_CONFIG_REQUEST';
73
- export const GET_CDN_TRANSFORMATION_CONFIG_SUCCESS = 'app/v2Containers/Templates/GET_CDN_TRANSFORMATION_CONFIG_SUCCESS';
74
- export const GET_CDN_TRANSFORMATION_CONFIG_FAILURE = 'app/v2Containers/Templates/GET_CDN_TRANSFORMATION_CONFIG_FAILURE';
@@ -3,7 +3,6 @@ import { LOCATION_CHANGE } from 'react-router-redux';
3
3
  // import { schema, normalize } from 'normalizr';
4
4
  import * as Api from '../../services/api';
5
5
  import * as types from './constants';
6
- import { saveCdnConfigs, removeAllCdnLocalStorageItems } from '../../utils/cdnTransformation';
7
6
 
8
7
  // Individual exports for testing
9
8
  export function* getAllTemplates(channel, queryParams) {
@@ -86,22 +85,6 @@ export function* getOrgLevelCampaignSettings() {
86
85
  }
87
86
  }
88
87
 
89
- function* getCdnTransformationConfig() {
90
- try {
91
- const res = yield call(Api.getCdnTransformationConfig);
92
-
93
- if (res?.success && res?.status?.code === 200) {
94
- const cdnConfigs = res?.response;
95
- saveCdnConfigs(cdnConfigs);
96
- } else {
97
- removeAllCdnLocalStorageItems();
98
- }
99
- } catch (error) {
100
- console.log("some error occured during getCdnTransformationConfig call");
101
- removeAllCdnLocalStorageItems();
102
- }
103
- }
104
-
105
88
  export function* watchGetOrgLevelCampaignSettings() {
106
89
  const watcher = yield takeLatest(
107
90
  types.GET_ORG_LEVEL_CAMPAIGN_SETTINGS_REQUEST,
@@ -239,13 +222,6 @@ function* watchGetSenderDetails() {
239
222
  yield cancel(watcher);
240
223
  }
241
224
 
242
- function* watchGetCdnTransformationConfig() {
243
- yield takeLatest(
244
- types.GET_CDN_TRANSFORMATION_CONFIG_REQUEST,
245
- getCdnTransformationConfig
246
- );
247
- }
248
-
249
225
  // All sagas to be loaded
250
226
  export default [
251
227
  watchGetAllTemplates,
@@ -257,5 +233,4 @@ export default [
257
233
  watchGetTemplateDetails,
258
234
  watchGetOrgLevelCampaignSettings,
259
235
  watchGetSenderDetails,
260
- watchGetCdnTransformationConfig
261
236
  ];