added form ordering and validation for s78
This commit is contained in:
@@ -5,7 +5,6 @@ import xpath from "xpath";
|
||||
|
||||
import {
|
||||
Textfield,
|
||||
DateField,
|
||||
DateFieldPicker,
|
||||
YesNofield,
|
||||
PickList,
|
||||
@@ -14,6 +13,8 @@ import {
|
||||
ReadOnlyfield,
|
||||
DecimalField,
|
||||
FileUploadField,
|
||||
CheckBoxfield,
|
||||
Radiofield,
|
||||
} from "../elements";
|
||||
|
||||
export default function BuildField(props) {
|
||||
@@ -26,9 +27,11 @@ export default function BuildField(props) {
|
||||
|
||||
const parser = new DOMParser();
|
||||
|
||||
console.log(props);
|
||||
//console.log(props);
|
||||
|
||||
const whichFieldType = (classid) => {
|
||||
//console.log(props.datafieldname, classid);
|
||||
|
||||
switch (classid) {
|
||||
case "{270BD3DB-D9AF-4782-9025-509E298DEC0A}":
|
||||
return (
|
||||
@@ -54,6 +57,7 @@ export default function BuildField(props) {
|
||||
label={props.label}
|
||||
datafieldname={props.datafieldname}
|
||||
picklistData={props.picklistData}
|
||||
validation={props.validation}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -62,10 +66,38 @@ export default function BuildField(props) {
|
||||
<YesNofield
|
||||
name={props.datafieldname}
|
||||
label={props.label}
|
||||
requiredDocumentValue={props.requiredDocumentValue}
|
||||
requiredDocumentLabel={props.requiredDocumentLabel}
|
||||
validation={props.validation}
|
||||
setDocumentsList={props.setDocumentsList}
|
||||
documentList={props.documentList}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
case "{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
|
||||
return (
|
||||
<Radiofield
|
||||
name={props.datafieldname}
|
||||
label={props.label}
|
||||
datafieldname={props.datafieldname}
|
||||
options={props.datafieldcontent}
|
||||
inline={false}
|
||||
hint={props.hint}
|
||||
form={props.props.props.form}
|
||||
formProps={props.props.props.props.form}
|
||||
parentField={props.parentField}
|
||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
||||
validation={props.validation}
|
||||
setDocumentsList={props.setDocumentsList}
|
||||
documentList={props.documentList}
|
||||
requiredDocumentValue={props.requiredDocumentValue}
|
||||
requiredDocumentLabel={props.requiredDocumentLabel}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
case "{4273EDBD-AC1D-40d3-9FB2-095C621B552D}":
|
||||
const required = (value) => (value ? undefined : "Is required");
|
||||
|
||||
return (
|
||||
<Textfield
|
||||
name={props.datafieldname}
|
||||
@@ -75,6 +107,12 @@ export default function BuildField(props) {
|
||||
props.props.props.appealType.caseReference
|
||||
.ticketnumber
|
||||
}
|
||||
form={props.props.props.form}
|
||||
formProps={props.props.props.props.form}
|
||||
parentField={props.parentField}
|
||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
||||
validation={props.validation}
|
||||
hint={props.hint}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -83,6 +121,13 @@ export default function BuildField(props) {
|
||||
<DateFieldPicker
|
||||
name={props.datafieldname}
|
||||
label={props.label}
|
||||
form={props.props.props.form}
|
||||
formProps={props.props.props.props.form}
|
||||
parentField={props.parentField}
|
||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
||||
validation={props.validation}
|
||||
dateStart={props.dateStart}
|
||||
dateEnd={props.dateEnd}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -91,6 +136,11 @@ export default function BuildField(props) {
|
||||
<MultiLinefield
|
||||
name={props.datafieldname}
|
||||
label={props.label}
|
||||
form={props.props.props.form}
|
||||
formProps={props.props.props.props.form}
|
||||
parentField={props.parentField}
|
||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
||||
validation={props.validation}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -99,6 +149,7 @@ export default function BuildField(props) {
|
||||
<NumericField
|
||||
name={props.datafieldname}
|
||||
label={props.label}
|
||||
validation={props.validation}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -107,6 +158,7 @@ export default function BuildField(props) {
|
||||
<DecimalField
|
||||
name={props.datafieldname}
|
||||
label={props.label}
|
||||
validation={props.validation}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -118,6 +170,21 @@ export default function BuildField(props) {
|
||||
/>
|
||||
);
|
||||
break;
|
||||
|
||||
case "{9EF39988-22BB-4f0b-BBBE-64B5A3748AEE}":
|
||||
return (
|
||||
<CheckBoxfield
|
||||
name={props.datafieldname}
|
||||
label={props.label}
|
||||
props={props}
|
||||
form={props.props.props.form}
|
||||
formProps={props.props.props.props.form}
|
||||
parentField={props.parentField}
|
||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
||||
validation={props.validation}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
default:
|
||||
return (
|
||||
<Textfield name={props.datafieldname} label={props.label} />
|
||||
|
||||
Reference in New Issue
Block a user