@capillarytech/creatives-library 2.0.94 → 2.0.96

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.
@@ -1287,7 +1287,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1287
1287
  header={this.state.previewTemplate.name}
1288
1288
  content={slideboxContent}
1289
1289
  show={this.state.showEmailPreviewModal}
1290
- handleClose={this.toggleImagePreview}
1290
+ handleClose={this.togglePreview}
1291
1291
  width={60}
1292
1292
  />
1293
1293
  );
@@ -14,7 +14,7 @@ import { createStructuredSelector } from 'reselect';
14
14
  import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
15
15
  import _ from 'lodash';
16
16
  import { Menu, Dropdown } from 'antd';
17
- import { CapRow, CapColumn, CapButton, CapCard, CapSpinner } from '@capillarytech/cap-react-ui-library';
17
+ import { CapRow, CapColumn, CapButton, CapCard, CapSpin } from '@capillarytech/cap-react-ui-library';
18
18
  import makeSelectCreate, {makeSelectTemplates, getAssetDetails, getContentAssetDetails} from './selectors';
19
19
  import * as actions from './actions';
20
20
  import richmediaschema from './richmediaschema';
@@ -970,7 +970,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
970
970
  }
971
971
  return (
972
972
  <div className="richmedia-container">
973
- <CapSpinner spinning={this.state.loading}>
973
+ <CapSpin spinning={this.state.loading}>
974
974
  {this.state.showPreview && <WechatRichmediaTemplatePreview
975
975
  show={this.state.showPreview}
976
976
  closeSlideBox={this.closeSlideBox}
@@ -1012,7 +1012,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
1012
1012
  </CapRow>
1013
1013
  </div>
1014
1014
  </div>
1015
- </CapSpinner>
1015
+ </CapSpin>
1016
1016
  </div>
1017
1017
  );
1018
1018
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "2.0.94",
4
+ "version": "2.0.96",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -64,4 +64,4 @@
64
64
  "warning": "3.0.0",
65
65
  "whatwg-fetch": "2.0.1"
66
66
  }
67
- }
67
+ }
@@ -212,7 +212,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
212
212
  ]}
213
213
  >
214
214
  <p>{this.props.intl.formatMessage(messages.numberOfDaysBeforeExpiry)}</p>
215
- <CapInput onChange={this.handleDynamicDateChange} value={this.state.dynamicDateValue}></CapInput>
215
+ <CapInput onChange={this.handleDynamicDateChange} value={this.state.dynamicDateValue} size="default"></CapInput>
216
216
  </CapModal>
217
217
  </div>
218
218
  );
@@ -2245,6 +2245,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2245
2245
  defaultValue={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
2246
2246
  value={value || ""}
2247
2247
  disabled={val.disabled}
2248
+ size="default"
2248
2249
  />
2249
2250
  </CapColumn>
2250
2251
  );
@@ -2609,6 +2610,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2609
2610
  value={value || ""}
2610
2611
  defaultValue={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
2611
2612
  disabled={val.disabled}
2613
+ size="default"
2612
2614
  />
2613
2615
  </CapColumn>
2614
2616
  );
@@ -7,9 +7,8 @@
7
7
  import PropTypes from 'prop-types';
8
8
 
9
9
  import React from 'react';
10
- import { injectIntl, intlShape } from 'react-intl';
10
+ import { injectIntl } from 'react-intl';
11
11
  import { Spin } from 'antd';
12
- import messages from './messages';
13
12
  import './_imagePreview.scss';
14
13
 
15
14
  class ImagePreview extends React.Component { // eslint-disable-line react/prefer-stateless-function
@@ -27,7 +26,7 @@ class ImagePreview extends React.Component { // eslint-disable-line react/prefer
27
26
  </div>
28
27
 
29
28
  <div id="image-preview-content">
30
- <Spin tip={this.props.intl.formatMessage(messages.loadingImage)} spinning={this.props.isLoading}>
29
+ <Spin spinning={this.props.isLoading}>
31
30
  {this.props.content}
32
31
  </Spin>
33
32
  </div>
@@ -46,7 +45,6 @@ ImagePreview.propTypes = {
46
45
  show: PropTypes.bool,
47
46
  handleClose: PropTypes.func.isRequired,
48
47
  isLoading: PropTypes.bool,
49
- intl: intlShape.isRequired,
50
48
  };
51
49
 
52
50
  export default injectIntl(ImagePreview);
@@ -98,6 +98,7 @@ class NewCallTask extends React.Component { // eslint-disable-line react/prefer-
98
98
  onChange={this.updateSubject}
99
99
  value={subject}
100
100
  isRequired
101
+ size="default"
101
102
  />
102
103
  </div>
103
104
  <div style={{ position: 'relative', marginBottom: '34px' }}>
@@ -10,25 +10,17 @@ import React from 'react';
10
10
  import './_pagination.scss';
11
11
  class Pagination extends React.Component { // eslint-disable-line react/prefer-stateless-function
12
12
 
13
- componentDidMount() {
14
- if (document.getElementsByClassName('pagination-container').length > 0) {
15
- document.getElementsByClassName('pagination-container')[0].addEventListener('scroll', this.handleScroll);
16
- }
17
- }
13
+
18
14
  handleScroll = (e) => {
19
15
  const offset = 50;
20
16
  if ((e.target.scrollHeight - e.target.scrollTop) - offset <= e.target.clientHeight) {
21
17
  this.props.onPageChange();
22
18
  }
23
19
  };
24
- componentDidUnMount() {
25
- if ( document.getElementsByClassName(this.props.paginationContainer).length > 0) {
26
- document.getElementsByClassName(this.props.paginationContainer)[0].removeEventListener('scroll', this.handleScroll);
27
- }
28
- }
20
+
29
21
  render() {
30
22
  return (
31
- <div style={this.props.style ? this.props.style : {}}>
23
+ <div style={this.props.style ? this.props.style : {}} onScroll={this.handleScroll}>
32
24
  {this.props.children}
33
25
  </div>
34
26
  );
@@ -39,7 +31,6 @@ Pagination.propTypes = {
39
31
  children: PropTypes.element,
40
32
  onPageChange: PropTypes.func,
41
33
  style: PropTypes.object,
42
- paginationContainer: PropTypes.string,
43
34
  };
44
35
 
45
36
  Pagination.defaultProps = {
@@ -45,7 +45,7 @@ class Creatives extends React.Component {
45
45
  showSlideBox: true,
46
46
  slidBoxContent: this.getSlideBocContent({mode: props.creativesMode, templateData: props.templateData, isFullMode: props.isFullMode}),
47
47
  templateData: this.getTemplateData(props.templateData),
48
- templateNameExists: false,
48
+ templateNameExists: props.creativesMode === 'edit', // if edit mode templateNameExists will be true, and false in create flow.
49
49
  currentChannel: this.props.channel || 'sms',
50
50
  };
51
51
  this.creativesTemplateSteps = {
@@ -1158,7 +1158,6 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
1158
1158
 
1159
1159
  render() {
1160
1160
  const previewHeader = (<h3>{this.props.intl.formatMessage(messages.ebillPreview)}</h3>);
1161
- const loaderText = this.props.intl.formatMessage(messages.loading);
1162
1161
  const spinning = false;
1163
1162
  const schema = this.state.schema;
1164
1163
  return (
@@ -1166,7 +1165,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
1166
1165
  <Helmet
1167
1166
  title="Ebill"
1168
1167
  />
1169
- <Spin tip={loaderText} spinning={spinning}>
1168
+ <Spin spinning={spinning}>
1170
1169
  {this.props.location.query.type !== 'embedded' && <Row>
1171
1170
  <Col span={24}>
1172
1171
  {this.props.location.query.type !== "embedded" &&
@@ -2528,6 +2528,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2528
2528
  prefix={<i className="material-icons" style={{color: '#707070', fontSize: '16px'}}>search</i>}
2529
2529
  value={this.state.searchText}
2530
2530
  onChange={(e) => this.searchAsset(e.target.value)}
2531
+ size="default"
2531
2532
  />
2532
2533
  </div>
2533
2534
  <div>
@@ -2576,11 +2577,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2576
2577
  if (!this.props.currentOrgDetails || !this.props.currentOrgDetails.basic_details) {
2577
2578
  return (<div>Loading...</div>);
2578
2579
  }
2579
-
2580
- let loaderText = this.props.Email.createTemplateInProgress ? this.props.intl.formatMessage(messages.saveTemplateLoader) : this.props.intl.formatMessage(messages.templateLoader);
2581
- if (this.props.Email.assetUploading) {
2582
- loaderText = this.props.intl.formatMessage(messages.uploadingImage);
2583
- }
2584
2580
  let tags = this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : [];
2585
2581
  if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library' && !this.props.getDefaultTags) {
2586
2582
  tags = this.props.supportedTags;
@@ -2589,7 +2585,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2589
2585
  <div className="email-container">
2590
2586
 
2591
2587
  {/* <PageHeader pageHeading={pageHeading} /> */}
2592
- <CapSpin tip={loaderText} spinning={isLoading}>
2588
+ <CapSpin spinning={isLoading}>
2593
2589
 
2594
2590
  <Row>
2595
2591
  <Col>
@@ -172,6 +172,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
172
172
  onChange={this.onTemplateNameChange}
173
173
  value={templateName}
174
174
  labelPosition="top"
175
+ size="default"
175
176
  />
176
177
  }
177
178
  <CardContainer>
@@ -728,10 +728,8 @@ export class Line extends Component {
728
728
  console.log("before render@@@", this.state.formData["0"].image);
729
729
  }
730
730
  console.log("render state", this.state);
731
- let tipText = this.props.Line.createTemplateInProgress ? "Saving Template..." : "";
732
731
  let loading = this.props.Line.createTemplateInProgress ? this.props.Line.createTemplateInProgress : false;
733
732
  if (this.props.Line.assetUploading) {
734
- tipText = "Uploading Image...";
735
733
  loading = true;
736
734
  }
737
735
  // if (!this.state.isReady) {
@@ -743,7 +741,7 @@ export class Line extends Component {
743
741
  tags = this.props.supportedTags;
744
742
  }
745
743
  return (
746
- <Spin tip={tipText} spinning={loading}>
744
+ <Spin spinning={loading}>
747
745
  <Row style={{marginLeft: '-48px'}}>
748
746
  <Col offset={1}>
749
747
  {this.props.location.query.type !== "embedded" &&
@@ -956,8 +956,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
956
956
 
957
957
  render() {
958
958
  const schema = this.state.schema;
959
- let tipText = this.props.Edit && ("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) ? 'Getting template details...' : '';
960
- tipText = this.props.Edit && ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress) ? 'Saving Template...' : '';
961
959
  const spinning = this.props.Edit.fetchingDefaultTemplates || this.props.Edit.assetUploading || this.state.loading || (this.props.Edit && (("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) || ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress)));
962
960
  let tags = this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : [];
963
961
  if (this.props.supportedTags) {
@@ -965,7 +963,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
965
963
  }
966
964
  return (
967
965
  <div>
968
- <Spin tip={tipText} spinning={spinning}>
966
+ <Spin spinning={spinning}>
969
967
  {<Row style={{marginBottom: '16px', marginLeft: '-40px'}}>
970
968
  <Col offset={1}>
971
969
  {this.props.location.query.type !== "embedded" &&
@@ -1668,10 +1668,8 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
1668
1668
  this.setState({showIosCtaTable: false, formData});
1669
1669
  }
1670
1670
  render() {
1671
- let tipText = this.props.Create.createTemplateInProgress ? "Saving Template..." : "";
1672
1671
  let loading = this.props.Create.createTemplateInProgress ? this.props.Create.createTemplateInProgress : false;
1673
1672
  if (this.props.Create.assetUploading) {
1674
- tipText = "Uploading Image...";
1675
1673
  loading = true;
1676
1674
  }
1677
1675
  let tags = this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : [];
@@ -1680,7 +1678,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
1680
1678
  }
1681
1679
  return (
1682
1680
  <div className="creatives-mobilepush-create">
1683
- <CapSpin tip={tipText} spinning={loading}>
1681
+ <CapSpin spinning={loading}>
1684
1682
  <CapRow>
1685
1683
  <CapColumn>
1686
1684
  <FormBuilder
@@ -1752,8 +1752,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
1752
1752
 
1753
1753
  render() {
1754
1754
  const schema = this.state.schema;
1755
- let tipText = this.props.Edit && ("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) ? 'Getting template details...' : '';
1756
- tipText = this.props.Edit && ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress) ? 'Saving Template...' : '';
1757
1755
  const loadingContentEdit = this.state.loadingContentEdit || (this.props.location.query.module === 'dvs' && _.isEmpty(this.state.schema));
1758
1756
  const spinning = this.props.isLoadingMetaEntities || loadingContentEdit || this.props.Edit.fetchingDefaultTemplates || this.props.Edit.assetUploading || this.state.loading || (this.props.Edit && (("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) || ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress)));
1759
1757
  let tags = this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : [];
@@ -1762,7 +1760,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
1762
1760
  }
1763
1761
  return (
1764
1762
  <div className="creatives-mobilepush-edit">
1765
- <CapSpin tip={tipText} spinning={spinning}>
1763
+ <CapSpin spinning={spinning}>
1766
1764
  <CapRow>
1767
1765
  <CapColumn>
1768
1766
  {!this.props.isLoadingMetaEntities && <FormBuilder
@@ -82,6 +82,7 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
82
82
  onChange={this.onTemplateNameChange}
83
83
  value={templateName}
84
84
  labelPosition="top"
85
+ size="default"
85
86
  />
86
87
  }
87
88
  <CardContainer>
@@ -9,7 +9,7 @@ import PropTypes from 'prop-types';
9
9
 
10
10
  import React from 'react';
11
11
  import { connect } from 'react-redux';
12
- import { CapRow, CapColumn, CapSpinner, CapNotification } from '@capillarytech/cap-ui-library';
12
+ import { CapRow, CapColumn, CapSpin, CapNotification } from '@capillarytech/cap-ui-library';
13
13
  import { injectIntl, intlShape } from 'react-intl';
14
14
  import { createStructuredSelector } from 'reselect';
15
15
  import _ from 'lodash';
@@ -923,8 +923,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
923
923
  }
924
924
  render() {
925
925
  const schema = this.state.schema;
926
- let tipText = this.props.Edit && ("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) ? this.props.intl.formatMessage(messages.getTemplateDetailsLoader) : '';
927
- tipText = this.props.Edit && ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress) ? this.props.intl.formatMessage(messages.saveTemplateLoader) : '';
928
926
  const spinning = this.isSmsLoading();
929
927
  let tags = this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : [];
930
928
  if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library' && !this.props.getDefaultTags) {
@@ -932,7 +930,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
932
930
  }
933
931
  return (
934
932
  <div className="sms-email-container">
935
- <CapSpinner tip={tipText} spinning={spinning}>
933
+ <CapSpin spinning={spinning}>
936
934
  {/*<CapRow style={{marginBottom: '16px', marginLeft: '-40px'}}>
937
935
  <CapColumn offset={1}>
938
936
  <Breadcrumb>
@@ -973,7 +971,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
973
971
  />
974
972
  </CapColumn>
975
973
  </CapRow>
976
- </CapSpinner>
974
+ </CapSpin>
977
975
  </div>
978
976
  );
979
977
  }
@@ -168,7 +168,7 @@ export const response = {
168
168
  order: 1,
169
169
  width: 18,
170
170
  onlyDisplay: false,
171
- errorMessage: "Please check if you intend to use unicode characters.",
171
+ errorMessage: "Unicode characters were detected in your content.",
172
172
  customComponent: false,
173
173
  },
174
174
  ],
@@ -392,7 +392,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
392
392
  }
393
393
  onPaginationChange = () => { this.getAllTemplates({getNextPage: true}); }
394
394
  onCreateComplete = () => {
395
- this.setState({routeParams: null});
395
+ this.setState({routeParams: null, previewOpen: false});
396
396
  }
397
397
  getCurrentWindow(e) {
398
398
  const response = {
@@ -1291,7 +1291,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1291
1291
  };
1292
1292
 
1293
1293
  toggleEmailPreview = () => {
1294
- this.setState({ showHtmlPreview: !this.state.showHtmlPreview }, () => {
1294
+ this.setState({ showHtmlPreview: !this.state.showHtmlPreview, previewOpen: !this.state.previewOpen }, () => {
1295
1295
  if (!this.state.showHtmlPreview) {
1296
1296
  this.setState({previewTemplate: {}});
1297
1297
  }
@@ -1362,7 +1362,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1362
1362
  header={this.state.previewTemplate.name}
1363
1363
  content={slideboxContent}
1364
1364
  show={this.state.showEmailPreviewModal}
1365
- handleClose={this.toggleImagePreview}
1365
+ handleClose={this.togglePreview}
1366
1366
  width={60}
1367
1367
  />
1368
1368
  );
@@ -14,7 +14,7 @@ import { createStructuredSelector } from 'reselect';
14
14
  import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
15
15
  import _ from 'lodash';
16
16
  import { Menu, Dropdown } from 'antd';
17
- import { CapRow, CapColumn, CapButton, CapCard, CapSpinner } from '@capillarytech/cap-ui-library';
17
+ import { CapRow, CapColumn, CapButton, CapCard, CapSpin } from '@capillarytech/cap-ui-library';
18
18
  import makeSelectCreate, {makeSelectTemplates, getAssetDetails, getContentAssetDetails} from './selectors';
19
19
  import * as actions from './actions';
20
20
  import richmediaschema from './richmediaschema';
@@ -970,7 +970,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
970
970
  }
971
971
  return (
972
972
  <div className="richmedia-container">
973
- <CapSpinner spinning={this.state.loading}>
973
+ <CapSpin spinning={this.state.loading}>
974
974
  {this.state.showPreview && <WechatRichmediaTemplatePreview
975
975
  show={this.state.showPreview}
976
976
  closeSlideBox={this.closeSlideBox}
@@ -1012,7 +1012,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
1012
1012
  </CapRow>
1013
1013
  </div>
1014
1014
  </div>
1015
- </CapSpinner>
1015
+ </CapSpin>
1016
1016
  </div>
1017
1017
  );
1018
1018
  }