@capillarytech/creatives-library 7.10.60 → 7.10.61

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
@@ -17,6 +17,7 @@ const config = {
17
17
  },
18
18
  development: {
19
19
  api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/creatives',
20
+ //api_endpoint: 'http://localhost:2022/arya/api/v1/creatives',
20
21
  campaigns_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/campaigns',
21
22
  campaigns_api_org_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/org/campaign',
22
23
  auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.10.60",
4
+ "version": "7.10.61",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -154,7 +154,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
154
154
  viberBrandName,
155
155
  viberAccountName,
156
156
  whatsappAccountName,
157
- whatsappContentLen = 0,
157
+ whatsappContentLen,
158
158
  intl,
159
159
  templateData,
160
160
  } = this.props;
@@ -293,6 +293,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
293
293
  );
294
294
 
295
295
  const whatsappUpdatedAccountName = whatsappAccountName || _.get(templateData, 'versions.base.content.whatsapp.accountName', '');
296
+ const whatsappUpdatedLen = whatsappContentLen !== undefined ? 36 + whatsappContentLen : content?.templateMsg?.length;
296
297
 
297
298
  return (
298
299
  <CapRow>
@@ -711,7 +712,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
711
712
  >
712
713
  <FormattedMessage
713
714
  {...messages.whatsappMessageLength}
714
- values={{ length: 36 + whatsappContentLen }}
715
+ values={{ length: whatsappUpdatedLen }}
715
716
  />
716
717
  </CapHeading>
717
718
  </>
@@ -1041,19 +1041,31 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1041
1041
  isEmpty(this.state.searchText) &&
1042
1042
  !isLoading &&
1043
1043
  <div style={this.isFullMode() ? { height: "calc(100vh - 325px)", overflow: 'auto' } : {}}>
1044
- {isEmpty(templates) && <CapIllustration buttonClassName={`create-new-${channelLowerCase}`} {...this.getChannelTypeIllustrationInfo(currentChannel)} />}
1045
- {!isEmpty(templates) && isEmpty(filteredTemplates) && <CapHeader
1046
- title={
1047
- <CapHeading type="h3" style={{ textAlign: "center", marginTop: CAP_SPACE_44 }}>
1048
- {this.props.intl.formatMessage(messages.noFilteredWhatsappTemplatesTitle)}
1049
- </CapHeading>
1050
- }
1051
- description={
1052
- <CapLabel style={{ textAlign: "center" }}>
1053
- {this.props.intl.formatMessage(messages.noFilteredWhatsappTemplatesDesc)}
1054
- </CapLabel>
1055
- }
1056
- />}
1044
+ {this.isFullMode() && isEmpty(templates) && <CapIllustration buttonClassName={`create-new-${channelLowerCase}`} {...this.getChannelTypeIllustrationInfo(currentChannel)} />}
1045
+ {this.isFullMode() && !isEmpty(templates) && isEmpty(filteredTemplates) && <CapHeader
1046
+ title={
1047
+ <CapHeading type="h3" style={{ textAlign: "center", marginTop: CAP_SPACE_44 }}>
1048
+ {this.props.intl.formatMessage(messages.noFilteredWhatsappTemplatesTitle)}
1049
+ </CapHeading>
1050
+ }
1051
+ description={
1052
+ <CapLabel style={{ textAlign: "center" }}>
1053
+ {this.props.intl.formatMessage(messages.noFilteredWhatsappTemplatesDesc)}
1054
+ </CapLabel>
1055
+ }
1056
+ />}
1057
+ {!this.isFullMode() && isEmpty(filteredTemplates) && <CapHeader
1058
+ title={
1059
+ <CapHeading type="h3" style={{ textAlign: "center", marginTop: CAP_SPACE_44 }}>
1060
+ {this.props.intl.formatMessage(messages.noApprovedWhatsappTemplatesTitle)}
1061
+ </CapHeading>
1062
+ }
1063
+ description={
1064
+ <CapLabel style={{ textAlign: "center" }}>
1065
+ {this.props.intl.formatMessage(messages.noApprovedWhatsappTemplatesDesc)}
1066
+ </CapLabel>
1067
+ }
1068
+ />}
1057
1069
  </div>
1058
1070
  )
1059
1071
  }
@@ -354,6 +354,14 @@ export default defineMessages({
354
354
  id: `${scope}.noFilteredWhatsappTemplatesDesc`,
355
355
  defaultMessage: 'Please try searching with another term or apply different filter',
356
356
  },
357
+ "noApprovedWhatsappTemplatesTitle": {
358
+ id: `${scope}.noFilteredWhatsappTemplatesDesc`,
359
+ defaultMessage: 'Sorry, we couldn’t find any approved templates',
360
+ },
361
+ "noApprovedWhatsappTemplatesDesc": {
362
+ id: `${scope}.noFilteredWhatsappTemplatesDesc`,
363
+ defaultMessage: 'Please try creating a new template, once it is approved by Whatsapp it will be available here',
364
+ },
357
365
  "smsTitleIllustartion": {
358
366
  id: `${scope}.smsTitleIllustartion`,
359
367
  defaultMessage: 'Create an SMS {template}',
@@ -51,7 +51,7 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
51
51
  isFullMode,
52
52
  onChannelChange,
53
53
  showDisabledFBInfo,
54
- enableNewChannels,
54
+ enableNewChannels = [],
55
55
  } = props;
56
56
 
57
57
  const defaultPanes = {
@@ -29,7 +29,11 @@ import {
29
29
  CAP_WHITE,
30
30
  } from '@capillarytech/cap-ui-library/styled/variables';
31
31
  import { makeSelectWhatsapp, makeSelectAccount } from './selectors';
32
- import { isLoadingMetaEntities } from '../Cap/selectors';
32
+ import {
33
+ isLoadingMetaEntities,
34
+ makeSelectMetaEntities,
35
+ setInjectedTags,
36
+ } from '../Cap/selectors';
33
37
  import * as WhatsappActions from './actions';
34
38
  import './index.scss';
35
39
  import {
@@ -47,11 +51,10 @@ import {
47
51
  } from './constants';
48
52
  import { DATE_DISPLAY_FORMAT, TIME_DISPLAY_FORMAT } from '../App/constants';
49
53
  import messages from './messages';
50
- import globalMessages from '../Cap/messages'
54
+ import globalMessages from '../Cap/messages';
51
55
  import withCreatives from '../../hoc/withCreatives';
52
56
  import TemplatePreview from '../../v2Components/TemplatePreview';
53
57
  import TagList from '../TagList';
54
- import { makeSelectMetaEntities, setInjectedTags } from '../Cap/selectors';
55
58
  import { validateTags } from '../../utils/tagValidations';
56
59
 
57
60
  let varMap = {};
@@ -76,7 +79,7 @@ export const Whatsapp = (props) => {
76
79
  metaEntities,
77
80
  injectedTags,
78
81
  loadingTags,
79
- getFormData
82
+ getFormData,
80
83
  } = props || {};
81
84
  const { formatMessage } = intl;
82
85
  const { TextArea } = CapInput;
@@ -130,9 +133,8 @@ export const Whatsapp = (props) => {
130
133
  configs = {},
131
134
  name = '',
132
135
  } = accountObj;
133
- const { accessToken = '' } = configs;
134
136
  setAccountId(sourceAccountIdentifier);
135
- setAccessToken(accessToken);
137
+ setAccessToken(configs.accessToken || '');
136
138
  setAccountName(name);
137
139
  }
138
140
  }, [accountData.selectedWhatsappAccount]);
@@ -266,7 +268,7 @@ export const Whatsapp = (props) => {
266
268
  }
267
269
  }, [metaEntities, isEditFlow]);
268
270
 
269
- //performs tag validation
271
+ //performs tag validation
270
272
  useEffect(() => {
271
273
  if (
272
274
  !isFullMode &&
@@ -494,11 +496,13 @@ export const Whatsapp = (props) => {
494
496
  languages: [
495
497
  {
496
498
  language: 'en',
497
- content:
498
- isEditFlow
499
- ? `${updatedSmsEditor.join('')} ${formatMessage(messages.templateMessageUnsubscribeText)}`
499
+ content: isEditFlow
500
+ ? `${updatedSmsEditor.join('')} ${formatMessage(
501
+ messages.templateMessageUnsubscribeText,
502
+ )}`
500
503
  : `$'${templateMessage}\nClick {{${
501
- addedVarCount + 1 }}} to unsubscribe'`,
504
+ addedVarCount + 1
505
+ }}} to unsubscribe'`,
502
506
  },
503
507
  ],
504
508
  mediaType: 'TEXT',
@@ -555,7 +559,7 @@ export const Whatsapp = (props) => {
555
559
  validity: true,
556
560
  type: 'WHATSAPP',
557
561
  });
558
- }
562
+ };
559
563
 
560
564
  const isDisableDone = () => {
561
565
  //if template name is not entered
@@ -884,22 +888,20 @@ export const Whatsapp = (props) => {
884
888
  <TemplatePreview
885
889
  channel={WHATSAPP}
886
890
  content={{ templateMsg }}
887
- whatsappContentLen={isEditFlow ? updatedSmsEditor.join('').length : templateMessage.length}
891
+ whatsappContentLen={
892
+ isEditFlow ? updatedSmsEditor.join('').length : templateMessage.length
893
+ }
888
894
  whatsappAccountName={accountName}
889
895
  />
890
896
  );
891
897
  };
892
898
 
893
- const isEditDoneDisabled = () => {
894
- return isTagValidationError || Object.values(varMap).some( (inputValue) => {
895
- if (inputValue === '') {
896
- return true;
897
- }
898
- });
899
- }
899
+ const isEditDoneDisabled = () =>
900
+ isTagValidationError ||
901
+ Object.values(varMap).some((inputValue) => inputValue === '');
900
902
  return (
901
903
  <CapSpin spinning={spin}>
902
- <CapRow className='cap-whatsapp-creatives'>
904
+ <CapRow className="cap-whatsapp-creatives">
903
905
  <CapColumn span={14}>
904
906
  {isEditFlow ? editModeContent : createModeContent}
905
907
  <div className="whatsapp-scroll-div" />
@@ -9072,7 +9072,7 @@ exports[`Creatives Whatsapp test/> Cancel Btn 1`] = `
9072
9072
  </CapRow>
9073
9073
  <Whatsapp__WhatsappFooter>
9074
9074
  <div
9075
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
9075
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
9076
9076
  >
9077
9077
  <CapButton
9078
9078
  className="whatsapp-create-btn"
@@ -18241,7 +18241,7 @@ exports[`Creatives Whatsapp test/> should render create mode 1`] = `
18241
18241
  </CapRow>
18242
18242
  <Whatsapp__WhatsappFooter>
18243
18243
  <div
18244
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
18244
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
18245
18245
  >
18246
18246
  <CapButton
18247
18247
  className="whatsapp-create-btn"
@@ -24989,7 +24989,7 @@ T&C
24989
24989
  </CapRow>
24990
24990
  <Whatsapp__WhatsappFooter>
24991
24991
  <div
24992
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
24992
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
24993
24993
  />
24994
24994
  </Whatsapp__WhatsappFooter>
24995
24995
  </div>
@@ -32441,7 +32441,7 @@ T&C
32441
32441
  </CapRow>
32442
32442
  <Whatsapp__WhatsappFooter>
32443
32443
  <div
32444
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
32444
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
32445
32445
  />
32446
32446
  </Whatsapp__WhatsappFooter>
32447
32447
  </div>
@@ -40697,7 +40697,7 @@ T&C
40697
40697
  </CapRow>
40698
40698
  <Whatsapp__WhatsappFooter>
40699
40699
  <div
40700
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
40700
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
40701
40701
  />
40702
40702
  </Whatsapp__WhatsappFooter>
40703
40703
  </div>
@@ -50011,7 +50011,7 @@ T&C
50011
50011
  </CapRow>
50012
50012
  <Whatsapp__WhatsappFooter>
50013
50013
  <div
50014
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
50014
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
50015
50015
  />
50016
50016
  </Whatsapp__WhatsappFooter>
50017
50017
  </div>
@@ -59333,7 +59333,7 @@ exports[`Creatives Whatsapp test/> template category change 1`] = `
59333
59333
  </CapRow>
59334
59334
  <Whatsapp__WhatsappFooter>
59335
59335
  <div
59336
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
59336
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
59337
59337
  >
59338
59338
  <CapButton
59339
59339
  className="whatsapp-create-btn"
@@ -68733,7 +68733,7 @@ exports[`Creatives Whatsapp test/> template message 1`] = `
68733
68733
  </CapRow>
68734
68734
  <Whatsapp__WhatsappFooter>
68735
68735
  <div
68736
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
68736
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
68737
68737
  >
68738
68738
  <CapButton
68739
68739
  className="whatsapp-create-btn"
@@ -78392,7 +78392,7 @@ exports[`Creatives Whatsapp test/> template message 2`] = `
78392
78392
  </CapRow>
78393
78393
  <Whatsapp__WhatsappFooter>
78394
78394
  <div
78395
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
78395
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
78396
78396
  >
78397
78397
  <CapButton
78398
78398
  className="whatsapp-create-btn"
@@ -88306,7 +88306,7 @@ exports[`Creatives Whatsapp test/> template message 3`] = `
88306
88306
  </CapRow>
88307
88307
  <Whatsapp__WhatsappFooter>
88308
88308
  <div
88309
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
88309
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
88310
88310
  >
88311
88311
  <CapButton
88312
88312
  className="whatsapp-create-btn"
@@ -98481,7 +98481,7 @@ exports[`Creatives Whatsapp test/> template message 4`] = `
98481
98481
  </CapRow>
98482
98482
  <Whatsapp__WhatsappFooter>
98483
98483
  <div
98484
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
98484
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
98485
98485
  >
98486
98486
  <CapButton
98487
98487
  className="whatsapp-create-btn"
@@ -108917,7 +108917,7 @@ exports[`Creatives Whatsapp test/> template message 5`] = `
108917
108917
  </CapRow>
108918
108918
  <Whatsapp__WhatsappFooter>
108919
108919
  <div
108920
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
108920
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
108921
108921
  >
108922
108922
  <CapButton
108923
108923
  className="whatsapp-create-btn"
@@ -119614,7 +119614,7 @@ exports[`Creatives Whatsapp test/> template message 6`] = `
119614
119614
  </CapRow>
119615
119615
  <Whatsapp__WhatsappFooter>
119616
119616
  <div
119617
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
119617
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
119618
119618
  >
119619
119619
  <CapButton
119620
119620
  className="whatsapp-create-btn"
@@ -129010,7 +129010,7 @@ exports[`Creatives Whatsapp test/> template name change 1`] = `
129010
129010
  </CapRow>
129011
129011
  <Whatsapp__WhatsappFooter>
129012
129012
  <div
129013
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
129013
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
129014
129014
  >
129015
129015
  <CapButton
129016
129016
  className="whatsapp-create-btn"
@@ -138664,7 +138664,7 @@ exports[`Creatives Whatsapp test/> template name change 2`] = `
138664
138664
  </CapRow>
138665
138665
  <Whatsapp__WhatsappFooter>
138666
138666
  <div
138667
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
138667
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
138668
138668
  >
138669
138669
  <CapButton
138670
138670
  className="whatsapp-create-btn"
@@ -148579,7 +148579,7 @@ exports[`Creatives Whatsapp test/> template name change 3`] = `
148579
148579
  </CapRow>
148580
148580
  <Whatsapp__WhatsappFooter>
148581
148581
  <div
148582
- className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 jTxhHk"
148582
+ className="Whatsapp__WhatsappFooter-sc-1ceifzy-0 fCfwuz"
148583
148583
  >
148584
148584
  <CapButton
148585
148585
  className="whatsapp-create-btn"