welsh changes

This commit is contained in:
2024-12-05 16:34:48 +00:00
parent 8b349e7d3a
commit 19310b8145
12 changed files with 143 additions and 56 deletions
+2 -1
View File
@@ -96,7 +96,8 @@ export default function BuildField(props) {
);
break;
case "{4273EDBD-AC1D-40d3-9FB2-095C621B552D}":
const required = (value) => (value ? undefined : "Is required");
const required = (value) =>
value ? undefined : t("newappeal:is-required-label");
return (
<Textfield
+16 -5
View File
@@ -186,7 +186,7 @@ const BuildProgress = (props) => {
<ul className="govuk-list ">
<li className="at-nav__page">
<ol className="govuk-list govuk-list--bullet">
<li>Application form</li>
<li>{t("newappeal:application-form")}</li>
{props.props.props.form.hasOwnProperty(
"appealForm"
@@ -223,7 +223,9 @@ const BuildProgress = (props) => {
.values.pinswg_caseworkreason ==
"846040005" && (
<li>
Registration of Application letter
{t(
"newappeal:registration-of-application-letter"
)}
</li>
)
: ""}
@@ -255,7 +257,11 @@ const BuildProgress = (props) => {
].values.hasOwnProperty("pinswg_attachsoc")
? props.props.props.form["appealForm"]
.values.pinswg_attachsoc ==
"true" && <li>Statement of Case</li>
"true" && (
<li>
{t("newappeal:statement-of-case")}
</li>
)
: ""}
{props.props.props.form.hasOwnProperty(
@@ -272,7 +278,11 @@ const BuildProgress = (props) => {
? props.props.props.form["appealForm"]
.values
.pinswg_attachcostapplication ==
"true" && <li>Cost Application</li>
"true" && (
<li>
{t("newappeal:cost-application")}
</li>
)
: ""}
{props.props.props.form.hasOwnProperty(
@@ -303,7 +313,8 @@ const BuildProgress = (props) => {
return <li key={key}>{value}</li>;
}
)} */}
<li>Site Location Plan</li>
<li>{t("newappeal:site-location-plan")}</li>
</ol>
</li>
</ul>
+17 -5
View File
@@ -626,12 +626,14 @@ const mapStateToProps = (state, ownProps) => {
formData: state.formData,
appealType: state.appealType,
initialValues: state.appealType.caseReference.caseDetails,
currentView: state.currentView,
}
: {
search: state.search,
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
currentView: state.currentView,
//form: state.form,
};
};
@@ -658,22 +660,28 @@ const mapDispatchToProps = (dispatch) => {
const selector = formValueSelector("appealForm"); // <-- same as form name
const validate = (values) => {
const validate = (values, props) => {
const errors = {};
const strippedHtml = (htmlStr) => {
return htmlStr.replace(/(<([^>]+)>)/gi, "").trim();
};
const locale = props.currentView.locale;
if (values.hasOwnProperty("pinswg_attachsoc")) {
if (values.pinswg_attachsoc == "false") {
if (values.hasOwnProperty("pinswg_statementofcase")) {
if (strippedHtml(values.pinswg_statementofcase).length == 0)
errors.pinswg_statementofcase =
"Submit your Statement of Case or select Yes to attach a separate Statement of Case Document";
locale != "cy"
? "Submit your Statement of Case or select Yes to attach a separate Statement of Case Document"
: "Cyflwynwch eich Datganiad Achos neu dewiswch Ie i atodi Dogfen Datganiad Achos ar wahân";
} else {
errors.pinswg_statementofcase =
"Submit your Statement of Case or select Yes to attach a separate Statement of Case Document";
locale != "cy"
? "Submit your Statement of Case or select Yes to attach a separate Statement of Case Document"
: "Cyflwynwch eich Datganiad Achos neu dewiswch Ie i atodi Dogfen Datganiad Achos ar wahân";
}
}
}
@@ -684,10 +692,14 @@ const validate = (values) => {
if (values.hasOwnProperty("pinswg_costapplication")) {
if (strippedHtml(values.pinswg_costapplication).length == 0)
errors.pinswg_costapplication =
"Submit a Costs application or select Yes to attach a separate Costs application";
locale != "cy"
? "Submit a Costs application or select Yes to attach a separate Costs application"
: "Cyflwyno cais Costau neu ddewis Ie i atodi cais Costau ar wahân";
} else {
errors.pinswg_costapplication =
"Submit a Costs application or select Yes to attach a separate Costs application";
locale != "cy"
? "Submit a Costs application or select Yes to attach a separate Costs application"
: "Cyflwyno cais Costau neu ddewis Ie i atodi cais Costau ar wahân";
}
}
}