@capillarytech/creatives-library 3.0.16 → 3.0.17
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 +9 -6
- package/v2Containers/Templates/messages.js +10 -6
- 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
|
});
|
|
@@ -1372,27 +1372,30 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1372
1372
|
return isLoading;
|
|
1373
1373
|
}
|
|
1374
1374
|
getChannelTypeIllustrationInfo = (type) => {
|
|
1375
|
+
const { isFullMode, intl } = this.props;
|
|
1376
|
+
const templateIntlMsg = intl.formatMessage(messages.template);
|
|
1377
|
+
const templateText = isFullMode ? templateIntlMsg : '';
|
|
1375
1378
|
switch (type) {
|
|
1376
1379
|
case 'SMS':
|
|
1377
1380
|
return {
|
|
1378
|
-
buttonLabel: <FormattedMessage {...messages.newSMSTemplate} />,
|
|
1381
|
+
buttonLabel: <FormattedMessage {...messages.newSMSTemplate} values={{ template: templateText }} />,
|
|
1379
1382
|
onClick: this.createTemplate,
|
|
1380
1383
|
illustrationImage: smsIllustration,
|
|
1381
|
-
title: <FormattedMessage {...messages.smsTitleIllustartion} />,
|
|
1384
|
+
title: <FormattedMessage {...messages.smsTitleIllustartion} values={{ template: templateText }} />,
|
|
1382
1385
|
};
|
|
1383
1386
|
case 'EMAIL':
|
|
1384
1387
|
return {
|
|
1385
|
-
buttonLabel: <FormattedMessage {...messages.newEmailTemplate} />,
|
|
1388
|
+
buttonLabel: <FormattedMessage {...messages.newEmailTemplate} values={{ template: templateText }} />,
|
|
1386
1389
|
onClick: this.createTemplate,
|
|
1387
1390
|
illustrationImage: emailIllustration,
|
|
1388
|
-
title: <FormattedMessage {...messages.emailTitleIllustartion} />,
|
|
1391
|
+
title: <FormattedMessage {...messages.emailTitleIllustartion} values={{ template: templateText }} />,
|
|
1389
1392
|
};
|
|
1390
1393
|
case 'MOBILEPUSH':
|
|
1391
1394
|
return {
|
|
1392
|
-
buttonLabel: <FormattedMessage {...messages.newNotificationTemplate} />,
|
|
1395
|
+
buttonLabel: <FormattedMessage {...messages.newNotificationTemplate} values={{ template: templateText }} />,
|
|
1393
1396
|
onClick: this.createTemplate,
|
|
1394
1397
|
illustrationImage: pushIllustration,
|
|
1395
|
-
title: <FormattedMessage {...messages.pushTitleIllustartion} />,
|
|
1398
|
+
title: <FormattedMessage {...messages.pushTitleIllustartion} values={{ template: templateText }} />,
|
|
1396
1399
|
};
|
|
1397
1400
|
default:
|
|
1398
1401
|
return {};
|
|
@@ -280,27 +280,31 @@ 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',
|
|
304
308
|
},
|
|
305
309
|
|
|
306
310
|
});
|
|
@@ -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`];
|