@capillarytech/creatives-library 6.6.1 → 6.6.5

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/index.html CHANGED
@@ -10,7 +10,10 @@
10
10
  <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
11
11
  <meta http-equiv="Pragma" content="no-cache" />
12
12
  <meta http-equiv="Expires" content="0" />
13
+ <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
13
14
  <script src="https://use.typekit.net/ifw1ntv.js"></script>
15
+ <!-- Roboto Font -->
16
+ <link href="https://fonts.googleapis.com/css?family=Roboto:400,500" rel="stylesheet">
14
17
  <!-- Google Tag Manager -->
15
18
  <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
16
19
  new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
@@ -40,8 +43,5 @@
40
43
  </div>
41
44
  </div>
42
45
  <!-- A lot of magic happens in this file. HtmlWebpackPlugin automatically includes all assets (e.g. bundle.js, main.css) with the correct HTML tags, which is why they are missing in this HTML file. Don't add any assets here! (Check out webpackconfig.js if you want to know more) -->
43
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons&display=swap" rel="stylesheet">
44
- <!-- Roboto Font -->
45
- <link href="https://fonts.googleapis.com/css?family=Roboto:400,500&display=swap" rel="stylesheet">
46
46
  </body>
47
47
  </html>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "6.6.1",
4
+ "version": "6.6.5",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -15,5 +15,3 @@ export const WECHAT = "WECHAT";
15
15
  export const FACEBOOK = "FACEBOOK";
16
16
  export const SHOW_CONTANER_LOADER = "app/CreativesContainer/SHOW_CONTANER_LOADER";
17
17
  export const HIDE_CONTAINER_LOADER = "app/CreativesContainer/HIDE_CONTAINER_LOADER";
18
- export const ANDROID = "android";
19
- export const IOS = "ios";
@@ -27,7 +27,6 @@ import messages from './messages';
27
27
  import getEventsMap from '../eventsMap';
28
28
  import { GA } from '@capillarytech/cap-ui-utils';
29
29
  import { TRACK_CREATE_MPUSH } from '../../App/constants';
30
- import { ANDROID, IOS } from '../../CreativesContainer/constants';
31
30
 
32
31
  const PrefixWrapper = styled.div`
33
32
  margin-right: 16px;
@@ -104,10 +103,8 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
104
103
  }
105
104
  if (nextProps.metaEntities && nextProps.metaEntities.layouts && nextProps.metaEntities.layouts.length > 0 && isEmpty(this.state.schema)) {
106
105
  const schema = this.props.params.mode === "text" ? nextProps.metaEntities.layouts[0].definition.textSchema : nextProps.metaEntities.layouts[0].definition.imageSchema;
107
- const account = this.props.Templates.selectedWeChatAccount;
108
- const { commChannels = [] } = account;
109
- const isAndroidSupported = commChannels.includes(ANDROID);
110
- const isIosSupported = commChannels.includes(IOS);
106
+ const isAndroidSupported = get(this, "props.Templates.selectedWeChatAccount.configs.android") === '1';
107
+ const isIosSupported = get(this, "props.Templates.selectedWeChatAccount.configs.ios") === '1';
111
108
  if (!isAndroidSupported) {
112
109
  const androidField = get(schema, "containers[0].panes[0]");
113
110
  androidField.isSupported = false;
@@ -31,7 +31,6 @@ import getEventsMap from '../eventsMap';
31
31
  import {getPrimaryCtaFields, getSecondaryCtaFields, getLinkTypeFields} from '../commonMethods';
32
32
  import { GA } from '@capillarytech/cap-ui-utils';
33
33
  import { TRACK_EDIT_MPUSH } from '../../App/constants';
34
- import { ANDROID, IOS } from '../../CreativesContainer/constants';
35
34
 
36
35
  const PrefixWrapper = styled.div`
37
36
  margin-right: 16px;
@@ -146,10 +145,8 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
146
145
  this.props = nextProps;
147
146
  const mode = nextProps.templateDetails.definition ? nextProps.templateDetails.definition.mode : nextProps.templateDetails.mode;
148
147
  const schema = mode === "text" ? this.state.fullSchema.textSchema : this.state.fullSchema.imageSchema;
149
- const account = this.props.Templates.selectedWeChatAccount;
150
- const { commChannels = [] } = account;
151
- const isAndroidSupported = commChannels.includes(ANDROID);
152
- const isIosSupported = commChannels.includes(IOS);
148
+ const isAndroidSupported = get(this, "props.Templates.selectedWeChatAccount.configs.android") === '1';
149
+ const isIosSupported = get(this, "props.Templates.selectedWeChatAccount.configs.ios") === '1';
153
150
  if (!isAndroidSupported) {
154
151
  const androidField = get(schema, "containers[0].panes[0]");
155
152
  androidField.isSupported = false;
@@ -346,16 +343,16 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
346
343
  licenseCode: selectedWeChatAccount.sourceAccountIdentifier,
347
344
  };
348
345
  if (this.props.location.query && this.props.location.query.module !== 'dvs') {
349
- obj.definition.mode = get(this, 'props.Edit.templateDetails.mode', '') || get(this, 'props.Edit.templateDetails.definition.mode', '');
346
+ obj.definition.mode = this.props.Edit.templateDetails.mode || get(this, 'props.Edit.templateDetails.definition.mode');
350
347
  }
351
348
  const android = {};
352
- Object.keys(formData[0] || {}).forEach((data) => {
349
+ Object.keys(formData[0]).forEach((data) => {
353
350
  if (!!formData[0][data] && data !== "tabKey") {
354
351
  android[data] = formData[0][data];
355
352
  }
356
353
  });
357
354
  const ios = {};
358
- Object.keys(formData[1] || {}).forEach((data) => {
355
+ Object.keys(formData[1]).forEach((data) => {
359
356
  if (!!formData[1][data] && data !== "tabKey") {
360
357
  ios[data] = formData[1][data];
361
358
  }
@@ -51,7 +51,7 @@ import EmailPreview from '../../v2Components/EmailPreview';
51
51
  import CreativesContainer from '../CreativesContainer';
52
52
  import WechatRichmediaTemplatePreview from '../../v2Components/TemplatePreview/WechatRichmediaTemplatePreview';
53
53
  import { CHANNEL_CREATE_TRACK_MAPPING, CHANNEL_EDIT_TRACK_MAPPING } from '../App/constants';
54
- import { MOBILE_PUSH, WECHAT, SMS, EMAIL, EBILL, LINE, ANDROID, IOS } from '../CreativesContainer/constants';
54
+ import { MOBILE_PUSH, WECHAT, SMS, EMAIL, EBILL, LINE } from '../CreativesContainer/constants';
55
55
  import emailIllustration from '../Assets/images/emailIllustration.svg';
56
56
  import smsIllustration from '../Assets/images/smsIllustration.svg';
57
57
  import pushIllustration from '../Assets/images/pushIllustration.svg';
@@ -193,8 +193,11 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
193
193
  queryParams.originalId = this.props.Templates.selectedWeChatAccount.sourceAccountIdentifier;
194
194
  }
195
195
  if (this.state.channel.toLowerCase() === "mobilepush" && !isEmpty(this.props.Templates.selectedWeChatAccount)) {
196
+ const account = this.props.Templates.selectedWeChatAccount;
196
197
  queryParams.accountId = account.id;
197
- if (!this.isAndroidOrIosSuppoerted()) {
198
+ const isAndroidSupported = get(account, "configs.android") === '1';
199
+ const isIosSupported = get(account, "configs.ios") === '1';
200
+ if (!(isAndroidSupported || isIosSupported)) {
198
201
  this.props.actions.resetAccount();
199
202
  return;
200
203
  }
@@ -419,9 +422,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
419
422
  this.props.actions.setWeChatAccount(this.props.Templates.weCrmAccounts[findIndex(this.props.Templates.weCrmAccounts, { name: value})]);
420
423
  const account = this.props.Templates.weCrmAccounts[findIndex(this.props.Templates.weCrmAccounts, { name: value})];
421
424
  params.accountId = account.id;
422
- const { commChannels = [] } = account;
423
- const isAndroidSupported = commChannels.includes(ANDROID);
424
- const isIosSupported = commChannels.includes(IOS);
425
+ const isAndroidSupported = get(account, "configs.android") === '1';
426
+ const isIosSupported = get(account, "configs.ios") === '1';
425
427
  if (!(isAndroidSupported || isIosSupported)) {
426
428
  this.setState({selectedAccountError: true});
427
429
  this.props.actions.resetTemplate();
@@ -690,13 +692,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
690
692
 
691
693
  </div>);
692
694
  }
693
- isAndroidOrIosSuppoerted = () => {
694
- const account = this.props.Templates.selectedWeChatAccount || {};
695
- const { commChannels = [] } = account;
696
- const isAndroidSupported = commChannels.includes(ANDROID);
697
- const isIosSupported = commChannels.includes(IOS);
698
- return isAndroidSupported || isIosSupported;
699
- }
700
695
  filterLineTemplates = (templates) => {
701
696
  const { lineFilter } = this.state;
702
697
  if (LINE_FILTERS.ALL === lineFilter) {
@@ -1559,7 +1554,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1559
1554
  return {};
1560
1555
  }
1561
1556
  }
1562
- checkSearchDisabled = () => (this.props.route.name === "mobilepush" && !(this.props.Templates.selectedWeChatAccount && this.props.Templates.selectedWeChatAccount.sourceAccountIdentifier && this.isAndroidOrIosSuppoerted()))
1557
+ 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')))
1563
1558
  renderEmailPreviewModal() {
1564
1559
  const slideboxContent = (
1565
1560
  <div style={{height: "75vh", width: '55vw'}}>