@capillarytech/creatives-library 7.17.181 → 7.17.183-alpha.0

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": "7.17.181",
4
+ "version": "7.17.183-alpha.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -343,6 +343,9 @@ describe("Creatives testing template creation", () => {
343
343
  });
344
344
  await userEvent.click(galleryBtn);
345
345
  delay(10000);
346
+ expect(
347
+ screen.getByText(/loading gallery.../i)
348
+ ).toBeInTheDocument();
346
349
  expect(
347
350
  screen.getByRole('button', {
348
351
  name: /close/i,
@@ -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 { CapHeading, CapHeader, CapInput, CapButton, CapIcon, CapDropdown, CapMenu, CapCustomCard, CapSlideBox, CapLabel, CapIllustration} from '@capillarytech/cap-ui-library';
16
+ import { CapHeading, CapHeader, CapInput, CapButton, CapSpin, CapIcon, CapDropdown, CapMenu, CapCustomCard, CapSlideBox, CapLabel, CapIllustration} from '@capillarytech/cap-ui-library';
17
17
  import { Popover } from 'antd';
18
18
  import makeSelectGallery from './selectors';
19
19
  import messages from './messages';
@@ -24,7 +24,6 @@ import {getMessageObject} from '../../../utils/messageUtils';
24
24
  import * as commonUtil from '../../../utils/common';
25
25
  import Pagination from '../../../v2Components/Pagination';
26
26
  import imageGalleryIllustration from '../images/imageGalleryIllustration.svg';
27
- import CapCustomSkeleton from '../../../v2Components/CapCustomSkeleton';
28
27
  import './_gallery.scss';
29
28
  const {CapCustomCardList} = CapCustomCard;
30
29
  export class Gallery extends React.Component { // eslint-disable-line react/prefer-stateless-function
@@ -350,7 +349,7 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
350
349
  }) : [];
351
350
  return (<div>
352
351
  {filterContent}
353
- <CapCustomSkeleton loader={isLoading}>
352
+ <CapSpin spinning={isLoading} tip={loadingTip} style={{width: "100%"}}>
354
353
  {!isLoading && <div>
355
354
  {!_.isEmpty(templates) || !_.isEmpty(searchText) ? <div className={`pagination-container ${this.props.isLineAsset ? 'gallery-upload' : ''}`}>
356
355
  <CapCustomCardList key={`${currentChannel}-card-list`} cardList={cardDataList} type={'Email'} />
@@ -367,7 +366,7 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
367
366
  )}
368
367
  </div>
369
368
  }
370
- </CapCustomSkeleton>
369
+ </CapSpin>
371
370
 
372
371
  </div>);
373
372
  }
@@ -30,7 +30,7 @@ import {
30
30
  CapIcon,
31
31
  CapRadioCard,
32
32
  CapPopover,
33
- CapSkeleton,
33
+ CapSpin,
34
34
  CapCustomCard,
35
35
  CapRow,
36
36
  CapSlideBox,
@@ -89,7 +89,6 @@ import EmailPreview from '../../v2Components/EmailPreview';
89
89
  import CreativesContainer from '../CreativesContainer';
90
90
  import WhatsappStatusContainer from '../../v2Components/WhatsappStatusContainer';
91
91
  import WechatRichmediaTemplatePreview from '../../v2Components/TemplatePreview/WechatRichmediaTemplatePreview';
92
- import CapCustomSkeleton from '../../v2Components/CapCustomSkeleton';
93
92
  import {
94
93
  CHANNEL_CREATE_TRACK_MAPPING,
95
94
  CHANNEL_EDIT_TRACK_MAPPING,
@@ -635,7 +634,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
635
634
  paramsDefault.username = name;
636
635
  paramsDefault.oa_id = sourceAccountIdentifier;
637
636
  paramsDefault.token = token;
638
- paramsDefault.host = hostName || this.state.hostName || this.props.Templates?.senderDetails?.hostName;
637
+ paramsDefault.host = hostName || this.props.Templates?.senderDetails?.hostName || this.props.Templates?.selectedZaloAccount?.hostName || this.state.hostName;
639
638
  }
640
639
  } else {
641
640
  paramsDefault.wecrmId = wecrm_app_id;
@@ -867,7 +866,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
867
866
  queryParams.username = name;
868
867
  queryParams.oa_id = sourceAccountIdentifier;
869
868
  queryParams.token = token;
870
- queryParams.host = hostName || this.state.hostName || this.props.Templates?.senderDetails?.hostName;
869
+ queryParams.host = hostName || this.props.Templates?.senderDetails?.hostName ||this.state.hostName;
871
870
  }
872
871
  this.setState({ page, templatesCount }, () => {
873
872
  queryParams.page = page;
@@ -1386,7 +1385,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1386
1385
  {[WECHAT, MOBILE_PUSH, INAPP].includes(currentChannel) && this.showAccountName()}
1387
1386
  {filterContent}
1388
1387
  {[WHATSAPP, ZALO].includes(currentChannel) && this.selectedFilters()}
1389
- <CapCustomSkeleton loader={isLoading}>
1388
+ <CapSpin spinning={isLoading} tip={loadingTip} style={{width: '100%'}}>
1390
1389
  {<div>
1391
1390
  {!isEmpty(filteredTemplates) || !isEmpty(this.state.searchText) || !isEmpty(this.props.Templates.templateError) ? (
1392
1391
  <div className={!isEmpty(this.state.searchText) && isEmpty(cardDataList) ? '' : "pagination-container"}>
@@ -1451,7 +1450,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1451
1450
  }
1452
1451
  </div>
1453
1452
  }
1454
- </CapCustomSkeleton>
1453
+ </CapSpin>
1455
1454
  </div>);
1456
1455
  }
1457
1456
  filterLineTemplates = (templates) => {
@@ -2658,7 +2657,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2658
2657
  if (channel === WECHAT && !commonUtil.hasWechatFeatureEnabled()) {
2659
2658
  showNoAccountHeader = true;
2660
2659
  }
2661
- return (<CapSkeleton loading={fetchingWeCrmAccounts} active paragraph={{ rows: 10 }}>
2660
+ return (<CapSpin spinning={fetchingWeCrmAccounts}>
2662
2661
  {showNoAccountHeader ? <FormattedMessage {...noAccountHeader} /> :
2663
2662
  <div style={{ overflowX: "auto", paddingBottom: CAP_SPACE_16 }}>
2664
2663
  <CapHeader
@@ -2679,7 +2678,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2679
2678
  />
2680
2679
  </div>
2681
2680
  }
2682
- </CapSkeleton>);
2681
+ </CapSpin>);
2683
2682
  };
2684
2683
 
2685
2684
  setAccountSelectionMode = () => {