@capillarytech/creatives-library 3.1.7 → 3.1.8

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "3.1.7",
4
+ "version": "3.1.8",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -73,7 +73,7 @@
73
73
  "creatives.componentsV2.CallTaskPreview.header": "This is the CallTaskPreview component !",
74
74
  "creatives.componentsV2.CapTagList.Cancel": "Cancel",
75
75
  "creatives.componentsV2.CapTagList.Ok": "Ok",
76
- "creatives.componentsV2.CapTagList.all": "Dynamic days before expiry",
76
+ "creatives.componentsV2.CapTagList.all": "All",
77
77
  "creatives.componentsV2.CapTagList.dynamic_days_before_expiry": "Dynamic days before expiry",
78
78
  "creatives.componentsV2.CapTagList.gettingTags": "Getting tags...",
79
79
  "creatives.componentsV2.CapTagList.loyalty": "Loyalty",
@@ -182,7 +182,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
182
182
  content={<div>
183
183
  <CapSpin tip={this.props.intl.formatMessage(messages.gettingTags)} spinning={this.props.loading}>
184
184
  <Search style={{ marginBottom: 8, width: '250px'}} placeholder={this.props.intl.formatMessage(messages.search)} onChange={this.onChange} />
185
- {this.props.moduleFilterEnabled ? <CapSelect getPopupContainer={(triggerNode) => triggerNode.parentNode} style={{width: '250px', marginBottom: '16px', minWidth: 'initial', display: 'inherit'}} onChange={this.props.onContextChange} defaultValue="All" options={options}>
185
+ {this.props.moduleFilterEnabled ? <CapSelect getPopupContainer={(triggerNode) => triggerNode.parentNode} style={{width: '250px', marginBottom: '16px', minWidth: 'initial', display: 'inherit'}} onChange={this.props.onContextChange} defaultValue={this.props.intl.formatMessage(messages.all)} options={options}>
186
186
  </CapSelect> : ''}
187
187
  <CapTree
188
188
  styling={{height: '350px', overflow: 'auto'}}
@@ -24,7 +24,7 @@ export default defineMessages({
24
24
  },
25
25
  "all": {
26
26
  id: 'creatives.componentsV2.CapTagList.all',
27
- defaultMessage: 'Dynamic days before expiry',
27
+ defaultMessage: 'All',
28
28
  },
29
29
  "outbound": {
30
30
  id: 'creatives.componentsV2.CapTagList.outbound',
@@ -22,7 +22,6 @@ class WechatRichmediaTemplatePreview extends React.PureComponent { // eslint-dis
22
22
  const content = JSON.parse(JSON.stringify(mediaList));
23
23
  const mediaListLength = content.length;
24
24
  const contentData = content[0];
25
- console.log("archita medialist: ", mediaList, content, mediaListLength);
26
25
  previewMsg.push(
27
26
  <div className="image-container">
28
27
  <img alt="default" width="100%" height="102px" src={contentData.image_url} />
@@ -45,11 +44,10 @@ class WechatRichmediaTemplatePreview extends React.PureComponent { // eslint-dis
45
44
  previewMsg.push(
46
45
  <div className="additional-richmedia-container">
47
46
  <div><CapHeading type="label7" style={{width: '170px', top: '12px', position: 'relative'}}>{data.title}</CapHeading></div>
48
- <img alt="default" width="40px" height="40px" src={data.image_url} />
47
+ <img alt="default" width="34px" height="34px" src={data.image_url} />
49
48
  </div>
50
49
  );
51
50
  });
52
- console.log("archita return obj: ", previewMsg);
53
51
  return (
54
52
  <div className="richmedia-template">
55
53
  {previewMsg}
@@ -387,7 +387,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
387
387
 
388
388
  onAccountSelect(e) {
389
389
  const value = e.target.value;
390
- console.log("onAccountSelect", e, value);
391
390
  this.setState({selectedAccount: value}, () => {
392
391
  const params = {
393
392
  name: this.state.searchText,
@@ -532,18 +531,14 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
532
531
  };
533
532
  filterWechatTemplates = (templates) => {
534
533
  const { wechatFilter } = this.state;
535
- switch(wechatFilter) {
534
+ switch (wechatFilter) {
536
535
  case WECHAT_FILTERS.RICHMEDIA:
537
- return templates.filter(function (template) {
538
- return template.definition && template.definition.msgcontent.toUpperCase() === "RICH_MEDIA_WECHAT";
539
- });
536
+ return templates.filter((template) => template.definition && template.definition.msgcontent.toUpperCase() === "RICH_MEDIA_WECHAT");
540
537
  case WECHAT_FILTERS.MAPTEMPLATES:
541
- return templates.filter(function (template) {
542
- return !template.definition;
543
- });
538
+ return templates.filter((template) => !template.definition);
544
539
  default:
545
540
  return templates;
546
- };
541
+ }
547
542
  }
548
543
  getTemplateDataForGrid = ({templates, handlers, filterContent, channel, isLoading, loadingTip}) => {
549
544
  const currentChannel = channel.toUpperCase();
@@ -1585,7 +1580,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1585
1580
  <CapRadioCard
1586
1581
  className="select-account"
1587
1582
  onChange={this.onAccountSelect}
1588
- value={this.props.Templates.selectedWeChatAccount ? this.props.Templates.selectedWeChatAccount.name : undefined}
1589
1583
  panes={accountOptions}
1590
1584
  cardHeight="48px"
1591
1585
  cardWidth="276px"
@@ -1611,7 +1605,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1611
1605
  const isMobilePushChannel = channel === MOBILE_PUSH;
1612
1606
  return (<CapHeader
1613
1607
  title={<CapHeading type="h4">{isMobilePushChannel ? this.props.intl.formatMessage(messages.mobilepushAccount) : this.props.intl.formatMessage(messages.wechatAccount)}</CapHeading>}
1614
- description={<><CapHeading type="h3">{selectedAccount} {weCrmAccounts.length > 1 && <CapLink onClick={this.setAccountSelectionMode} style={{display: 'inline-block', position: 'relative', top: '3px'}} fontWeight="regular" fontSize="14px" title="change"/>} </CapHeading></>}
1608
+ description={<><CapHeading type="h3">{selectedAccount} {weCrmAccounts.length > 1 && <CapLink onClick={this.setAccountSelectionMode} style={{display: 'inline-block', position: 'relative', top: '3px'}} fontWeight="regular" fontSize="14px" title="change"/>} </CapHeading></>}
1615
1609
  size="regular"
1616
1610
  />);
1617
1611
  }
@@ -1649,6 +1643,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1649
1643
  //TODO -> uncomment the following line
1650
1644
  // const isfilterContentVisisble = !isEmpty(this.props.TemplatesList) || !isEmpty(this.state.searchText) || !isEmpty(this.props.Templates.templateError);
1651
1645
  const isfilterContentVisisble = true;
1646
+ const isWechatEmbedded = !this.props.isFullMode && channel.toUpperCase() === WECHAT;
1652
1647
  const filterContent = (( isfilterContentVisisble || [WECHAT, MOBILE_PUSH].includes(this.state.channel.toUpperCase())) && <div className="action-container">
1653
1648
  {isfilterContentVisisble && <CapInput.Search
1654
1649
  className="search-text"
@@ -1673,7 +1668,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1673
1668
  </CapRadio.CapRadioGroup>
1674
1669
  }
1675
1670
  <div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
1676
- {isfilterContentVisisble && <CapButton
1671
+ {isfilterContentVisisble && !isWechatEmbedded && <CapButton
1677
1672
  type={"primary"}
1678
1673
  disabled={this.isCreateDisabled()}
1679
1674
  style={{marginLeft: '8px'}}
@@ -18,8 +18,6 @@ import cloneDeep from 'lodash/cloneDeep';
18
18
  import forEach from 'lodash/forEach';
19
19
  import isEqual from 'lodash/isEqual';
20
20
  import get from 'lodash/get';
21
-
22
- import { Menu } from 'antd';
23
21
  import { CapRow, CapColumn, CapButton, CapCard, CapSpin, CapInput, CapHeading, CapDivider, CapIcon, CapLink } from '@capillarytech/cap-ui-library';
24
22
  import makeSelectCreate, {makeSelectTemplates, getAssetDetails, getContentAssetDetails} from './selectors';
25
23
  import * as actions from './actions';
@@ -925,11 +923,11 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
925
923
  />
926
924
  <div className="wechat-container">
927
925
  <CapRow className="wechat-form-container">
928
- <CapColumn span={8}>
926
+ <CapColumn span={9}>
929
927
  {cardLayout}
930
928
  {!this.state.isIframe && contentMenu}
931
929
  </CapColumn>
932
- <CapColumn span={16}>
930
+ <CapColumn span={15}>
933
931
  { !isIframe && <CapInput
934
932
  label="Name of the template"
935
933
  value={this.state.templateName}