@capillarytech/creatives-library 3.6.9 → 3.6.10
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
|
@@ -548,6 +548,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
548
548
|
}
|
|
549
549
|
getTemplateDataForGrid = ({templates, handlers, filterContent, channel, isLoading, loadingTip}) => {
|
|
550
550
|
const currentChannel = channel.toUpperCase();
|
|
551
|
+
const {channel: stateChannel} = this.state;
|
|
552
|
+
const channelLowerCase = stateChannel.toLowerCase();
|
|
551
553
|
let filteredTemplates = templates;
|
|
552
554
|
if (currentChannel === WECHAT) {
|
|
553
555
|
filteredTemplates = this.filterWechatTemplates(templates);
|
|
@@ -559,23 +561,23 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
559
561
|
title: <span title={template.name} >{template.name}</span>,
|
|
560
562
|
extra: [
|
|
561
563
|
<CapIcon
|
|
562
|
-
className={`view-${
|
|
564
|
+
className={`view-${channelLowerCase}`}
|
|
563
565
|
style={{marginRight: '16px'}}
|
|
564
566
|
type="eye"
|
|
565
567
|
onClick={() => { if (this.props.isFullMode) { handlers.handlePreviewClick(template); } else { this.props.handlePeviewTemplate(template); } }}
|
|
566
568
|
/>,
|
|
567
569
|
],
|
|
568
|
-
hoverOption: <CapButton className={this.props.isFullMode ? `edit-${
|
|
570
|
+
hoverOption: <CapButton className={this.props.isFullMode ? `edit-${channelLowerCase}` : `select-${channelLowerCase}`} onClick={(e) => handlers.handleEditClick(e, template)}>{this.props.intl.formatMessage(this.props.isFullMode ? messages.creativesTemplatesEdit : messages.selectButton)}</CapButton>,
|
|
569
571
|
};
|
|
570
572
|
if (this.props.isFullMode) {
|
|
571
573
|
templateData.extra.push(<CapDropdown
|
|
572
574
|
overlay={
|
|
573
575
|
<CapMenu>
|
|
574
|
-
{this.state.channel.toUpperCase() !== WECHAT && <CapMenu.Item className={`duplicate-${
|
|
576
|
+
{this.state.channel.toUpperCase() !== WECHAT && <CapMenu.Item className={`duplicate-${channelLowerCase}`} onClick={() => this.duplicateTemplate(template)}>
|
|
575
577
|
<FormattedMessage {...messages.duplicateButton} />
|
|
576
578
|
</CapMenu.Item>}
|
|
577
579
|
<CapMenu.Item
|
|
578
|
-
className={this.state.channel.toUpperCase() === WECHAT && !template.definition ? `unmap-${
|
|
580
|
+
className={this.state.channel.toUpperCase() === WECHAT && !template.definition ? `unmap-${channelLowerCase}` : `delete-${channelLowerCase}`}
|
|
579
581
|
onClick={() => this.deleteTemplate(template)}
|
|
580
582
|
>
|
|
581
583
|
{this.state.channel.toUpperCase() === WECHAT && !template.definition ? <FormattedMessage {...messages.unMapButton} /> : <FormattedMessage {...messages.deleteButton} />}
|
|
@@ -1662,6 +1664,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1662
1664
|
// const isfilterContentVisisble = !isEmpty(this.props.TemplatesList) || !isEmpty(this.state.searchText) || !isEmpty(this.props.Templates.templateError);
|
|
1663
1665
|
const isfilterContentVisisble = true;
|
|
1664
1666
|
const isWechatEmbedded = !this.props.isFullMode && channel.toUpperCase() === WECHAT;
|
|
1667
|
+
const channelLowerCase = channel.toLowerCase();
|
|
1665
1668
|
const filterContent = (( isfilterContentVisisble || [WECHAT, MOBILE_PUSH].includes(this.state.channel.toUpperCase())) && <div className="action-container">
|
|
1666
1669
|
{isfilterContentVisisble && <CapInput.Search
|
|
1667
1670
|
className="search-text"
|
|
@@ -1688,7 +1691,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1688
1691
|
|
|
1689
1692
|
<div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
|
|
1690
1693
|
{isfilterContentVisisble && !isWechatEmbedded && <CapButton
|
|
1691
|
-
className={`create-new-${
|
|
1694
|
+
className={`create-new-${channelLowerCase}`}
|
|
1692
1695
|
type={"primary"}
|
|
1693
1696
|
disabled={this.isCreateDisabled()}
|
|
1694
1697
|
style={{marginLeft: '8px'}}
|