@capillarytech/creatives-library 3.0.14 → 3.0.16
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/containers/Cap/actions.js +0 -6
- package/containers/Cap/constants.js +0 -1
- package/containers/Cap/reducer.js +0 -2
- package/containers/Email/index.js +7 -9
- package/containers/MobilePush/Create/index.js +0 -1
- package/containers/MobilePush/Edit/index.js +1 -0
- package/containers/Templates/index.js +1 -1
- package/package.json +1 -1
- package/v2Containers/Assets/Gallery/index.js +2 -2
- package/v2Containers/Templates/index.js +11 -4
- package/v2Containers/Templates/reducer.js +4 -3
|
@@ -51,12 +51,6 @@ export function fetchSchemaForEntity(queryParams) {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export function removeEntitySchema() {
|
|
55
|
-
return {
|
|
56
|
-
type: types.ROMOVE_ENTITY_SCHEMA,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
54
|
export function setInjectedTags(injectedTags) {
|
|
61
55
|
return {
|
|
62
56
|
type: types.SET_INJECTED_TAGS, injectedTags,
|
|
@@ -18,7 +18,6 @@ export const GET_USER_DATA_FAILURE = 'cap/GET_USER_DATA_FAILURE';
|
|
|
18
18
|
export const GET_SCHEMA_FOR_ENTITY_FAILURE = 'cap/GET_SCHEMA_FOR_ENTITY_FAILURE';
|
|
19
19
|
export const GET_SCHEMA_FOR_ENTITY_REQUEST = 'cap/GET_SCHEMA_FOR_ENTITY_REQUEST';
|
|
20
20
|
export const GET_SCHEMA_FOR_ENTITY_SUCCESS = 'cap/GET_SCHEMA_FOR_ENTITY_SUCCESS';
|
|
21
|
-
export const ROMOVE_ENTITY_SCHEMA = 'cap/ROMOVE_ENTITY_SCHEMA';
|
|
22
21
|
export const CLEAR_META_ENTITIES = 'cap/CLEAR_META_ENTITIES';
|
|
23
22
|
export const HIDE_TAGS = 'cap/HIDE_TAGS';
|
|
24
23
|
|
|
@@ -90,8 +90,6 @@ function capReducer(state = fromJS(initialState), action) {
|
|
|
90
90
|
tags: action.data && action.entityType === 'TAG' ? action.data.metaEntities : stateMeta.tags,
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
case types.ROMOVE_ENTITY_SCHEMA:
|
|
94
|
-
return state.set('metaEntities', {});
|
|
95
93
|
case types.CLEAR_META_ENTITIES:
|
|
96
94
|
return state.set('metaEntities', {
|
|
97
95
|
layouts: [],
|
|
@@ -2537,15 +2537,13 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2537
2537
|
});
|
|
2538
2538
|
}
|
|
2539
2539
|
});
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
});
|
|
2548
|
-
}
|
|
2540
|
+
_.forEach(temp.standalone.sections[1].inputFields[0].cols, (inputField) => {
|
|
2541
|
+
if (inputField.id === "template-version") {
|
|
2542
|
+
const iF = inputField;
|
|
2543
|
+
iF.colStyle = {};
|
|
2544
|
+
iF.colStyle.display = "none";
|
|
2545
|
+
}
|
|
2546
|
+
});
|
|
2549
2547
|
//}
|
|
2550
2548
|
temp = type === 'embedded' ? this.removeStandAlone(temp) : temp;
|
|
2551
2549
|
this.setState({schema: temp, isSchemaChanged: true, loadingStatus: this.state.loadingStatus + 1}, () => {
|
|
@@ -179,7 +179,6 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
179
179
|
query: type === 'embedded' ? {type: 'embedded', module} : {module},
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
-
this.props.globalActions.removeEntitySchema();
|
|
183
182
|
};
|
|
184
183
|
|
|
185
184
|
componentDidMount = () => {
|
|
@@ -1128,7 +1128,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1128
1128
|
{template._id === this.state.hoveredItem ? <CapButton onClick={(e) => this.handleEditClick(e, template._id)} className="edit-button" type="secondary">{type === 'embedded' ? this.props.intl.formatMessage(messages.selectButton) : this.props.intl.formatMessage(messages.editButton)}</CapButton> : ''}
|
|
1129
1129
|
{template._id === this.state.hoveredItem ? <CapButton onClick={() => this.handlePreviewClick(template)} className="preview-button" type="cancel">{this.props.intl.formatMessage(messages.previewButton)}</CapButton> : ''}
|
|
1130
1130
|
</div>);
|
|
1131
|
-
} else if (this.state.channel.toLowerCase() === 'line'
|
|
1131
|
+
} else if (this.state.channel.toLowerCase() === 'line') {
|
|
1132
1132
|
//content = template.versions.base.messages[0].Text;
|
|
1133
1133
|
content = {
|
|
1134
1134
|
bodyText: template.versions.base.content.messages[0].text ? template.versions.base.content.messages[0].text : '',
|
package/package.json
CHANGED
|
@@ -334,7 +334,7 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
|
|
|
334
334
|
{filterContent}
|
|
335
335
|
<CapSpin spinning={isLoading} tip={loadingTip} style={{width: "100%"}}>
|
|
336
336
|
{!isLoading && <div>
|
|
337
|
-
{!_.isEmpty(templates) ? <div className="pagination-container">
|
|
337
|
+
{!_.isEmpty(templates) || !_.isEmpty(this.state.searchText) ? <div className="pagination-container">
|
|
338
338
|
<CapCustomCardList key={`${currentChannel}-card-list`} cardList={cardDataList} type={'Email'} />
|
|
339
339
|
</div> : <CapIllustration {...this.getIllustrationProps} />}</div>
|
|
340
340
|
}
|
|
@@ -392,7 +392,7 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
|
|
|
392
392
|
}
|
|
393
393
|
render() {
|
|
394
394
|
const assetList = this.props.Gallery.assetList;
|
|
395
|
-
const filterContent = !_.isEmpty(assetList) ? (
|
|
395
|
+
const filterContent = !_.isEmpty(assetList) || !_.isEmpty(this.state.searchText) ? (
|
|
396
396
|
<div className="action-container" style={{ display: 'inline-flex', width: '100%'}}>
|
|
397
397
|
<div style={{ marginTop: '8px', width: '50%'}}>
|
|
398
398
|
<CapInput.Search
|
|
@@ -542,7 +542,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
542
542
|
{filterContent}
|
|
543
543
|
<CapSpin spinning={isLoading} tip={loadingTip} style={{width: '100%'}}>
|
|
544
544
|
{!isLoading && <div>
|
|
545
|
-
{!_.isEmpty(templates) ? <div className="pagination-container">
|
|
545
|
+
{!_.isEmpty(templates) || !_.isEmpty(this.state.searchText) || !_.isEmpty(this.props.Templates.templateError) ? <div className="pagination-container">
|
|
546
546
|
<CapCustomCardList key={`${currentChannel}-card-list`} cardList={cardDataList} type={currentChannel} />
|
|
547
547
|
</div> : ['sms', "email"].includes(this.state.channel.toLowerCase()) && <CapIllustration {...this.getChannelTypeIllustrationInfo(currentChannel)} />
|
|
548
548
|
}
|
|
@@ -1609,8 +1609,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1609
1609
|
>
|
|
1610
1610
|
</CardGrid>
|
|
1611
1611
|
);
|
|
1612
|
-
const
|
|
1613
|
-
|
|
1612
|
+
const isfilterContentVisisble = !_.isEmpty(this.props.TemplatesList) || !_.isEmpty(this.state.searchText) || !_.isEmpty(this.props.Templates.templateError);
|
|
1613
|
+
const filterContent = (( isfilterContentVisisble || this.state.channel.toLowerCase() === 'mobilepush' ) && <div className="action-container">
|
|
1614
|
+
{isfilterContentVisisble && <CapInput.Search
|
|
1614
1615
|
className="search-text"
|
|
1615
1616
|
style={{width: '210px'}}
|
|
1616
1617
|
placeholder={this.props.intl.formatMessage(messages.searchText)}
|
|
@@ -1621,7 +1622,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1621
1622
|
/>}
|
|
1622
1623
|
<div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
|
|
1623
1624
|
{(this.props.location.query.type === 'embedded' ) ? pageHeaderDvs : pageHeader}
|
|
1624
|
-
{
|
|
1625
|
+
{isfilterContentVisisble && <CapButton
|
|
1625
1626
|
type={"primary"}
|
|
1626
1627
|
disabled={this.isCreateDisabled()}
|
|
1627
1628
|
style={{marginLeft: '8px'}}
|
|
@@ -1665,7 +1666,13 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1665
1666
|
>
|
|
1666
1667
|
</CardGrid>
|
|
1667
1668
|
</Pagination>} */}
|
|
1669
|
+
{(((this.state.selectedAccount !== '' && !_.isEmpty(this.props.Templates.selectedWeChatAccount) && this.state.channel.toLowerCase() === 'wechat') || this.state.channel.toLowerCase() !== 'wechat') && _.isEmpty(this.props.TemplatesList)) && !this.props.Templates.getAllTemplatesInProgress && !_.isEmpty(this.state.searchText) &&
|
|
1670
|
+
<div style={{ height: '65vh', textAlign: 'center', lineHeight: '65vh'}}>
|
|
1671
|
+
<CapHeading type="h6">{this.props.intl.formatMessage(messages.noTemplatesMessage)}</CapHeading>
|
|
1672
|
+
</div>}
|
|
1668
1673
|
</CapRow>
|
|
1674
|
+
|
|
1675
|
+
|
|
1669
1676
|
<CapRow>
|
|
1670
1677
|
{!_.isEmpty(creativesParams.mode) && isFullMode && //creatives container for fullmode
|
|
1671
1678
|
<CreativesContainer
|
|
@@ -12,6 +12,7 @@ const initialState = fromJS({
|
|
|
12
12
|
templates: [],
|
|
13
13
|
deleteResponse: {},
|
|
14
14
|
deleteTemplateInProgress: false,
|
|
15
|
+
templateError: {},
|
|
15
16
|
});
|
|
16
17
|
|
|
17
18
|
function templatesReducer(state = initialState, action) {
|
|
@@ -19,20 +20,20 @@ function templatesReducer(state = initialState, action) {
|
|
|
19
20
|
case types.DEFAULT_ACTION:
|
|
20
21
|
return state;
|
|
21
22
|
case types.GET_ALL_TEMPLATES_REQUEST:
|
|
22
|
-
return state.set('getAllTemplatesInProgress', true);
|
|
23
|
+
return state.set('getAllTemplatesInProgress', true).set('templateError', {});
|
|
23
24
|
case types.GET_ALL_TEMPLATES_SUCCESS:
|
|
24
25
|
if (action.isReset) {
|
|
25
26
|
return state.set('getAllTemplatesInProgress', false)
|
|
26
27
|
.set('templates', action.data ? action.data.templates : [])
|
|
27
28
|
.set('isSearch', action.data ? action.data.search : false)
|
|
28
|
-
.set('weCRMtemplates', action.weCRMTemplate ? action.weCRMTemplate : []);
|
|
29
|
+
.set('weCRMtemplates', action.weCRMTemplate ? action.weCRMTemplate : []).set('templateError', {});
|
|
29
30
|
}
|
|
30
31
|
return state.set('getAllTemplatesInProgress', false)
|
|
31
32
|
.set('templates', action.data ? state.get('templates').concat(action.data.templates) : [])
|
|
32
33
|
.set('isSearch', action.data ? action.data.search : false)
|
|
33
34
|
.set('weCRMtemplates', action.weCRMTemplate ? state.get('weCRMtemplates').concat(action.weCRMTemplate) : []);
|
|
34
35
|
case types.GET_ALL_TEMPLATES_FAILURE:
|
|
35
|
-
return state.set('getAllTemplatesInProgress', false);
|
|
36
|
+
return state.set('getAllTemplatesInProgress', false).set('templateError', action.error);
|
|
36
37
|
case types.DELETE_TEMPLATE_REQUEST:
|
|
37
38
|
return state.set('deleteTemplateInProgress', true);
|
|
38
39
|
case types.DELETE_TEMPLATE_SUCCESS:
|