@capillarytech/creatives-library 7.6.2 → 7.6.4
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 +5 -5
- package/components/Card/index.js +1 -1
- package/components/Ckeditor/index.js +5 -5
- package/components/CustomPopOver/index.js +3 -3
- package/components/Edmeditor/index.js +4 -4
- package/components/EmailPreview/index.js +1 -1
- package/components/PreviewSideBar/index.js +3 -3
- package/components/Sidebar/index.js +1 -1
- package/components/SmsTest/index.js +4 -4
- package/components/TemplatePreview/index.js +2 -2
- package/components/Toastr/index.js +1 -1
- package/containers/Assets/Gallery/index.js +2 -2
- package/containers/Assets/Gallery/sagas.js +1 -1
- package/containers/Cap/actions.js +2 -2
- package/containers/Cap/reducer.js +1 -1
- package/containers/Cap/sagas.js +3 -3
- package/containers/Cap/selectors.js +1 -1
- package/containers/Ebill/actions.js +1 -1
- package/containers/Ebill/index.js +34 -34
- package/containers/Ebill/sagas.js +3 -3
- package/containers/Email/actions.js +2 -2
- package/containers/Email/index.js +171 -171
- package/containers/Email/reducer.js +1 -1
- package/containers/Email/sagas.js +6 -6
- package/containers/LanguageProvider/actions.js +1 -1
- package/containers/Line/Create/actions.js +5 -5
- package/containers/Line/Create/index.js +37 -37
- package/containers/Line/Create/sagas.js +7 -7
- package/containers/Line/Edit/actions.js +3 -3
- package/containers/Line/Edit/index.js +24 -24
- package/containers/Line/Edit/sagas.js +4 -4
- package/containers/MobilePush/Create/actions.js +2 -2
- package/containers/MobilePush/Create/index.js +35 -35
- package/containers/MobilePush/Create/sagas.js +2 -2
- package/containers/MobilePush/Edit/actions.js +3 -3
- package/containers/MobilePush/Edit/index.js +32 -32
- package/containers/MobilePush/Edit/sagas.js +5 -5
- package/containers/Sms/Create/actions.js +2 -2
- package/containers/Sms/Create/index.js +57 -57
- package/containers/Sms/Create/sagas.js +2 -2
- package/containers/Sms/Edit/actions.js +3 -3
- package/containers/Sms/Edit/index.js +44 -44
- package/containers/Sms/Edit/sagas.js +3 -3
- package/containers/TagList/index.js +9 -9
- package/containers/Templates/actions.js +5 -5
- package/containers/Templates/index.js +44 -44
- package/containers/Templates/sagas.js +5 -5
- package/containers/WeChat/MapTemplates/actions.js +1 -1
- package/containers/WeChat/MapTemplates/index.js +34 -34
- package/containers/WeChat/MapTemplates/sagas.js +2 -2
- package/containers/WeChat/RichmediaTemplates/Create/index.js +9 -9
- package/containers/WeChat/RichmediaTemplates/Edit/actions.js +1 -1
- package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +1 -1
- package/package.json +1 -1
- package/services/api.js +13 -13
- package/utils/authWrapper.js +2 -2
- package/utils/smsCharCount.js +5 -5
- package/v2Components/CapTagList/index.js +1 -1
- package/v2Components/Card/index.js +1 -1
- package/v2Components/Ckeditor/index.js +5 -5
- package/v2Components/CustomPopOver/index.js +3 -3
- package/v2Components/Edmeditor/index.js +4 -4
- package/v2Components/EmailMobilePreview/index.js +4 -4
- package/v2Components/EmailPreviewV2/index.js +4 -4
- package/v2Components/FormBuilder/index.js +3 -3
- package/v2Components/PreviewSideBar/index.js +3 -3
- package/v2Components/SmsTest/index.js +4 -4
- package/v2Components/TemplatePreview/index.js +1 -1
- package/v2Components/Toastr/index.js +1 -1
- package/v2Containers/Assets/Gallery/sagas.js +1 -1
- package/v2Containers/Cap/actions.js +1 -1
- package/v2Containers/Cap/index.js +2 -2
- package/v2Containers/Cap/reducer.js +1 -1
- package/v2Containers/Cap/sagas.js +3 -3
- package/v2Containers/Cap/selectors.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +7 -1
- package/v2Containers/CreativesContainer/index.js +10 -3
- package/v2Containers/Ebill/actions.js +1 -1
- package/v2Containers/Ebill/index.js +34 -34
- package/v2Containers/Ebill/sagas.js +3 -3
- package/v2Containers/Email/reducer.js +1 -1
- package/v2Containers/EmailWrapper/index.js +4 -4
- package/v2Containers/Facebook/Advertisement/index.js +0 -1
- package/v2Containers/Facebook/Facebook.style.js +1 -1
- package/v2Containers/Facebook/constants.js +4 -0
- package/v2Containers/Facebook/index.js +189 -121
- package/v2Containers/Facebook/messages.js +20 -4
- package/v2Containers/Facebook/sagas.js +1 -1
- package/v2Containers/LanguageProvider/actions.js +1 -1
- package/v2Containers/Line/Container/actions.js +5 -5
- package/v2Containers/Line/Container/sagas.js +4 -4
- package/v2Containers/MobilePush/Create/actions.js +2 -2
- package/v2Containers/MobilePush/Create/index.js +1 -1
- package/v2Containers/MobilePush/Create/sagas.js +2 -2
- package/v2Containers/MobilePush/Edit/actions.js +3 -3
- package/v2Containers/MobilePush/Edit/index.js +26 -26
- package/v2Containers/MobilePush/Edit/sagas.js +5 -5
- package/v2Containers/Sms/Create/index.js +4 -4
- package/v2Containers/TagList/index.js +6 -6
- package/v2Containers/Templates/actions.js +5 -5
- package/v2Containers/Templates/index.js +6 -2
- package/v2Containers/Templates/sagas.js +4 -4
- package/v2Containers/TemplatesV2/index.js +9 -4
- package/v2Containers/Viber/actions.js +2 -2
- package/v2Containers/Viber/sagas.js +2 -2
- package/v2Containers/WeChat/MapTemplates/actions.js +1 -1
- package/v2Containers/WeChat/MapTemplates/index.js +19 -19
- package/v2Containers/WeChat/MapTemplates/sagas.js +3 -3
- package/v2Containers/WeChat/RichmediaTemplates/Create/actions.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Edit/actions.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Edit/sagas.js +1 -1
- package/assets/DeviceForEmail.png +0 -0
|
@@ -82,7 +82,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
componentWillMount() {
|
|
85
|
-
|
|
85
|
+
console.log('create mounting');
|
|
86
86
|
if (this.props.route.name === 'view') {
|
|
87
87
|
this.setState({loading: false});
|
|
88
88
|
// this.removeStandAlone();
|
|
@@ -90,7 +90,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
componentDidMount() {
|
|
93
|
-
|
|
93
|
+
console.log('added listener create,', this.props);
|
|
94
94
|
const query = {
|
|
95
95
|
layout: 'SMS',
|
|
96
96
|
type: 'LAYOUT',
|
|
@@ -124,12 +124,12 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
componentWillReceiveProps(nextProps) {
|
|
127
|
-
|
|
127
|
+
console.log('recieved props ', nextProps, this.props, this.state);
|
|
128
128
|
if (nextProps.location.query.module === 'library' && nextProps.isGetFormData) {
|
|
129
129
|
nextProps.getFormSubscriptionData(this.getFormData());
|
|
130
130
|
}
|
|
131
131
|
if (nextProps.createResponse && nextProps.createResponse.templateId) {
|
|
132
|
-
|
|
132
|
+
console.log('create response', nextProps.createResponse);
|
|
133
133
|
this.discardValues();
|
|
134
134
|
const message = getMessageObject('success', this.props.intl.formatMessage(messages.smsCreateSuccess), true);
|
|
135
135
|
this.props.globalActions.addMessageToQueue(message);
|
|
@@ -147,7 +147,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
147
147
|
this.props.globalActions.addMessageToQueue(message);
|
|
148
148
|
}
|
|
149
149
|
if (nextProps.metaEntities && nextProps.metaEntities.layouts && nextProps.metaEntities.layouts.length > 0 && _.isEmpty(this.state.schema)) {
|
|
150
|
-
|
|
150
|
+
console.log('final schema is**', nextProps.metaEntities.layouts[0].definition);
|
|
151
151
|
this.injectEvents(nextProps.metaEntities.layouts[0].definition);
|
|
152
152
|
if (this.props.location.query.module !== 'library' || (this.props.location.query.module === 'library' && this.props.getDefaultTags)) {
|
|
153
153
|
const query = {
|
|
@@ -168,24 +168,24 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
componentWillUnmount() {
|
|
171
|
-
|
|
171
|
+
console.log('removed listener create');
|
|
172
172
|
window.removeEventListener("message", this.handleFrameTasks);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
onTemplateNameChange(name) {
|
|
176
|
-
|
|
176
|
+
console.log('Template name changed to ', name);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
onTemplateContentChange(content) {
|
|
180
|
-
|
|
180
|
+
console.log('Template content changed to ', content);
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
onVersionNameChange(data, versionIndex) {
|
|
184
|
-
|
|
184
|
+
console.log('version name changed to', data, versionIndex);
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
onFormDataChange(formData, tabCount, currentTab) {
|
|
188
|
-
|
|
188
|
+
console.log('Form data changed is ', formData, tabCount, currentTab);
|
|
189
189
|
this.setState({formData, tabCount});
|
|
190
190
|
if (currentTab) {
|
|
191
191
|
this.setState({currentTab});
|
|
@@ -193,24 +193,24 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
onTagSelect(data, currentTab) {
|
|
196
|
-
|
|
196
|
+
console.log('parent data tag', data, currentTab);
|
|
197
197
|
const editorId = currentTab > 1 ? `sms-editor${currentTab}` : 'sms-editor';
|
|
198
198
|
this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`, currentTab);
|
|
199
199
|
document.getElementById(editorId).focus();
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
onTabChange(data) {
|
|
203
|
-
|
|
203
|
+
console.log('inside parent ontabchange', data, this.state);
|
|
204
204
|
this.setState({currentTab: data});
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
getFormData(e, value) {
|
|
208
|
-
|
|
208
|
+
console.log('posting final result', this.state.formData);
|
|
209
209
|
const formData = _.cloneDeep(this.state.formData);
|
|
210
210
|
let baseData = {};
|
|
211
211
|
let versionIdx;
|
|
212
212
|
_.forEach(formData, (val, idx) => {
|
|
213
|
-
|
|
213
|
+
console.log('val', val);
|
|
214
214
|
if (val.base && idx !== 'base') {
|
|
215
215
|
baseData = val;
|
|
216
216
|
versionIdx = idx;
|
|
@@ -224,7 +224,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
224
224
|
result.base = baseData;
|
|
225
225
|
const msgObj = updateCharCount(baseData['sms-editor']);
|
|
226
226
|
result.base.msg_count = msgObj.msgCount;
|
|
227
|
-
|
|
227
|
+
console.log("Message Count", msgObj.msgCount);
|
|
228
228
|
const response = {
|
|
229
229
|
action: "getFormData",
|
|
230
230
|
value: result,
|
|
@@ -232,7 +232,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
232
232
|
validity: this.state.isFormValid,
|
|
233
233
|
};
|
|
234
234
|
this.setState({checkValidation: true});
|
|
235
|
-
|
|
235
|
+
console.log('posting final result internal', response);
|
|
236
236
|
if (e) {
|
|
237
237
|
e.source.postMessage(JSON.stringify(response), e.origin);
|
|
238
238
|
}
|
|
@@ -240,7 +240,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
getCurrentWindow(e) {
|
|
243
|
-
|
|
243
|
+
console.log('in sms create', e);
|
|
244
244
|
const response = {
|
|
245
245
|
action: e.action,
|
|
246
246
|
value: 'edit',
|
|
@@ -331,7 +331,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
moveToTemplates() {
|
|
334
|
-
|
|
334
|
+
console.log('in move to Templates');
|
|
335
335
|
const modalContent = {
|
|
336
336
|
title: this.props.intl.formatMessage(messages.alertMessage),
|
|
337
337
|
body: this.props.intl.formatMessage(messages.goBackConfirmation),
|
|
@@ -358,7 +358,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
injectEvents(schema) {
|
|
361
|
-
|
|
361
|
+
console.log('now injecting events');
|
|
362
362
|
const temp = schema;
|
|
363
363
|
temp.standalone.sections = this.injectSections(temp.standalone.sections);
|
|
364
364
|
_.forEach(temp.containers, (container) => {
|
|
@@ -366,7 +366,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
366
366
|
tempContainer = this.injectContainer(tempContainer);
|
|
367
367
|
return tempContainer;
|
|
368
368
|
});
|
|
369
|
-
|
|
369
|
+
console.log('final injected schema', schema);
|
|
370
370
|
this.setState({schema}, () => {
|
|
371
371
|
const type = this.props.location.query.type;
|
|
372
372
|
if (type === 'embedded') {
|
|
@@ -408,7 +408,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
408
408
|
console.log('injected event for ', col, event, this.getMappedEvent(col.id, event));
|
|
409
409
|
temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
|
|
410
410
|
});
|
|
411
|
-
|
|
411
|
+
console.log('should translate multicol', temp);
|
|
412
412
|
if (temp.type === 'icon') {
|
|
413
413
|
return true;
|
|
414
414
|
}
|
|
@@ -439,7 +439,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
439
439
|
_.forEach(col.supportedEvents, (event) => {
|
|
440
440
|
temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
|
|
441
441
|
});
|
|
442
|
-
|
|
442
|
+
console.log('should translate multicol action', temp);
|
|
443
443
|
if (temp.type === 'icon') {
|
|
444
444
|
return true;
|
|
445
445
|
}
|
|
@@ -473,7 +473,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
473
473
|
_.forEach(inputField.supportedEvents, (event) => {
|
|
474
474
|
temp.injectedEvents[event] = this.getMappedEvent(inputField.id, event);
|
|
475
475
|
});
|
|
476
|
-
|
|
476
|
+
console.log('should translate collabel', temp);
|
|
477
477
|
if (temp.type === 'icon') {
|
|
478
478
|
return true;
|
|
479
479
|
}
|
|
@@ -502,7 +502,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
502
502
|
_.forEach(actionField.supportedEvents, (event) => {
|
|
503
503
|
temp.injectedEvents[event] = this.getMappedEvent(actionField.id, event);
|
|
504
504
|
});
|
|
505
|
-
|
|
505
|
+
console.log('should translate collabel action', temp);
|
|
506
506
|
if (temp.type === 'icon') {
|
|
507
507
|
return true;
|
|
508
508
|
}
|
|
@@ -552,7 +552,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
552
552
|
}
|
|
553
553
|
|
|
554
554
|
cloneColLabel(sectionObj, tabIndex) {
|
|
555
|
-
|
|
555
|
+
console.log('cloning cloneColLabel', sectionObj, tabIndex);
|
|
556
556
|
const section = _.cloneDeep(sectionObj);
|
|
557
557
|
const inputFields = _.forEach(section.inputFields, (inputField) => {
|
|
558
558
|
const inputF = inputField;
|
|
@@ -561,12 +561,12 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
561
561
|
return inputF;
|
|
562
562
|
});
|
|
563
563
|
section.inputFields = inputFields;
|
|
564
|
-
|
|
564
|
+
console.log('cloned ifs are', section);
|
|
565
565
|
return section;
|
|
566
566
|
}
|
|
567
567
|
|
|
568
568
|
cloneMultiCol(sectionObj, tabIndex) {
|
|
569
|
-
|
|
569
|
+
console.log('cloning multicol ', sectionObj, tabIndex);
|
|
570
570
|
const section = _.cloneDeep(sectionObj);
|
|
571
571
|
const inputFields = _.forEach(section.inputFields, (inputField) => {
|
|
572
572
|
const inputF = inputField;
|
|
@@ -580,7 +580,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
580
580
|
return inputF;
|
|
581
581
|
});
|
|
582
582
|
section.inputFields = inputFields;
|
|
583
|
-
|
|
583
|
+
console.log('cloned cols are', section);
|
|
584
584
|
return section;
|
|
585
585
|
}
|
|
586
586
|
|
|
@@ -598,19 +598,19 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
598
598
|
} else if (childSection.type === 'parent') {
|
|
599
599
|
sect = this.cloneParent(childSection, tabIndex);
|
|
600
600
|
}
|
|
601
|
-
|
|
601
|
+
console.log('returning cloned parent section', sect);
|
|
602
602
|
childSections.push(sect);
|
|
603
603
|
return true;
|
|
604
604
|
});
|
|
605
605
|
console.log('returning cloned parent section final 1', JSON.stringify(childSections));
|
|
606
606
|
parentsect.childSections = childSections;
|
|
607
|
-
|
|
607
|
+
console.log('returning cloned parent section final', parentsect);
|
|
608
608
|
return _.cloneDeep(parentsect);
|
|
609
609
|
}
|
|
610
610
|
|
|
611
611
|
deleteVersion(data, currentTab) {
|
|
612
|
-
|
|
613
|
-
|
|
612
|
+
console.log('trying to delete version in parent sms create');
|
|
613
|
+
console.log('deleting version', data, currentTab);
|
|
614
614
|
if (this.state.tabCount === 1) {
|
|
615
615
|
return;
|
|
616
616
|
}
|
|
@@ -621,22 +621,22 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
621
621
|
}
|
|
622
622
|
|
|
623
623
|
renameVersion(data, currentTab) {
|
|
624
|
-
|
|
624
|
+
console.log('renaming version', data, currentTab);
|
|
625
625
|
}
|
|
626
626
|
|
|
627
627
|
markFinalVersion(data, currentTab) {
|
|
628
628
|
const message = getMessageObject('success', this.props.intl.formatMessage(messages.templateMarkedFinal), true);
|
|
629
629
|
this.props.globalActions.addMessageToQueue(message);
|
|
630
|
-
|
|
630
|
+
console.log('markFinal version', data, currentTab);
|
|
631
631
|
}
|
|
632
632
|
|
|
633
633
|
duplicateVersion(data, currentTab) {
|
|
634
|
-
|
|
634
|
+
console.log('duplicate version', data, currentTab);
|
|
635
635
|
this.addVersion(this.state.tabCount);
|
|
636
636
|
}
|
|
637
637
|
|
|
638
638
|
addVersion(data, addNow) {
|
|
639
|
-
|
|
639
|
+
console.log('adding version', data);
|
|
640
640
|
let tabIndex = data + 1;
|
|
641
641
|
const schema = _.cloneDeep(this.state.schema);
|
|
642
642
|
const containers = schema.containers.slice();
|
|
@@ -660,7 +660,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
660
660
|
});
|
|
661
661
|
firstPane.sections = sections;
|
|
662
662
|
schema.containers[0].panes.push(firstPane);
|
|
663
|
-
|
|
663
|
+
console.log('adding version tabIndex', tabIndex, tabIndex === 5, schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols);
|
|
664
664
|
if (tabIndex === 5) {
|
|
665
665
|
schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols[0].disabled = true;
|
|
666
666
|
}
|
|
@@ -685,7 +685,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
685
685
|
});
|
|
686
686
|
firstPane.sections = sections;
|
|
687
687
|
schema.containers[0].panes.push(firstPane);
|
|
688
|
-
|
|
688
|
+
console.log('adding version tabIndex', tabIndex, tabIndex === 5, schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols);
|
|
689
689
|
if (tabIndex === 5) {
|
|
690
690
|
schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols[0].disabled = true;
|
|
691
691
|
}
|
|
@@ -708,12 +708,12 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
708
708
|
}
|
|
709
709
|
}
|
|
710
710
|
if (isValid) {
|
|
711
|
-
|
|
711
|
+
console.log('isValid');
|
|
712
712
|
return true;
|
|
713
713
|
}
|
|
714
714
|
const message = getMessageObject('error', 'Template data is not valid', true);
|
|
715
715
|
this.props.globalActions.addMessageToQueue(message);
|
|
716
|
-
|
|
716
|
+
console.log('not valid');
|
|
717
717
|
return false;
|
|
718
718
|
}
|
|
719
719
|
|
|
@@ -741,11 +741,11 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
741
741
|
}
|
|
742
742
|
|
|
743
743
|
startTemplateCreation(data) {
|
|
744
|
-
|
|
744
|
+
console.log("reached here", data);
|
|
745
745
|
if (data.edit) {
|
|
746
|
-
|
|
746
|
+
console.log('in if startTemplateCreation', data.tags);
|
|
747
747
|
const ifUnicode = checkUnicode(data.content ? data.content : '');
|
|
748
|
-
|
|
748
|
+
console.log('smsDetails', ifUnicode, data.content);
|
|
749
749
|
const content = data.content;
|
|
750
750
|
const id = _.uniqueId();
|
|
751
751
|
const tempData = {
|
|
@@ -761,25 +761,25 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
761
761
|
this.setState({tabKey: ''});
|
|
762
762
|
});
|
|
763
763
|
} else {
|
|
764
|
-
|
|
764
|
+
console.log("in else startTemplateCreation: ", data.tags);
|
|
765
765
|
this.setState({injectedTags: data.tags});
|
|
766
766
|
}
|
|
767
767
|
this.props.globalActions.setInjectedTags(data.tags);
|
|
768
768
|
}
|
|
769
769
|
|
|
770
770
|
startLoading(ifEdit) {
|
|
771
|
-
|
|
771
|
+
console.log('startLoading', ifEdit);
|
|
772
772
|
if (ifEdit) {
|
|
773
773
|
this.setState({loading: true});
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
776
|
|
|
777
777
|
handleFrameTasks = (e) => {
|
|
778
|
-
|
|
778
|
+
console.log('data listened to is', e.data);
|
|
779
779
|
const type = e.data;
|
|
780
|
-
|
|
780
|
+
console.log('data type', typeof type);
|
|
781
781
|
if (typeof type === 'object') {
|
|
782
|
-
|
|
782
|
+
console.log('received something', type);
|
|
783
783
|
const action = type.action;
|
|
784
784
|
switch (action) {
|
|
785
785
|
case "startTemplateCreation":
|
|
@@ -803,15 +803,15 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
803
803
|
this.getFormData(e);
|
|
804
804
|
break;
|
|
805
805
|
case "startTemplateCreation":
|
|
806
|
-
|
|
806
|
+
console.log('Starting to create template');
|
|
807
807
|
//this.getFormData(e);
|
|
808
808
|
break;
|
|
809
809
|
case "moveToTemplates":
|
|
810
|
-
|
|
810
|
+
console.log('moving to templates');
|
|
811
811
|
this.moveToTemplates();
|
|
812
812
|
break;
|
|
813
813
|
case "validateContent":
|
|
814
|
-
|
|
814
|
+
console.log('validating Content');
|
|
815
815
|
this.validateContent(e);
|
|
816
816
|
break;
|
|
817
817
|
default:
|
|
@@ -821,7 +821,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
821
821
|
}
|
|
822
822
|
|
|
823
823
|
handleOnTagsContextChange = (data) => {
|
|
824
|
-
|
|
824
|
+
console.log('parent tags context', data);
|
|
825
825
|
const query = {
|
|
826
826
|
layout: 'SMS',
|
|
827
827
|
type: 'TAG',
|
|
@@ -852,7 +852,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
852
852
|
}
|
|
853
853
|
|
|
854
854
|
validateContent = (e) => {
|
|
855
|
-
|
|
855
|
+
console.log('posting final validation result', this.state.isFormValid);
|
|
856
856
|
const response = {
|
|
857
857
|
action: "validateContent",
|
|
858
858
|
value: this.state.isFormValid,
|
|
@@ -1370,11 +1370,11 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1370
1370
|
saveFormData(formData) {
|
|
1371
1371
|
//Logic to save in db etc
|
|
1372
1372
|
// const isValidated = this.validateFormData(formData);
|
|
1373
|
-
//
|
|
1373
|
+
// console.log('whyyyy');
|
|
1374
1374
|
// if (!isValidated) {
|
|
1375
1375
|
// return;
|
|
1376
1376
|
// }
|
|
1377
|
-
|
|
1377
|
+
console.log('Saving form data', formData, this.state.tabCount);
|
|
1378
1378
|
const obj = {};
|
|
1379
1379
|
obj.versions = {
|
|
1380
1380
|
base: {},
|
|
@@ -1387,11 +1387,11 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1387
1387
|
}
|
|
1388
1388
|
obj.name = formData['template-name'];
|
|
1389
1389
|
obj.versions.base = formData.base;
|
|
1390
|
-
|
|
1390
|
+
console.log('obj', obj);
|
|
1391
1391
|
this.props.actions.createTemplate(obj);
|
|
1392
1392
|
}
|
|
1393
1393
|
render() {
|
|
1394
|
-
|
|
1394
|
+
console.log("this.props sms create: ", this.props);
|
|
1395
1395
|
const schema = this.state.schema;
|
|
1396
1396
|
const spinning = this.state.loading || (this.props.Create && "createTemplateInProgress" in this.props.Create && this.props.Create.createTemplateInProgress);
|
|
1397
1397
|
let tags = this.props.metaEntities && this.props.metaEntities.tags && this.props.metaEntities.tags.standard ? this.props.metaEntities.tags.standard : [];
|
|
@@ -9,7 +9,7 @@ import * as types from './constants';
|
|
|
9
9
|
export function* createTemplate(template) {
|
|
10
10
|
let errorMsg;
|
|
11
11
|
try {
|
|
12
|
-
|
|
12
|
+
console.log('saga createTemplate sms', template);
|
|
13
13
|
const result = yield call(Api.createTemplate, template);
|
|
14
14
|
// const sidebar = result.response.sidebar;
|
|
15
15
|
if (result.message || result.status.code === 500) {
|
|
@@ -24,7 +24,7 @@ export function* createTemplate(template) {
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
function* watchCreateTemplate() {
|
|
27
|
-
|
|
27
|
+
console.log('inside watch');
|
|
28
28
|
const watcher = yield takeLatest(types.CREATE_TEMPLATE_REQUEST, createTemplate);
|
|
29
29
|
yield take(LOCATION_CHANGE);
|
|
30
30
|
yield cancel(watcher);
|
|
@@ -12,14 +12,14 @@ export function defaultAction() {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export function editTemplate(template) {
|
|
15
|
-
|
|
15
|
+
console.log('action trigereed');
|
|
16
16
|
return {
|
|
17
17
|
type: types.EDIT_TEMPLATE_REQUEST, template,
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export function getTemplateDetails(id) {
|
|
22
|
-
|
|
22
|
+
console.log('getting template', id);
|
|
23
23
|
return {
|
|
24
24
|
type: types.GET_TEMPLATE_DETAILS_REQUEST, id,
|
|
25
25
|
};
|
|
@@ -33,7 +33,7 @@ export function setTemplateDetails(templateDetails) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export function clearEditResponse() {
|
|
36
|
-
|
|
36
|
+
console.log('clearEditResponse');
|
|
37
37
|
return {
|
|
38
38
|
type: types.CLEAR_EDIT_RESPONSE_REQUEST,
|
|
39
39
|
};
|