add mock api calls for modules viewall component
This commit is contained in:
@@ -303,3 +303,52 @@ export const createCase = (lpaType, appealType) => {
|
|||||||
// Xrm.Utility.alertDialog(textStatus + " " + errorThrown);
|
// Xrm.Utility.alertDialog(textStatus + " " + errorThrown);
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
export const getMyCases = () => {
|
||||||
|
return axios
|
||||||
|
|
||||||
|
.get(BASE_URL + "/api/lookups/myCases", {
|
||||||
|
httpsAgent: new https.Agent({ rejectUnauthorized: false }),
|
||||||
|
})
|
||||||
|
.then((res) => res.data)
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("thi serror", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getMyRepresentations = () => {
|
||||||
|
return axios
|
||||||
|
|
||||||
|
.get(BASE_URL + "/api/lookups/myRepresentations", {
|
||||||
|
httpsAgent: new https.Agent({ rejectUnauthorized: false }),
|
||||||
|
})
|
||||||
|
.then((res) => res.data)
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("thi serror", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getWatchedCases = () => {
|
||||||
|
return axios
|
||||||
|
|
||||||
|
.get(BASE_URL + "/api/lookups/watchedCases", {
|
||||||
|
httpsAgent: new https.Agent({ rejectUnauthorized: false }),
|
||||||
|
})
|
||||||
|
.then((res) => res.data)
|
||||||
|
.catch((error) => {
|
||||||
|
w;
|
||||||
|
console.log("thi serror", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getAwaitingSubmission = () => {
|
||||||
|
return axios
|
||||||
|
|
||||||
|
.get(BASE_URL + "/api/lookups/awaitingSubmission", {
|
||||||
|
httpsAgent: new https.Agent({ rejectUnauthorized: false }),
|
||||||
|
})
|
||||||
|
.then((res) => res.data)
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("thi serror", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
+17
-10
@@ -5,16 +5,7 @@ import { useRouter } from "next/router";
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|
||||||
const Breadcrumbs = (props) => {
|
const Breadcrumbs = (props) => {
|
||||||
const {
|
const { courseContent, slug, currentView } = props;
|
||||||
courseContent,
|
|
||||||
slug,
|
|
||||||
formTitle,
|
|
||||||
activitysub,
|
|
||||||
activity,
|
|
||||||
applicant_id,
|
|
||||||
course_id,
|
|
||||||
applicant_ref,
|
|
||||||
} = props;
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { appealType, section } = router.query;
|
const { appealType, section } = router.query;
|
||||||
|
|
||||||
@@ -143,6 +134,22 @@ const Breadcrumbs = (props) => {
|
|||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
|
{router.pathname == "/myportal/viewall" ? (
|
||||||
|
<>
|
||||||
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
|
<Link href="/myportal">
|
||||||
|
<a className="govuk-breadcrumbs__link">
|
||||||
|
My Portal
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
|
{currentView.viewName}
|
||||||
|
</li>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
{router.pathname == "/case" ? (
|
{router.pathname == "/case" ? (
|
||||||
<>
|
<>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
|
|||||||
+12
-6
@@ -10,7 +10,7 @@ import MyRepresentations from "./myportal/myrepresentations";
|
|||||||
import WatchedCases from "./myportal/watchedcases";
|
import WatchedCases from "./myportal/watchedcases";
|
||||||
import YourAccount from "./myportal/youraccount";
|
import YourAccount from "./myportal/youraccount";
|
||||||
|
|
||||||
export default function MyPortal({ children, pages }) {
|
const MyPortal = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -26,11 +26,15 @@ export default function MyPortal({ children, pages }) {
|
|||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="flex-container grid-row govuk-body ">
|
<div className="flex-container grid-row govuk-body ">
|
||||||
<MakeNewAppeal />
|
<MakeNewAppeal />
|
||||||
<MyCases />
|
<MyCases myCases={props.myCases} />
|
||||||
<SearchCases />
|
<SearchCases />
|
||||||
<AwaitingSubmission />
|
<AwaitingSubmission
|
||||||
<MyRepresentations />
|
awaitingSubmission={props.awaitingSubmission}
|
||||||
<WatchedCases />
|
/>
|
||||||
|
<MyRepresentations
|
||||||
|
myRepresentations={props.myRepresentations}
|
||||||
|
/>
|
||||||
|
<WatchedCases watchedCases={props.watchedCases} />
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-container grid-row govuk-body ">
|
<div className="flex-container grid-row govuk-body ">
|
||||||
<YourAccount />
|
<YourAccount />
|
||||||
@@ -39,4 +43,6 @@ export default function MyPortal({ children, pages }) {
|
|||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
export default MyPortal;
|
||||||
|
|||||||
@@ -2,12 +2,16 @@ import Link from "next/link";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import TopThree from "./topthree";
|
import TopThree from "./topthree";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { setCurrentView } from "../../store/currentView/action";
|
||||||
|
|
||||||
export default function AwaitingSubmission() {
|
const AwaitingSubmission = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
const { setCurrentView } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card card-3" id="casescomment-card">
|
<div className="card card-3" id="casescomment-card">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
@@ -15,14 +19,37 @@ export default function AwaitingSubmission() {
|
|||||||
{t("myportal:awatitingsubmission-card-title")}
|
{t("myportal:awatitingsubmission-card-title")}
|
||||||
</h3>
|
</h3>
|
||||||
<div className="cardModuleContainer">
|
<div className="cardModuleContainer">
|
||||||
<TopThree />
|
<TopThree
|
||||||
|
showTopThree={
|
||||||
|
props.awaitingSubmission.awaitingSubmission
|
||||||
|
}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link href="/viewall">
|
<Link href="/myportal/viewall">
|
||||||
<a>{t("myportal:viewall-link")}</a>
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentView({
|
||||||
|
"viewName": "Awaiting Submission",
|
||||||
|
"viewKey": "awaitingSubmission",
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("myportal:viewall-link")}
|
||||||
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => {
|
||||||
|
return {
|
||||||
|
setCurrentView: (currentView) => {
|
||||||
|
dispatch(setCurrentView(currentView));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(null, mapDispatchToProps)(AwaitingSubmission);
|
||||||
|
|||||||
@@ -2,11 +2,15 @@ import Link from "next/link";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import TopThree from "./topthree";
|
import TopThree from "./topthree";
|
||||||
export default function MyCases() {
|
import { connect } from "react-redux";
|
||||||
|
import { setCurrentView } from "../../store/currentView/action";
|
||||||
|
|
||||||
|
const MyCases = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
const { setCurrentView } = props;
|
||||||
return (
|
return (
|
||||||
<div className="card card-3" id="casescomment-card">
|
<div className="card card-3" id="casescomment-card">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
@@ -14,15 +18,34 @@ export default function MyCases() {
|
|||||||
{t("myportal:mycases-card-title")}
|
{t("myportal:mycases-card-title")}
|
||||||
</h3>
|
</h3>
|
||||||
<div className="cardModuleContainer">
|
<div className="cardModuleContainer">
|
||||||
<TopThree />
|
<TopThree showTopThree={props.myCases.myCases} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link href="/viewall">
|
<Link href="/myportal/viewall" shallow>
|
||||||
<a>{t("myportal:viewall-link")}</a>
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentView({
|
||||||
|
"viewName": "My Cases",
|
||||||
|
"viewKey": "myCases",
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("myportal:viewall-link")}
|
||||||
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => {
|
||||||
|
return {
|
||||||
|
setCurrentView: (currentView) => {
|
||||||
|
dispatch(setCurrentView(currentView));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(null, mapDispatchToProps)(MyCases);
|
||||||
|
|||||||
@@ -2,11 +2,16 @@ import Link from "next/link";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import TopThree from "./topthree";
|
import TopThree from "./topthree";
|
||||||
export default function MyRepresentations() {
|
import { connect } from "react-redux";
|
||||||
|
import { setCurrentView } from "../../store/currentView/action";
|
||||||
|
|
||||||
|
const MyRepresentations = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
const { setCurrentView } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card card-3" id="casescomment-card">
|
<div className="card card-3" id="casescomment-card">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
@@ -14,15 +19,36 @@ export default function MyRepresentations() {
|
|||||||
{t("myportal:myrepresentations-card-title")}
|
{t("myportal:myrepresentations-card-title")}
|
||||||
</h3>
|
</h3>
|
||||||
<div className="cardModuleContainer">
|
<div className="cardModuleContainer">
|
||||||
<TopThree />{" "}
|
<TopThree
|
||||||
|
showTopThree={props.myRepresentations.myRepresentations}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link href="/viewall">
|
<Link href="/myportal/viewall">
|
||||||
<a>{t("myportal:viewall-link")}</a>
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentView({
|
||||||
|
"viewName": "My Representations",
|
||||||
|
"viewKey": "myRepresentations",
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("myportal:viewall-link")}
|
||||||
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => {
|
||||||
|
return {
|
||||||
|
setCurrentView: (currentView) => {
|
||||||
|
dispatch(setCurrentView(currentView));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(null, mapDispatchToProps)(MyRepresentations);
|
||||||
|
|||||||
@@ -2,55 +2,34 @@ import Link from "next/link";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|
||||||
export default function TopThree() {
|
const TopThree = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
const { showTopThree } = props;
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
return (
|
|
||||||
<>
|
let topthreeRow = [];
|
||||||
<div className="cardModuleItem">
|
|
||||||
|
for (var i = 0; i < 3; i++)
|
||||||
|
topthreeRow.push(
|
||||||
|
<div className="cardModuleItem" key={i}>
|
||||||
<div className="cardModuleDetails">
|
<div className="cardModuleDetails">
|
||||||
<div className="cardModuleReference">
|
<div className="cardModuleReference">
|
||||||
<b>Case reference:</b>{" "}
|
<b>Case reference:</b>{" "}
|
||||||
<Link href="/case">
|
<Link href="/case">
|
||||||
<a>CAS-00010-J9W6L5</a>
|
<a>{props.showTopThree.value[i].reference}</a>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="carModuleAddress">
|
<div className="carModuleAddress">
|
||||||
<b>Address: </b> Beggars Lane
|
<b>Address: </b> {props.showTopThree.value[i].address}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="cardModuleRemoveCase"> —</div>
|
<div className="cardModuleRemoveCase"> —</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="cardModuleItem">
|
);
|
||||||
<div className="cardModuleDetails">
|
|
||||||
<div className="cardModuleReference">
|
return <>{topthreeRow}</>;
|
||||||
<b>Case reference:</b>{" "}
|
};
|
||||||
<Link href="/case">
|
|
||||||
<a>CAS-00010-J9W6L5</a>
|
export default TopThree;
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div className="carModuleAddress">
|
|
||||||
<b>Address: </b> Beggars Lane
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="cardModuleRemoveCase"> —</div>
|
|
||||||
</div>
|
|
||||||
<div className="cardModuleItem">
|
|
||||||
<div className="cardModuleDetails">
|
|
||||||
<div className="cardModuleReference">
|
|
||||||
<b>Case reference:</b>{" "}
|
|
||||||
<Link href="/case">
|
|
||||||
<a>CAS-00010-J9W6L5</a>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div className="carModuleAddress">
|
|
||||||
<b>Address: </b> Beggars Lane
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="cardModuleRemoveCase"> —</div>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -0,0 +1,113 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|
||||||
|
export default function ViewAllResults(props) {
|
||||||
|
const { searchString, searchResultsObj, currentView } = props;
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
|
||||||
|
var resultsArr = props[currentView.viewKey][currentView.viewKey].value || [
|
||||||
|
{},
|
||||||
|
];
|
||||||
|
let resultsRowArr = [];
|
||||||
|
Object.keys(resultsArr).map((key, index) => {
|
||||||
|
resultsRowArr.push(
|
||||||
|
<div className="govuk-summary-list__row" key={key}>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-!-padding-left-2">
|
||||||
|
<Link href="/case">
|
||||||
|
<a>
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
Case Reference:
|
||||||
|
</span>
|
||||||
|
{resultsArr[index].reference}
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-14">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
Site Address:{" "}
|
||||||
|
</span>
|
||||||
|
{resultsArr[index].address1}
|
||||||
|
<br /> {resultsArr[index].town}
|
||||||
|
<br />
|
||||||
|
{resultsArr[index].postcode}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-14">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
Appellant/Applicant:
|
||||||
|
</span>
|
||||||
|
{resultsArr[index].appellantApplicant}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-14">
|
||||||
|
<span className="results-visually-hidden">Authority:</span>
|
||||||
|
{resultsArr[index].lpaname}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-14">
|
||||||
|
<span className="results-visually-hidden">Case Type:</span>
|
||||||
|
{
|
||||||
|
resultsArr[index][
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-14">
|
||||||
|
<span className="results-visually-hidden">Status:</span>
|
||||||
|
{
|
||||||
|
resultsArr[index][
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||||
|
{currentView.viewName}
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<dl className="govuk-summary-list govuk-!-margin-bottom-9 results">
|
||||||
|
<div className="govuk-summary-list__row results-headings">
|
||||||
|
<dd className="govuk-summary-list__key govuk-!-font-size-14 results_wider govuk-!-padding-left-2">
|
||||||
|
{t("search:searchresults-case-reference-label")}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__key govuk-!-font-size-14">
|
||||||
|
{t("search:searchresults-site-address-label")}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__key govuk-!-font-size-14">
|
||||||
|
{t("search:searchresults-applicant-label")}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__key govuk-!-font-size-14">
|
||||||
|
{t("search:searchresults-authority-label")}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__key govuk-!-font-size-14">
|
||||||
|
{t("search:searchresults-case-type-label")}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__key govuk-!-font-size-14">
|
||||||
|
{t("search:searchresults-status-label")}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{resultsRowArr}
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<div className="govuk-button-group">
|
||||||
|
<Link href="/myportal">
|
||||||
|
<a className="govuk-button">Back</a>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -2,11 +2,16 @@ import Link from "next/link";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import TopThree from "./topthree";
|
import TopThree from "./topthree";
|
||||||
export default function WatchedCases() {
|
import { connect } from "react-redux";
|
||||||
|
import { setCurrentView } from "../../store/currentView/action";
|
||||||
|
|
||||||
|
const WatchedCases = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
const { setCurrentView } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card card-3" id="casescomment-card">
|
<div className="card card-3" id="casescomment-card">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
@@ -14,15 +19,35 @@ export default function WatchedCases() {
|
|||||||
{t("myportal:watchedcases-card-title")}
|
{t("myportal:watchedcases-card-title")}
|
||||||
</h3>
|
</h3>
|
||||||
<div className="cardModuleContainer">
|
<div className="cardModuleContainer">
|
||||||
<TopThree />
|
<TopThree showTopThree={props.watchedCases.watchedCases} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link href="/viewall">
|
<Link href="/myportal/viewall">
|
||||||
<a>{t("myportal:viewall-link")}</a>
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentView({
|
||||||
|
"viewName": "Watched Cases",
|
||||||
|
"viewKey": "watchedCases",
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("myportal:viewall-link")}
|
||||||
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => {
|
||||||
|
return {
|
||||||
|
setCurrentView: (currentView) => {
|
||||||
|
console.log(currentView);
|
||||||
|
dispatch(setCurrentView(currentView));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(null, mapDispatchToProps)(WatchedCases);
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ let CreateCase = (props) => {
|
|||||||
<div>
|
<div>
|
||||||
<select
|
<select
|
||||||
{...input}
|
{...input}
|
||||||
className="govuk-select govuk-!-width-one-half"
|
className="govuk-select govuk-input--error"
|
||||||
id="lpatypes"
|
id="lpatypes"
|
||||||
name={name}
|
name={name}
|
||||||
//onChange={(e) => props.onChangeSelectLPA(e)}
|
//onChange={(e) => props.onChangeSelectLPA(e)}
|
||||||
@@ -143,7 +143,7 @@ let CreateCase = (props) => {
|
|||||||
<div>
|
<div>
|
||||||
<select
|
<select
|
||||||
{...input}
|
{...input}
|
||||||
className="govuk-select govuk-!-width-one-half"
|
className="govuk-select"
|
||||||
id="appealTypes"
|
id="appealTypes"
|
||||||
name={name}
|
name={name}
|
||||||
//onChange={(e) => props.onChangeSelectAppealType(e)}
|
//onChange={(e) => props.onChangeSelectAppealType(e)}
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
"/myportal": [
|
"/myportal": [
|
||||||
"myportal"
|
"myportal"
|
||||||
],
|
],
|
||||||
|
"/myportal/viewall": [
|
||||||
|
"search"
|
||||||
|
],
|
||||||
"/advancedsearch": [
|
"/advancedsearch": [
|
||||||
"search"
|
"search"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
const ApiResponse = (req, res) => {
|
||||||
|
res.statusCode = 200;
|
||||||
|
res.json({
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Vale of Glamorgan Council",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "21 Courtenay Road",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00017-B8X7N0",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Bridgend CBC",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "17 Colin Way",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00016-Y9K9Q0",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Cardiff County Council Planning (A)",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "120 Severn Grove",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00011-K1N0J8",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Cardiff County Council Planning",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "25 Merches Gardens",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00015-L7J9H1",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
};
|
||||||
|
export default ApiResponse;
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
const ApiResponse = (req, res) => {
|
||||||
|
res.statusCode = 200;
|
||||||
|
res.json({
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Vale of Glamorgan Council",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "21 Courtenay Road",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00009-W8N6W4",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue":
|
||||||
|
"Planning Appeal - S78",
|
||||||
|
"pinswg_appealcasetype": "846040000",
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue":
|
||||||
|
"In Progress",
|
||||||
|
"statuscode": "1",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Bridgend CBC",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "17 Colin Way",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00010-J9W6L5",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue":
|
||||||
|
"Planning Appeal - S78",
|
||||||
|
"pinswg_appealcasetype": "846040000",
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue":
|
||||||
|
"In Progress",
|
||||||
|
"statuscode": "1",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Cardiff County Council Planning (A)",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "120 Severn Grove",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00011-K1N0J8",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue":
|
||||||
|
"Planning Conditions - S73 + S79",
|
||||||
|
"pinswg_appealcasetype": "846040001",
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue":
|
||||||
|
"In Progress",
|
||||||
|
"statuscode": "1",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Cardiff County Council Planning",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "25 Merches Gardens",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00012-D9W6S8",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue":
|
||||||
|
"Planning Appeal - S78",
|
||||||
|
"pinswg_appealcasetype": "846040000",
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue":
|
||||||
|
"In Progress",
|
||||||
|
"statuscode": "1",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
};
|
||||||
|
export default ApiResponse;
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
const ApiResponse = (req, res) => {
|
||||||
|
res.statusCode = 200;
|
||||||
|
res.json({
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Vale of Glamorgan Council",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "21 Courtenay Road",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00009-W8N6W4",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Bridgend CBC",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "17 Colin Way",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00010-J9W6L5",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Cardiff County Council Planning (A)",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "120 Severn Grove",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00011-K1N0J8",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Cardiff County Council Planning",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "25 Merches Gardens",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00012-D9W6S8",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
};
|
||||||
|
export default ApiResponse;
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
const ApiResponse = (req, res) => {
|
||||||
|
res.statusCode = 200;
|
||||||
|
res.json({
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Vale of Glamorgan Council",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "21 Courtenay Road",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00009-W8N6W4",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Bridgend CBC",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "17 Colin Way",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00010-J9W6L5",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Cardiff County Council Planning (A)",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "120 Severn Grove",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00011-K1N0J8",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@odata.etag": 'W/"547952"',
|
||||||
|
"lpaname": "Cardiff County Council Planning",
|
||||||
|
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
|
||||||
|
"address1": "25 Merches Gardens",
|
||||||
|
"town": "Cardiff",
|
||||||
|
"postcode": "CF24 0JL",
|
||||||
|
"reference": "CAS-00012-D9W6S8",
|
||||||
|
"appellantApplicant": "Mrs Denise Williams",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
};
|
||||||
|
export default ApiResponse;
|
||||||
+53
-32
@@ -13,9 +13,26 @@ import { wrapper } from "../../store/store";
|
|||||||
import Cookies from "cookies";
|
import Cookies from "cookies";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { setMyCases } from "../../store/myCases/action";
|
||||||
|
import { setMyRepresentations } from "../../store/myRepresentations/action";
|
||||||
|
import { setWatchedCases } from "../../store/watchedCases/action";
|
||||||
|
import { setAwaitingSubmission } from "../../store/awaitingSubmission/action";
|
||||||
|
import {
|
||||||
|
getMyCases,
|
||||||
|
getMyRepresentations,
|
||||||
|
getWatchedCases,
|
||||||
|
getAwaitingSubmission,
|
||||||
|
} from "../../actions";
|
||||||
|
|
||||||
const Home = (props) => {
|
const Home = (props) => {
|
||||||
const { footerLinks, pages } = props;
|
const {
|
||||||
|
footerLinks,
|
||||||
|
pages,
|
||||||
|
myCases,
|
||||||
|
myRepresentations,
|
||||||
|
watchedCases,
|
||||||
|
awaitingSubmission,
|
||||||
|
} = props;
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -35,7 +52,12 @@ const Home = (props) => {
|
|||||||
<div className="govuk-width-container">
|
<div className="govuk-width-container">
|
||||||
<Banner />
|
<Banner />
|
||||||
<Breadcrumbs slug={appealtypes} />
|
<Breadcrumbs slug={appealtypes} />
|
||||||
<MyPortal />
|
<MyPortal
|
||||||
|
myCases={myCases}
|
||||||
|
myRepresentations={myRepresentations}
|
||||||
|
watchedCases={watchedCases}
|
||||||
|
awaitingSubmission={awaitingSubmission}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Footer footerLinks={footerLinks} />
|
<Footer footerLinks={footerLinks} />
|
||||||
</div>
|
</div>
|
||||||
@@ -43,38 +65,37 @@ const Home = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// export const getServerSideProps = wrapper.getServerSideProps(
|
export const getServerSideProps = wrapper.getServerSideProps(
|
||||||
// async ({ locale, store, req, res }) => {
|
(store) =>
|
||||||
// const token = await getToken();
|
async ({ query, req, res }) => {
|
||||||
// let accessToken = token.access_token;
|
//console.log("the query", query);
|
||||||
|
|
||||||
// const apiRoot = process.browser ? window.API_ROOT : process.env.API_ROOT;
|
const myCases = await getMyCases();
|
||||||
|
const myRepresentations = await getMyRepresentations();
|
||||||
|
const watchedCases = await getWatchedCases();
|
||||||
|
const awaitingSubmission = await getAwaitingSubmission();
|
||||||
|
|
||||||
// const [pages, footerLinks, courseListContent] = await Promise.all([
|
store.dispatch(setMyCases(myCases));
|
||||||
// await getPages(accessToken, locale),
|
store.dispatch(setMyRepresentations(myRepresentations));
|
||||||
// await getFooterLinks(accessToken, locale),
|
store.dispatch(setWatchedCases(watchedCases));
|
||||||
// await getCourseList(accessToken, locale),
|
store.dispatch(setAwaitingSubmission(awaitingSubmission));
|
||||||
// ]);
|
}
|
||||||
// //const courseID = await getCourseID
|
);
|
||||||
// store.dispatch(setApiRoot(apiRoot));
|
|
||||||
// store.dispatch(setPages(pages));
|
|
||||||
// store.dispatch(setFooterLinks(footerLinks));
|
|
||||||
// store.dispatch(setCourseListContent(courseListContent));
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
|
|
||||||
// const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
// //console.log(state);
|
//console.log(state);
|
||||||
|
|
||||||
// return {
|
return {
|
||||||
// apiroot: state.apiroot,
|
search: state.search,
|
||||||
// courseListContent: state.courseListContent.courseListContent,
|
searchResultsObj: state.searchResultsObj,
|
||||||
// pages: state.pages.pages,
|
formData: state.formData,
|
||||||
// footerLinks: state.footerLinks.footerLinks,
|
appealType: state.appealType,
|
||||||
// regions: state.regions,
|
form: state.form,
|
||||||
// sectors: state.sectors,
|
myCases: state.myCases,
|
||||||
// form: state.form,
|
watchedCases: state.watchedCases,
|
||||||
// };
|
myRepresentations: state.myRepresentations,
|
||||||
// };
|
awaitingSubmission: state.awaitingSubmission,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
export default Home; //connect(mapStateToProps)(Home);
|
export default connect(mapStateToProps)(Home);
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
import _ from "lodash";
|
||||||
|
import Head from "next/head";
|
||||||
|
import Header from "../../components/header";
|
||||||
|
import Banner from "../../components/banner";
|
||||||
|
import CookieBanner from "../../components/cookieBanner";
|
||||||
|
import Breadcrumbs from "../../components/breadcrumbs";
|
||||||
|
import ViewAll from "../../components/myportal/viewall";
|
||||||
|
import Footer from "../../components/footer";
|
||||||
|
import Errorpage from "../../components/errorpage";
|
||||||
|
import styles from "../../styles/Home.module.css";
|
||||||
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
|
import { wrapper } from "../../store/store";
|
||||||
|
import Cookies from "cookies";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|
||||||
|
import { setSearch, getSearchObj } from "../../store/search/action";
|
||||||
|
import {
|
||||||
|
setSearchResults,
|
||||||
|
getSearchResultsObj,
|
||||||
|
} from "../../store/searchOutput/action";
|
||||||
|
import { getBasicSearch } from "../../actions";
|
||||||
|
|
||||||
|
const Home = (props) => {
|
||||||
|
const { footerLinks, pages } = props;
|
||||||
|
let { t, lang } = useTranslation();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
const { appealtypes } = router.query;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Head>
|
||||||
|
<title>
|
||||||
|
{t("search:page-title")} - {t("common:service-name")}
|
||||||
|
</title>
|
||||||
|
</Head>
|
||||||
|
<div id="page_wrapper">
|
||||||
|
<CookieBanner />
|
||||||
|
<Header courseName={t("common:service-name")} />
|
||||||
|
<div className="govuk-width-container">
|
||||||
|
<Banner />
|
||||||
|
<Breadcrumbs
|
||||||
|
slug={appealtypes}
|
||||||
|
currentView={props.currentView.currentView}
|
||||||
|
/>
|
||||||
|
<ViewAll
|
||||||
|
searchString={"View All"}
|
||||||
|
searchResultsObj={props.searchResultsObj}
|
||||||
|
currentView={props.currentView.currentView}
|
||||||
|
myCases={props.myCases}
|
||||||
|
watchedCases={props.watchedCases}
|
||||||
|
myRepresentations={props.myRepresentations}
|
||||||
|
awaitingSubmission={props.awaitingSubmission}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<Footer footerLinks={footerLinks} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// export const getServerSideProps = wrapper.getServerSideProps(
|
||||||
|
// (store) =>
|
||||||
|
// async ({ req, res }) => {
|
||||||
|
// const searchResultsObj = (await getBasicSearch("View All")) || null;
|
||||||
|
// store.dispatch(setSearchResults(searchResultsObj));
|
||||||
|
// store.dispatch(setSearch("View All"));
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
|
||||||
|
const mapStateToProps = (state) => {
|
||||||
|
return {
|
||||||
|
search: state.search,
|
||||||
|
searchResultsObj: state.searchResultsObj,
|
||||||
|
formData: state.formData,
|
||||||
|
appealType: state.appealType,
|
||||||
|
form: state.form,
|
||||||
|
myCases: state.myCases,
|
||||||
|
watchedCases: state.watchedCases,
|
||||||
|
myRepresentations: state.myRepresentations,
|
||||||
|
awaitingSubmission: state.awaitingSubmission,
|
||||||
|
currentView: state.currentView,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(mapStateToProps)(Home);
|
||||||
@@ -45,6 +45,7 @@ const Home = (props) => {
|
|||||||
<ViewAll
|
<ViewAll
|
||||||
searchString={"View All"}
|
searchString={"View All"}
|
||||||
searchResultsObj={props.searchResultsObj}
|
searchResultsObj={props.searchResultsObj}
|
||||||
|
currentView={props.currentView.currentView}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Footer footerLinks={footerLinks} />
|
<Footer footerLinks={footerLinks} />
|
||||||
@@ -89,6 +90,7 @@ const mapStateToProps = (state) => {
|
|||||||
search: state.search,
|
search: state.search,
|
||||||
searchResultsObj: state.searchResultsObj,
|
searchResultsObj: state.searchResultsObj,
|
||||||
form: state.form,
|
form: state.form,
|
||||||
|
currentView: state.currentView,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { actionTypes } from "redux-form";
|
|
||||||
|
|
||||||
export const appealTypeDataActionTypes = {
|
export const appealTypeDataActionTypes = {
|
||||||
GETAPPEALTYPEDATA: "GETAPPEALTYPEDATA",
|
GETAPPEALTYPEDATA: "GETAPPEALTYPEDATA",
|
||||||
SETAPPEALTYPEDATA: "SETAPPEALTYPEDATA",
|
SETAPPEALTYPEDATA: "SETAPPEALTYPEDATA",
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
export const awaitingSubmissionActionTypes = {
|
||||||
|
GETAWAITINGSUBMISSION: "GETAWAITINGSUBMISSION",
|
||||||
|
SETAWAITINGSUBMISSION: "SETAWAITINGSUBMISSION",
|
||||||
|
UPDATEAWAITINGSUBMISSION: "UPDATEAWAITINGSUBMISSION",
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getAwaitingSubmissionObj = () => (dispatch) => {
|
||||||
|
return dispatch({
|
||||||
|
type: awaitingSubmissionActionTypes.GETAWAITINGSUBMISSION,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const setAwaitingSubmission = (awaitingSubmission) => (dispatch) => {
|
||||||
|
return dispatch({
|
||||||
|
type: awaitingSubmissionActionTypes.SETAWAITINGSUBMISSION,
|
||||||
|
awaitingSubmission: awaitingSubmission,
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import { awaitingSubmissionActionTypes } from "./action";
|
||||||
|
|
||||||
|
const awaitingSubmissionInitialState = {
|
||||||
|
awaitingSubmission: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function reducer(
|
||||||
|
state = awaitingSubmissionInitialState,
|
||||||
|
action
|
||||||
|
) {
|
||||||
|
switch (action.type) {
|
||||||
|
case awaitingSubmissionActionTypes.SETAWAITINGSUBMISSION:
|
||||||
|
return {
|
||||||
|
awaitingSubmission: action.awaitingSubmission,
|
||||||
|
};
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
export const currentViewActionTypes = {
|
||||||
|
GETCURRENTVIEW: "GETCURRENTVIEW",
|
||||||
|
SETCURRENTVIEW: "SETCURRENTVIEW",
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getCurrentViewObj = () => (dispatch) => {
|
||||||
|
return dispatch({
|
||||||
|
type: currentViewActionTypes.GETCURRENTVIEW,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const setCurrentView = (currentView) => (dispatch) => {
|
||||||
|
return dispatch({
|
||||||
|
type: currentViewActionTypes.SETCURRENTVIEW,
|
||||||
|
currentView: currentView,
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { currentViewActionTypes } from "./action";
|
||||||
|
|
||||||
|
const currentViewInitialState = {
|
||||||
|
currentView: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function reducer(state = currentViewInitialState, action) {
|
||||||
|
switch (action.type) {
|
||||||
|
case currentViewActionTypes.SETCURRENTVIEW:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
currentView: action.currentView,
|
||||||
|
};
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
export const myCasesActionTypes = {
|
||||||
|
GETMYCASES: "GETMYCASES",
|
||||||
|
SETMYCASES: "SETMYCASES",
|
||||||
|
UPDATEMYCASES: "UPDATEMYCASES",
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getMyCasesObj = () => (dispatch) => {
|
||||||
|
return dispatch({
|
||||||
|
type: myCasesActionTypes.GETMYCASES,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const setMyCases = (myCases) => (dispatch) => {
|
||||||
|
return dispatch({
|
||||||
|
type: myCasesActionTypes.SETMYCASES,
|
||||||
|
myCases: myCases,
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { myCasesActionTypes } from "./action";
|
||||||
|
|
||||||
|
const myCasesInitialState = {
|
||||||
|
myCases: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function reducer(state = myCasesInitialState, action) {
|
||||||
|
switch (action.type) {
|
||||||
|
case myCasesActionTypes.SETMYCASES:
|
||||||
|
return {
|
||||||
|
myCases: action.myCases,
|
||||||
|
};
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
export const myRepresentationsActionTypes = {
|
||||||
|
GETMYREPRESENTATIONS: "GETMYREPRESENTATIONS",
|
||||||
|
SETMYREPRESENTATIONS: "SETMYREPRESENTATIONS",
|
||||||
|
UPDATEMYREPRESENTATIONS: "UPDATEMYREPRESENTATIONS",
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getMyRepresentationsObj = () => (dispatch) => {
|
||||||
|
return dispatch({
|
||||||
|
type: myRepresentationsActionTypes.GETMYREPRESENTATIONS,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const setMyRepresentations = (myRepresentations) => (dispatch) => {
|
||||||
|
return dispatch({
|
||||||
|
type: myRepresentationsActionTypes.SETMYREPRESENTATIONS,
|
||||||
|
myRepresentations: myRepresentations,
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { myRepresentationsActionTypes } from "./action";
|
||||||
|
|
||||||
|
const myRepresentationsInitialState = {
|
||||||
|
myRepresentations: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function reducer(state = myRepresentationsInitialState, action) {
|
||||||
|
switch (action.type) {
|
||||||
|
case myRepresentationsActionTypes.SETMYREPRESENTATIONS:
|
||||||
|
return {
|
||||||
|
myRepresentations: action.myRepresentations,
|
||||||
|
};
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
+19
-3
@@ -1,24 +1,35 @@
|
|||||||
import { createStore, applyMiddleware, combineReducers } from "redux";
|
import { createStore, applyMiddleware, combineReducers } from "redux";
|
||||||
import { createWrapper, HYDRATE } from "next-redux-wrapper";
|
import { createWrapper, HYDRATE } from "next-redux-wrapper";
|
||||||
import thunkMiddleware from "redux-thunk";
|
import thunkMiddleware from "redux-thunk";
|
||||||
|
import { reducer as formReducer } from "redux-form";
|
||||||
|
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
|
||||||
|
import autoMergeLevel1 from "redux-persist/lib/stateReconciler/autoMergeLevel1";
|
||||||
|
import storage from "redux-persist/lib/storage";
|
||||||
|
import currentView from "./currentView/reducer";
|
||||||
import search from "./search/reducer";
|
import search from "./search/reducer";
|
||||||
import searchResultsObj from "./searchOutput/reducer";
|
import searchResultsObj from "./searchOutput/reducer";
|
||||||
import formData from "./formData/reducer";
|
import formData from "./formData/reducer";
|
||||||
import appealType from "./appealType/reducer";
|
import appealType from "./appealType/reducer";
|
||||||
import LPAData from "./lpa/reducer";
|
import LPAData from "./lpa/reducer";
|
||||||
import accountDetails from "./accountDetails/reducer";
|
import accountDetails from "./accountDetails/reducer";
|
||||||
import { reducer as formReducer } from "redux-form";
|
import awaitingSubmission from "./awaitingSubmission/reducer";
|
||||||
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
|
import myCases from "./myCases/reducer";
|
||||||
import storage from "redux-persist/lib/storage";
|
import myRepresentations from "./myRepresentations/reducer";
|
||||||
|
import watchedCases from "./watchedCases/reducer";
|
||||||
|
|
||||||
//COMBINING ALL REDUCERS
|
//COMBINING ALL REDUCERS
|
||||||
const appReducer = combineReducers({
|
const appReducer = combineReducers({
|
||||||
|
currentView,
|
||||||
search,
|
search,
|
||||||
searchResultsObj,
|
searchResultsObj,
|
||||||
formData,
|
formData,
|
||||||
appealType,
|
appealType,
|
||||||
LPAData,
|
LPAData,
|
||||||
accountDetails,
|
accountDetails,
|
||||||
|
awaitingSubmission,
|
||||||
|
myCases,
|
||||||
|
myRepresentations,
|
||||||
|
watchedCases,
|
||||||
form: formReducer,
|
form: formReducer,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -90,12 +101,17 @@ const makeStore = ({ isServer }) => {
|
|||||||
const persistConfig = {
|
const persistConfig = {
|
||||||
key: "acp",
|
key: "acp",
|
||||||
whitelist: [
|
whitelist: [
|
||||||
|
"currentView",
|
||||||
"search",
|
"search",
|
||||||
"searchResults",
|
"searchResults",
|
||||||
"formData",
|
"formData",
|
||||||
"appealType",
|
"appealType",
|
||||||
"LPAData",
|
"LPAData",
|
||||||
"accountDetails",
|
"accountDetails",
|
||||||
|
"awaitingSubmission",
|
||||||
|
"myCases",
|
||||||
|
"myRepresentations",
|
||||||
|
"watchedCases",
|
||||||
"form",
|
"form",
|
||||||
],
|
],
|
||||||
storage: storage,
|
storage: storage,
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
export const watchedCasesActionTypes = {
|
||||||
|
GETWATCHEDCASES: "GETWATCHEDCASES",
|
||||||
|
SETWATCHEDCASES: "SETWATCHEDCASES",
|
||||||
|
UPDATEWATCHEDCASES: "UPDATEWATCHEDCASES",
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getWatchedCasesObj = () => (dispatch) => {
|
||||||
|
return dispatch({
|
||||||
|
type: watchedCasesActionTypes.GETWATCHEDCASES,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const setWatchedCases = (watchedCases) => (dispatch) => {
|
||||||
|
return dispatch({
|
||||||
|
type: watchedCasesActionTypes.SETWATCHEDCASES,
|
||||||
|
watchedCases: watchedCases,
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { watchedCasesActionTypes } from "./action";
|
||||||
|
|
||||||
|
const watchedCasesInitialState = {
|
||||||
|
watchedCases: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function reducer(state = watchedCasesInitialState, action) {
|
||||||
|
switch (action.type) {
|
||||||
|
case watchedCasesActionTypes.SETWATCHEDCASES:
|
||||||
|
return {
|
||||||
|
watchedCases: action.watchedCases,
|
||||||
|
};
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user