@capillarytech/creatives-library 2.0.61 → 2.0.63
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/app.js +1 -1
- package/assets/NoImage1.js +50 -0
- package/assets/WithImage1.js +57 -0
- package/components/FormBuilder/_formBuilder.scss +8 -3
- package/components/FormBuilder/index.js +94 -64
- package/components/PreviewSideBar/_previewsidebar.scss +1 -1
- package/components/TemplatePreview/_templatePreview.scss +1 -1
- package/containers/CreativesContainer/SlideBoxContent.js +1 -1
- package/containers/CreativesContainer/index.js +1 -1
- package/containers/MobilePush/Create/_mobilePushCreate.scss +13 -0
- package/containers/MobilePush/Create/actions.js +6 -0
- package/containers/MobilePush/Create/constants.js +1 -0
- package/containers/MobilePush/Create/index.js +626 -1128
- package/containers/MobilePush/Create/messages.js +5 -1
- package/containers/MobilePush/Create/reducer.js +2 -0
- package/containers/MobilePush/Create/selectors.js +3 -3
- package/containers/MobilePush/Edit/_mobilePushCreate.scss +10 -0
- package/containers/MobilePush/Edit/index.js +375 -1106
- package/containers/MobilePush/Edit/messages.js +4 -0
- package/containers/MobilePush/Edit/reducer.js +2 -1
- package/containers/MobilePush/Edit/selectors.js +3 -1
- package/containers/MobilePush/commonMethods.js +249 -0
- package/containers/MobilePush/eventsMap.js +127 -0
- package/containers/MobilePush/initialSchema.js +1751 -0
- package/containers/MobilepushWrapper/_mobilepushWrapper.scss +18 -0
- package/containers/MobilepushWrapper/index.js +7 -4
- package/containers/Sms/Create/_smsCreate.scss +1 -1
- package/containers/TemplatesV2/index.js +7 -8
- package/global-styles.js +1 -0
- package/index.html +2 -0
- package/package.json +1 -1
- package/services/api.js +3 -0
package/app.js
CHANGED
|
@@ -67,7 +67,7 @@ if (module.hot) {
|
|
|
67
67
|
render(translationMessages);
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
const openSansObserver = new FontFaceObserver('
|
|
70
|
+
const openSansObserver = new FontFaceObserver('Roboto', {});
|
|
71
71
|
// When Open Sans is loaded, add a font-family using Open Sans to the body
|
|
72
72
|
openSansObserver.load().then(() => {
|
|
73
73
|
document.body.classList.add('fontLoaded');
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropsTypes from 'prop-types';
|
|
3
|
+
const SvgNoImage1 = (props) => (
|
|
4
|
+
<svg
|
|
5
|
+
width={props.width || "1em"}
|
|
6
|
+
height={props.height || "1em"}
|
|
7
|
+
viewBox="0 0 244 124"
|
|
8
|
+
fill="currentColor"
|
|
9
|
+
{...props}
|
|
10
|
+
>
|
|
11
|
+
<g fill="none" fillRule="evenodd">
|
|
12
|
+
<path
|
|
13
|
+
fill="#FFF"
|
|
14
|
+
fillRule="nonzero"
|
|
15
|
+
d="M7.692 0h228.616c2.675 0 3.645.278 4.623.801a5.452 5.452 0 0 1 2.268 2.268c.523.978.801 1.948.801 4.623v108.616c0 2.675-.278 3.645-.801 4.623a5.452 5.452 0 0 1-2.268 2.268c-.978.523-1.948.801-4.623.801H7.692c-2.675 0-3.645-.278-4.623-.801a5.452 5.452 0 0 1-2.268-2.268c-.523-.978-.801-1.948-.801-4.623V7.692c0-2.675.278-3.645.801-4.623A5.452 5.452 0 0 1 3.07.801C4.047.278 5.017 0 7.692 0z"
|
|
16
|
+
/>
|
|
17
|
+
<circle cx={212.074} cy={61} r={19} fill="#F4F5F7" />
|
|
18
|
+
<circle cx={20} cy={19} r={8} fill="#F4F5F7" />
|
|
19
|
+
<rect width={62} height={12} x={12} y={45} fill="#EBECF0" rx={4} />
|
|
20
|
+
<rect width={162} height={12} x={12} y={65} fill="#EBECF0" rx={4} />
|
|
21
|
+
<rect
|
|
22
|
+
width={62}
|
|
23
|
+
height={20}
|
|
24
|
+
x={12}
|
|
25
|
+
y={92}
|
|
26
|
+
fill="#2466EA"
|
|
27
|
+
opacity={0.2}
|
|
28
|
+
rx={4}
|
|
29
|
+
/>
|
|
30
|
+
<rect
|
|
31
|
+
width={62}
|
|
32
|
+
height={20}
|
|
33
|
+
x={86}
|
|
34
|
+
y={92}
|
|
35
|
+
fill="#2466EA"
|
|
36
|
+
opacity={0.2}
|
|
37
|
+
rx={4}
|
|
38
|
+
/>
|
|
39
|
+
<rect width={54} height={12} x={32} y={13} fill="#F4F5F7" rx={4} />
|
|
40
|
+
<rect width={23} height={12} x={98} y={13} fill="#F4F5F7" rx={4} />
|
|
41
|
+
</g>
|
|
42
|
+
</svg>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
SvgNoImage1.propTypes = {
|
|
46
|
+
width: PropsTypes.width,
|
|
47
|
+
height: PropsTypes.height,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default SvgNoImage1;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
const SvgWithImage1 = (props) => (
|
|
4
|
+
<svg
|
|
5
|
+
width="1em"
|
|
6
|
+
height="1em"
|
|
7
|
+
viewBox="0 0 244 248"
|
|
8
|
+
fill="currentColor"
|
|
9
|
+
{...props}
|
|
10
|
+
>
|
|
11
|
+
<defs>
|
|
12
|
+
<rect id="with-image-1_svg__a" width={220} height={120} rx={4} />
|
|
13
|
+
</defs>
|
|
14
|
+
<g fill="none" fillRule="evenodd">
|
|
15
|
+
<path
|
|
16
|
+
fill="#FFF"
|
|
17
|
+
fillRule="nonzero"
|
|
18
|
+
d="M7.692 0h228.616c2.675 0 3.645.278 4.623.801a5.452 5.452 0 0 1 2.268 2.268c.523.978.801 1.948.801 4.623v232.616c0 2.675-.278 3.645-.801 4.623a5.452 5.452 0 0 1-2.268 2.268c-.978.523-1.948.801-4.623.801H7.692c-2.675 0-3.645-.278-4.623-.801a5.452 5.452 0 0 1-2.268-2.268c-.523-.978-.801-1.948-.801-4.623V7.692c0-2.675.278-3.645.801-4.623A5.452 5.452 0 0 1 3.07.801C4.047.278 5.017 0 7.692 0z"
|
|
19
|
+
/>
|
|
20
|
+
<circle cx={212.074} cy={57} r={19} fill="#F4F5F7" />
|
|
21
|
+
<circle cx={20} cy={19} r={8} fill="#F4F5F7" />
|
|
22
|
+
<use
|
|
23
|
+
fill="#F4F5F7"
|
|
24
|
+
transform="translate(12 86)"
|
|
25
|
+
xlinkHref="#with-image-1_svg__a"
|
|
26
|
+
/>
|
|
27
|
+
<path
|
|
28
|
+
fill="#DFE2E7"
|
|
29
|
+
d="M97.5 141a9.5 9.5 0 1 1 0-19 9.5 9.5 0 0 1 0 19zm7.802 29H88l13.458-16.823a4 4 0 0 1 6.247 0l4.42 5.524 12.102-20.044a4 4 0 0 1 6.848 0L150 170h-44.698z"
|
|
30
|
+
/>
|
|
31
|
+
<rect
|
|
32
|
+
width={62}
|
|
33
|
+
height={20}
|
|
34
|
+
x={12}
|
|
35
|
+
y={216}
|
|
36
|
+
fill="#2466EA"
|
|
37
|
+
opacity={0.2}
|
|
38
|
+
rx={4}
|
|
39
|
+
/>
|
|
40
|
+
<rect width={62} height={12} x={12} y={41} fill="#EBECF0" rx={4} />
|
|
41
|
+
<rect width={162} height={12} x={12} y={61} fill="#EBECF0" rx={4} />
|
|
42
|
+
<rect width={54} height={12} x={32} y={13} fill="#F4F5F7" rx={4} />
|
|
43
|
+
<rect width={23} height={12} x={98} y={13} fill="#F4F5F7" rx={4} />
|
|
44
|
+
<rect
|
|
45
|
+
width={62}
|
|
46
|
+
height={20}
|
|
47
|
+
x={86}
|
|
48
|
+
y={216}
|
|
49
|
+
fill="#2466EA"
|
|
50
|
+
opacity={0.2}
|
|
51
|
+
rx={4}
|
|
52
|
+
/>
|
|
53
|
+
</g>
|
|
54
|
+
</svg>
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
export default SvgWithImage1;
|
|
@@ -3,12 +3,17 @@
|
|
|
3
3
|
.form-tab-header{
|
|
4
4
|
display: flex;
|
|
5
5
|
align-items: center;
|
|
6
|
-
font-family: open-sans, sans-serif !important;
|
|
7
6
|
font-style: normal;
|
|
8
7
|
font-weight: 600;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
.form-builder-radio-group {
|
|
11
|
+
|
|
12
|
+
.cap-radio-v2{
|
|
13
|
+
display: inline-block;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
12
17
|
|
|
13
18
|
.textarea-error-message {
|
|
14
19
|
top: initial !important;
|
|
@@ -59,7 +64,7 @@
|
|
|
59
64
|
display: inline-block;
|
|
60
65
|
font-size: 16px;
|
|
61
66
|
margin: 4px;
|
|
62
|
-
font-family: Open-Sans;
|
|
67
|
+
// font-family: Open-Sans;
|
|
63
68
|
text-align: center;
|
|
64
69
|
width: 24px;
|
|
65
70
|
height: 24px;
|
|
@@ -12,6 +12,7 @@ import { Label } from 'semantic-ui-react';
|
|
|
12
12
|
import _ from 'lodash';
|
|
13
13
|
import { Tabs, Table, Modal} from 'antd';
|
|
14
14
|
import { CapButton, CapInput, CapPopover, CapCheckbox, CapRadio, CapSelect, CapTable, CapRow, CapColumn, CapNotification} from '@capillarytech/cap-ui-library';
|
|
15
|
+
import LabelHOC from '@capillarytech/cap-ui-library/assets/HOCs/ComponentWithLabelHOC';
|
|
15
16
|
import TemplatePreview from '../../components/TemplatePreview';
|
|
16
17
|
import TagList from '../../containers/TagList';
|
|
17
18
|
import SmsEditor from '../SmsEditor';
|
|
@@ -564,43 +565,49 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
564
565
|
const selector = index > 0 ? `${Number(index) + 1}` : '';
|
|
565
566
|
let message = tab[`message-editor${selector}`];
|
|
566
567
|
|
|
567
|
-
message = message.trim();
|
|
568
|
-
|
|
569
568
|
if (errorData[parseInt(index)]) {
|
|
570
|
-
if (message
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
} else {
|
|
575
|
-
errorData[parseInt(index)][`message-editor${selector}`] = false;
|
|
576
|
-
const tagValidationResponse = this.validateTags(message, tags, injectedTags);
|
|
577
|
-
|
|
578
|
-
if (tagValidationResponse.valid) {
|
|
579
|
-
errorData[parseInt(index)][`message-editor${selector}`] = false;
|
|
580
|
-
} else {
|
|
569
|
+
if (message) {
|
|
570
|
+
message = message.trim();
|
|
571
|
+
|
|
572
|
+
if (message === "") {
|
|
581
573
|
errorData[parseInt(index)][`message-editor${selector}`] = true;
|
|
582
574
|
isValid = false;
|
|
575
|
+
isCurrentTabValid = false;
|
|
576
|
+
} else {
|
|
577
|
+
errorData[parseInt(index)][`message-editor${selector}`] = false;
|
|
578
|
+
const tagValidationResponse = this.validateTags(message, tags, injectedTags);
|
|
579
|
+
|
|
580
|
+
if (tagValidationResponse.valid) {
|
|
581
|
+
errorData[parseInt(index)][`message-editor${selector}`] = false;
|
|
582
|
+
} else {
|
|
583
|
+
errorData[parseInt(index)][`message-editor${selector}`] = true;
|
|
584
|
+
isValid = false;
|
|
585
|
+
}
|
|
583
586
|
}
|
|
584
|
-
}
|
|
585
587
|
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
|
|
586
591
|
|
|
587
|
-
|
|
588
|
-
if
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
isCurrentTabValid = false;
|
|
592
|
-
} else {
|
|
593
|
-
errorData[parseInt(index)][`message-title${selector}`] = false;
|
|
594
|
-
const tagValidationResponse = this.validateTags(title, tags, injectedTags);
|
|
595
|
-
|
|
596
|
-
if (tagValidationResponse.valid) {
|
|
597
|
-
errorData[parseInt(index)][`message-title${selector}`] = false;
|
|
598
|
-
} else {
|
|
592
|
+
let title = tab[`message-title${selector}`]
|
|
593
|
+
if(title){
|
|
594
|
+
title = title.trim();
|
|
595
|
+
if (title === "") {
|
|
599
596
|
errorData[parseInt(index)][`message-title${selector}`] = true;
|
|
600
597
|
isValid = false;
|
|
598
|
+
isCurrentTabValid = false;
|
|
599
|
+
} else {
|
|
600
|
+
errorData[parseInt(index)][`message-title${selector}`] = false;
|
|
601
|
+
const tagValidationResponse = this.validateTags(title, tags, injectedTags);
|
|
602
|
+
|
|
603
|
+
if (tagValidationResponse.valid) {
|
|
604
|
+
errorData[parseInt(index)][`message-title${selector}`] = false;
|
|
605
|
+
} else {
|
|
606
|
+
errorData[parseInt(index)][`message-title${selector}`] = true;
|
|
607
|
+
isValid = false;
|
|
608
|
+
}
|
|
601
609
|
}
|
|
602
610
|
}
|
|
603
|
-
|
|
604
611
|
// if(tab['primary-cta-link'].trim() === ""){
|
|
605
612
|
// errorData[parseInt(index)][`primary-cta-link`] = true;
|
|
606
613
|
// isValid = false;
|
|
@@ -1132,7 +1139,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1132
1139
|
}
|
|
1133
1140
|
}
|
|
1134
1141
|
if (col.type === 'checkbox') {
|
|
1135
|
-
if (isContainer) {
|
|
1142
|
+
if (isContainer && !formData[index][col.id]) {
|
|
1136
1143
|
formData[index][col.id] = false;
|
|
1137
1144
|
} else if (!isContainer && formData[col.id] === undefined) {
|
|
1138
1145
|
formData[col.id] = false;
|
|
@@ -1963,7 +1970,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1963
1970
|
val.injectedEvents[event].call(this.props.parent, data);
|
|
1964
1971
|
}
|
|
1965
1972
|
openFileDialog = () => {
|
|
1966
|
-
console.log("filedialog: ");
|
|
1967
1973
|
document.getElementById("fileName").click();
|
|
1968
1974
|
};
|
|
1969
1975
|
handleOk = (ev) => {
|
|
@@ -2027,7 +2033,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2027
2033
|
return val.value;
|
|
2028
2034
|
}
|
|
2029
2035
|
uploadImages = (e, {files}, val) => {
|
|
2030
|
-
console.log("uploadImages: ", e, {files}, val);
|
|
2031
2036
|
e.preventDefault();
|
|
2032
2037
|
const _URL = window.URL || window.webkitURL;
|
|
2033
2038
|
const file = files[0];
|
|
@@ -2164,7 +2169,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2164
2169
|
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2165
2170
|
const value = isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id];
|
|
2166
2171
|
columns.push(
|
|
2167
|
-
<CapColumn key={val.id} span={val.width}>
|
|
2172
|
+
<CapColumn key={val.id} span={val.width} offset={val.offset}>
|
|
2168
2173
|
<CapInput
|
|
2169
2174
|
id={val.id}
|
|
2170
2175
|
errorMessage={val.errorMessage && ifError ? val.errorMessage : ''}
|
|
@@ -2202,6 +2207,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2202
2207
|
id={val.id}
|
|
2203
2208
|
className={`${ifError ? 'error' : ''}`}
|
|
2204
2209
|
errorMessage={val.errorMessage && ifError ? val.errorMessage : ''}
|
|
2210
|
+
label={val.label}
|
|
2205
2211
|
autosize={val.autosize ? val.autosizeParams : false}
|
|
2206
2212
|
onChange={(e) => this.updateFormData(e.target.value, val)}
|
|
2207
2213
|
style={val.style ? val.style : {}}
|
|
@@ -2450,13 +2456,14 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2450
2456
|
renderPrimitiveElement(val, childIndex) {
|
|
2451
2457
|
const type = val.type;
|
|
2452
2458
|
const tabName = this.state.formData[childIndex - 1] && this.state.formData[childIndex - 1].name ? this.state.formData[childIndex - 1].name : `${val.value} ${childIndex}`;
|
|
2453
|
-
|
|
2459
|
+
const value = val.dynamicTab ? tabName : val.value;
|
|
2454
2460
|
switch (type) {
|
|
2455
2461
|
case "span":
|
|
2456
2462
|
return <span id={`${val.id}${childIndex > 1 ? childIndex : ''}`}>{val.dynamicTab ? tabName : val.value}</span>;
|
|
2457
2463
|
case "div":
|
|
2458
|
-
|
|
2459
|
-
|
|
2464
|
+
let children = _.get(this.state, `formData[${this.state.currentTab - 1}][${val.id}]`) || value;
|
|
2465
|
+
if (_.isEmpty(value) && !_.isEmpty(val.value)) {
|
|
2466
|
+
children = val.value;
|
|
2460
2467
|
}
|
|
2461
2468
|
return (<div
|
|
2462
2469
|
className={val.className ? val.className : ''}
|
|
@@ -2464,7 +2471,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2464
2471
|
onClick={(data) => this.callChildEvent(data, val, val.submitAction)}
|
|
2465
2472
|
style={val.style ? val.style : {}}
|
|
2466
2473
|
onInput={(e) => { e.stopPropagation(); this.callChildEvent(e.target.textContent, val, 'onChange'); }}
|
|
2467
|
-
>{
|
|
2474
|
+
>{children}</div>);
|
|
2468
2475
|
default:
|
|
2469
2476
|
return '';
|
|
2470
2477
|
}
|
|
@@ -2523,10 +2530,11 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2523
2530
|
const value = isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id];
|
|
2524
2531
|
if (styling === 'semantic') {
|
|
2525
2532
|
columns.push(
|
|
2526
|
-
<CapColumn key={val.id} span={val.width}>
|
|
2533
|
+
<CapColumn key={val.id} span={val.width} offset={val.offset}>
|
|
2527
2534
|
<CapInput
|
|
2528
2535
|
id={val.id}
|
|
2529
2536
|
errorMessage={val.errorMessage && ifError ? val.errorMessage : ''}
|
|
2537
|
+
label={val.label}
|
|
2530
2538
|
className={`input-primary chart-name-input${ifError ? ' error' : ''}`}
|
|
2531
2539
|
// fluid={val.fluid}
|
|
2532
2540
|
style={val.style ? val.style : {}}
|
|
@@ -2563,6 +2571,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2563
2571
|
disabled={val.disabled}
|
|
2564
2572
|
className={`${ifError ? 'error' : ''}`}
|
|
2565
2573
|
errorMessage={val.errorMessage && ifError ? val.errorMessage : ''}
|
|
2574
|
+
label={val.label}
|
|
2566
2575
|
autosize={val.autosize ? val.autosizeParams : false}
|
|
2567
2576
|
onChange={(e) => this.updateFormData(e.target.value, val)}
|
|
2568
2577
|
style={val.style ? val.style : {}}
|
|
@@ -2581,13 +2590,15 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2581
2590
|
columns.push(
|
|
2582
2591
|
<CapColumn key="input" span={val.width} offset={val.offset}>
|
|
2583
2592
|
<CapCheckbox
|
|
2593
|
+
key={val.id}
|
|
2584
2594
|
className={`${ifError ? 'error' : ''}`}
|
|
2585
2595
|
errorMessage={val.errorMessage && ifError ? val.errorMessage : ''}
|
|
2586
|
-
onChange={(e) => this.updateFormData(e.target.checked, val)}
|
|
2596
|
+
onChange={(e) => this.updateFormData(e.target.checked, val, val.submitAction)}
|
|
2587
2597
|
checked={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2588
2598
|
defaultChecked={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2589
2599
|
style={val.style ? val.style : {}}
|
|
2590
2600
|
disabled={val.disabled}
|
|
2601
|
+
inductiveText={val.inductiveText}
|
|
2591
2602
|
>
|
|
2592
2603
|
{val.label}
|
|
2593
2604
|
</CapCheckbox>
|
|
@@ -2621,15 +2632,16 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2621
2632
|
<CapColumn key={`input-${val.id}`} span={val.width} offset={val.offset}>
|
|
2622
2633
|
<CapRadioGroup
|
|
2623
2634
|
key={`${val.id}-radio-group`}
|
|
2624
|
-
className={
|
|
2635
|
+
className={`form-builder-radio-group ${ifError ? 'error' : ''}`}
|
|
2625
2636
|
errorMessage={val.errorMessage && ifError ? val.errorMessage : ''}
|
|
2626
2637
|
onChange={(e) => this.updateFormData(e.target.value, val)}
|
|
2627
2638
|
style={val.style ? val.style : {}}
|
|
2628
2639
|
value={this.handleSetRadioValue(this.state.formData, self.state.currentTab, val)}
|
|
2629
2640
|
name={val.name ? val.name : `${val.id}-name`}
|
|
2630
|
-
options={val.options}
|
|
2631
2641
|
disabled={val.disabled}
|
|
2632
2642
|
>
|
|
2643
|
+
{val.options.map((option, index) => <CapRadio value={option} inductiveText={val.inductiveText && val.inductiveText[index]}>{option}</CapRadio>) }
|
|
2644
|
+
|
|
2633
2645
|
</CapRadioGroup>
|
|
2634
2646
|
{/*{ifError ?*/}
|
|
2635
2647
|
{/*<div className="error"> {val.errorMessage}</div>*/}
|
|
@@ -2658,17 +2670,34 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2658
2670
|
);
|
|
2659
2671
|
break;
|
|
2660
2672
|
case 'upload':
|
|
2673
|
+
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2674
|
+
const ImageComponent = (props) => (
|
|
2675
|
+
<div>
|
|
2676
|
+
<div className={`image-container ${ifError ? 'error' : ''}`}>
|
|
2677
|
+
{self.state && !!self.state.formData[`${self.state.currentTab - 1}`].image ?
|
|
2678
|
+
<img src={self.state.formData[`${self.state.currentTab - 1}`].image} alt={props.alt} style={props.style}/>
|
|
2679
|
+
:
|
|
2680
|
+
<div style={{width: "100%", textAlign: "center"}}><span className="image-placeholder">{props.placeholder}</span></div>
|
|
2681
|
+
}
|
|
2682
|
+
</div>
|
|
2683
|
+
{ifError && <div><span className="error">{props.errorMessage}</span></div>}
|
|
2684
|
+
|
|
2685
|
+
</div>
|
|
2686
|
+
);
|
|
2687
|
+
const WithLabel = LabelHOC(ImageComponent);
|
|
2661
2688
|
columns.push(
|
|
2662
2689
|
<CapColumn span={val.width} offset={val.offset} style={val.style}>
|
|
2690
|
+
{val.showPreview && <WithLabel {...val.previewProps}/>}
|
|
2663
2691
|
<form encType="multipart/form-data" id={val.id}>
|
|
2664
2692
|
<input key={val.id} style={{ display: 'none'}} id="fileName" type="file" onChange={(e) => this.uploadImages(e, {files: e.target.files}, val)} accept="image/*" />
|
|
2665
|
-
<CapButton disabled={val.disabled ? val.disabled : false} type="secondary" onClick={(e) => this.openFileDialog(e)} style={{float: 'right'}}>
|
|
2693
|
+
<CapButton disabled={val.disabled ? val.disabled : false} type="secondary" onClick={(e) => this.openFileDialog(e)} style={{float: 'right', marginTop: '-68px'}}>
|
|
2666
2694
|
{val.label}
|
|
2667
2695
|
</CapButton>
|
|
2668
2696
|
</form>
|
|
2669
2697
|
</CapColumn>
|
|
2670
|
-
|
|
2698
|
+
);
|
|
2671
2699
|
break;
|
|
2700
|
+
|
|
2672
2701
|
case "table":
|
|
2673
2702
|
columns.push(
|
|
2674
2703
|
<CapTable dataSource={self.props.iosCtasData} loading={self.props.iosCtasData ? !self.props.iosCtasData.length : true} onRowClick={(row) => this.updateFormData(row, val, "onRowClick" )} pagination={val.pagination}>
|
|
@@ -2844,7 +2873,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2844
2873
|
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2845
2874
|
const options = (this.state.formData[`${val.id}-options`]) ? (this.state.formData[`${val.id}-options`]) : val.options;
|
|
2846
2875
|
columns.push(
|
|
2847
|
-
<CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2876
|
+
<CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width} offset={val.offset}>
|
|
2848
2877
|
<CapSelect
|
|
2849
2878
|
id={val.id}
|
|
2850
2879
|
options={options}
|
|
@@ -3045,33 +3074,34 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3045
3074
|
const currentLang = this.state.formData[this.state.currentTab - 1].selectedLanguages[index];
|
|
3046
3075
|
paneTabKey = this.state.formData[this.state.currentTab - 1] && this.state.formData[this.state.currentTab - 1][currentLang] && this.state.formData[this.state.currentTab - 1][currentLang].tabKey;
|
|
3047
3076
|
}
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3077
|
+
if (pane.isSupported) {
|
|
3078
|
+
renderedPanes.push(
|
|
3079
|
+
<TabPane
|
|
3080
|
+
forceRender
|
|
3081
|
+
tab={
|
|
3082
|
+
<div className="form-tab-header" onInput={(e) => e.stopPropagation()}>
|
|
3083
|
+
{
|
|
3084
|
+
_.forEach(renderedContentSections, (value) => {
|
|
3085
|
+
if (value) {
|
|
3086
|
+
return value;
|
|
3087
|
+
}
|
|
3088
|
+
return value;
|
|
3089
|
+
})
|
|
3090
|
+
}
|
|
3091
|
+
</div>
|
|
3092
|
+
}
|
|
3093
|
+
key={paneTabKey && paneTabKey !== '' ? `${paneTabKey}` : index}>
|
|
3094
|
+
{
|
|
3095
|
+
_.forEach(renderedSections, (value) => {
|
|
3056
3096
|
if (value) {
|
|
3057
3097
|
return value;
|
|
3058
3098
|
}
|
|
3059
3099
|
return value;
|
|
3060
3100
|
})
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
{
|
|
3066
|
-
_.forEach(renderedSections, (value) => {
|
|
3067
|
-
if (value) {
|
|
3068
|
-
return value;
|
|
3069
|
-
}
|
|
3070
|
-
return value;
|
|
3071
|
-
})
|
|
3072
|
-
}
|
|
3073
|
-
</TabPane>);
|
|
3074
|
-
paneIndex += 1;
|
|
3101
|
+
}
|
|
3102
|
+
</TabPane>);
|
|
3103
|
+
paneIndex += 1;
|
|
3104
|
+
}
|
|
3075
3105
|
});
|
|
3076
3106
|
extraActionSections = container.tabBarExtraContent && container.tabBarExtraContent.sections ? container.tabBarExtraContent.sections.map((section) => {
|
|
3077
3107
|
result = this.renderSection(section);
|
|
@@ -54,7 +54,7 @@ function SlideBoxContent(props) {
|
|
|
54
54
|
let channel = currentChannel;//for create mode
|
|
55
55
|
const isCreateSms = slidBoxContent === 'createTemplate' && channel === constants.SMS;
|
|
56
56
|
const isCreateMPush = slidBoxContent === 'createTemplate' && channel === constants.MOBILE_PUSH;
|
|
57
|
-
const isCreateCallTask = slidBoxContent === 'createTemplate' && channel ===
|
|
57
|
+
const isCreateCallTask = slidBoxContent === 'createTemplate' && channel === constants.CALL_TASK;
|
|
58
58
|
let isEditSms = false;
|
|
59
59
|
let isEditEmailWithId = false;
|
|
60
60
|
let isEmailEditWithContent = false;
|
|
@@ -265,7 +265,7 @@ class Creatives extends React.Component {
|
|
|
265
265
|
if (!isFullMode ) {
|
|
266
266
|
const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL && currentStep !== 'createTemplateContent';
|
|
267
267
|
const isCreate = (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate') && !isEmailCreate;
|
|
268
|
-
const isCallTask = channel ===
|
|
268
|
+
const isCallTask = channel === constants.CALL_TASK;
|
|
269
269
|
showFooter = (isCreate || (isEmailCreate && emailCreateMode) || slidBoxContent === 'preview') && !isCallTask;
|
|
270
270
|
if (isMobilepush) {
|
|
271
271
|
showFooter = currentStep === "modeSelection" || (currentStep === 'createTemplateContent' && !isEmpty(mobilePushCreateMode));
|
|
@@ -21,3 +21,4 @@ export const CLEAR_CREATE_RESPONSE_FAILURE = 'app/containers/PushMessage/Create/
|
|
|
21
21
|
export const GET_IOS_CTAS = 'app/containers/PushMessage/Create/GET_IOS_CTAS';
|
|
22
22
|
export const GET_IOS_CTAS_SUCCESS = 'app/containers/PushMessage/Create/GET_IOS_CTAS_SUCCESS';
|
|
23
23
|
export const GET_IOS_CTAS_FAILURE = 'app/containers/PushMessage/Create/GET_IOS_CTAS_FAILURE';
|
|
24
|
+
export const RESET_STORE = 'app/containers/PushMessage/Create/RESET_STORE';
|