@capillarytech/creatives-library 7.12.83 → 7.12.84

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.
@@ -13,7 +13,7 @@ import React from 'react';
13
13
  import _ from 'lodash';
14
14
  // import messages from './messages';
15
15
  const loadScript = require('load-script');
16
- const defaultScriptUrl = "https://ckeditor.com/assets/libs/ckeditor4/4.19.0/ckeditor.js";
16
+ const defaultScriptUrl = "https://ckeditor.com/assets/libs/ckeditor4/4.14.1/ckeditor.js";
17
17
  const user = localStorage.getItem('user');
18
18
  let locale = 'en';
19
19
  if (user && JSON.parse(user).lang) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.12.83",
4
+ "version": "7.12.84",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -13,7 +13,7 @@ import React from 'react';
13
13
  import _ from 'lodash';
14
14
  // import messages from './messages';
15
15
  const loadScript = require('load-script');
16
- const defaultScriptUrl = "https://ckeditor.com/assets/libs/ckeditor4/4.19.0/ckeditor.js";
16
+ const defaultScriptUrl = "https://ckeditor.com/assets/libs/ckeditor4/4.14.1/ckeditor.js";
17
17
  const user = localStorage.getItem('user');
18
18
  let locale = 'en';
19
19
  if (user && JSON.parse(user).lang) {
@@ -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}
@@ -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) {
@@ -322,7 +322,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
322
322
  if (this.state.isEdit && nextProps.location.query.module === "library" && !_.isEmpty(nextProps.templateData) && !this.props.params.id && !nextProps.isGetFormData && _.isEmpty(_.get(this, `state.formData['template-subject']`))) {
323
323
  this.startTemplateCreation(nextProps.templateData);
324
324
  }
325
- if (nextProps.location.query.module === 'library' && nextProps.isGetFormData && (this.props.isGetFormData!==nextProps.isGetFormData)) {
325
+ if (nextProps.location.query.module === 'library' && nextProps.isGetFormData && (this.props.isGetFormData !== nextProps.isGetFormData)) {
326
326
  const formData = this.state.formData;
327
327
  let isBeeEditor = false;
328
328
  const isBEEEnable = this.checkBeeEditorAllowedForLibrary();
@@ -679,9 +679,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
679
679
  channel: EMAIL,
680
680
  timeTaken,
681
681
  content: base?.[activeTab]?.['template-content'],
682
- mode: isEdit ? EDIT : CREATE
682
+ mode: isEdit ? EDIT : CREATE,
683
683
  });
684
-
684
+
685
685
  // this.resetSchema();
686
686
  let message;
687
687
  if (isEdit) {
@@ -870,46 +870,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
870
870
  } else {
871
871
  schema.containers[index].isActive = false;
872
872
  }
873
- // const isLanguageSupport = this.props.location.query.isLanguageSupport;
874
-
875
- _.forEach(data.selectedLanguages, (lang, langIndex) => {
876
- if ((type !== 'embedded' || (type === 'embedded' && isLanguageSupport === 'true')) && lang !== this.props.currentOrgDetails.basic_details.base_language) {
877
- const tabContent = _.cloneDeep(containers[0].tabContent.sections[0]);
878
- const tabContentSection = tabContent.inputFields[0].cols[0];
879
- const panes = containers[0].panes.slice();
880
- const firstPane = _.cloneDeep(panes[0]);
881
- const sections = [];
882
- _.forEach(firstPane.sections, (section) => {
883
- let sect = _.cloneDeep(section);
884
-
885
- if (sect.type === 'col-label') {
886
- sect = this.cloneColLabel(sect, (langIndex + 1));
887
- } else if (sect.type === 'multicols') {
888
- sect = this.cloneMultiCol(sect, (langIndex + 1));
889
- } else if (sect.type === 'parent') {
890
- sect = this.cloneParent(sect, (langIndex + 1));
891
- }
892
-
893
- sections.push(sect);
894
- return true;
895
- });
896
- //
897
-
898
- this.map[`template-content${data.selectedLanguages.indexOf(lang) + 1}`] = this.map['template-content'];
899
- tabContentSection.id = `${tabContentSection.id}${index + 1}`;
900
- tabContentSection.value = `${data[lang].language}`;
901
-
902
- firstPane.sections = sections;
903
- firstPane.sectionsHeaders = [tabContent];
904
-
905
- // panes.push(firstPane);
906
-
907
- schema.containers[index].panes.push(firstPane);
908
- } else if (lang !== this.props.currentOrgDetails.basic_details.base_language) {
909
- delete data[lang];
910
- data.selectedLanguages.splice(langIndex, 1);
911
- }
912
- });
913
873
  }
914
874
  if (data.base) {
915
875
  formData.base = data;
@@ -2371,7 +2331,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2371
2331
  const response = {
2372
2332
  action: "getFormData",
2373
2333
  postAction: this.state.getFormDataValue || 'next',
2374
- id : _.get(this.props, 'Email.templateDetails._id', ''),
2334
+ id: _.get(this.props, 'Email.templateDetails._id', ''),
2375
2335
  value: this.transformFormData(passedData),
2376
2336
  validity: this.state.isFormValid,
2377
2337
  type: 'EMAIL',
@@ -2405,9 +2365,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2405
2365
  const newdata = data;
2406
2366
 
2407
2367
  if (!isNaN(index) && newdata) {
2408
- const baseLangTabKey = newdata[baseLanguage].tabKey;
2368
+ const baseLangTabKey = newdata[baseLanguage]?.tabKey || newdata.tabKey;
2409
2369
  newdata.tabKey = baseLangTabKey;
2410
- newdata.activeTab = baseLanguage;
2411
2370
  if (newdata.base) {
2412
2371
  baseKey = baseLangTabKey;
2413
2372
  }
@@ -2429,7 +2388,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2429
2388
  obj.versions.base = formData.base;
2430
2389
  obj.versions.base.tabKey = baseKey;
2431
2390
  obj.versions.base.subject = formData['template-subject'];
2432
- obj.versions.base.activeTab = baseLanguage;
2391
+ obj.versions.base.activeTab = formData?.base?.activeTab || baseLanguage;
2433
2392
  _.forEach(obj.versions.base.selectedLanguages, (language) => {
2434
2393
  if (obj.versions.base[language].is_drag_drop) {
2435
2394
  delete obj.versions.base[language].edmeditorsrc;
@@ -2727,7 +2686,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2727
2686
  isEdit={this.state.isEdit}
2728
2687
  iframeParent={parent}
2729
2688
  router={this.props.router}
2730
- baseLanguage={this.props.currentOrgDetails.basic_details.base_language}
2689
+ baseLanguage={this.state.formData[0]?.activeTab || this.props.currentOrgDetails.basic_details.base_language}
2731
2690
  supportedLanguages={this.getSupportedLanguages(this.props)}
2732
2691
  isSchemaChanged={this.state.isSchemaChanged}
2733
2692
  cmsTemplates={this.props.Templates.cmsTemplates}