@capillarytech/creatives-library 3.0.10 → 3.0.13

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.
@@ -2537,15 +2537,13 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2537
2537
  });
2538
2538
  }
2539
2539
  });
2540
- if (temp.standalone.sections && temp.standalone.sections.length > 0) {
2541
- _.forEach(temp.standalone.sections[1].inputFields[0].cols, (inputField) => {
2542
- if (inputField.id === "template-version") {
2543
- const iF = inputField;
2544
- iF.colStyle = {};
2545
- iF.colStyle.display = "none";
2546
- }
2547
- });
2548
- }
2540
+ _.forEach(temp.standalone.sections[1].inputFields[0].cols, (inputField) => {
2541
+ if (inputField.id === "template-version") {
2542
+ const iF = inputField;
2543
+ iF.colStyle = {};
2544
+ iF.colStyle.display = "none";
2545
+ }
2546
+ });
2549
2547
  //}
2550
2548
  temp = type === 'embedded' ? this.removeStandAlone(temp) : temp;
2551
2549
  this.setState({schema: temp, isSchemaChanged: true, loadingStatus: this.state.loadingStatus + 1}, () => {
@@ -803,6 +803,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
803
803
  };
804
804
 
805
805
  getCurrentWindow = (e) => {
806
+ console.log('in sms create', e);
806
807
  const response = {
807
808
  action: e.action,
808
809
  value: 'edit',
@@ -216,7 +216,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
216
216
  let ifBase = false;
217
217
  let currentTab = 1;
218
218
  for (let count = 0; count < tabCount; count += 1) {
219
- formData[count] = _.cloneDeep(data.versions.history[count]);
219
+ formData[count] = _.cloneDeep(data.versions.base);
220
220
  if (data.versions && data.versions.history && data.versions.history[count] && data.versions.history[count].base) {
221
221
  if (!formData[count]) {
222
222
  formData[count] = {};
@@ -1239,6 +1239,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
1239
1239
  }
1240
1240
  const formData = _.cloneDeep(this.state.formData);
1241
1241
  formData[currentTab - 1][field.id] = myField.value;
1242
+ formData.base[field.id] = myField.value;
1242
1243
  this.setState({formData});
1243
1244
  }
1244
1245
 
@@ -1128,7 +1128,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1128
1128
  {template._id === this.state.hoveredItem ? <CapButton onClick={(e) => this.handleEditClick(e, template._id)} className="edit-button" type="secondary">{type === 'embedded' ? this.props.intl.formatMessage(messages.selectButton) : this.props.intl.formatMessage(messages.editButton)}</CapButton> : ''}
1129
1129
  {template._id === this.state.hoveredItem ? <CapButton onClick={() => this.handlePreviewClick(template)} className="preview-button" type="cancel">{this.props.intl.formatMessage(messages.previewButton)}</CapButton> : ''}
1130
1130
  </div>);
1131
- } else if (this.state.channel.toLowerCase() === 'line' && template.type.toLowerCase() === 'line') {
1131
+ } else if (this.state.channel.toLowerCase() === 'line') {
1132
1132
  //content = template.versions.base.messages[0].Text;
1133
1133
  content = {
1134
1134
  bodyText: template.versions.base.content.messages[0].text ? template.versions.base.content.messages[0].text : '',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "3.0.10",
4
+ "version": "3.0.13",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -30,14 +30,6 @@ const deviceAspectRatio = {
30
30
  };
31
31
 
32
32
  class EmailMobilePreview extends React.Component {
33
- static getDerivedStateFromProps(props) {
34
- if (props.showAllDevices) {
35
- return {
36
- showAllDevices: true,
37
- };
38
- }
39
- return null;
40
- }
41
33
  constructor() {
42
34
  super();
43
35
  this.state = {
@@ -123,7 +115,6 @@ EmailMobilePreview.propTypes = {
123
115
 
124
116
  EmailMobilePreview.defaultProps = {
125
117
  showDeviceSelection: true,
126
- showAllDevices: false,
127
118
  };
128
119
 
129
120
  const mapStateToProps = (state, props) => createStructuredSelector({
@@ -13,7 +13,7 @@ import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
13
13
  import { createStructuredSelector } from 'reselect';
14
14
  import moment from "moment";
15
15
  import _ from "lodash";
16
- import { CapHeader, CapInput, CapButton, CapSpin, CapIcon, CapDropdown, CapMenu, CapCustomCard, CapSlideBox, CapLabel, CapIllustration} from '@capillarytech/cap-ui-library';
16
+ import { CapHeader, CapInput, CapButton, CapSpin, CapIcon, CapDropdown, CapMenu, CapCustomCard, CapSlideBox, CapLabel } from '@capillarytech/cap-ui-library';
17
17
  import { Popover } from 'antd';
18
18
  import makeSelectGallery from './selectors';
19
19
  import messages from './messages';
@@ -23,7 +23,7 @@ import * as globalActions from '../../Cap/actions';
23
23
  import {getMessageObject} from '../../../utils/messageUtils';
24
24
  import * as commonUtil from '../../../utils/common';
25
25
  import Pagination from '../../../v2Components/Pagination';
26
- import imageGalleryIllustration from '../images/imageGalleryIllustration.svg';
26
+
27
27
  import './_gallery.scss';
28
28
  const {CapCustomCardList} = CapCustomCard;
29
29
  export class Gallery extends React.Component { // eslint-disable-line react/prefer-stateless-function
@@ -240,12 +240,6 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
240
240
  };
241
241
  }
242
242
  }
243
- getIllustrationProps={
244
- buttonLabel: <FormattedMessage {...messages.upload} />,
245
- onClick: (e) => this.openFileDialog(e),
246
- illustrationImage: imageGalleryIllustration,
247
- title: <FormattedMessage {...messages.addImages} />,
248
- }
249
243
 
250
244
  prepareData() {
251
245
  const data = [];
@@ -332,12 +326,10 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
332
326
  }) : [];
333
327
  return (<div>
334
328
  {filterContent}
335
- <CapSpin spinning={isLoading} tip={loadingTip} style={{width: "100%"}}>
336
- {!isLoading && <div>
337
- {!_.isEmpty(templates) ? <div className="pagination-container">
338
- <CapCustomCardList key={`${currentChannel}-card-list`} cardList={cardDataList} type={'Email'} />
339
- </div> : <CapIllustration {...this.getIllustrationProps} />}</div>
340
- }
329
+ <CapSpin spinning={isLoading} tip={loadingTip}>
330
+ {!_.isEmpty(templates) && <div className="pagination-container">
331
+ <CapCustomCardList key={`${currentChannel}-card-list`} cardList={cardDataList} type={'Email'} />
332
+ </div>}
341
333
  </CapSpin>
342
334
 
343
335
  </div>);
@@ -391,8 +383,7 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
391
383
  );
392
384
  }
393
385
  render() {
394
- const assetList = this.props.Gallery.assetList;
395
- const filterContent = !_.isEmpty(assetList) ? (
386
+ const filterContent = (
396
387
  <div className="action-container" style={{ display: 'inline-flex', width: '100%'}}>
397
388
  <div style={{ marginTop: '8px', width: '50%'}}>
398
389
  <CapInput.Search
@@ -413,10 +404,10 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
413
404
  </form>
414
405
  </div>
415
406
  </div>
416
- ) : <input style={{ display: 'none'}} id="fileName" type="file" onChange={(e) => this.uploadImages(e, {files: e.target.files})} accept="image/*" multiple/>;
407
+ );
417
408
  const isLoading = this.props.Gallery.assetUploading || this.props.Gallery.fetchingAllAssets;
418
409
  const loadingTip = "Loading gallery... ";
419
-
410
+ const assetList = this.props.Gallery.assetList;
420
411
  return (
421
412
  <div>
422
413
  {this.state.showEmbeddedPreview ?
@@ -22,10 +22,6 @@ export default defineMessages({
22
22
  id: 'app.containers.Assets.Gallery.upload',
23
23
  defaultMessage: 'Upload image',
24
24
  },
25
- addImages: {
26
- id: `app.containers.Assets.Gallery.addImages`,
27
- defaultMessage: 'Add images',
28
- },
29
25
  imagePreview: {
30
26
  id: 'app.containers.Assets.Gallery.imagePreview',
31
27
  defaultMessage: 'Image preview',
@@ -9,10 +9,10 @@ import { bindActionCreators } from "redux";
9
9
  import { connect } from 'react-redux';
10
10
  import {
11
11
  //CapSlideBox,
12
+ CapButton,
12
13
  //CapIcon,
13
14
  //CapHeader,
14
15
  CapLabel,
15
- CapIllustration,
16
16
  } from '@capillarytech/cap-ui-library';
17
17
  import { injectIntl, intlShape } from 'react-intl';
18
18
  import { createStructuredSelector } from 'reselect';
@@ -23,7 +23,7 @@ import makeSelectCallTask from './selectors';
23
23
  import NewCallTask from '../../v2Components/NewCallTask';
24
24
  import messages from './messages';
25
25
  import './_callTask.scss';
26
- import calltaskIllustration from '../Assets/images/calltaskIllustration.svg';
26
+
27
27
  export class CallTask extends React.Component { // eslint-disable-line react/prefer-stateless-function
28
28
  constructor(props) {
29
29
  super(props);
@@ -57,18 +57,8 @@ export class CallTask extends React.Component { // eslint-disable-line react/pre
57
57
  });
58
58
  }
59
59
 
60
- getIllustrationProps=() => {
61
- const { intl, showContentInSlidebox, onCreateNew } = this.props;
62
- const { formatMessage } = intl;
63
- return {
64
- buttonLabel: formatMessage(messages.newCallTaskTemplate),
65
- onClick: showContentInSlidebox ? this.showNewCallTask : onCreateNew,
66
- illustrationImage: calltaskIllustration,
67
- title: formatMessage(messages.callTaskTitleIllustartion),
68
- };
69
- }
70
60
  render() {
71
- const { intl, onCallTaskSubmit, templateData, loadingMetaEntities, metaEntities } = this.props;
61
+ const { intl, onCallTaskSubmit, templateData, loadingMetaEntities, metaEntities, showContentInSlidebox, onCreateNew } = this.props;
72
62
  const { formatMessage } = intl;
73
63
  const { mode } = this.state;
74
64
  return (
@@ -87,7 +77,9 @@ export class CallTask extends React.Component { // eslint-disable-line react/pre
87
77
  {formatMessage(messages.callTaskInfo)}
88
78
  </CapLabel>
89
79
  <div className="call-task-action-button">
90
- <CapIllustration {...this.getIllustrationProps()} />
80
+ <CapButton onClick={showContentInSlidebox ? this.showNewCallTask : onCreateNew}>
81
+ {formatMessage(messages.addNewCallTask)}
82
+ </CapButton>
91
83
  </div>
92
84
  {/* {
93
85
  showCallTaskSlidebox && showContentInSlidebox &&
@@ -18,12 +18,4 @@ export default defineMessages({
18
18
  id: 'app.containers.CallTask.callTaskInfo',
19
19
  defaultMessage: 'Call Tasks are message sent to store staff. The messages are displayed on the Point of Sale (POS) machines for store staff to take action.',
20
20
  },
21
- callTaskTitleIllustartion: {
22
- id: `app.containers.CallTask.callTaskTitleIllustartion`,
23
- defaultMessage: 'Create a Call Task template',
24
- },
25
- newCallTaskTemplate: {
26
- id: `app.containers.CallTask.newCallTaskTemplate`,
27
- defaultMessage: 'New Call Task template',
28
- },
29
21
  });
@@ -253,7 +253,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
253
253
  let ifBase = false;
254
254
  let currentTab = 1;
255
255
  for (let count = 0; count < tabCount; count += 1) {
256
- formData[count] = _.cloneDeep(data.versions.history[count]);
256
+ formData[count] = _.cloneDeep(data.versions.base);
257
257
  if (data.versions && data.versions.history && data.versions.history[count] && data.versions.history[count].base) {
258
258
  if (!formData[count]) {
259
259
  formData[count] = {};
@@ -789,6 +789,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
789
789
  }
790
790
  const formData = _.cloneDeep(this.state.formData);
791
791
  formData[currentTab - 1][field.id] = myField.value;
792
+ formData.base[field.id] = myField.value;
792
793
  this.setState({formData});
793
794
  }
794
795
 
@@ -15,7 +15,7 @@ import moment from "moment";
15
15
  import _ from 'lodash';
16
16
  import { bindActionCreators } from 'redux';
17
17
  import { Modal} from 'antd';
18
- import {CapMenu, CapDropdown, CapButton, CapInput, CapIcon, CapSelect, CapPopover, CapSpin, CapCustomCard, CapRow, CapSlideBox, CapLink, CapHeading, CapNotification, CapIllustration} from '@capillarytech/cap-ui-library';
18
+ import {CapMenu, CapDropdown, CapButton, CapInput, CapIcon, CapSelect, CapPopover, CapSpin, CapCustomCard, CapRow, CapSlideBox, CapLink, CapHeading, CapNotification} from '@capillarytech/cap-ui-library';
19
19
  import { makeSelectTemplates, makeSelectTemplatesResponse } from './selectors';
20
20
  import { makeSelectCreate as makeSelectCreateSms} from '../Sms/Create/selectors';
21
21
  import { makeSelectCreate as makeSelectCreateMobilePush } from '../MobilePush/Create/selectors';
@@ -44,11 +44,6 @@ import EmailPreview from '../../v2Components/EmailPreview';
44
44
  import CreativesContainer from '../CreativesContainer';
45
45
  import WechatRichmediaTemplatePreview from '../../v2Components/TemplatePreview/WechatRichmediaTemplatePreview';
46
46
  import { MOBILE_PUSH, WECHAT, SMS, EMAIL, EBILL, LINE } from '../CreativesContainer/constants';
47
- import emailIllustration from '../Assets/images/emailIllustration.svg';
48
- import smsIllustration from '../Assets/images/smsIllustration.svg';
49
- import pushIllustration from '../Assets/images/pushIllustration.svg';
50
-
51
-
52
47
  const {CapCustomCardList} = CapCustomCard;
53
48
  const InlineDiv = styled.div`
54
49
  display: inline;
@@ -84,7 +79,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
84
79
  modeType: null,
85
80
  routeParams: null,
86
81
  };
87
-
88
82
  this.handleOnHoverItem = this.handleOnHoverItem.bind(this);
89
83
  this.handleOnItemClick = this.handleOnItemClick.bind(this);
90
84
  this.handleEditClick = this.handleEditClick.bind(this);
@@ -261,7 +255,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
261
255
  }
262
256
  }
263
257
  if (this.state.channel.toLowerCase() === "mobilepush" && nextProps.CreateMobilePush && nextProps.CreateMobilePush.response && nextProps.CreateMobilePush.response.templateId && nextProps.CreateMobilePush.response.templateId !== '') {
264
-
258
+
265
259
  }
266
260
 
267
261
  if (this.state.channel.toLowerCase() === "ebill" && nextProps.CreateEbill && nextProps.CreateEbill.createResponse && nextProps.CreateEbill.createResponse.templateId && nextProps.CreateEbill.createResponse.templateId !== '') {
@@ -383,8 +377,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
383
377
  this.setState({selectedAccountError: true});
384
378
  this.props.actions.resetTemplate();
385
379
  return;
386
- } else {
387
- this.setState({selectedAccountError: false});
388
380
  }
389
381
  }
390
382
 
@@ -540,32 +532,24 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
540
532
  const accounts = _.get(this.props, 'Templates.weCrmAccounts');
541
533
  return (<div>
542
534
  {filterContent}
543
- <CapSpin spinning={isLoading} tip={loadingTip} style={{width: '100%'}}>
544
- {!isLoading && <div>
545
- {!_.isEmpty(templates) ? <div className="pagination-container">
546
- <CapCustomCardList key={`${currentChannel}-card-list`} cardList={cardDataList} type={currentChannel} />
547
- </div> : ['sms', "email"].includes(this.state.channel.toLowerCase()) && <CapIllustration {...this.getChannelTypeIllustrationInfo(currentChannel)} />
548
- }
549
-
550
- {(this.state.selectedAccount === '' && _.isEmpty(this.props.Templates.selectedWeChatAccount)) && (this.state.channel.toLowerCase() === 'wechat' || this.state.channel.toLowerCase() === "mobilepush") &&
535
+ <CapSpin spinning={isLoading} tip={loadingTip}>
536
+ {!_.isEmpty(templates) && <div className="pagination-container">
537
+ <CapCustomCardList key={`${currentChannel}-card-list`} cardList={cardDataList} type={currentChannel} />
538
+ </div>}
539
+ {(this.state.selectedAccount === '' && _.isEmpty(this.props.Templates.selectedWeChatAccount)) && (this.state.channel.toLowerCase() === 'wechat' || this.state.channel.toLowerCase() === "mobilepush") &&
540
+ <div style={{ height: '65vh', textAlign: 'center', lineHeight: '65vh'}}>
541
+ <CapHeading type="h6">{accounts ? this.props.intl.formatMessage(messages.noAccountMessage) : this.props.intl.formatMessage(messages.noAccountsPresent)}</CapHeading>
542
+ </div>}
543
+ { !_.isEmpty(this.props.Templates.selectedWeChatAccount) && this.state.channel.toLowerCase() === "mobilepush" && this.state.selectedAccountError &&
551
544
  <div style={{ height: '65vh', textAlign: 'center', lineHeight: '65vh'}}>
552
- <CapHeading type="h6">{accounts ? this.props.intl.formatMessage(messages.noAccountMessage) : this.props.intl.formatMessage(messages.noAccountsPresent)}</CapHeading>
545
+ <CapHeading type="h6" >
546
+ {this.props.intl.formatMessage(messages.accountConfigError)}
547
+ <InlineDiv>
548
+ <CapLink title="here" style={{display: 'inline'}} onClick={() => { window.open(config.production.accountConfig`${accountId}`); }}/>
549
+ </InlineDiv>
550
+ </CapHeading>
553
551
  </div>
554
- }
555
-
556
- { !_.isEmpty(this.props.Templates.selectedWeChatAccount) && this.state.channel.toLowerCase() === "mobilepush" && this.state.selectedAccountError ?
557
- <div style={{ height: '65vh', textAlign: 'center', lineHeight: '65vh'}}>
558
- <CapHeading type="h6" >
559
- {this.props.intl.formatMessage(messages.accountConfigError)}
560
- <InlineDiv>
561
- <CapLink title="here" style={{display: 'inline'}} onClick={() => { window.open(config.production.accountConfig`${accountId}`); }}/>
562
- </InlineDiv>
563
- </CapHeading>
564
- </div> : ["mobilepush"].includes(this.state.channel.toLowerCase()) && _.isEmpty(templates) && <CapIllustration {...this.getChannelTypeIllustrationInfo(currentChannel)} />
565
- }
566
- </div>
567
552
  }
568
-
569
553
  </CapSpin>
570
554
 
571
555
  </div>);
@@ -1371,33 +1355,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1371
1355
  (lineLoader !== undefined ? lineLoader : false);
1372
1356
  return isLoading;
1373
1357
  }
1374
- getChannelTypeIllustrationInfo = (type) => {
1375
- switch (type) {
1376
- case 'SMS':
1377
- return {
1378
- buttonLabel: <FormattedMessage {...messages.newSMSTemplate} />,
1379
- onClick: this.createTemplate,
1380
- illustrationImage: smsIllustration,
1381
- title: <FormattedMessage {...messages.smsTitleIllustartion} />,
1382
- };
1383
- case 'EMAIL':
1384
- return {
1385
- buttonLabel: <FormattedMessage {...messages.newEmailTemplate} />,
1386
- onClick: this.createTemplate,
1387
- illustrationImage: emailIllustration,
1388
- title: <FormattedMessage {...messages.emailTitleIllustartion} />,
1389
- };
1390
- case 'MOBILEPUSH':
1391
- return {
1392
- buttonLabel: <FormattedMessage {...messages.newNotificationTemplate} />,
1393
- onClick: this.createTemplate,
1394
- illustrationImage: pushIllustration,
1395
- title: <FormattedMessage {...messages.pushTitleIllustartion} />,
1396
- };
1397
- default:
1398
- return {};
1399
- }
1400
- }
1401
1358
  checkSearchDisabled = () => (this.props.route.name === "mobilepush" && !(this.props.Templates.selectedWeChatAccount && this.props.Templates.selectedWeChatAccount.sourceAccountIdentifier && this.props.Templates.selectedWeChatAccount.configs && (this.props.Templates.selectedWeChatAccount.configs.ios === '1' || this.props.Templates.selectedWeChatAccount.configs.android === '1')))
1402
1359
  renderEmailPreviewModal() {
1403
1360
  const slideboxContent = (
@@ -1434,7 +1391,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1434
1391
  </Modal>);
1435
1392
  return modal;
1436
1393
  };
1437
-
1438
1394
  render() {
1439
1395
  const accountOptions = [];
1440
1396
  const isFullMode = this.isFullMode();
@@ -1609,28 +1565,30 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1609
1565
  >
1610
1566
  </CardGrid>
1611
1567
  );
1612
- const filterContent = ((!_.isEmpty(this.props.TemplatesList) || this.state.channel.toLowerCase() === 'mobilepush' ) && <div className="action-container">
1613
- {!_.isEmpty(this.props.TemplatesList) && <CapInput.Search
1614
- className="search-text"
1615
- style={{width: '210px'}}
1616
- placeholder={this.props.intl.formatMessage(messages.searchText)}
1617
- value={this.state.searchText}
1618
- onChange={(e) => this.searchTemplate(e.target.value)}
1619
- disabled={this.checkSearchDisabled()}
1620
- onClear={() => this.searchTemplate('')}
1621
- />}
1622
- <div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
1623
- {(this.props.location.query.type === 'embedded' ) ? pageHeaderDvs : pageHeader}
1624
- {!_.isEmpty(this.props.TemplatesList) && <CapButton
1625
- type={"primary"}
1626
- disabled={this.isCreateDisabled()}
1627
- style={{marginLeft: '8px'}}
1628
- onClick={this.createTemplate} >
1629
- { this.props.intl.formatMessage(messages.createNewActionButton) }
1630
- </CapButton>}
1631
- </div>
1568
+ const filterContent = (
1569
+ <div className="action-container">
1570
+ <CapInput.Search
1571
+ className="search-text"
1572
+ style={{width: '210px'}}
1573
+ placeholder={this.props.intl.formatMessage(messages.searchText)}
1574
+ value={this.state.searchText}
1575
+ onChange={(e) => this.searchTemplate(e.target.value)}
1576
+ disabled={this.checkSearchDisabled()}
1577
+ onClear={() => this.searchTemplate('')}
1578
+ />
1579
+ <div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
1580
+ {(this.props.location.query.type === 'embedded' ) ? pageHeaderDvs : pageHeader}
1581
+ <CapButton
1582
+ type={"primary"}
1583
+ disabled={this.isCreateDisabled()}
1584
+ style={{marginLeft: '8px'}}
1585
+ onClick={this.createTemplate} >
1586
+ { this.props.intl.formatMessage(messages.createNewActionButton) }
1587
+ </CapButton>
1588
+ </div>
1632
1589
 
1633
- </div>);
1590
+ </div>
1591
+ );
1634
1592
  let htmlPreviewContent = "";
1635
1593
  if (this.state.channel.toLowerCase() === 'ebill') {
1636
1594
  htmlPreviewContent = this.state.previewTemplate && this.state.previewTemplate.versions && this.state.previewTemplate.versions.base && this.state.previewTemplate.versions.base['ebill-editor'];
@@ -1665,6 +1623,10 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1665
1623
  >
1666
1624
  </CardGrid>
1667
1625
  </Pagination>} */}
1626
+ {(((this.state.selectedAccount !== '' && !_.isEmpty(this.props.Templates.selectedWeChatAccount) && this.state.channel.toLowerCase() === 'wechat') || this.state.channel.toLowerCase() !== 'wechat') && _.isEmpty(this.props.TemplatesList)) && !this.props.Templates.getAllTemplatesInProgress &&
1627
+ <div style={{ height: '65vh', textAlign: 'center', lineHeight: '65vh'}}>
1628
+ <CapHeading type="h6">{this.props.intl.formatMessage(messages.noTemplatesMessage)}</CapHeading>
1629
+ </div>}
1668
1630
  </CapRow>
1669
1631
  <CapRow>
1670
1632
  {!_.isEmpty(creativesParams.mode) && isFullMode && //creatives container for fullmode
@@ -1722,7 +1684,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1722
1684
  </div>
1723
1685
  );
1724
1686
  }
1725
-
1726
1687
  }
1727
1688
 
1728
1689
  Templates.propTypes = {
@@ -278,29 +278,5 @@ export default defineMessages({
278
278
  id: `${scope}.accountConfigError`,
279
279
  defaultMessage: 'This account is not configured properly. You can configure it ',
280
280
  },
281
- "newSMSTemplate": {
282
- id: `${scope}.newSMSTemplate`,
283
- defaultMessage: 'New SMS template',
284
- },
285
- "newEmailTemplate": {
286
- id: `${scope}.newEmailTemplate`,
287
- defaultMessage: 'New email template',
288
- },
289
- "newNotificationTemplate": {
290
- id: `${scope}.newNotificationTemplate`,
291
- defaultMessage: 'New notification template',
292
- },
293
- "pushTitleIllustartion": {
294
- id: `${scope}.pushTitleIllustartion`,
295
- defaultMessage: 'Create a mobile push notification template',
296
- },
297
- "emailTitleIllustartion": {
298
- id: `${scope}.emailTitleIllustartion`,
299
- defaultMessage: 'Create an email template',
300
- },
301
- "smsTitleIllustartion": {
302
- id: `${scope}.smsTitleIllustartion`,
303
- defaultMessage: 'Create an SMS template',
304
- },
305
281
 
306
282
  });
Binary file
Binary file