chore(refactor): commit current refactor branch updates and slice1 xml/form derivation extraction

This commit is contained in:
2026-04-10 09:39:28 +01:00
parent bd3d311cfb
commit e9d4b65a3d
28 changed files with 1340 additions and 439 deletions
+17 -23
View File
@@ -4,7 +4,6 @@ import { useRouter } from "next/router";
import { useState } from "react";
import { connect } from "react-redux";
import { formValueSelector, reduxForm } from "redux-form";
import xpath from "xpath";
import { uploadFiles } from "../../actions/services/documentService";
import { sendEmail } from "../../actions/services/notifyService";
import {
@@ -16,6 +15,14 @@ import {
} from "../../store/appealType/action";
import { getFormCollectionByID, getProgressObj, updateLinks } from "../utils";
import BuildRow from "./buildrow";
import {
parseXml,
selectAllTabTitleDescriptions,
selectCurrentSectionRows,
selectCurrentSectionTitleDescriptions,
selectErrorFieldLabelDescription,
selectFormTabs
} from "../../lib/newappeal/formDerivation";
import { FieldsTranslations } from "../elements";
import BuildProgress from "./buildprogress";
@@ -55,26 +62,13 @@ let BuildSection = (props) => {
const documentListObj = props.appealType.documentList;
const currentSection = props.appealType.currentSection;
const parser = new DOMParser();
var doc = parser.parseFromString(props.formXML, "text/xml");
var titles = xpath.select(
"//form/tabs/tab[" + currentSection + " ]/labels/label/@description",
doc
);
var rowXML = xpath.select(
"/form/tabs/tab[" +
currentSection +
"]/columns//sections/section/rows/row",
//"/form/tabs/tab/columns//sections/section/rows/row",
doc
);
var doc = parseXml(props.formXML);
var titles = selectCurrentSectionTitleDescriptions(doc, currentSection);
var rowXML = selectCurrentSectionRows(doc, currentSection);
var formObjXML = xpath.select("/form/tabs", doc);
var formObjXML = selectFormTabs(doc);
var titleList = xpath.select(
"//form/tabs/tab[*]/labels/label/@description",
doc
);
var titleList = selectAllTabTitleDescriptions(doc);
const progObj = getProgressObj(
formXML,
@@ -370,10 +364,10 @@ let BuildSection = (props) => {
errorsobj = _.keys(errorsobj);
const getErrorLabel = (whichField) => {
var doc = parser.parseFromString(props.formXML, "text/xml");
var errorFieldLabel = xpath.select(
"//*[control/@id='" + whichField + "']//@description",
doc
var doc = parseXml(props.formXML);
var errorFieldLabel = selectErrorFieldLabelDescription(
doc,
whichField
);
return errorFieldLabel[0].value;