@capillarytech/creatives-library 2.0.100 → 3.0.2

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
@@ -8,7 +8,7 @@ const config = {
8
8
  login_url: 'auth/login',
9
9
  dashboard_url: '/sms',
10
10
  dashboard_url_v2: '/v2',
11
- accountConfig: (strs, accountId) => `org/config/AccountAdd?q=a&channelId=2&accountId=${accountId}&edit=1`,
11
+ accountConfig: (strs, accountId) => `${window.location.origin}/org/config/AccountAdd?q=a&channelId=2&accountId=${accountId}&edit=1`,
12
12
  },
13
13
  development: {
14
14
  api_endpoint: 'https://nightly.capillary.in/arya/api/v1/creatives',
@@ -227,14 +227,14 @@ export class Line extends Component {
227
227
  onTagSelect(data, currentTab) {
228
228
  console.log('parent data tag', data, currentTab);
229
229
  const editorId = 'message-editor';
230
- this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`);
230
+ this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`, currentTab);
231
231
  document.getElementById(editorId).focus();
232
232
  }
233
233
 
234
234
  onTagSelectTitle(data, currentTab) {
235
235
  console.log('parent data tag', data, currentTab);
236
236
  const editorId = 'message-title';
237
- this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`);
237
+ this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`, currentTab);
238
238
  document.getElementById(editorId).focus();
239
239
  }
240
240
 
@@ -520,7 +520,7 @@ export class Line extends Component {
520
520
  return section;
521
521
  };
522
522
 
523
- insertAtCursor = (field, myValue) => {
523
+ insertAtCursor = (field, myValue, currentTab) => {
524
524
  //IE support
525
525
  const myField = field;
526
526
  if (document.selection) {
@@ -538,8 +538,9 @@ export class Line extends Component {
538
538
  } else {
539
539
  myField.value += myValue;
540
540
  }
541
- const event = new Event('input', { bubbles: true });
542
- myField.dispatchEvent(event);
541
+ const formData = _.cloneDeep(this.state.formData);
542
+ formData[currentTab - 1][field.id] = myField.value;
543
+ this.setState({formData});
543
544
  };
544
545
 
545
546
  startTemplateCreation = (data) => {
@@ -254,7 +254,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
254
254
  onTagSelect = (data, currentTab, srcComp) => {
255
255
  console.log('parent data tag', data, currentTab);
256
256
  const editorId = srcComp.target;
257
- this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`);
257
+ this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`, currentTab);
258
258
  document.getElementById(editorId).focus();
259
259
  };
260
260
  onModalCancel = () => {
@@ -685,7 +685,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
685
685
  this.setState({showModal: false});
686
686
  };
687
687
 
688
- insertAtCursor = (field, myValue) => {
688
+ insertAtCursor = (field, myValue, currentTab) => {
689
689
  //IE support
690
690
  const myField = field;
691
691
  if (document.selection) {
@@ -703,8 +703,9 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
703
703
  } else {
704
704
  myField.value += myValue;
705
705
  }
706
- const event = new Event('input', { bubbles: true });
707
- myField.dispatchEvent(event);
706
+ const formData = _.cloneDeep(this.state.formData);
707
+ formData[currentTab - 1][field.id] = myField.value;
708
+ this.setState({formData});
708
709
  };
709
710
 
710
711
  selectCtaIos = (selectedConfig) => {
@@ -301,7 +301,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
301
301
  onTagSelect = (data, currentTab, srcComp) => {
302
302
  console.log('parent data tag', data, currentTab);
303
303
  const editorId = srcComp.target;
304
- this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`);
304
+ this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`, currentTab);
305
305
  document.getElementById(editorId).focus();
306
306
  };
307
307
 
@@ -907,7 +907,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
907
907
  });
908
908
  return section;
909
909
  };
910
- insertAtCursor = (field, myValue) => {
910
+ insertAtCursor = (field, myValue, currentTab) => {
911
911
  //IE support
912
912
  const myField = field;
913
913
  if (document.selection) {
@@ -925,8 +925,9 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
925
925
  } else {
926
926
  myField.value += myValue;
927
927
  }
928
- const event = new Event('input', { bubbles: true });
929
- myField.dispatchEvent(event);
928
+ const formData = _.cloneDeep(this.state.formData);
929
+ formData[currentTab - 1][field.id] = myField.value;
930
+ this.setState({formData});
930
931
  };
931
932
 
932
933
  startTemplateCreation = (data) => {
@@ -490,7 +490,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
490
490
  onTagSelect = (data, currentTab, srcComp) => {
491
491
  console.log('parent data tag', data, currentTab);
492
492
  const editorId = srcComp.target;
493
- this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`);
493
+ this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`, currentTab);
494
494
  document.getElementById(editorId).focus();
495
495
  };
496
496
  onModalCancel = () => {
@@ -1032,7 +1032,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
1032
1032
  this.setState({showModal: false});
1033
1033
  };
1034
1034
 
1035
- insertAtCursor = (field, myValue) => {
1035
+ insertAtCursor = (field, myValue, currentTab) => {
1036
1036
  //IE support
1037
1037
  const myField = field;
1038
1038
  if (document.selection) {
@@ -1050,8 +1050,9 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
1050
1050
  } else {
1051
1051
  myField.value += myValue;
1052
1052
  }
1053
- const event = new Event('input', { bubbles: true });
1054
- myField.dispatchEvent(event);
1053
+ const formData = _.cloneDeep(this.state.formData);
1054
+ formData[currentTab - 1][field.id] = myField.value;
1055
+ this.setState({formData});
1055
1056
  };
1056
1057
 
1057
1058
  selectCtaIos = (selectedConfig) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "2.0.100",
4
+ "version": "3.0.2",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -12,54 +12,20 @@
12
12
  },
13
13
  "license": "LicenseRef-LICENSE",
14
14
  "dependencies": {
15
- "@capillarytech/cap-ui-library": "^1.0.170",
16
- "antd": "3.19.6",
17
- "axios": "^0.16.2",
18
- "babel-polyfill": "6.20.0",
19
- "babel-preset-env": "^1.6.1",
20
15
  "chalk": "1.1.3",
21
- "chevrotain": "*",
22
- "compression": "1.6.2",
23
- "cross-env": "3.1.3",
24
- "express": "4.14.0",
25
- "fixed-data-table": "^0.6.4",
26
- "fontfaceobserver": "2.0.7",
27
- "fs": "0.0.1-security",
28
- "fs-extra": "^5.0.0",
29
- "immutable": "3.8.1",
30
- "intl": "1.2.5",
31
- "invariant": "2.2.2",
32
- "ip": "1.1.4",
33
16
  "jquery": "^3.3.1",
34
17
  "load-script": "^1.0.0",
35
- "lodash": "4.17.2",
36
- "minimist": "1.2.0",
37
- "moment": "2.19.2",
38
18
  "normalizr": "^3.2.3",
39
19
  "perfect-scrollbar": "^0.7.0",
40
- "prop-types": "^15.7.2",
41
- "react": "^16.8.1",
42
20
  "react-datepicker": "^0.46.0",
43
- "react-dom": "^16.8.1",
44
21
  "react-grid-layout": "^0.14.6",
45
- "react-helmet": "^5.0.3",
46
- "react-intl": "^2.4.0",
47
- "react-redux": "^5.0.4",
48
22
  "react-router": "^3.2.0",
49
23
  "react-router-dom": "^4.2.2",
50
- "react-router-redux": "4.0.6",
51
- "react-router-scroll": "^0.4.3",
52
- "react-sizeme": "^2.3.2",
53
24
  "redux": "3.6.0",
54
25
  "redux-auth-wrapper": "^1.1.0",
55
26
  "redux-beacon": "^0.4.0",
56
27
  "redux-immutable": "3.0.8",
57
- "redux-saga": "0.14.0",
58
- "redux-saga-test-plan": "^3.1.0",
59
28
  "reselect": "2.5.4",
60
- "sanitize.css": "4.1.0",
61
- "semantic-ui-react": "0.68.3",
62
- "source-map-loader": "^0.2.4",
63
29
  "styled-components": "^3.2.1",
64
30
  "warning": "3.0.0",
65
31
  "whatwg-fetch": "2.0.1"
package/routes.js CHANGED
@@ -433,7 +433,7 @@ export default function createRoutes(store) {
433
433
  const renderRoute = loadModule(cb);
434
434
 
435
435
  importModules.then(([reducer, sagas, component]) => {
436
- injectReducer('mobilepushEdit', reducer.default);
436
+ injectReducer('mobileEdit', reducer.default);
437
437
  injectSagas(sagas.default);
438
438
  injectSagas(rootSaga.default);
439
439
  injectSagas(templateSagas.default);
@@ -9,14 +9,12 @@
9
9
  import PropTypes from 'prop-types';
10
10
 
11
11
  import React from 'react';
12
- import { Label } from 'semantic-ui-react';
13
12
  import _ from 'lodash';
14
13
  import { Tabs, Table, Modal} from 'antd';
15
- import { CapButton, CapInput, CapPopover, CapCheckbox, CapRadio, CapSelect, CapTable, CapRow, CapColumn, CapNotification} from '@capillarytech/cap-ui-library';
14
+ import { CapLabel, CapButton, CapInput, CapPopover, CapCheckbox, CapRadio, CapSelect, CapTable, CapRow, CapColumn, CapNotification} from '@capillarytech/cap-ui-library';
16
15
  import LabelHOC from '@capillarytech/cap-ui-library/assets/HOCs/ComponentWithLabelHOC';
17
16
  import TemplatePreview from '../TemplatePreview';
18
17
  import TagList from '../../v2Containers/TagList';
19
- import SmsEditor from '../SmsEditor';
20
18
  import SlideBox from '../SlideBox';
21
19
  import CardGrid from '../CardGrid';
22
20
  import CKEditor from "../Ckeditor/";
@@ -2206,7 +2204,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2206
2204
  //
2207
2205
  columns.push(
2208
2206
  <CapColumn key="label" span={4}>
2209
- <Label style={val.labelStyle ? val.labelStyle : {}}>{val.label}</Label>
2207
+ <CapLabel style={val.labelStyle ? val.labelStyle : {}}>{val.label}</CapLabel>
2210
2208
  </CapColumn>
2211
2209
  );
2212
2210
  let ifError = false;
@@ -2251,17 +2249,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2251
2249
  );
2252
2250
  }
2253
2251
  break;
2254
- case "SmsEditor":
2255
- columns.push(
2256
- <CapColumn span={5} key="input">
2257
- <SmsEditor
2258
- id={val.id}
2259
- content={this.state.formData[val.id]}
2260
- onDataChange={(data) => this.updateFormData(data.value, val)}
2261
- />
2262
- </CapColumn>
2263
- );
2264
- break;
2265
2252
  case "textarea":
2266
2253
  ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
2267
2254
  const value = isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id];
@@ -2616,17 +2603,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2616
2603
  );
2617
2604
  }
2618
2605
  break;
2619
- case "SmsEditor":
2620
- columns.push(
2621
- <CapColumn span={5} key="input">
2622
- <SmsEditor
2623
- id={val.id}
2624
- content={this.state.formData[val.id]}
2625
- onDataChange={(data) => this.updateFormData(data.value, val)}
2626
- />
2627
- </CapColumn>
2628
- );
2629
- break;
2606
+
2630
2607
  case "textarea":
2631
2608
  ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
2632
2609
  const textValue = isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id];
@@ -7,7 +7,6 @@
7
7
  import PropTypes from 'prop-types';
8
8
 
9
9
  import React from 'react';
10
- import { Progress } from 'semantic-ui-react';
11
10
  import styled from 'styled-components';
12
11
  import { messageTypeConfig } from '../../config/toastr';
13
12
 
@@ -91,7 +90,6 @@ class ToastrMessage extends React.Component { // eslint-disable-line react/prefe
91
90
  {this.props.text}
92
91
  </MessageContent>
93
92
  </div>
94
- {(this.props.timeout > 0 && !this.props.hideProgressBar) ? <Progress style={{ transition: `${0.4}s linear` }} percent={this.state.percent} attached="bottom" /> : ''}
95
93
  </StyledMessageWrapper>
96
94
  );
97
95
  }
@@ -220,7 +220,7 @@ class Creatives extends React.Component {
220
220
  templateData.iosContent.type = get(mobilpushTemplate, 'definition.mode').toUpperCase();
221
221
  templateData.iosContent.deviceType = 'IOS';
222
222
  }
223
- templateData.messageSubject = mobilpushTemplate.name;
223
+ templateData.messageSubject = mobilpushTemplate.name ? mobilpushTemplate.name : "messageSubject";
224
224
  }
225
225
  return templateData;
226
226
  };
@@ -9,7 +9,6 @@ import makeSelectDashboard from './selectors';
9
9
  import messages from './messages';
10
10
  import { UserIsAuthenticated } from '../../../utils/authWrapper';
11
11
  import * as actions from './actions';
12
- import PageHeader from '../../v2Components/PageHeader';
13
12
  import BreadCrumbs from '../../v2Components/BreadCrumbs/index';
14
13
  export class Dashboard extends React.Component { // eslint-disable-line react/prefer-stateless-function
15
14
  render() {
@@ -30,7 +29,6 @@ export class Dashboard extends React.Component { // eslint-disable-line react/pr
30
29
  />)}
31
30
  </FormattedMessage>
32
31
  <BreadCrumbs locations={breadCrumbLocations} />
33
- <PageHeader pageHeading={<FormattedMessage {...messages.header} />} />
34
32
  </div>
35
33
  );
36
34
  }
@@ -464,7 +464,6 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
464
464
  message: ios['message-title2'],
465
465
  ctas: [
466
466
  ],
467
- categoryId: ios['secondary-cta-1-table'] ? ios['secondary-cta-1-table'].id : undefined,
468
467
  },
469
468
  custom: map(ios, (field, key) => {
470
469
  if (key.indexOf('custom-value') > -1) {
@@ -596,6 +595,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
596
595
  delete cta.ioscdeepLinkName;
597
596
  }
598
597
  obj.versions.base.IOS.expandableDetails.ctas.push(cta);
598
+ obj.versions.base.IOS.expandableDetails.categoryId = get(this.state, "templateCta.ctaTemplateDetails.id");
599
599
  if (obj.versions.base.IOS.expandableDetails.ctas[obj.versions.base.IOS.expandableDetails.ctas.length - 1].type === "DEEP_LINK") {
600
600
  const params = map(ios, (field, key) => {
601
601
  let actionLink;
@@ -395,7 +395,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
395
395
  ctas: [
396
396
 
397
397
  ],
398
- categoryId: ios['secondary-cta-1-table'] ? ios['secondary-cta-1-table'].id : undefined,
399
398
  },
400
399
  custom: _.map(ios, (field, key) => {
401
400
  if (key.indexOf('custom-value') > -1) {
@@ -525,6 +524,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
525
524
  delete cta.ioscdeepLinkName;
526
525
  }
527
526
  obj.versions.base.IOS.expandableDetails.ctas.push(cta);
527
+ obj.versions.base.IOS.expandableDetails.categoryId = get(this.state, "templateCta.ctaTemplateDetails.id");
528
528
  if (obj.versions.base.IOS.expandableDetails.ctas[obj.versions.base.IOS.expandableDetails.ctas.length - 1].type === "DEEP_LINK") {
529
529
  const params = _.map(ios, (field, key) => {
530
530
  let actionLink;