added display of representatons on my portal
This commit is contained in:
@@ -4,6 +4,7 @@ import { useContext } from "react";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import Summary from "./case/summary";
|
||||
import Documents from "./case/documents";
|
||||
import RepresentationList from "./case/representationList";
|
||||
|
||||
const CaseSummary = (props) => {
|
||||
let { t } = useTranslation();
|
||||
@@ -42,6 +43,8 @@ const CaseSummary = (props) => {
|
||||
documentDetailsObj={props.documentDetailsObj}
|
||||
documentHistoryObj={props.documentHistoryObj}
|
||||
/>
|
||||
|
||||
<RepresentationList />
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -49,6 +49,7 @@ let MakeRepresentation = (props) => {
|
||||
watchedCases,
|
||||
awaitingSubmission,
|
||||
searchResultsObj,
|
||||
representationSubmit,
|
||||
currentType,
|
||||
currentView,
|
||||
setRepresentationCapacity,
|
||||
@@ -160,7 +161,7 @@ let MakeRepresentation = (props) => {
|
||||
/>
|
||||
);
|
||||
break;
|
||||
case "interestedpartyperson":
|
||||
case "interestedparty/person":
|
||||
// setRepresentationCapacity("interestedpartyperson");
|
||||
return (
|
||||
<RepInterestedPartyPerson
|
||||
@@ -232,27 +233,31 @@ let MakeRepresentation = (props) => {
|
||||
|
||||
return (
|
||||
<div>
|
||||
{repForm["representationForm.submitSucceeded"] == true ? (
|
||||
<RepCompleteSubmit
|
||||
formObj={formObj}
|
||||
capacityOptionsArr={capacityOptionsArr}
|
||||
currentType={currentType}
|
||||
casesObj={casesObj}
|
||||
setRepresentationCapacity={setRepresentationCapacity}
|
||||
setRepresentationSubmit={setRepresentationSubmit}
|
||||
currentView={currentView}
|
||||
setSubmitBack={setSubmitBack}
|
||||
setRepresentationSubmitConfirmation={
|
||||
setRepresentationSubmitConfirmation
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||
{whichControl()}
|
||||
</form>
|
||||
)}
|
||||
|
||||
{console.log("is submitted", currentView.representationSubmit)}
|
||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||
{representationSubmit == true ? (
|
||||
<RepCompleteSubmit
|
||||
formObj={formObj}
|
||||
capacityOptionsArr={capacityOptionsArr}
|
||||
currentType={currentType}
|
||||
casesObj={casesObj}
|
||||
setRepresentationCapacity={setRepresentationCapacity}
|
||||
setRepresentationSubmit={setRepresentationSubmit}
|
||||
currentView={currentView}
|
||||
setSubmitBack={setSubmitBack}
|
||||
setRepresentationSubmitConfirmation={
|
||||
setRepresentationSubmitConfirmation
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
<h1 className="govuk-heading-l">
|
||||
Make a representation on:{" "}
|
||||
{currentView.caseReference.currentReference}
|
||||
</h1>
|
||||
{whichControl()}
|
||||
</>
|
||||
)}
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -271,8 +276,8 @@ const mapStateToProps = (state) => {
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
setRepresentationCapacity: (representationCapacity) => {
|
||||
dispatch(setRepresentationCapacity(representationCapacity));
|
||||
dispatch(reset("representationForm"));
|
||||
dispatch(setRepresentationCapacity(representationCapacity));
|
||||
},
|
||||
setRepresentationSubmit: (representationSubmit) => {
|
||||
dispatch(setRepresentationSubmit(representationSubmit));
|
||||
|
||||
@@ -219,7 +219,7 @@ const RepAgent = (props) => {
|
||||
|
||||
<a
|
||||
onClick={() => {
|
||||
setRepresentationCapacity("false");
|
||||
setRepresentationCapacity();
|
||||
}}
|
||||
className="govuk-link"
|
||||
>
|
||||
|
||||
@@ -38,10 +38,6 @@ const RepAppellant = (props) => {
|
||||
<div id="rep-appellant">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="govuk-grid-row">
|
||||
<h2 className="govuk-heading-m ">
|
||||
Representation - appellantApplicant
|
||||
</h2>
|
||||
|
||||
<div className="govuk-form-group">
|
||||
<label
|
||||
className="govuk-label govuk-body-m"
|
||||
@@ -204,7 +200,6 @@ const RepAppellant = (props) => {
|
||||
</div>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-button-group">
|
||||
{currentView.representationCapacity}
|
||||
<button
|
||||
type="submit"
|
||||
className="govuk-button"
|
||||
@@ -222,7 +217,7 @@ const RepAppellant = (props) => {
|
||||
</a> */}
|
||||
<a
|
||||
onClick={() => {
|
||||
setRepresentationCapacity(false);
|
||||
setRepresentationCapacity();
|
||||
}}
|
||||
className="govuk-link"
|
||||
>
|
||||
|
||||
@@ -17,21 +17,7 @@ const RepDetails = (props) => {
|
||||
{" "}
|
||||
<div className="govuk-grid-column-full">
|
||||
<div id="rep-sumamry" className="govuk-grid-row">
|
||||
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||
Make a representation
|
||||
</h1>
|
||||
|
||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9">
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
Appeal Reference
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{currentType == "searchResultsObj"
|
||||
? casesObj.title
|
||||
: casesObj.reference}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:summary-applicant-label")}
|
||||
@@ -40,14 +26,14 @@ const RepDetails = (props) => {
|
||||
{casesObj.appellantApplicant || ""}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
{/* <div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:summary-agent-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
Mr A Agent
|
||||
</dd>
|
||||
</div>
|
||||
</div> */}
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:summary-site-address-label")}
|
||||
@@ -66,14 +52,13 @@ const RepDetails = (props) => {
|
||||
<div className="govuk-grid-row">
|
||||
<p className="govuk-body">
|
||||
This form enables you to submit comments on a case to
|
||||
The Planning Inspectorate.{" "}
|
||||
Planning and Environment Decisions Wales.{" "}
|
||||
</p>
|
||||
<p className="govuk-body">
|
||||
Please note that comments from interested parties need
|
||||
to be made within the timetable. This can be found on
|
||||
the previous ‘Case Summary‘ page. Comments
|
||||
submitted after this date may be considered invalid and
|
||||
returned to the sender.
|
||||
submitted after this date may be considered invalid.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -297,7 +297,7 @@ const RepInterestedPartyPerson = (props) => {
|
||||
<Link href="/representation">
|
||||
<a
|
||||
onClick={() => {
|
||||
setRepresentationSubmit(false);
|
||||
setRepresentationSubmit(true);
|
||||
}}
|
||||
className="govuk-button"
|
||||
>
|
||||
@@ -306,7 +306,7 @@ const RepInterestedPartyPerson = (props) => {
|
||||
</Link>
|
||||
<a
|
||||
onClick={() => {
|
||||
setRepresentationCapacity(false);
|
||||
setRepresentationCapacity();
|
||||
}}
|
||||
className="govuk-link"
|
||||
>
|
||||
|
||||
@@ -205,7 +205,7 @@ const RepLandOwner = (props) => {
|
||||
<Link href="/representation">
|
||||
<a
|
||||
onClick={() => {
|
||||
setRepresentationSubmit(false);
|
||||
setRepresentationSubmit(true);
|
||||
}}
|
||||
className="govuk-button"
|
||||
>
|
||||
@@ -214,7 +214,7 @@ const RepLandOwner = (props) => {
|
||||
</Link>
|
||||
<a
|
||||
onClick={() => {
|
||||
setRepresentationCapacity(false);
|
||||
setRepresentationCapacity();
|
||||
}}
|
||||
className="govuk-link"
|
||||
>
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { useState, useEffect, useRef } from "react";
|
||||
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import jsonpath from "jsonpath";
|
||||
import _ from "lodash";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import LoadingOverlay from "react-loading-overlay";
|
||||
|
||||
const RepresentationList = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||
|
||||
let spinnerState = () => {
|
||||
showSpinnerState == true
|
||||
? setShowSpinnerState(false)
|
||||
: setShowSpinnerState(true);
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h2>Representations</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<LoadingOverlay
|
||||
active={showSpinnerState}
|
||||
spinner
|
||||
text={t("common:spinner-searching")}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default RepresentationList;
|
||||
@@ -199,14 +199,14 @@ const CaseSummary = (props) => {
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
{/* <div className="govuk-grid-row">
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="govuk-button-group">
|
||||
{noRepresentationLink.includes(router.pathname) ==
|
||||
true ? (
|
||||
""
|
||||
) : (
|
||||
<Link href="/representation">
|
||||
<Link href="/myportal/representation">
|
||||
<a className="govuk-button">
|
||||
{t(
|
||||
"case:summary-make-representation-label"
|
||||
@@ -226,7 +226,7 @@ const CaseSummary = (props) => {
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div> */}
|
||||
</div>
|
||||
|
||||
{showSummary(casesObj, detailsObj)}
|
||||
</div>
|
||||
|
||||
@@ -114,16 +114,27 @@ const TopThree = (props) => {
|
||||
setCurrentReference({
|
||||
"currentReference":
|
||||
topThreeType != "watchedCases"
|
||||
? showTopThreeArr[key]
|
||||
.ticketnumber
|
||||
? topThreeType !=
|
||||
"myRepresentations"
|
||||
? showTopThreeArr[key]
|
||||
.ticketnumber
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
],
|
||||
"currentType": topThreeType,
|
||||
|
||||
"incidentid":
|
||||
topThreeType != "watchedCases"
|
||||
? showTopThreeArr[key]
|
||||
.incidentid
|
||||
? topThreeType !=
|
||||
"myRepresentations"
|
||||
? showTopThreeArr[key]
|
||||
._pinswg_case_value
|
||||
: showTopThreeArr[key][
|
||||
" _pinswg_watchedcase_value"
|
||||
]
|
||||
: showTopThreeArr[key][
|
||||
" _pinswg_watchedcase_value"
|
||||
],
|
||||
@@ -135,7 +146,11 @@ const TopThree = (props) => {
|
||||
}}
|
||||
>
|
||||
{topThreeType != "watchedCases"
|
||||
? showTopThreeArr[key].ticketnumber
|
||||
? topThreeType != "myRepresentations"
|
||||
? showTopThreeArr[key].ticketnumber
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
]}
|
||||
|
||||
Reference in New Issue
Block a user