@capillarytech/creatives-library 3.0.22 → 3.0.23
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
|
@@ -38,6 +38,7 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
|
|
|
38
38
|
page: 1,
|
|
39
39
|
perPageLimit: 25,
|
|
40
40
|
totalCount: 0,
|
|
41
|
+
searchLoader: false,
|
|
41
42
|
};
|
|
42
43
|
this.uploadImages = this.uploadImages.bind(this);
|
|
43
44
|
this.openFileDialog = this.openFileDialog.bind(this);
|
|
@@ -205,7 +206,7 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
|
|
|
205
206
|
}
|
|
206
207
|
|
|
207
208
|
searchAsset(value) {
|
|
208
|
-
this.setState({searchText: value}, () => {
|
|
209
|
+
this.setState({searchText: value, searchLoader: true}, () => {
|
|
209
210
|
this.delay(() => {
|
|
210
211
|
const params = {
|
|
211
212
|
name: this.state.searchText,
|
|
@@ -214,6 +215,9 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
|
|
|
214
215
|
params.sortBy = this.state.sortBy;
|
|
215
216
|
}
|
|
216
217
|
this.getAllAssets({params, resetPage: true});
|
|
218
|
+
this.setState({
|
|
219
|
+
searchLoader: false,
|
|
220
|
+
});
|
|
217
221
|
}, 1000);
|
|
218
222
|
});
|
|
219
223
|
}
|
|
@@ -299,6 +303,7 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
|
|
|
299
303
|
}
|
|
300
304
|
getTemplateDataForGrid = ({templates, handlers, filterContent, isLoading, loadingTip}) => {
|
|
301
305
|
const currentChannel = 'gallery';
|
|
306
|
+
const { searchLoader, searchText } = this.state;
|
|
302
307
|
const cardDataList = templates.length ? _.map(templates, (template) => {
|
|
303
308
|
const templateData =
|
|
304
309
|
{
|
|
@@ -334,14 +339,20 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
|
|
|
334
339
|
{filterContent}
|
|
335
340
|
<CapSpin spinning={isLoading} tip={loadingTip} style={{width: "100%"}}>
|
|
336
341
|
{!isLoading && <div>
|
|
337
|
-
{!_.isEmpty(templates) || !_.isEmpty(
|
|
342
|
+
{!_.isEmpty(templates) || !_.isEmpty(searchText) ? <div className="pagination-container">
|
|
338
343
|
<CapCustomCardList key={`${currentChannel}-card-list`} cardList={cardDataList} type={'Email'} />
|
|
339
|
-
{!_.isEmpty(
|
|
344
|
+
{!_.isEmpty(searchText) && _.isEmpty(templates) && (
|
|
340
345
|
<div style={{ height: '65vh', textAlign: 'center', lineHeight: '65vh'}}>
|
|
341
346
|
<CapHeading type="h6">{this.props.intl.formatMessage(messages.noTemplatesFound)}</CapHeading>
|
|
342
347
|
</div>
|
|
343
348
|
)}
|
|
344
|
-
</div> :
|
|
349
|
+
</div> : (
|
|
350
|
+
_.isEmpty(templates) &&
|
|
351
|
+
_.isEmpty(searchText) &&
|
|
352
|
+
!searchLoader &&
|
|
353
|
+
<CapIllustration {...this.getIllustrationProps} />
|
|
354
|
+
)}
|
|
355
|
+
</div>
|
|
345
356
|
}
|
|
346
357
|
</CapSpin>
|
|
347
358
|
|
|
@@ -563,7 +563,14 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
563
563
|
<CapLink title="here" style={{display: 'inline'}} onClick={() => { window.open(config.production.accountConfig`${accountId}`); }}/>
|
|
564
564
|
</InlineDiv>
|
|
565
565
|
</CapHeading>
|
|
566
|
-
</div> :
|
|
566
|
+
</div> : (
|
|
567
|
+
["mobilepush"].includes(this.state.channel.toLowerCase()) &&
|
|
568
|
+
_.isEmpty(templates) &&
|
|
569
|
+
_.isEmpty(this.state.searchText) &&
|
|
570
|
+
<div style={this.isFullMode() ? { height: "calc(100vh - 325px)", overflow: 'auto'} : {}}>
|
|
571
|
+
<CapIllustration {...this.getChannelTypeIllustrationInfo(currentChannel)} />
|
|
572
|
+
</div>
|
|
573
|
+
)
|
|
567
574
|
}
|
|
568
575
|
</div>
|
|
569
576
|
}
|
|
@@ -1646,6 +1653,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1646
1653
|
|
|
1647
1654
|
|
|
1648
1655
|
const creativesParams = this.getCreativesParams();
|
|
1656
|
+
const templates = this.props.TemplatesList || [];
|
|
1649
1657
|
const {route} = this.props;
|
|
1650
1658
|
const loadingTip = (this.props.Templates.sendingFile && (this.state.channel.toLowerCase() === 'email' || this.state.channel.toLowerCase() === 'ebill')) ? this.props.intl.formatMessage(messages.uploadingFile) : this.props.intl.formatMessage(messages.gettingAllTemplates);
|
|
1651
1659
|
return (
|
|
@@ -1654,7 +1662,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1654
1662
|
|
|
1655
1663
|
|
|
1656
1664
|
<CapRow>
|
|
1657
|
-
<Pagination onPageChange={this.onPaginationChange} paginationSelector="pagination-container">
|
|
1665
|
+
<Pagination onPageChange={templates.length ? this.onPaginationChange : () => {}} paginationSelector="pagination-container">
|
|
1658
1666
|
{this.getTemplateDataForGrid({isLoading, loadingTip, channel: this.state.channel, templates: this.props.TemplatesList, filterContent, handlers: {handlePreviewClick: this.handlePreviewClick, handleEditClick: this.handleEditClick}})}
|
|
1659
1667
|
</Pagination>
|
|
1660
1668
|
{/* {!this.props.renderNewCardGrid && ((templateList && templateList.length > 0) || isSearch) && // old UI GRID
|