@capillarytech/creatives-library 8.0.72 → 8.0.73-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/config/app.js CHANGED
@@ -17,7 +17,7 @@ const config = {
17
17
  accountConfig: (strs, accountId) => `${window.location.origin}/org/config/AccountAdd?q=a&channelId=2&accountId=${accountId}&edit=1`,
18
18
  },
19
19
  development: {
20
- api_endpoint: 'http://localhost:2022/arya/api/v1/creatives',
20
+ api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/creatives',
21
21
  campaigns_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/campaigns',
22
22
  campaigns_api_org_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/org/campaign',
23
23
  auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "8.0.72",
4
+ "version": "8.0.73-alpha.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
package/services/api.js CHANGED
@@ -2,12 +2,12 @@
2
2
  * Created by vivek on 3/5/17.
3
3
  */
4
4
  import 'whatwg-fetch';
5
+ import { GA, decompressJsonObject } from '@capillarytech/cap-ui-utils';
5
6
  import { loadItem, clearItem } from './localStorageApi';
6
7
  import config from '../config/app';
7
8
  import pathConfig from '../config/path';
8
9
  import getSchema from './getSchema';
9
10
  import * as API from '../utils/ApiCaller';
10
- import { GA, decompressJsonObject } from '@capillarytech/cap-ui-utils';
11
11
  import { addBaseToTemplate } from '../utils/commonUtils';
12
12
  import { EMAIL, SMS } from '../v2Containers/CreativesContainer/constants';
13
13
  let API_ENDPOINT = config.development.api_endpoint;
@@ -403,14 +403,20 @@ export const getCmsData = (cmsType, projectId, langId) => {
403
403
  return API.get(url);
404
404
  };
405
405
 
406
- export const getEdmTemplates = () => {
406
+ export const getEdmTemplates = async () => {
407
407
  const url = `${API_ENDPOINT}/templates/email/default`;
408
- return request(url, getAPICallObject('GET'));
408
+ const compressedEdmTemplates = await request(url, getAPICallObject('GET'));
409
+ const { response = '' } = compressedEdmTemplates || {};
410
+ const decompressedEdmTemplates = decompressJsonObject(response);
411
+ return { ...compressedEdmTemplates, response: addBaseToTemplate(decompressedEdmTemplates)};
409
412
  };
410
413
 
411
- export const getDefaultBeeTemplates = () => {
414
+ export const getDefaultBeeTemplates = async () => {
412
415
  const url = `${API_ENDPOINT}/templates/v2/email/default`;
413
- return request(url, getAPICallObject('GET'));
416
+ const compressedDefaultBeeTemplates = await request(url, getAPICallObject('GET'));
417
+ const { response = '' } = compressedDefaultBeeTemplates || {};
418
+ const decompressedEdmTemplates = decompressJsonObject(response);
419
+ return { ...compressedDefaultBeeTemplates, response: addBaseToTemplate(decompressedEdmTemplates)};
414
420
  };
415
421
 
416
422
  // All about line
@@ -199,9 +199,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
199
199
  this.setState({isDragDrop: true});
200
200
  }
201
201
  if (this.props.params.id) {
202
- this.props.actions.getCmsSetting(BEE_PLUGIN, this.props.Templates.BEETemplate._id, 'open', undefined, isBEESupport, isBEEAppEnable);
202
+ this.props.actions.getCmsSetting(BEE_PLUGIN, this.props.Templates.BEETemplate.versions.base.drag_drop_id, 'open', undefined, isBEESupport, isBEEAppEnable);
203
203
  } else if (this.props.location.query.module !== "library" || (this.props.location.query.module === "library" && !this.props.templateData)) {
204
- this.props.actions.getCmsSetting(BEE_PLUGIN, this.props.Templates.BEETemplate._id, 'create', undefined, isBEESupport, isBEEAppEnable);
204
+ this.props.actions.getCmsSetting(BEE_PLUGIN, this.props.Templates.BEETemplate.versions.base.drag_drop_id, 'create', undefined, isBEESupport, isBEEAppEnable);
205
205
  }
206
206
  }
207
207
  this.setState({ content: (this.props.Templates.selectedEmailLayout ? this.props.Templates.selectedEmailLayout : ''), formData});