added crm driven form via oauth

This commit is contained in:
robert.bond@test.gov.wales
2021-09-07 12:46:59 +01:00
parent 9e13a9e7c8
commit 8e8797418a
12 changed files with 245 additions and 149 deletions
+20 -12
View File
@@ -1,4 +1,5 @@
import Link from "next/link";
import _ from "lodash";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import xpath from "xpath";
@@ -21,18 +22,25 @@ export default function BuildRow(props) {
rowXML[key].outerHTML,
"text/xml"
);
var rows = xpath.select("//label/@description", doc);
var fieldtype = xpath.select("//@classid", doc);
var datafieldname = xpath.select("//@datafieldname", doc);
return (
<BuildField
fieldType={fieldtype[0].value}
label={rows[0].value}
datafieldname={datafieldname[0].value}
key={key}
props={props}
/>
);
if (_.isEmpty(rowXML[key].innerHTML)) {
("");
} else {
var rows = xpath.select("//label/@description", doc);
var fieldtype = xpath.select("//@classid", doc);
var datafieldname = xpath.select("//@datafieldname", doc);
return (
<BuildField
fieldType={fieldtype[0].value}
label={rows[0].value}
datafieldname={datafieldname[0].value}
key={key}
props={props}
picklistData={
props.props.props.formData.pickListData
}
/>
);
}
})}
</div>
);