@capillarytech/creatives-library 2.0.44 → 2.0.45
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/CmsTemplatesComponent/index.js +1 -0
- package/components/FormBuilder/_formBuilder.scss +2 -14
- package/components/FormBuilder/index.js +106 -93
- package/components/Header/index.js +41 -0
- package/components/Header/messages.js +13 -0
- package/components/Header/tests/index.test.js +10 -0
- package/components/PreviewSideBar/index.js +7 -3
- package/components/TemplatePreview/index.js +6 -7
- package/config/app.js +2 -2
- package/containers/Cap/index.js +1 -1
- package/containers/Cap/selectors.js +11 -1
- package/containers/CreativesContainer/SlideBoxContent.js +5 -1
- package/containers/CreativesContainer/SlideBoxFooter.js +5 -9
- package/containers/CreativesContainer/index.js +56 -12
- package/containers/Email/actions.js +2 -3
- package/containers/Email/index.js +32 -26
- package/containers/Email/sagas.js +1 -0
- package/containers/EmailWrapper/index.js +43 -13
- package/containers/EmailWrapper/messages.js +8 -0
- package/containers/MobilePush/Create/index.js +1 -1
- package/containers/Sms/Create/actions.js +4 -4
- package/containers/Sms/Create/index.js +28 -17
- package/containers/Sms/Create/sagas.js +1 -2
- package/containers/Sms/Edit/actions.js +4 -5
- package/containers/Sms/Edit/index.js +31 -5
- package/containers/Sms/Edit/sagas.js +1 -3
- package/containers/Templates/actions.js +3 -1
- package/containers/Templates/index.js +219 -84
- package/containers/Templates/messages.js +8 -0
- package/containers/Templates/sagas.js +16 -4
- package/containers/Templates/selectors.js +2 -0
- package/containers/TemplatesV2/index.js +9 -4
- package/containers/WeChat/MapTemplates/_mapTemplates.scss +8 -0
- package/containers/WeChat/MapTemplates/actions.js +52 -0
- package/containers/WeChat/MapTemplates/constants.js +28 -0
- package/containers/WeChat/MapTemplates/index.js +1401 -0
- package/containers/WeChat/MapTemplates/messages.js +73 -0
- package/containers/WeChat/MapTemplates/reducer.js +74 -0
- package/containers/WeChat/MapTemplates/sagas.js +86 -0
- package/containers/WeChat/MapTemplates/selectors.js +25 -0
- package/containers/WeChat/MapTemplates/tests/actions.test.js +18 -0
- package/containers/WeChat/MapTemplates/tests/index.test.js +10 -0
- package/containers/WeChat/MapTemplates/tests/reducer.test.js +9 -0
- package/containers/WeChat/MapTemplates/tests/sagas.test.js +15 -0
- package/containers/WeChat/MapTemplates/tests/selectors.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +13 -0
- package/containers/WeChat/RichmediaTemplates/Create/actions.js +35 -0
- package/containers/WeChat/RichmediaTemplates/Create/constants.js +14 -0
- package/containers/WeChat/RichmediaTemplates/Create/index.js +679 -0
- package/containers/WeChat/RichmediaTemplates/Create/messages.js +13 -0
- package/containers/WeChat/RichmediaTemplates/Create/reducer.js +49 -0
- package/containers/WeChat/RichmediaTemplates/Create/sagas.js +44 -0
- package/containers/WeChat/RichmediaTemplates/Create/selectors.js +32 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/actions.test.js +18 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/index.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/reducer.test.js +9 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/sagas.test.js +15 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/selectors.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Create/testschema.js +379 -0
- package/containers/WeChat/RichmediaTemplates/Edit/actions.js +20 -0
- package/containers/WeChat/RichmediaTemplates/Edit/constants.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Edit/index.js +98 -0
- package/containers/WeChat/RichmediaTemplates/Edit/messages.js +13 -0
- package/containers/WeChat/RichmediaTemplates/Edit/reducer.js +28 -0
- package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +32 -0
- package/containers/WeChat/RichmediaTemplates/Edit/selectors.js +25 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/actions.test.js +18 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/index.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/reducer.test.js +9 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/sagas.test.js +15 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/selectors.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/View/actions.js +15 -0
- package/containers/WeChat/RichmediaTemplates/View/constants.js +7 -0
- package/containers/WeChat/RichmediaTemplates/View/index.js +45 -0
- package/containers/WeChat/RichmediaTemplates/View/messages.js +13 -0
- package/containers/WeChat/RichmediaTemplates/View/reducer.js +23 -0
- package/containers/WeChat/RichmediaTemplates/View/sagas.js +11 -0
- package/containers/WeChat/RichmediaTemplates/View/selectors.js +25 -0
- package/containers/WeChat/RichmediaTemplates/View/tests/actions.test.js +18 -0
- package/containers/WeChat/RichmediaTemplates/View/tests/index.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/View/tests/reducer.test.js +9 -0
- package/containers/WeChat/RichmediaTemplates/View/tests/sagas.test.js +15 -0
- package/containers/WeChat/RichmediaTemplates/View/tests/selectors.test.js +10 -0
- package/index.js +3 -3
- package/package.json +1 -1
- package/routes.js +53 -13
- package/services/api.js +6 -1
|
@@ -10,8 +10,8 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { Label } from 'semantic-ui-react';
|
|
12
12
|
import _ from 'lodash';
|
|
13
|
-
import { Tabs,
|
|
14
|
-
import { CapButton, CapInput, CapPopover, CapCheckbox, CapRadio, CapSelect, CapTable, CapColumn, CapNotification} from '@capillarytech/cap-ui-library';
|
|
13
|
+
import { Tabs, Table, Modal} from 'antd';
|
|
14
|
+
import { CapButton, CapInput, CapPopover, CapCheckbox, CapRadio, CapSelect, CapTable, CapRow, CapColumn, CapNotification} from '@capillarytech/cap-ui-library';
|
|
15
15
|
import TemplatePreview from '../../components/TemplatePreview';
|
|
16
16
|
import TagList from '../../containers/TagList';
|
|
17
17
|
import SmsEditor from '../SmsEditor';
|
|
@@ -79,6 +79,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
79
79
|
this.initializeEditErrorData = this.initializeEditErrorData.bind(this);
|
|
80
80
|
this.checkIfSupportedTag = this.checkIfSupportedTag.bind(this);
|
|
81
81
|
this.transformInjectedTags = this.transformInjectedTags.bind(this);
|
|
82
|
+
this.handleSetRadioValue = this.handleSetRadioValue.bind(this);
|
|
82
83
|
this.formElements = [];
|
|
83
84
|
}
|
|
84
85
|
|
|
@@ -298,8 +299,9 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
298
299
|
return modal;
|
|
299
300
|
};
|
|
300
301
|
|
|
301
|
-
openNotificationWithIcon = (type, message) => {
|
|
302
|
+
openNotificationWithIcon = (type, message, key) => {
|
|
302
303
|
CapNotification.error({
|
|
304
|
+
key: key || type + message,
|
|
303
305
|
message: (`${type.toUpperCase()} ! ! ! `),
|
|
304
306
|
description: message, //'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
|
|
305
307
|
});
|
|
@@ -848,7 +850,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
848
850
|
}
|
|
849
851
|
}
|
|
850
852
|
if (errorString !== "") {
|
|
851
|
-
this.openNotificationWithIcon('error', errorString);
|
|
853
|
+
this.openNotificationWithIcon('error', errorString, "email-validation-error");
|
|
852
854
|
}
|
|
853
855
|
_.forEach(errorData[index], (versionData, key) => {
|
|
854
856
|
if (data.selectedLanguages.indexOf(key) === -1) {
|
|
@@ -947,7 +949,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
947
949
|
}
|
|
948
950
|
|
|
949
951
|
skipTags(tag) {
|
|
950
|
-
const regexGroups = ["dynamic_expiry_date_after_\\d+_days.FORMAT_\\d","Link_to_[a-zA-z]"];
|
|
952
|
+
const regexGroups = ["dynamic_expiry_date_after_\\d+_days.FORMAT_\\d", "unsubscribe\\(#[a-zA-Z\\d]{6}\\)","Link_to_[a-zA-z]","SURVEY.*.TOKEN"];
|
|
951
953
|
|
|
952
954
|
//const regexGroups = [];
|
|
953
955
|
let skipped = false;
|
|
@@ -1580,9 +1582,10 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1580
1582
|
}
|
|
1581
1583
|
|
|
1582
1584
|
deleteLanguage = () => {
|
|
1583
|
-
if (this.state.formData[`${this.state.currentTab - 1}`].activeTab === this.props.baseLanguage) {
|
|
1585
|
+
// if (this.state.formData[`${this.state.currentTab - 1}`].activeTab === this.props.baseLanguage) {
|
|
1584
1586
|
|
|
1585
|
-
} else {
|
|
1587
|
+
// } else {
|
|
1588
|
+
if (this.state.formData[`${this.state.currentTab - 1}`].activeTab !== this.props.baseLanguage) {
|
|
1586
1589
|
const formData = _.cloneDeep(this.state.formData);
|
|
1587
1590
|
const currentTab = `${this.state.currentTab - 1}`;
|
|
1588
1591
|
const currentLang = formData[`${this.state.currentTab - 1}`].activeTab;
|
|
@@ -1953,10 +1956,10 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1953
1956
|
// }
|
|
1954
1957
|
return;
|
|
1955
1958
|
}
|
|
1956
|
-
|
|
1957
1959
|
val.injectedEvents[event].call(this.props.parent, data);
|
|
1958
1960
|
}
|
|
1959
1961
|
openFileDialog = () => {
|
|
1962
|
+
console.log("filedialog: ");
|
|
1960
1963
|
document.getElementById("fileName").click();
|
|
1961
1964
|
};
|
|
1962
1965
|
handleOk = (ev) => {
|
|
@@ -2011,7 +2014,16 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2011
2014
|
this.setState({showModal: true});
|
|
2012
2015
|
};
|
|
2013
2016
|
|
|
2017
|
+
handleSetRadioValue = (formData, currentTab, val) => {
|
|
2018
|
+
if (formData[currentTab - 1] && formData[currentTab - 1][val.id] && formData[currentTab - 1][val.id] !== "") {
|
|
2019
|
+
return formData[currentTab - 1][val.id];
|
|
2020
|
+
} else if (formData[val.id]) {
|
|
2021
|
+
return formData[val.id];
|
|
2022
|
+
}
|
|
2023
|
+
return val.value;
|
|
2024
|
+
}
|
|
2014
2025
|
uploadImages = (e, {files}, val) => {
|
|
2026
|
+
console.log("uploadImages: ", e, {files}, val);
|
|
2015
2027
|
e.preventDefault();
|
|
2016
2028
|
const _URL = window.URL || window.webkitURL;
|
|
2017
2029
|
const file = files[0];
|
|
@@ -2066,7 +2078,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2066
2078
|
if (this.props.schema.channel.toLowerCase() === 'email') {
|
|
2067
2079
|
//
|
|
2068
2080
|
const imgSrc = template && template.versions && template.versions.base ? template.versions.base.preview_http_url : '';
|
|
2069
|
-
const ifPreviewGenerated = template && template.versions && template.versions.base ? template.versions.base.isPreviewGenerated : 0;
|
|
2081
|
+
// const ifPreviewGenerated = template && template.versions && template.versions.base ? template.versions.base.isPreviewGenerated : 0;
|
|
2070
2082
|
const content = <img src={imgSrc || ''} alt="" />;
|
|
2071
2083
|
|
|
2072
2084
|
temp.content = (
|
|
@@ -2120,9 +2132,9 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2120
2132
|
}
|
|
2121
2133
|
//
|
|
2122
2134
|
columns.push(
|
|
2123
|
-
<
|
|
2135
|
+
<CapColumn key="label" span={4}>
|
|
2124
2136
|
<Label style={val.labelStyle ? val.labelStyle : {}}>{val.label}</Label>
|
|
2125
|
-
</
|
|
2137
|
+
</CapColumn>
|
|
2126
2138
|
);
|
|
2127
2139
|
let ifError = false;
|
|
2128
2140
|
const isVersionEnable = (this.state.usingTabContainer && !val.standalone);
|
|
@@ -2134,19 +2146,21 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2134
2146
|
}
|
|
2135
2147
|
}
|
|
2136
2148
|
columns.push(
|
|
2137
|
-
<
|
|
2149
|
+
<CapColumn key={val.id} span={val.width}>
|
|
2138
2150
|
{this.renderPrimitiveElement(val, childIndex)}
|
|
2139
|
-
</
|
|
2151
|
+
</CapColumn>
|
|
2140
2152
|
);
|
|
2141
2153
|
return true;
|
|
2142
2154
|
}
|
|
2155
|
+
let content = "";
|
|
2156
|
+
let charList = {};
|
|
2143
2157
|
switch (type) {
|
|
2144
2158
|
case "input":
|
|
2145
2159
|
if (styling === 'semantic') {
|
|
2146
2160
|
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2147
2161
|
|
|
2148
2162
|
columns.push(
|
|
2149
|
-
<
|
|
2163
|
+
<CapColumn key={val.id} span={val.width}>
|
|
2150
2164
|
<CapInput
|
|
2151
2165
|
id={val.id}
|
|
2152
2166
|
errorMessage={val.errorMessage && ifError ? val.errorMessage : ''}
|
|
@@ -2159,26 +2173,26 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2159
2173
|
value={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2160
2174
|
disabled={val.disabled}
|
|
2161
2175
|
/>
|
|
2162
|
-
</
|
|
2176
|
+
</CapColumn>
|
|
2163
2177
|
);
|
|
2164
2178
|
}
|
|
2165
2179
|
break;
|
|
2166
2180
|
case "SmsEditor":
|
|
2167
2181
|
columns.push(
|
|
2168
|
-
<
|
|
2182
|
+
<CapColumn span={5} key="input">
|
|
2169
2183
|
<SmsEditor
|
|
2170
2184
|
id={val.id}
|
|
2171
2185
|
content={this.state.formData[val.id]}
|
|
2172
2186
|
onDataChange={(data) => this.updateFormData(data.value, val)}
|
|
2173
2187
|
/>
|
|
2174
|
-
</
|
|
2188
|
+
</CapColumn>
|
|
2175
2189
|
);
|
|
2176
2190
|
break;
|
|
2177
2191
|
case "textarea":
|
|
2178
2192
|
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2179
2193
|
if (styling === 'semantic') {
|
|
2180
2194
|
columns.push(
|
|
2181
|
-
<
|
|
2195
|
+
<CapColumn key="input" span={val.width}>
|
|
2182
2196
|
<TextArea
|
|
2183
2197
|
id={val.id}
|
|
2184
2198
|
className={`${ifError ? 'error' : ''}`}
|
|
@@ -2192,13 +2206,13 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2192
2206
|
disabled={val.disabled}
|
|
2193
2207
|
cols={20}
|
|
2194
2208
|
/>
|
|
2195
|
-
</
|
|
2209
|
+
</CapColumn>
|
|
2196
2210
|
);
|
|
2197
2211
|
}
|
|
2198
2212
|
break;
|
|
2199
2213
|
case "contentPreview":
|
|
2200
|
-
|
|
2201
|
-
|
|
2214
|
+
content = isVersionEnable ? this.state.formData[this.state.currentTab - 1]['sms-editor'] : this.state.formData['sms-editor'];
|
|
2215
|
+
charList = updateCharCount(content).char_list;
|
|
2202
2216
|
columns.push(<CapColumn id={val.id} className={"preview-chars"} span={val.width}>
|
|
2203
2217
|
{charList.map((char) => char)}
|
|
2204
2218
|
</CapColumn>);
|
|
@@ -2207,7 +2221,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2207
2221
|
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2208
2222
|
if (styling === 'semantic') {
|
|
2209
2223
|
columns.push(
|
|
2210
|
-
<
|
|
2224
|
+
<CapColumn key="input" span={val.width} offset={val.offset}>
|
|
2211
2225
|
<CapCheckbox
|
|
2212
2226
|
className={`${ifError ? 'error' : ''}`}
|
|
2213
2227
|
errorMessage={val.errorMessage && ifError ? val.errorMessage : ''}
|
|
@@ -2217,13 +2231,13 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2217
2231
|
defaultChecked={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2218
2232
|
disabled={val.disabled}
|
|
2219
2233
|
/>
|
|
2220
|
-
</
|
|
2234
|
+
</CapColumn>
|
|
2221
2235
|
);
|
|
2222
2236
|
}
|
|
2223
2237
|
break;
|
|
2224
2238
|
case "tag-list":
|
|
2225
2239
|
columns.push(
|
|
2226
|
-
<
|
|
2240
|
+
<CapColumn key={`input-${val.id}`} span={10} offset={val.offset}>
|
|
2227
2241
|
<TagList
|
|
2228
2242
|
key={`input-${val.id}`}
|
|
2229
2243
|
moduleFilterEnabled={this.props.location && this.props.location.query && this.props.location.query.type !== 'embedded'}
|
|
@@ -2237,27 +2251,26 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2237
2251
|
id={val.id}
|
|
2238
2252
|
userLocale={this.props.userLocale}
|
|
2239
2253
|
/>
|
|
2240
|
-
</
|
|
2254
|
+
</CapColumn>
|
|
2241
2255
|
);
|
|
2242
2256
|
break;
|
|
2243
2257
|
case "tabs":
|
|
2244
2258
|
columns.push(
|
|
2245
|
-
<
|
|
2259
|
+
<CapColumn key="input" span={10}>
|
|
2246
2260
|
<TagList
|
|
2247
2261
|
onTagSelect={(data) => this.callChildEvent(data, val, 'onTagSelect')}
|
|
2248
2262
|
/>
|
|
2249
|
-
</
|
|
2263
|
+
</CapColumn>
|
|
2250
2264
|
);
|
|
2251
2265
|
break;
|
|
2252
2266
|
case "sms-preview": {
|
|
2253
|
-
let content = "";
|
|
2254
2267
|
if (this.state.usingTabContainer && !this.state.formData[`${this.state.currentTab - 1}`]) {
|
|
2255
2268
|
return true;
|
|
2256
2269
|
}
|
|
2257
2270
|
content = isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][`sms-editor${this.state.currentTab > 1 ? this.state.currentTab : ''}`] : this.state.formData[val.id];
|
|
2258
2271
|
const unicodeEnabled = isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][`unicode-validity${this.state.currentTab > 1 ? this.state.currentTab : ''}`] : this.state.formData['unicode-validity'];
|
|
2259
2272
|
columns.push(
|
|
2260
|
-
<
|
|
2273
|
+
<CapColumn key="input" span={10}>
|
|
2261
2274
|
<TemplatePreview
|
|
2262
2275
|
channel={val.channel ? val.channel : 'SMS'}
|
|
2263
2276
|
content={content}
|
|
@@ -2265,7 +2278,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2265
2278
|
unicodeEnabled={unicodeEnabled}
|
|
2266
2279
|
>
|
|
2267
2280
|
</TemplatePreview>
|
|
2268
|
-
</
|
|
2281
|
+
</CapColumn>
|
|
2269
2282
|
);
|
|
2270
2283
|
break;
|
|
2271
2284
|
}
|
|
@@ -2293,7 +2306,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2293
2306
|
case "select": {
|
|
2294
2307
|
const options = (this.state.formData[`${val.id}-options`]) ? (this.state.formData[`${val.id}-options`]) : val.options;
|
|
2295
2308
|
columns.push(
|
|
2296
|
-
<
|
|
2309
|
+
<CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2297
2310
|
<CapSelect
|
|
2298
2311
|
id={val.id}
|
|
2299
2312
|
placeholder={val.placeholder ? val.placeholder : ''}
|
|
@@ -2303,14 +2316,14 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2303
2316
|
value={(this.state.formData[val.id] && this.state.formData[val.id] !== '' ? this.state.formData[val.id] : undefined)}
|
|
2304
2317
|
disabled={val.disabled}
|
|
2305
2318
|
/>
|
|
2306
|
-
</
|
|
2319
|
+
</CapColumn>
|
|
2307
2320
|
);
|
|
2308
2321
|
}
|
|
2309
2322
|
break;
|
|
2310
2323
|
case "ckeditor":
|
|
2311
2324
|
|
|
2312
2325
|
columns.push(
|
|
2313
|
-
<
|
|
2326
|
+
<CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2314
2327
|
<CKEditor
|
|
2315
2328
|
id={val.id}
|
|
2316
2329
|
content={(this.state.formData[`${this.state.currentTab - 1}`][val.id] ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : '')}
|
|
@@ -2319,7 +2332,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2319
2332
|
// this.callChildEvent(data, val, 'addVersion', event);
|
|
2320
2333
|
handleContentChange={(event) => this.callChildEvent(event, val, 'onContentChange')}
|
|
2321
2334
|
/>
|
|
2322
|
-
</
|
|
2335
|
+
</CapColumn>
|
|
2323
2336
|
);
|
|
2324
2337
|
break;
|
|
2325
2338
|
case "edmeditor": {
|
|
@@ -2339,13 +2352,13 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2339
2352
|
}
|
|
2340
2353
|
|
|
2341
2354
|
columns.push(
|
|
2342
|
-
<
|
|
2355
|
+
<CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2343
2356
|
<EDMEditor
|
|
2344
2357
|
id={val.id}
|
|
2345
2358
|
getEditorInstanse={this.getEditorInstanse}
|
|
2346
2359
|
edmSrc={edmSrc}
|
|
2347
2360
|
/>
|
|
2348
|
-
</
|
|
2361
|
+
</CapColumn>
|
|
2349
2362
|
);
|
|
2350
2363
|
}
|
|
2351
2364
|
break;
|
|
@@ -2353,7 +2366,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2353
2366
|
break;
|
|
2354
2367
|
}
|
|
2355
2368
|
row.push(
|
|
2356
|
-
<
|
|
2369
|
+
<CapRow>
|
|
2357
2370
|
{
|
|
2358
2371
|
_.forEach(columns, (value) => {
|
|
2359
2372
|
if (value) {
|
|
@@ -2362,7 +2375,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2362
2375
|
return value;
|
|
2363
2376
|
})
|
|
2364
2377
|
}
|
|
2365
|
-
</
|
|
2378
|
+
</CapRow>
|
|
2366
2379
|
);
|
|
2367
2380
|
|
|
2368
2381
|
fields.push(row);
|
|
@@ -2377,12 +2390,12 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2377
2390
|
case "button":
|
|
2378
2391
|
if (styling === 'semantic' && val.metaType === 'submit-button') {
|
|
2379
2392
|
columns.push(
|
|
2380
|
-
<
|
|
2393
|
+
<CapColumn>
|
|
2381
2394
|
<CapButton
|
|
2382
2395
|
onClick={(data) => val.id === 'save-button' ? this.saveForm() : this.callChildEvent(data, val, val.submitAction)}>
|
|
2383
2396
|
{val.value}
|
|
2384
2397
|
</CapButton>
|
|
2385
|
-
</
|
|
2398
|
+
</CapColumn>
|
|
2386
2399
|
);
|
|
2387
2400
|
}
|
|
2388
2401
|
break;
|
|
@@ -2399,10 +2412,10 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2399
2412
|
const cols = [];
|
|
2400
2413
|
section.childSections.map( (childSection) => {
|
|
2401
2414
|
const renderedChildSection = this.renderSection(childSection, childIndex);
|
|
2402
|
-
cols.push(<
|
|
2415
|
+
cols.push(<CapColumn style={childSection.colStyle ? childSection.colStyle : {}}offset={childSection.offset} span={childSection.width}>{renderedChildSection}</CapColumn>);
|
|
2403
2416
|
return true;
|
|
2404
2417
|
});
|
|
2405
|
-
const row = (<
|
|
2418
|
+
const row = (<CapRow style={section.rowStyle ? section.rowStyle : {}}>
|
|
2406
2419
|
{
|
|
2407
2420
|
_.forEach(cols, (value) => {
|
|
2408
2421
|
if (value) {
|
|
@@ -2411,7 +2424,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2411
2424
|
return value;
|
|
2412
2425
|
})
|
|
2413
2426
|
}
|
|
2414
|
-
</
|
|
2427
|
+
</CapRow>);
|
|
2415
2428
|
return row;
|
|
2416
2429
|
}
|
|
2417
2430
|
|
|
@@ -2492,9 +2505,9 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2492
2505
|
}
|
|
2493
2506
|
}
|
|
2494
2507
|
columns.push(
|
|
2495
|
-
<
|
|
2508
|
+
<CapColumn style={val.colStyle ? val.colStyle : {}} offset={val.offset} key={val.id} span={val.width}>
|
|
2496
2509
|
{this.renderPrimitiveElement(val, childIndex)}
|
|
2497
|
-
</
|
|
2510
|
+
</CapColumn>
|
|
2498
2511
|
);
|
|
2499
2512
|
return true;
|
|
2500
2513
|
}
|
|
@@ -2505,7 +2518,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2505
2518
|
|
|
2506
2519
|
if (styling === 'semantic') {
|
|
2507
2520
|
columns.push(
|
|
2508
|
-
<
|
|
2521
|
+
<CapColumn key={val.id} span={val.width}>
|
|
2509
2522
|
<CapInput
|
|
2510
2523
|
id={val.id}
|
|
2511
2524
|
errorMessage={val.errorMessage && ifError ? val.errorMessage : ''}
|
|
@@ -2518,26 +2531,26 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2518
2531
|
defaultValue={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2519
2532
|
disabled={val.disabled}
|
|
2520
2533
|
/>
|
|
2521
|
-
</
|
|
2534
|
+
</CapColumn>
|
|
2522
2535
|
);
|
|
2523
2536
|
}
|
|
2524
2537
|
break;
|
|
2525
2538
|
case "SmsEditor":
|
|
2526
2539
|
columns.push(
|
|
2527
|
-
<
|
|
2540
|
+
<CapColumn span={5} key="input">
|
|
2528
2541
|
<SmsEditor
|
|
2529
2542
|
id={val.id}
|
|
2530
2543
|
content={this.state.formData[val.id]}
|
|
2531
2544
|
onDataChange={(data) => this.updateFormData(data.value, val)}
|
|
2532
2545
|
/>
|
|
2533
|
-
</
|
|
2546
|
+
</CapColumn>
|
|
2534
2547
|
);
|
|
2535
2548
|
break;
|
|
2536
2549
|
case "textarea":
|
|
2537
2550
|
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2538
2551
|
if (styling === 'semantic') {
|
|
2539
2552
|
columns.push(
|
|
2540
|
-
<
|
|
2553
|
+
<CapColumn key="input" span={val.width} offset={val.offset}>
|
|
2541
2554
|
<TextArea
|
|
2542
2555
|
id={val.id}
|
|
2543
2556
|
placeholder={val.placeholder ? val.placeholder : ''}
|
|
@@ -2552,7 +2565,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2552
2565
|
rows={10}
|
|
2553
2566
|
cols={2}
|
|
2554
2567
|
/>
|
|
2555
|
-
</
|
|
2568
|
+
</CapColumn>
|
|
2556
2569
|
);
|
|
2557
2570
|
}
|
|
2558
2571
|
break;
|
|
@@ -2560,7 +2573,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2560
2573
|
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2561
2574
|
if (styling === 'semantic') {
|
|
2562
2575
|
columns.push(
|
|
2563
|
-
<
|
|
2576
|
+
<CapColumn key="input" span={val.width} offset={val.offset}>
|
|
2564
2577
|
<CapCheckbox
|
|
2565
2578
|
className={`${ifError ? 'error' : ''}`}
|
|
2566
2579
|
errorMessage={val.errorMessage && ifError ? val.errorMessage : ''}
|
|
@@ -2572,7 +2585,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2572
2585
|
>
|
|
2573
2586
|
{val.label}
|
|
2574
2587
|
</CapCheckbox>
|
|
2575
|
-
</
|
|
2588
|
+
</CapColumn>
|
|
2576
2589
|
);
|
|
2577
2590
|
}
|
|
2578
2591
|
break;
|
|
@@ -2580,7 +2593,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2580
2593
|
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2581
2594
|
if (styling === 'semantic') {
|
|
2582
2595
|
columns.push(
|
|
2583
|
-
<
|
|
2596
|
+
<CapColumn key={`input-${val.id}`} span={val.width} offset={val.offset}>
|
|
2584
2597
|
<CapRadio
|
|
2585
2598
|
className={`${ifError ? 'error' : ''}`}
|
|
2586
2599
|
errorMessage={val.errorMessage && ifError ? val.errorMessage : ''}
|
|
@@ -2591,7 +2604,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2591
2604
|
>
|
|
2592
2605
|
{val.label}
|
|
2593
2606
|
</CapRadio>
|
|
2594
|
-
</
|
|
2607
|
+
</CapColumn>
|
|
2595
2608
|
);
|
|
2596
2609
|
}
|
|
2597
2610
|
break;
|
|
@@ -2599,14 +2612,14 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2599
2612
|
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2600
2613
|
if (styling === 'semantic') {
|
|
2601
2614
|
columns.push(
|
|
2602
|
-
<
|
|
2615
|
+
<CapColumn key={`input-${val.id}`} span={val.width} offset={val.offset}>
|
|
2603
2616
|
<CapRadioGroup
|
|
2604
2617
|
key={`${val.id}-radio-group`}
|
|
2605
2618
|
className={`${ifError ? 'error' : ''}`}
|
|
2606
2619
|
errorMessage={val.errorMessage && ifError ? val.errorMessage : ''}
|
|
2607
2620
|
onChange={(e) => this.updateFormData(e.target.value, val)}
|
|
2608
2621
|
style={val.style ? val.style : {}}
|
|
2609
|
-
value={this.
|
|
2622
|
+
value={this.handleSetRadioValue(this.state.formData, self.state.currentTab, val)}
|
|
2610
2623
|
name={val.name ? val.name : `${val.id}-name`}
|
|
2611
2624
|
options={val.options}
|
|
2612
2625
|
disabled={val.disabled}
|
|
@@ -2617,14 +2630,14 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2617
2630
|
{/*:*/}
|
|
2618
2631
|
{/*""*/}
|
|
2619
2632
|
{/*}*/}
|
|
2620
|
-
</
|
|
2633
|
+
</CapColumn>
|
|
2621
2634
|
);
|
|
2622
2635
|
}
|
|
2623
2636
|
break;
|
|
2624
2637
|
case 'image':
|
|
2625
2638
|
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2626
2639
|
columns.push(
|
|
2627
|
-
<
|
|
2640
|
+
<CapColumn key={`input-${val.id}${self.state.currentTab - 1}`} style={val.style} span={val.width} offset={val.offset}>
|
|
2628
2641
|
<div>
|
|
2629
2642
|
<div className={`image-container ${ifError ? 'error' : ''}`}>
|
|
2630
2643
|
{self.state && !!self.state.formData[`${self.state.currentTab - 1}`].image ?
|
|
@@ -2635,19 +2648,19 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2635
2648
|
</div>
|
|
2636
2649
|
{ifError && <span className="error">{val.errorMessage}</span>}
|
|
2637
2650
|
</div>
|
|
2638
|
-
</
|
|
2651
|
+
</CapColumn>
|
|
2639
2652
|
);
|
|
2640
2653
|
break;
|
|
2641
2654
|
case 'upload':
|
|
2642
2655
|
columns.push(
|
|
2643
|
-
<
|
|
2656
|
+
<CapColumn span={val.width} offset={val.offset} style={val.style}>
|
|
2644
2657
|
<form encType="multipart/form-data" id={val.id}>
|
|
2645
2658
|
<input key={val.id} style={{ display: 'none'}} id="fileName" type="file" onChange={(e) => this.uploadImages(e, {files: e.target.files}, val)} accept="image/*" />
|
|
2646
|
-
<CapButton type="secondary" onClick={(e) => this.openFileDialog(e)} style={{float: 'right'}}>
|
|
2659
|
+
<CapButton disabled={val.disabled ? val.disabled : false} type="secondary" onClick={(e) => this.openFileDialog(e)} style={{float: 'right'}}>
|
|
2647
2660
|
{val.label}
|
|
2648
2661
|
</CapButton>
|
|
2649
2662
|
</form>
|
|
2650
|
-
</
|
|
2663
|
+
</CapColumn>
|
|
2651
2664
|
);
|
|
2652
2665
|
break;
|
|
2653
2666
|
case "table":
|
|
@@ -2659,7 +2672,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2659
2672
|
break;
|
|
2660
2673
|
case "tag-list":
|
|
2661
2674
|
columns.push(
|
|
2662
|
-
<
|
|
2675
|
+
<CapColumn key={`input-${val.id}`} offset={val.offset} span={val.width ? val.width : ''} style={val.style ? val.style : {marginBottom: '16px'}}>
|
|
2663
2676
|
<TagList
|
|
2664
2677
|
key={`input-${val.id}`}
|
|
2665
2678
|
moduleFilterEnabled={this.props.location && this.props.location.query && this.props.location.query.type !== 'embedded'}
|
|
@@ -2673,13 +2686,13 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2673
2686
|
id={val.id}
|
|
2674
2687
|
userLocale={this.props.userLocale}
|
|
2675
2688
|
/>
|
|
2676
|
-
</
|
|
2689
|
+
</CapColumn>
|
|
2677
2690
|
);
|
|
2678
2691
|
break;
|
|
2679
2692
|
case "button":
|
|
2680
2693
|
if (styling === 'semantic' && val.metaType === 'submit-button') {
|
|
2681
2694
|
columns.push(
|
|
2682
|
-
<
|
|
2695
|
+
<CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width} offset={val.offset}>
|
|
2683
2696
|
<CapButton
|
|
2684
2697
|
type={val.buttonType}
|
|
2685
2698
|
icon={val.icon}
|
|
@@ -2687,7 +2700,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2687
2700
|
onClick={(data) => val.id === 'save-button' ? this.saveForm() : this.callChildEvent(data, val, val.submitAction)}>
|
|
2688
2701
|
{val.value}
|
|
2689
2702
|
</CapButton>
|
|
2690
|
-
</
|
|
2703
|
+
</CapColumn>
|
|
2691
2704
|
);
|
|
2692
2705
|
}
|
|
2693
2706
|
break;
|
|
@@ -2700,7 +2713,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2700
2713
|
content = isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][`sms-editor${this.state.currentTab > 1 ? this.state.currentTab : ''}`] : this.state.formData[val.id];
|
|
2701
2714
|
const unicodeEnabled = isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][`unicode-validity${this.state.currentTab > 1 ? this.state.currentTab : ''}`] : this.state.formData['unicode-validity'];
|
|
2702
2715
|
columns.push(
|
|
2703
|
-
<
|
|
2716
|
+
<CapColumn key="input" span={23} offset={1}>
|
|
2704
2717
|
<TemplatePreview
|
|
2705
2718
|
key={val.id}
|
|
2706
2719
|
style={val.customStyling ? val.customStyling : {}}
|
|
@@ -2710,7 +2723,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2710
2723
|
unicodeEnabled={unicodeEnabled}
|
|
2711
2724
|
>
|
|
2712
2725
|
</TemplatePreview>
|
|
2713
|
-
</
|
|
2726
|
+
</CapColumn>
|
|
2714
2727
|
);
|
|
2715
2728
|
}
|
|
2716
2729
|
break;
|
|
@@ -2724,7 +2737,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2724
2737
|
}
|
|
2725
2738
|
|
|
2726
2739
|
columns.push(
|
|
2727
|
-
<
|
|
2740
|
+
<CapColumn key="input" span={23} offset={1}>
|
|
2728
2741
|
<TemplatePreview
|
|
2729
2742
|
key={val.id}
|
|
2730
2743
|
style={val.customStyling ? val.customStyling : {}}
|
|
@@ -2732,7 +2745,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2732
2745
|
content={content}
|
|
2733
2746
|
>
|
|
2734
2747
|
</TemplatePreview>
|
|
2735
|
-
</
|
|
2748
|
+
</CapColumn>
|
|
2736
2749
|
);
|
|
2737
2750
|
}
|
|
2738
2751
|
break;
|
|
@@ -2741,7 +2754,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2741
2754
|
return true;
|
|
2742
2755
|
}
|
|
2743
2756
|
columns.push(
|
|
2744
|
-
<
|
|
2757
|
+
<CapColumn key="input" span={23} offset={1}>
|
|
2745
2758
|
<TemplatePreview
|
|
2746
2759
|
key={val.id}
|
|
2747
2760
|
device={val.device ? val.device : 'android'}
|
|
@@ -2759,7 +2772,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2759
2772
|
}}
|
|
2760
2773
|
>
|
|
2761
2774
|
</TemplatePreview>
|
|
2762
|
-
</
|
|
2775
|
+
</CapColumn>
|
|
2763
2776
|
);
|
|
2764
2777
|
break;
|
|
2765
2778
|
case "popover":
|
|
@@ -2772,7 +2785,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2772
2785
|
return result;
|
|
2773
2786
|
});
|
|
2774
2787
|
columns.push(
|
|
2775
|
-
<
|
|
2788
|
+
<CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width} offset={val.offset}>
|
|
2776
2789
|
<CapPopover
|
|
2777
2790
|
trigger={val.trigger}
|
|
2778
2791
|
placement={val.placement}
|
|
@@ -2796,7 +2809,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2796
2809
|
})
|
|
2797
2810
|
}
|
|
2798
2811
|
</CapPopover>
|
|
2799
|
-
</
|
|
2812
|
+
</CapColumn>
|
|
2800
2813
|
);
|
|
2801
2814
|
break;
|
|
2802
2815
|
|
|
@@ -2808,7 +2821,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2808
2821
|
}
|
|
2809
2822
|
}
|
|
2810
2823
|
columns.push(
|
|
2811
|
-
<
|
|
2824
|
+
<CapColumn
|
|
2812
2825
|
key={`icon-${val.id}`}
|
|
2813
2826
|
id={val.id}
|
|
2814
2827
|
offset={val.offset}
|
|
@@ -2818,14 +2831,14 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2818
2831
|
style={val.colStyle ? val.colStyle : {}}
|
|
2819
2832
|
>
|
|
2820
2833
|
<i style={val.style ? val.style : {}} className="material-icons">{val.value ? val.value : ''}</i>
|
|
2821
|
-
</
|
|
2834
|
+
</CapColumn>
|
|
2822
2835
|
);
|
|
2823
2836
|
break;
|
|
2824
2837
|
case "select": {
|
|
2825
2838
|
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2826
2839
|
const options = (this.state.formData[`${val.id}-options`]) ? (this.state.formData[`${val.id}-options`]) : val.options;
|
|
2827
2840
|
columns.push(
|
|
2828
|
-
<
|
|
2841
|
+
<CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2829
2842
|
<CapSelect
|
|
2830
2843
|
id={val.id}
|
|
2831
2844
|
options={options}
|
|
@@ -2838,7 +2851,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2838
2851
|
{ifError && val.errorMessage &&
|
|
2839
2852
|
<span className={'error'}>{val.errorMessage}</span>
|
|
2840
2853
|
}
|
|
2841
|
-
</
|
|
2854
|
+
</CapColumn>
|
|
2842
2855
|
);
|
|
2843
2856
|
}
|
|
2844
2857
|
break;
|
|
@@ -2858,7 +2871,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2858
2871
|
// content = "";
|
|
2859
2872
|
}
|
|
2860
2873
|
columns.push(
|
|
2861
|
-
<
|
|
2874
|
+
<CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2862
2875
|
<CKEditor
|
|
2863
2876
|
id={val.id}
|
|
2864
2877
|
content={content}
|
|
@@ -2866,7 +2879,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2866
2879
|
getEditorInstanse={(evt, id) => val.injectedEvents.getEditorInstanse.call(this, evt, id)}
|
|
2867
2880
|
handleContentChange={(event) => this.callChildEvent(event, val, 'onContentChange')}
|
|
2868
2881
|
/>
|
|
2869
|
-
</
|
|
2882
|
+
</CapColumn>
|
|
2870
2883
|
);
|
|
2871
2884
|
}
|
|
2872
2885
|
break;
|
|
@@ -2897,13 +2910,13 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2897
2910
|
|
|
2898
2911
|
|
|
2899
2912
|
columns.push(
|
|
2900
|
-
<
|
|
2913
|
+
<CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2901
2914
|
<EDMEditor
|
|
2902
2915
|
id={val.id}
|
|
2903
2916
|
getEditorInstanse={this.getEditorInstanse}
|
|
2904
2917
|
edmSrc={edmSrc}
|
|
2905
2918
|
/>
|
|
2906
|
-
</
|
|
2919
|
+
</CapColumn>
|
|
2907
2920
|
);
|
|
2908
2921
|
}
|
|
2909
2922
|
break;
|
|
@@ -2912,7 +2925,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2912
2925
|
return true;
|
|
2913
2926
|
}
|
|
2914
2927
|
columns.push(
|
|
2915
|
-
<
|
|
2928
|
+
<CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2916
2929
|
<CustomPopOver
|
|
2917
2930
|
id={val.id}
|
|
2918
2931
|
popOverList={this.props.supportedLanguages}
|
|
@@ -2921,7 +2934,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2921
2934
|
visible={this.state.customPopoverVisible}
|
|
2922
2935
|
onVisibleChange={this.handleCustomPopoverVisibleChange}
|
|
2923
2936
|
/>
|
|
2924
|
-
</
|
|
2937
|
+
</CapColumn>
|
|
2925
2938
|
);
|
|
2926
2939
|
}
|
|
2927
2940
|
break;
|
|
@@ -2931,7 +2944,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2931
2944
|
return true;
|
|
2932
2945
|
});
|
|
2933
2946
|
const row = (
|
|
2934
|
-
<
|
|
2947
|
+
<CapRow style={field.rowStyle ? field.rowStyle : {}} className={field.rowClassName ? field.rowClassName : ''}>
|
|
2935
2948
|
{
|
|
2936
2949
|
_.forEach(columns, (value) => {
|
|
2937
2950
|
if (value) {
|
|
@@ -2940,7 +2953,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2940
2953
|
return value;
|
|
2941
2954
|
})
|
|
2942
2955
|
}
|
|
2943
|
-
</
|
|
2956
|
+
</CapRow>
|
|
2944
2957
|
);
|
|
2945
2958
|
fields.push(row);
|
|
2946
2959
|
});
|
|
@@ -2954,7 +2967,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2954
2967
|
case "button":
|
|
2955
2968
|
if (styling === 'semantic' && val.metaType === 'submit-button') {
|
|
2956
2969
|
columns.push(
|
|
2957
|
-
<
|
|
2970
|
+
<CapColumn span={3}>
|
|
2958
2971
|
<CapButton
|
|
2959
2972
|
type={val.buttonType}
|
|
2960
2973
|
icon={val.icon}
|
|
@@ -2962,7 +2975,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2962
2975
|
onClick={(data) => val.id === 'save-button' ? this.saveForm() : this.callChildEvent(data, val, val.submitAction)}>
|
|
2963
2976
|
{val.value}
|
|
2964
2977
|
</CapButton>
|
|
2965
|
-
</
|
|
2978
|
+
</CapColumn>
|
|
2966
2979
|
);
|
|
2967
2980
|
}
|
|
2968
2981
|
break;
|
|
@@ -2971,7 +2984,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2971
2984
|
}
|
|
2972
2985
|
});
|
|
2973
2986
|
const row = (
|
|
2974
|
-
<
|
|
2987
|
+
<CapRow>
|
|
2975
2988
|
{
|
|
2976
2989
|
_.forEach(columns, (value) => {
|
|
2977
2990
|
if (value) {
|
|
@@ -2980,7 +2993,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2980
2993
|
return value;
|
|
2981
2994
|
})
|
|
2982
2995
|
}
|
|
2983
|
-
</
|
|
2996
|
+
</CapRow>
|
|
2984
2997
|
);
|
|
2985
2998
|
fields.push(row);
|
|
2986
2999
|
});
|
|
@@ -3139,7 +3152,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3139
3152
|
|
|
3140
3153
|
|
|
3141
3154
|
return (
|
|
3142
|
-
<
|
|
3155
|
+
<CapRow>
|
|
3143
3156
|
{
|
|
3144
3157
|
this.props.schema ? this.renderForm() : ''
|
|
3145
3158
|
}
|
|
@@ -3152,7 +3165,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3152
3165
|
loadingText={"Loading EDM Templates"}
|
|
3153
3166
|
isLoading={this.props.getCmsTemplatesInProgress}
|
|
3154
3167
|
/>
|
|
3155
|
-
</
|
|
3168
|
+
</CapRow>
|
|
3156
3169
|
);
|
|
3157
3170
|
}
|
|
3158
3171
|
}
|