adjusted timetable to display correct dates

This commit is contained in:
2024-05-28 08:57:02 +01:00
parent 6b36c5dc51
commit 8b385217c3
7 changed files with 233 additions and 141 deletions
@@ -3,7 +3,7 @@ import _ from "lodash";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { connect } from "react-redux";
import { Field, reduxForm, formValueSelector } from "redux-form";
import { Field, reduxForm, formValueSelector, change } from "redux-form";
import {
RenderPickList,
RenderTextfield,
@@ -339,7 +339,8 @@ let RepLPA = (props) => {
"representationType",
]) ||
typeof props.representationType != "undefined") &&
(props.representationType != "Questionnaire" ? (
(props.representationType != "Questionnaire" &&
props.representationType != "Select..." ? (
<>
<p className="govuk-body">
{t("myrepresentations:enter-comment-label")}
@@ -480,10 +481,15 @@ let RepLPA = (props) => {
<a
onClick={() => {
//setRepresentationCapacity();
props.updateField(
"representationForm",
"representationType",
""
);
}}
className="govuk-link"
>
{t("common:back-link")}
{t("common:back-link")}ss
</a>
</>
)}
@@ -505,6 +511,11 @@ RepLPA = connect((state) => {
};
})(RepLPA);
const mapDispatchToProps = (dispatch) => ({
updateField: (form, field, newValue) =>
dispatch(change(form, field, newValue)),
});
const mapStateToProps = (state, props) => {
let initialValuesTemp = Object.assign(
state.currentView.caseReference.hasOwnProperty("repDetails")
@@ -534,7 +545,10 @@ const mapStateToProps = (state, props) => {
};
};
export default connect(mapStateToProps)(
export default connect(
mapStateToProps,
mapDispatchToProps
)(
reduxForm({
form: "representationForm",
enableReinitialize: true,