@capillarytech/creatives-library 7.17.180 → 7.17.182
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 +1 -1
- package/package.json +1 -1
- package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +3 -0
- package/v2Containers/Assets/Gallery/index.js +3 -4
- package/v2Containers/Templates/index.js +7 -8
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +601 -154
- package/assets/loading_image.avif +0 -0
- package/v2Components/CapCustomSkeleton/index.js +0 -58
- package/v2Components/CapCustomSkeleton/tests/__snapshots__/index.test.js.snap +0 -264
- package/v2Components/CapCustomSkeleton/tests/index.test.js +0 -12
- package/v2Containers/Cap/Loadable.js +0 -25
- package/v2Containers/Templates/Loadable.js +0 -25
- package/v2Containers/TemplatesV2/Loadable.js +0 -25
package/config/app.js
CHANGED
|
@@ -16,7 +16,7 @@ const config = {
|
|
|
16
16
|
accountConfig: (strs, accountId) => `${window.location.origin}/org/config/AccountAdd?q=a&channelId=2&accountId=${accountId}&edit=1`,
|
|
17
17
|
},
|
|
18
18
|
development: {
|
|
19
|
-
api_endpoint: '
|
|
19
|
+
api_endpoint: 'http://localhost:2022/arya/api/v1/creatives',
|
|
20
20
|
campaigns_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/campaigns',
|
|
21
21
|
campaigns_api_org_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/org/campaign',
|
|
22
22
|
auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
|
package/package.json
CHANGED
|
@@ -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
|
-
<
|
|
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
|
-
</
|
|
369
|
+
</CapSpin>
|
|
371
370
|
|
|
372
371
|
</div>);
|
|
373
372
|
}
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
CapIcon,
|
|
31
31
|
CapRadioCard,
|
|
32
32
|
CapPopover,
|
|
33
|
-
|
|
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,
|
|
@@ -625,7 +624,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
625
624
|
} = configs || {};
|
|
626
625
|
if (weCrmChannels.includes(selectedChannel)) {
|
|
627
626
|
if ([WHATSAPP_LOWERCASE, ZALO_LOWERCASE].includes(selectedChannel)) {
|
|
628
|
-
if (hostName === '') {
|
|
627
|
+
if (hostName === '' && selectedChannel === WHATSAPP_LOWERCASE) {
|
|
629
628
|
return;
|
|
630
629
|
}
|
|
631
630
|
|
|
@@ -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.state.hostName || this.props.Templates?.senderDetails?.hostName || this.props.Templates?.selectedZaloAccount?.hostName;
|
|
639
638
|
}
|
|
640
639
|
} else {
|
|
641
640
|
paramsDefault.wecrmId = wecrm_app_id;
|
|
@@ -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
|
-
<
|
|
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
|
-
</
|
|
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 (<
|
|
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
|
-
</
|
|
2681
|
+
</CapSpin>);
|
|
2683
2682
|
};
|
|
2684
2683
|
|
|
2685
2684
|
setAccountSelectionMode = () => {
|