added default list views for myportal linked cases

This commit is contained in:
2021-07-14 16:57:18 +01:00
parent d3beb33a41
commit 42a9d51ed2
21 changed files with 648 additions and 96 deletions
+101
View File
@@ -0,0 +1,101 @@
const ApiResponse = (req, res) => {
res.statusCode = 200;
res.json({
"@odata.context":
"https://devcrm2016.llcdt.gov.wales/DVPINS/api/data/v8.2/$metadata#incidents(_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title)",
"@odata.count": 9,
"value": [
{
"@odata.etag": 'W/"704047"',
"_accountid_value": null,
"_customerid_value": "56e7ef63-7e64-eb11-aaba-00224800be9c",
"pinswg_appealcasetype": 846040000,
"statuscode": 1,
"ticketnumber": "CAS-00009-W8N6W4",
"title": "CAS-00009-W8N6W4",
"incidentid": "9919eac3-21af-eb11-aac3-00224800be9c",
},
{
"@odata.etag": 'W/"704095"',
"_accountid_value": null,
"_customerid_value": "56e7ef63-7e64-eb11-aaba-00224800be9c",
"pinswg_appealcasetype": 846040011,
"statuscode": 1,
"ticketnumber": "CAS-00010-J9W6L5",
"title": "CAS-00010-J9W6L5",
"incidentid": "55f4fc74-33af-eb11-aac3-00224800be9c",
},
{
"@odata.etag": 'W/"709250"',
"_accountid_value": null,
"_customerid_value": "41fead24-29ba-eb11-aac4-00224800be9c",
"pinswg_appealcasetype": 846040001,
"statuscode": 1,
"ticketnumber": "CAS-00011-K1N0J8",
"title": "CAS-00011-K1N0J8",
"incidentid": "6bd04d33-29ba-eb11-aac4-00224800be9c",
},
{
"@odata.etag": 'W/"710463"',
"_accountid_value": null,
"_customerid_value": "56e7ef63-7e64-eb11-aaba-00224800be9c",
"pinswg_appealcasetype": 846040000,
"statuscode": 1,
"ticketnumber": "CAS-00012-D9W6S8",
"title": "CAS-00012-D9W6S8",
"incidentid": "b9c9cbe4-6abc-eb11-aac4-00224800be9c",
},
{
"@odata.etag": 'W/"746096"',
"_accountid_value": null,
"_customerid_value": "80d99a34-82ad-eb11-aac3-00224800be9c",
"pinswg_appealcasetype": 846040025,
"statuscode": 1,
"ticketnumber": "CAS-00013-Z0B5Z9",
"title": "CAS-00013-Z0B5Z9",
"incidentid": "34071ec4-54d3-eb11-aac5-00224800be9c",
},
{
"@odata.etag": 'W/"749764"',
"_accountid_value": null,
"_customerid_value": "56e7ef63-7e64-eb11-aaba-00224800be9c",
"pinswg_appealcasetype": 846040021,
"statuscode": 1,
"ticketnumber": "CAS-00014-S3L9B4",
"title": "CAS-00014-S3L9B4",
"incidentid": "2230700b-ebd7-eb11-aac5-00224800be9c",
},
{
"@odata.etag": 'W/"750875"',
"_accountid_value": null,
"_customerid_value": "cfb7b446-a7d8-eb11-aac5-00224800be9c",
"pinswg_appealcasetype": 846040000,
"statuscode": 1,
"ticketnumber": "CAS-00015-L7J9H1",
"title": "CAS-00015-L7J9H1",
"incidentid": "d5b7b446-a7d8-eb11-aac5-00224800be9c",
},
{
"@odata.etag": 'W/"755001"',
"_accountid_value": null,
"_customerid_value": "cfb7b446-a7d8-eb11-aac5-00224800be9c",
"pinswg_appealcasetype": 846040004,
"statuscode": 1,
"ticketnumber": "CAS-00016-Y9K9Q0",
"title": "CAS-00016-Y9K9Q0",
"incidentid": "cc6f93ea-bdd9-eb11-aac5-00224800be9c",
},
{
"@odata.etag": 'W/"755216"',
"_accountid_value": null,
"_customerid_value": "243c0009-49da-eb11-aac5-00224800be9c",
"pinswg_appealcasetype": 846040004,
"statuscode": 1,
"ticketnumber": "CAS-00017-B8X7N0",
"title": "CAS-00017-B8X7N0",
"incidentid": "73895a1b-68dd-eb11-aac5-00224800be9c",
},
],
});
};
export default ApiResponse;
+2
View File
@@ -21,6 +21,7 @@ const Home = (props) => {
const router = useRouter();
const { locale } = router;
const { appealtypes } = router.query;
return (
<div>
@@ -34,6 +35,7 @@ const Home = (props) => {
<Header courseName={t("common:service-name")} />
<div className="govuk-width-container">
<Banner />
<Breadcrumbs slug={appealtypes} />
<Case />
</div>
<Footer footerLinks={footerLinks} />
+1 -1
View File
@@ -109,7 +109,7 @@ let Home = (props) => {
<Header courseName={t("common:service-name")} />
<div className="govuk-width-container">
<Banner />
<Breadcrumbs slug={appealtypes} />
<Breadcrumbs slug={appealtypes} formTitle={formTitle} />
<BuildSection
formXML={formXML}
+2 -2
View File
@@ -33,8 +33,8 @@ const Home = (props) => {
const { appealType } = props;
const optionsObj =
props.appealType.appealTypeOptions.GlobalOptionSet.Options;
const optionsObj = props.appealType.appealTypeOptions.GlobalOptionSet
.Options || [{}];
const appealOptions = Object.keys(optionsObj).map((key, index) => (
<option
+97
View File
@@ -0,0 +1,97 @@
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/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} />
<ViewAll
searchString={"View All"}
searchResultsObj={props.searchResultsObj}
/>
</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"));
}
);
// export const getServerSideProps = wrapper.getServerSideProps(
// async ({ locale, store, query, req, res }) => {
// // const token = await getToken();
// // let accessToken = token.access_token;
// // const apiRoot = process.browser ? window.API_ROOT : process.env.API_ROOT;
// // const [pages, footerLinks, courseListContent] = await Promise.all([
// // await getPages(accessToken, locale),
// // await getFooterLinks(accessToken, locale),
// // await getCourseList(accessToken, locale),
// // ]);
// // //const courseID = await getCourseID
// // store.dispatch(setApiRoot(apiRoot));
// // store.dispatch(setPages(pages));
// // store.dispatch(setFooterLinks(footerLinks));
// // store.dispatch(setCourseListContent(courseListContent));
// console.log(query);
// //store.dispatch(setSearch(query.search));
// }
// );
const mapStateToProps = (state) => {
console.log("mapstate", state);
return {
search: state.search,
searchResultsObj: state.searchResultsObj,
form: state.form,
};
};
export default connect(mapStateToProps)(Home);