@capillarytech/creatives-library 0.0.2 → 0.0.3
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/components/CapTagList/index.js +2 -2
- package/components/CapTagList/messages.js +4 -0
- package/components/CardGrid/index.js +2 -2
- package/components/Ckeditor/index.js +3 -1
- package/components/Edmeditor/index.js +1 -1
- package/components/FormBuilder/index.js +143 -38
- package/containers/Ebill/index.js +1 -1
- package/containers/Ebill/reducer.js +5 -2
- package/containers/Ebill/sagas.js +6 -2
- package/containers/Email/_email.scss +9 -0
- package/containers/Email/index.js +643 -602
- package/containers/Email/reducer.js +5 -2
- package/containers/Email/sagas.js +6 -2
- package/containers/MobilePush/Create/index.js +23 -1
- package/containers/MobilePush/Create/messages.js +1 -1
- package/containers/MobilePush/Create/reducer.js +6 -3
- package/containers/MobilePush/Create/sagas.js +6 -3
- package/containers/MobilePush/Edit/index.js +22 -1
- package/containers/MobilePush/Edit/messages.js +1 -1
- package/containers/MobilePush/Edit/reducer.js +6 -3
- package/containers/MobilePush/Edit/sagas.js +6 -3
- package/containers/Sms/Create/index.js +18 -11
- package/containers/Sms/Create/messages.js +4 -0
- package/containers/Sms/Create/reducer.js +6 -3
- package/containers/Sms/Create/sagas.js +7 -2
- package/containers/Sms/Edit/index.js +18 -11
- package/containers/Sms/Edit/messages.js +4 -0
- package/containers/Sms/Edit/reducer.js +6 -3
- package/containers/Sms/Edit/sagas.js +7 -2
- package/containers/Templates/index.js +85 -19
- package/containers/Templates/messages.js +28 -0
- package/containers/Templates/reducer.js +3 -2
- package/package.json +1 -1
|
@@ -77,7 +77,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
77
77
|
handleOk = () => {
|
|
78
78
|
const days = this.state.dynamicDateValue;
|
|
79
79
|
let tagValue = this.state.tagValue;
|
|
80
|
-
tagValue = tagValue.replace("N", `${days}`);
|
|
80
|
+
tagValue = tagValue.replace("(N)", `${days}`);
|
|
81
81
|
const resultArray = [];
|
|
82
82
|
resultArray.push(tagValue);
|
|
83
83
|
this.props.onSelect(resultArray);
|
|
@@ -202,7 +202,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
202
202
|
</CapPopover>
|
|
203
203
|
<Modal
|
|
204
204
|
visible={this.state.showModal}
|
|
205
|
-
title={"Dynamic Days before Expiry"}
|
|
205
|
+
title={this.props.intl.formatMessage(messages["Dynamic Days before Expiry"])}
|
|
206
206
|
onOk={this.handleOk}
|
|
207
207
|
onCancel={this.handleCancel}
|
|
208
208
|
footer={[
|
|
@@ -18,4 +18,8 @@ export default defineMessages({
|
|
|
18
18
|
id: 'app.components.CapTagList.Cancel',
|
|
19
19
|
defaultMessage: 'Cancel',
|
|
20
20
|
},
|
|
21
|
+
"Dynamic Days before Expiry": {
|
|
22
|
+
id: 'app.components.CapTagList.dynamic_days_before_expiry',
|
|
23
|
+
defaultMessage: 'Dynamic Days before Expiry',
|
|
24
|
+
},
|
|
21
25
|
});
|
|
@@ -27,7 +27,7 @@ class CardGrid extends React.Component { // eslint-disable-line react/prefer-sta
|
|
|
27
27
|
return (
|
|
28
28
|
<div className={this.props.className}>
|
|
29
29
|
<div style={{ marginBottom: '16px' }}>{this.props.filterContent}</div>
|
|
30
|
-
<div className={this.props.enablePagination ? 'pagination-container' : ''}>
|
|
30
|
+
{this.props.listItem && this.props.listItem.length > 0 && <div className={this.props.enablePagination ? 'pagination-container' : ''}>
|
|
31
31
|
<Row gutter={this.props.gutterSize}>
|
|
32
32
|
{ this.props.listItem ? this.props.listItem.map( (item) => (
|
|
33
33
|
<Col style={{ width: `${100 / this.props.colNumber}%`, paddingBottom: '16px'}} key={item.id} span={parseInt(24 / this.props.colNumber, 10)}>
|
|
@@ -35,7 +35,7 @@ class CardGrid extends React.Component { // eslint-disable-line react/prefer-sta
|
|
|
35
35
|
</Col>
|
|
36
36
|
)) : ''}
|
|
37
37
|
</Row>
|
|
38
|
-
</div>
|
|
38
|
+
</div>}
|
|
39
39
|
</div>
|
|
40
40
|
);
|
|
41
41
|
}
|
|
@@ -143,7 +143,9 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
|
|
|
143
143
|
);
|
|
144
144
|
console.log('2');
|
|
145
145
|
|
|
146
|
-
this.props.getEditorInstanse
|
|
146
|
+
if (this.props.getEditorInstanse) {
|
|
147
|
+
this.props.getEditorInstanse(this.editorInstance);
|
|
148
|
+
}
|
|
147
149
|
|
|
148
150
|
//Register listener for custom events if any
|
|
149
151
|
this.editorInstance.on('change', this.handleContentChange);
|
|
@@ -42,7 +42,7 @@ class Edmeditor extends React.Component { // eslint-disable-line react/prefer-st
|
|
|
42
42
|
console.log('current language edm editor loading', this.props.id, this.props.edmSrc);
|
|
43
43
|
return (
|
|
44
44
|
this.props.edmSrc ?
|
|
45
|
-
(<iframe id={this.props.id} className={this.props.activeClass} src={this.props.edmSrc} height="
|
|
45
|
+
(<iframe id={this.props.id} className={this.props.activeClass} src={this.props.edmSrc} height="460" width="100%"></iframe>)
|
|
46
46
|
: 'aaasass'
|
|
47
47
|
);
|
|
48
48
|
}
|
|
@@ -232,7 +232,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
232
232
|
console.log('Inside Tags', nextProps.tags, this.props.tags);
|
|
233
233
|
this.validateForm(nextProps.tags, nextProps.injectedTags);
|
|
234
234
|
}
|
|
235
|
-
if (
|
|
235
|
+
if (!_.isEqual(nextProps.showModal, this.props.showModal)) {
|
|
236
236
|
console.log('Inside Modal change ', nextProps.showModal);
|
|
237
237
|
this.setState({showModal: nextProps.showModal});
|
|
238
238
|
}
|
|
@@ -277,11 +277,37 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
277
277
|
>
|
|
278
278
|
{this.state.modal.body}
|
|
279
279
|
</Modal>);
|
|
280
|
+
} else if (this.state.modal.type === "action") {
|
|
281
|
+
modal = (<Modal
|
|
282
|
+
visible={this.state.showModal}
|
|
283
|
+
title={this.state.modal.title}
|
|
284
|
+
onOk={this.handleOk}
|
|
285
|
+
onCancel={this.handleCancel}
|
|
286
|
+
footer={[
|
|
287
|
+
]}
|
|
288
|
+
afterClose={this.handleCloseModal}
|
|
289
|
+
>
|
|
290
|
+
{this.state.modal.jsx}
|
|
291
|
+
</Modal>);
|
|
280
292
|
}
|
|
281
293
|
}
|
|
282
294
|
return modal;
|
|
283
295
|
};
|
|
284
296
|
|
|
297
|
+
handleCloseModal = (data, e) => {
|
|
298
|
+
console.log('handle close modal', data, e);
|
|
299
|
+
const event = this.state.currentEvent;
|
|
300
|
+
if (!_.isEmpty(this.state.currentEvent)) {
|
|
301
|
+
switch (event) {
|
|
302
|
+
case "addLanguage":
|
|
303
|
+
this.updateFormData(this.state.currentEventData, this.state.currentEventVal, this.state.currentEvent);
|
|
304
|
+
break;
|
|
305
|
+
default:
|
|
306
|
+
break;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
285
311
|
handleVisibleChange = (popoverVisible) => {
|
|
286
312
|
this.setState({ popoverVisible });
|
|
287
313
|
};
|
|
@@ -632,10 +658,12 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
632
658
|
}
|
|
633
659
|
}
|
|
634
660
|
if(_.isEmpty(androidData) && this.state.currentTab === 2){
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
661
|
+
this.setState({androidValid, iosValid}, () => {
|
|
662
|
+
this.props.setModalContent('ios');
|
|
663
|
+
});
|
|
664
|
+
// modal.body = "Android template is not configured. Save without Android template";
|
|
665
|
+
// modal.id = "ios";
|
|
666
|
+
// modal.type = 'confirm';
|
|
639
667
|
return;
|
|
640
668
|
}
|
|
641
669
|
const iosData = {};
|
|
@@ -645,10 +673,13 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
645
673
|
}
|
|
646
674
|
}
|
|
647
675
|
if(_.isEmpty(iosData) && this.state.currentTab === 1){
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
676
|
+
this.setState({androidValid, iosValid}, () => {
|
|
677
|
+
this.props.setModalContent('android');
|
|
678
|
+
});
|
|
679
|
+
// modal.body = "IOS template is not configured, Save without IOS template";
|
|
680
|
+
// modal.id = 'android';
|
|
681
|
+
// modal.type = 'confirm';
|
|
682
|
+
// this.setState({modal, showModal: true, androidValid, iosValid});
|
|
652
683
|
return;
|
|
653
684
|
}
|
|
654
685
|
}
|
|
@@ -1385,7 +1416,10 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1385
1416
|
formData[currentTab].selectedLanguages.splice(deleteLanguageIndex, 1);
|
|
1386
1417
|
formData[currentTab].tabKey = baseLangTabKey;
|
|
1387
1418
|
if (formData[currentTab].base) {
|
|
1419
|
+
delete formData.base[currentLang];
|
|
1420
|
+
delete formData.base.selectedLanguages.splice(deleteLanguageIndex, 1);
|
|
1388
1421
|
formData.base.tabKey = baseLangTabKey;
|
|
1422
|
+
formData.base.activeTab = this.props.baseLanguage;
|
|
1389
1423
|
}
|
|
1390
1424
|
console.log('After Deleting Form data ', formData);
|
|
1391
1425
|
this.setState({formData, currentLangTab: this.props.baseLanguage, tabKey: baseLangTabKey}, () => {
|
|
@@ -1409,17 +1443,74 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1409
1443
|
if (this.state.usingTabContainer && !val.standalone) {
|
|
1410
1444
|
const data1 = data;
|
|
1411
1445
|
if (event === "addLanguage") {
|
|
1412
|
-
const
|
|
1413
|
-
|
|
1414
|
-
baseTab
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1446
|
+
const addLanguageType = this.props.addLanguageType;
|
|
1447
|
+
const currentLang = formData[tabIndex].activeTab;
|
|
1448
|
+
let baseTab = _.cloneDeep(formData[tabIndex][currentLang]);
|
|
1449
|
+
let id = _.uniqueId();
|
|
1450
|
+
let validId = false;
|
|
1451
|
+
switch (addLanguageType) {
|
|
1452
|
+
case "upload":
|
|
1453
|
+
baseTab = _.cloneDeep(formData[tabIndex][currentLang]);
|
|
1454
|
+
console.log('Add Language Event', JSON.stringify(formData), "\n", JSON.stringify(baseTab));
|
|
1455
|
+
baseTab.iso_code = data.iso_code;
|
|
1456
|
+
baseTab.lang_id = data.lang_id;
|
|
1457
|
+
baseTab.language = data.language;
|
|
1458
|
+
while (!validId) {
|
|
1459
|
+
validId = true;
|
|
1460
|
+
for (let idx = 0; idx < formData[tabIndex].selectedLanguages.length; idx += 1) {
|
|
1461
|
+
if (!formData[idx]) {
|
|
1462
|
+
continue;
|
|
1463
|
+
}
|
|
1464
|
+
if (id === formData[idx].tabKey) {
|
|
1465
|
+
validId = false;
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
if (validId) {
|
|
1469
|
+
break;
|
|
1470
|
+
}
|
|
1471
|
+
id = _.uniqueId();
|
|
1472
|
+
}
|
|
1473
|
+
baseTab.tabKey = id;
|
|
1474
|
+
//formData[tabIndex].selectedLanguages.push(data.iso_code);
|
|
1475
|
+
formData[tabIndex][data.iso_code] = baseTab;
|
|
1476
|
+
console.log('Add Language Event After', formData);
|
|
1477
|
+
formData[tabIndex].activeTab = data.iso_code;
|
|
1478
|
+
formData[tabIndex].tabKey = baseTab.tabKey;
|
|
1479
|
+
break;
|
|
1480
|
+
case "copyPrimaryLanguage":
|
|
1481
|
+
case "useEditor":
|
|
1482
|
+
baseTab = _.cloneDeep(formData[tabIndex][this.props.baseLanguage]);
|
|
1483
|
+
console.log('Add Language Event', data, val, tabIndex, _.cloneDeep(baseTab));
|
|
1484
|
+
//baseTab['template-content'] = '';
|
|
1485
|
+
baseTab.iso_code = data.iso_code;
|
|
1486
|
+
baseTab.lang_id = data.lang_id;
|
|
1487
|
+
baseTab.language = data.language;
|
|
1488
|
+
validId = false;
|
|
1489
|
+
while (!validId) {
|
|
1490
|
+
validId = true;
|
|
1491
|
+
for (let idx = 0; idx < formData[tabIndex].selectedLanguages.length; idx += 1) {
|
|
1492
|
+
if (!formData[idx]) {
|
|
1493
|
+
continue;
|
|
1494
|
+
}
|
|
1495
|
+
if (id === formData[idx].tabKey) {
|
|
1496
|
+
validId = false;
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
if (validId) {
|
|
1500
|
+
break;
|
|
1501
|
+
}
|
|
1502
|
+
id = _.uniqueId();
|
|
1503
|
+
}
|
|
1504
|
+
baseTab.tabKey = id;
|
|
1505
|
+
formData[tabIndex].selectedLanguages.push(data.iso_code);
|
|
1506
|
+
formData[tabIndex][data.iso_code] = baseTab;
|
|
1507
|
+
console.log('Add Language Event After', formData);
|
|
1508
|
+
formData[tabIndex].activeTab = data.iso_code;
|
|
1509
|
+
formData[tabIndex].tabKey = baseTab.tabKey;
|
|
1510
|
+
break;
|
|
1511
|
+
default:
|
|
1512
|
+
break;
|
|
1513
|
+
}
|
|
1423
1514
|
const that = this;
|
|
1424
1515
|
setTimeout(() => {
|
|
1425
1516
|
that.setState({tabKey: baseTab.tabKey});
|
|
@@ -1435,6 +1526,9 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1435
1526
|
formData.base[val.id] = data1;
|
|
1436
1527
|
} else {
|
|
1437
1528
|
formData.base[data1.iso_code] = formData[tabIndex][data1.iso_code];
|
|
1529
|
+
formData.base.tabKey = formData[tabIndex].tabKey;
|
|
1530
|
+
formData.base.activeTab = formData[tabIndex].activeTab;
|
|
1531
|
+
formData.base.selectedLanguages = formData[tabIndex].selectedLanguages;
|
|
1438
1532
|
}
|
|
1439
1533
|
}
|
|
1440
1534
|
} else {
|
|
@@ -1620,13 +1714,9 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1620
1714
|
} else if (event === 'deleteVersion') {
|
|
1621
1715
|
if (this.props.schema.channel.toUpperCase() === 'EMAIL') {
|
|
1622
1716
|
// this.deleteVersion(false, this.state.currentTab);
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
type: 'confirm',
|
|
1627
|
-
id: 'email-version-delete-modal',
|
|
1628
|
-
};
|
|
1629
|
-
this.setState({showModal: true, modal: modalContent, currentEvent: val.injectedEvents[event], currentEventData: data });
|
|
1717
|
+
this.setState({currentEvent: val.injectedEvents[event], currentEventData: data }, () => {
|
|
1718
|
+
this.props.setModalContent('delete-version');
|
|
1719
|
+
});
|
|
1630
1720
|
} else {
|
|
1631
1721
|
this.handleConfirmations();
|
|
1632
1722
|
}
|
|
@@ -1653,13 +1743,15 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1653
1743
|
return;
|
|
1654
1744
|
}
|
|
1655
1745
|
} else if (event === 'deleteLanguage') {
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1746
|
+
this.setState({currentEvent: val.injectedEvents[event], currentEventData: data }, () => {
|
|
1747
|
+
this.props.setModalContent('delete-language');
|
|
1748
|
+
});
|
|
1749
|
+
// const modalContent = {
|
|
1750
|
+
// title: "Alert",
|
|
1751
|
+
// body: "Do you really want to delete this language?",
|
|
1752
|
+
// type: 'confirm',
|
|
1753
|
+
// id: 'email-language-delete-modal',
|
|
1754
|
+
// };
|
|
1663
1755
|
// debugger;
|
|
1664
1756
|
// if (this.state.formData[`${this.state.currentTab - 1}`].activeTab === this.props.baseLanguage) {
|
|
1665
1757
|
// console.log('Base Language');
|
|
@@ -1817,6 +1909,12 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1817
1909
|
return items;
|
|
1818
1910
|
}
|
|
1819
1911
|
|
|
1912
|
+
handleAddLanguageFlow(data, val, event) {
|
|
1913
|
+
this.setState({currentEventData: data, currentEventVal: val, currentEvent: event}, () => {
|
|
1914
|
+
this.props.setModalContent('add-language', data);
|
|
1915
|
+
});
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1820
1918
|
renderColLabelSection(section, childIndex) {
|
|
1821
1919
|
// const schema = this.props.schema
|
|
1822
1920
|
const fields = [];
|
|
@@ -2538,14 +2636,18 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2538
2636
|
}
|
|
2539
2637
|
console.log('CKEditor Data 2', this.state.formData, this.state.formData[`${this.state.currentTab - 1}`], val, this.state.currentTab, this.state.currentLangTab, langIndex);
|
|
2540
2638
|
const currentLang = (!_.isEmpty(this.state.formData) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`]) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages) && this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex]) ? this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex] : this.props.baseLanguage;
|
|
2541
|
-
|
|
2639
|
+
const content = (!_.isEmpty(this.state.formData) && this.state.formData[`${this.state.currentTab - 1}`][currentLang]['template-content'] ? this.state.formData[`${this.state.currentTab - 1}`][currentLang]['template-content'] : '');
|
|
2640
|
+
console.log('ckeditor current lang', currentLang, content);
|
|
2641
|
+
if (this.state.formData[`${this.state.currentTab - 1}`][currentLang].is_drag_drop) {
|
|
2642
|
+
// content = "";
|
|
2643
|
+
}
|
|
2542
2644
|
columns.push(
|
|
2543
2645
|
<Col style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2544
2646
|
<CKEditor
|
|
2545
2647
|
id={val.id}
|
|
2546
|
-
content={
|
|
2648
|
+
content={content}
|
|
2547
2649
|
events={val.events}
|
|
2548
|
-
getEditorInstanse={val.getEditorInstanse}
|
|
2650
|
+
getEditorInstanse={(evt) => val.injectedEvents.getEditorInstanse.call(this, evt)}
|
|
2549
2651
|
handleContentChange={(event) => this.updateFormData(event, val, 'onContentChange')}
|
|
2550
2652
|
/>
|
|
2551
2653
|
</Col>
|
|
@@ -2601,7 +2703,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2601
2703
|
id={val.id}
|
|
2602
2704
|
popOverList={this.props.supportedLanguages}
|
|
2603
2705
|
excludeList={this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages}
|
|
2604
|
-
handlePopOverClick={(data) => this.
|
|
2706
|
+
handlePopOverClick={(data) => this.handleAddLanguageFlow(data, val, "addLanguage")}
|
|
2605
2707
|
/>
|
|
2606
2708
|
</Col>
|
|
2607
2709
|
);
|
|
@@ -2711,6 +2813,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2711
2813
|
console.log('tabs rendering pushing pane', paneTabKey, renderedSections, index, pane);
|
|
2712
2814
|
renderedPanes.push(
|
|
2713
2815
|
<TabPane
|
|
2816
|
+
forceRender
|
|
2714
2817
|
tab={
|
|
2715
2818
|
<div className="form-tab-header" onInput={(e) => e.stopPropagation()}>
|
|
2716
2819
|
{
|
|
@@ -2874,6 +2977,8 @@ FormBuilder.propTypes = {
|
|
|
2874
2977
|
toggleEdmEmailTemplateSelection: PropTypes.func,
|
|
2875
2978
|
handleEdmDefaultTemplateSelection: PropTypes.func,
|
|
2876
2979
|
userLocale: PropTypes.string,
|
|
2980
|
+
setModalContent: PropTypes.func,
|
|
2981
|
+
addLanguageType: PropTypes.string,
|
|
2877
2982
|
};
|
|
2878
2983
|
|
|
2879
2984
|
export default FormBuilder;
|
|
@@ -622,7 +622,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
|
|
|
622
622
|
}
|
|
623
623
|
|
|
624
624
|
if (nextProps.Ebill.createTemplateError && !_.isEqual(nextProps.Ebill.createTemplateError, this.props.Ebill.createTemplateError)) {
|
|
625
|
-
const message = getMessageObject('error', this.props.intl.formatMessage(messages.somethingWentWrong), true);
|
|
625
|
+
const message = getMessageObject('error', (nextProps.Ebill.createTemplateErrorMessage && nextProps.Ebill.createTemplateErrorMessage !== '') ? nextProps.Ebill.createTemplateErrorMessage : this.props.intl.formatMessage(messages.somethingWentWrong), true);
|
|
626
626
|
this.props.globalActions.addMessageToQueue(message);
|
|
627
627
|
}
|
|
628
628
|
|
|
@@ -14,16 +14,19 @@ function ebillReducer(state = initialState, action) {
|
|
|
14
14
|
case types.CREATE_TEMPLATE_REQUEST:
|
|
15
15
|
return state
|
|
16
16
|
.set('createTemplateInProgress', true)
|
|
17
|
-
.set('createTemplateError', false)
|
|
17
|
+
.set('createTemplateError', false)
|
|
18
|
+
.set('createTemplateErrorMessage', fromJS(""));
|
|
18
19
|
case types.CREATE_TEMPLATE_SUCCESS:
|
|
19
20
|
return state
|
|
20
21
|
.set('createTemplateInProgress', false)
|
|
21
22
|
.set('createResponse', action.data)
|
|
23
|
+
.set('createTemplateErrorMessage', fromJS(action.errorMsg))
|
|
22
24
|
.set('createTemplateError', (action.statusCode !== undefined && action.statusCode > 300));
|
|
23
25
|
case types.CREATE_TEMPLATE_FAILURE:
|
|
24
26
|
return state
|
|
25
27
|
.set('createTemplateInProgress', false)
|
|
26
|
-
.set('createTemplateError', true)
|
|
28
|
+
.set('createTemplateError', true)
|
|
29
|
+
.set('createTemplateErrorMessage', fromJS(action.errorMsg));
|
|
27
30
|
case types.GET_TEMPLATE_DETAILS_REQUEST:
|
|
28
31
|
return state
|
|
29
32
|
.set('getTemplateDetailsInProgress', true);
|
|
@@ -5,12 +5,16 @@ import * as types from './constants';
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
export function* createTemplate(template) {
|
|
8
|
+
let errorMsg = "";
|
|
8
9
|
try {
|
|
9
10
|
console.log('Template data ', template);
|
|
10
11
|
const result = yield call(Api.createEbillTemplate, template);
|
|
11
|
-
|
|
12
|
+
if ((result.message && typeof result.message === 'string') || result.status.code === 500) {
|
|
13
|
+
errorMsg = result.message;
|
|
14
|
+
}
|
|
15
|
+
yield put({ type: types.CREATE_TEMPLATE_SUCCESS, data: result.response, statusCode: result.status ? result.status.code : '', errorMsg });
|
|
12
16
|
} catch (error) {
|
|
13
|
-
yield put({ type: types.CREATE_TEMPLATE_FAILURE, error });
|
|
17
|
+
yield put({ type: types.CREATE_TEMPLATE_FAILURE, error, errorMsg });
|
|
14
18
|
}
|
|
15
19
|
}
|
|
16
20
|
|
|
@@ -51,6 +51,15 @@
|
|
|
51
51
|
font-style: normal;
|
|
52
52
|
font-weight: 600;
|
|
53
53
|
}
|
|
54
|
+
.ant-tabs.ant-tabs-top.ant-tabs-line {
|
|
55
|
+
// overflow: hidden !important;
|
|
56
|
+
}
|
|
57
|
+
.ant-tabs:not(.ant-tabs-vertical) > .ant-tabs-content-animated {
|
|
58
|
+
margin-left: 0 !important;
|
|
59
|
+
}
|
|
60
|
+
.ant-tabs:not(.ant-tabs-vertical) > .ant-tabs-content > .ant-tabs-tabpane-inactive {
|
|
61
|
+
display: none !important;
|
|
62
|
+
}
|
|
54
63
|
.ant-tabs-bar{
|
|
55
64
|
margin-bottom: 0 !important;
|
|
56
65
|
display: flex;
|