@capillarytech/creatives-library 3.0.16 → 3.0.18
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 +6 -0
- package/containers/Cap/constants.js +1 -0
- package/containers/Cap/reducer.js +2 -0
- package/containers/Email/index.js +9 -7
- package/containers/MobilePush/Create/index.js +1 -0
- package/containers/MobilePush/Edit/index.js +0 -1
- package/containers/Templates/index.js +1 -1
- package/package.json +1 -1
- package/v2Containers/CallTask/index.js +6 -3
- package/v2Containers/CallTask/messages.js +6 -2
- package/v2Containers/Templates/index.js +15 -10
- package/v2Containers/Templates/messages.js +14 -7
- package/v2Containers/TemplatesV2/index.js +7 -1
|
@@ -51,6 +51,12 @@ 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
|
+
|
|
54
60
|
export function setInjectedTags(injectedTags) {
|
|
55
61
|
return {
|
|
56
62
|
type: types.SET_INJECTED_TAGS, injectedTags,
|
|
@@ -18,6 +18,7 @@ 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';
|
|
21
22
|
export const CLEAR_META_ENTITIES = 'cap/CLEAR_META_ENTITIES';
|
|
22
23
|
export const HIDE_TAGS = 'cap/HIDE_TAGS';
|
|
23
24
|
|
|
@@ -90,6 +90,8 @@ 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', {});
|
|
93
95
|
case types.CLEAR_META_ENTITIES:
|
|
94
96
|
return state.set('metaEntities', {
|
|
95
97
|
layouts: [],
|
|
@@ -2537,13 +2537,15 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2537
2537
|
});
|
|
2538
2538
|
}
|
|
2539
2539
|
});
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2540
|
+
if (temp.standalone.sections && temp.standalone.sections.length > 0) {
|
|
2541
|
+
_.forEach(temp.standalone.sections[1].inputFields[0].cols, (inputField) => {
|
|
2542
|
+
if (inputField.id === "template-version") {
|
|
2543
|
+
const iF = inputField;
|
|
2544
|
+
iF.colStyle = {};
|
|
2545
|
+
iF.colStyle.display = "none";
|
|
2546
|
+
}
|
|
2547
|
+
});
|
|
2548
|
+
}
|
|
2547
2549
|
//}
|
|
2548
2550
|
temp = type === 'embedded' ? this.removeStandAlone(temp) : temp;
|
|
2549
2551
|
this.setState({schema: temp, isSchemaChanged: true, loadingStatus: this.state.loadingStatus + 1}, () => {
|
|
@@ -179,6 +179,7 @@ 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();
|
|
182
183
|
};
|
|
183
184
|
|
|
184
185
|
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' && template.type.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
|
@@ -58,13 +58,15 @@ export class CallTask extends React.Component { // eslint-disable-line react/pre
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
getIllustrationProps=() => {
|
|
61
|
-
const { intl, showContentInSlidebox, onCreateNew } = this.props;
|
|
61
|
+
const { intl, showContentInSlidebox, onCreateNew, isFullMode } = this.props;
|
|
62
62
|
const { formatMessage } = intl;
|
|
63
|
+
const templateIntlText = formatMessage(messages.template);
|
|
64
|
+
const templateText = isFullMode ? templateIntlText : '';
|
|
63
65
|
return {
|
|
64
|
-
buttonLabel: formatMessage(messages.newCallTaskTemplate),
|
|
66
|
+
buttonLabel: formatMessage(messages.newCallTaskTemplate, { templateText }),
|
|
65
67
|
onClick: showContentInSlidebox ? this.showNewCallTask : onCreateNew,
|
|
66
68
|
illustrationImage: calltaskIllustration,
|
|
67
|
-
title: formatMessage(messages.callTaskTitleIllustartion),
|
|
69
|
+
title: formatMessage(messages.callTaskTitleIllustartion, { templateText }),
|
|
68
70
|
};
|
|
69
71
|
}
|
|
70
72
|
render() {
|
|
@@ -129,6 +131,7 @@ CallTask.propTypes = {
|
|
|
129
131
|
loadingMetaEntities: PropTypes.bool,
|
|
130
132
|
showContentInSlidebox: PropTypes.bool,
|
|
131
133
|
onCreateNew: PropTypes.func,
|
|
134
|
+
isFullMode: PropTypes.bool,
|
|
132
135
|
};
|
|
133
136
|
|
|
134
137
|
|
|
@@ -20,10 +20,14 @@ export default defineMessages({
|
|
|
20
20
|
},
|
|
21
21
|
callTaskTitleIllustartion: {
|
|
22
22
|
id: `app.containers.CallTask.callTaskTitleIllustartion`,
|
|
23
|
-
defaultMessage: 'Create a Call Task
|
|
23
|
+
defaultMessage: 'Create a Call Task {templateText}',
|
|
24
24
|
},
|
|
25
25
|
newCallTaskTemplate: {
|
|
26
26
|
id: `app.containers.CallTask.newCallTaskTemplate`,
|
|
27
|
-
defaultMessage: 'New Call Task
|
|
27
|
+
defaultMessage: 'New Call Task {templateText}',
|
|
28
|
+
},
|
|
29
|
+
template: {
|
|
30
|
+
id: `app.containers.CallTask.template`,
|
|
31
|
+
defaultMessage: 'template',
|
|
28
32
|
},
|
|
29
33
|
});
|
|
@@ -542,9 +542,11 @@ 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) || !_.isEmpty(this.state.searchText) || !_.isEmpty(this.props.Templates.templateError) ?
|
|
546
|
-
<
|
|
547
|
-
|
|
545
|
+
{!_.isEmpty(templates) || !_.isEmpty(this.state.searchText) || !_.isEmpty(this.props.Templates.templateError) ? (
|
|
546
|
+
<div className={!_.isEmpty(this.state.searchText) && _.isEmpty(cardDataList) ? '' : "pagination-container"}>
|
|
547
|
+
<CapCustomCardList key={`${currentChannel}-card-list`} cardList={cardDataList} type={currentChannel} />
|
|
548
|
+
</div>)
|
|
549
|
+
: ['sms', "email"].includes(this.state.channel.toLowerCase()) && <CapIllustration {...this.getChannelTypeIllustrationInfo(currentChannel)} />
|
|
548
550
|
}
|
|
549
551
|
|
|
550
552
|
{(this.state.selectedAccount === '' && _.isEmpty(this.props.Templates.selectedWeChatAccount)) && (this.state.channel.toLowerCase() === 'wechat' || this.state.channel.toLowerCase() === "mobilepush") &&
|
|
@@ -1372,27 +1374,30 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1372
1374
|
return isLoading;
|
|
1373
1375
|
}
|
|
1374
1376
|
getChannelTypeIllustrationInfo = (type) => {
|
|
1377
|
+
const { isFullMode, intl } = this.props;
|
|
1378
|
+
const templateIntlMsg = intl.formatMessage(messages.template);
|
|
1379
|
+
const templateText = isFullMode ? templateIntlMsg : '';
|
|
1375
1380
|
switch (type) {
|
|
1376
1381
|
case 'SMS':
|
|
1377
1382
|
return {
|
|
1378
|
-
buttonLabel: <FormattedMessage {...messages.newSMSTemplate} />,
|
|
1383
|
+
buttonLabel: <FormattedMessage {...messages.newSMSTemplate} values={{ template: templateText }} />,
|
|
1379
1384
|
onClick: this.createTemplate,
|
|
1380
1385
|
illustrationImage: smsIllustration,
|
|
1381
|
-
title: <FormattedMessage {...messages.smsTitleIllustartion} />,
|
|
1386
|
+
title: <FormattedMessage {...messages.smsTitleIllustartion} values={{ template: templateText }} />,
|
|
1382
1387
|
};
|
|
1383
1388
|
case 'EMAIL':
|
|
1384
1389
|
return {
|
|
1385
|
-
buttonLabel: <FormattedMessage {...messages.newEmailTemplate} />,
|
|
1390
|
+
buttonLabel: <FormattedMessage {...messages.newEmailTemplate} values={{ template: templateText }} />,
|
|
1386
1391
|
onClick: this.createTemplate,
|
|
1387
1392
|
illustrationImage: emailIllustration,
|
|
1388
|
-
title: <FormattedMessage {...messages.emailTitleIllustartion} />,
|
|
1393
|
+
title: <FormattedMessage {...messages.emailTitleIllustartion} values={{ template: templateText }} />,
|
|
1389
1394
|
};
|
|
1390
1395
|
case 'MOBILEPUSH':
|
|
1391
1396
|
return {
|
|
1392
|
-
buttonLabel: <FormattedMessage {...messages.newNotificationTemplate} />,
|
|
1397
|
+
buttonLabel: <FormattedMessage {...messages.newNotificationTemplate} values={{ template: templateText }} />,
|
|
1393
1398
|
onClick: this.createTemplate,
|
|
1394
1399
|
illustrationImage: pushIllustration,
|
|
1395
|
-
title: <FormattedMessage {...messages.pushTitleIllustartion} />,
|
|
1400
|
+
title: <FormattedMessage {...messages.pushTitleIllustartion} values={{ template: templateText }} />,
|
|
1396
1401
|
};
|
|
1397
1402
|
default:
|
|
1398
1403
|
return {};
|
|
@@ -1668,7 +1673,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1668
1673
|
</Pagination>} */}
|
|
1669
1674
|
{(((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
1675
|
<div style={{ height: '65vh', textAlign: 'center', lineHeight: '65vh'}}>
|
|
1671
|
-
<CapHeading type="h6">{this.props.intl.formatMessage(messages.
|
|
1676
|
+
<CapHeading type="h6">{this.props.intl.formatMessage(messages.noTemplatesFound)}</CapHeading>
|
|
1672
1677
|
</div>}
|
|
1673
1678
|
</CapRow>
|
|
1674
1679
|
|
|
@@ -280,27 +280,34 @@ export default defineMessages({
|
|
|
280
280
|
},
|
|
281
281
|
"newSMSTemplate": {
|
|
282
282
|
id: `${scope}.newSMSTemplate`,
|
|
283
|
-
defaultMessage: 'New SMS template',
|
|
283
|
+
defaultMessage: 'New SMS {template}',
|
|
284
284
|
},
|
|
285
285
|
"newEmailTemplate": {
|
|
286
286
|
id: `${scope}.newEmailTemplate`,
|
|
287
|
-
defaultMessage: 'New email template',
|
|
287
|
+
defaultMessage: 'New email {template}',
|
|
288
288
|
},
|
|
289
289
|
"newNotificationTemplate": {
|
|
290
290
|
id: `${scope}.newNotificationTemplate`,
|
|
291
|
-
defaultMessage: 'New notification template',
|
|
291
|
+
defaultMessage: 'New notification {template}',
|
|
292
292
|
},
|
|
293
293
|
"pushTitleIllustartion": {
|
|
294
294
|
id: `${scope}.pushTitleIllustartion`,
|
|
295
|
-
defaultMessage: 'Create a mobile push notification template',
|
|
295
|
+
defaultMessage: 'Create a mobile push notification {template}',
|
|
296
296
|
},
|
|
297
297
|
"emailTitleIllustartion": {
|
|
298
298
|
id: `${scope}.emailTitleIllustartion`,
|
|
299
|
-
defaultMessage: 'Create an email template',
|
|
299
|
+
defaultMessage: 'Create an email {template}',
|
|
300
300
|
},
|
|
301
301
|
"smsTitleIllustartion": {
|
|
302
302
|
id: `${scope}.smsTitleIllustartion`,
|
|
303
|
-
defaultMessage: 'Create an SMS template',
|
|
303
|
+
defaultMessage: 'Create an SMS {template}',
|
|
304
|
+
},
|
|
305
|
+
"template": {
|
|
306
|
+
id: `${scope}.template`,
|
|
307
|
+
defaultMessage: 'template',
|
|
308
|
+
},
|
|
309
|
+
"noTemplatesFound": {
|
|
310
|
+
id: `${scope}.noTemplatesFound`,
|
|
311
|
+
defaultMessage: 'No templates found',
|
|
304
312
|
},
|
|
305
|
-
|
|
306
313
|
});
|
|
@@ -111,7 +111,13 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
111
111
|
</div>);
|
|
112
112
|
}
|
|
113
113
|
getGalleryComponent = (location) => <Gallery location={location} isFullMode={this.props.isFullMode}/>
|
|
114
|
-
getCallTaskComponent = () =>
|
|
114
|
+
getCallTaskComponent = () => (
|
|
115
|
+
<CallTask
|
|
116
|
+
onCreateNew={this.props.createNew}
|
|
117
|
+
onCallTaskSubmit={this.props.onCallTaskSubmit}
|
|
118
|
+
isFullMode={this.props.isFullMode}
|
|
119
|
+
/>
|
|
120
|
+
);
|
|
115
121
|
|
|
116
122
|
getTemplatesComponent(channel) {
|
|
117
123
|
// const templates = this.props.Templates[`${channel}Templates`];
|