added back missing files

This commit is contained in:
2021-07-19 21:49:14 +01:00
parent 016c960720
commit de84da00c2
16 changed files with 610 additions and 192 deletions
-2
View File
@@ -76,8 +76,6 @@ const Home = (props) => {
// };
const mapStateToProps = (state) => {
console.log(state);
return {
search: state.search,
};
+161
View File
@@ -0,0 +1,161 @@
const ApiResponse = (req, res) => {
res.statusCode = 200;
res.json({
"@odata.context":
"https://devcrm2016.llcdt.gov.wales/DVPINS/api/data/v8.2/$metadata#accounts(name)",
"@odata.count": 30,
"value": [
{
"@odata.etag": 'W/"547952"',
"name": "Bridgend CBC",
"accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c",
},
{
"@odata.etag": 'W/"694923"',
"name": "Bishop Landaff High School",
"accountid": "c9389617-82ad-eb11-aac3-00224800be9c",
},
{
"@odata.etag": 'W/"694925"',
"name": "Stanwell High school",
"accountid": "24537624-82ad-eb11-aac3-00224800be9c",
},
{
"@odata.etag": 'W/"762163"',
"name": "Barry Boys High School",
"accountid": "80d99a34-82ad-eb11-aac3-00224800be9c",
},
{
"@odata.etag": 'W/"694929"',
"name": "St Sirus High School",
"accountid": "6d337b5a-82ad-eb11-aac3-00224800be9c",
},
{
"@odata.etag": 'W/"694931"',
"name": "Fitzalan High School",
"accountid": "984d0e75-82ad-eb11-aac3-00224800be9c",
},
{
"@odata.etag": 'W/"757759"',
"name": "Zoe",
"accountid": "41fead24-29ba-eb11-aac4-00224800be9c",
},
{
"@odata.etag": 'W/"755100"',
"name": "Blaenau Gwent County Borough Council",
"accountid": "744c69f4-48da-eb11-aac5-00224800be9c",
},
{
"@odata.etag": 'W/"755102"',
"name": "Caerphilly County Borough Council",
"accountid": "243c0009-49da-eb11-aac5-00224800be9c",
},
{
"@odata.etag": 'W/"757756"',
"name": "Test 2",
"accountid": "bf14b684-8ee0-eb11-aac5-00224800be9c",
},
{
"@odata.etag": 'W/"755104"',
"name": "Bridgend County Borough Council",
"accountid": "c35f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755106"',
"name": "Cardiff Council",
"accountid": "c75f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755108"',
"name": "Carmarthenshire County Council",
"accountid": "c95f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755110"',
"name": "Ceredigion County Council",
"accountid": "cb5f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755112"',
"name": "Conwy County Borough Council",
"accountid": "cd5f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755114"',
"name": "Denbighshire County Council",
"accountid": "cf5f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755116"',
"name": "Flintshire County Council",
"accountid": "d15f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755118"',
"name": "Gwynedd Council",
"accountid": "d35f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755120"',
"name": "Isle of Anglesey County Council",
"accountid": "d55f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755122"',
"name": "Merthyr Tydfil County Borough Council",
"accountid": "d75f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755124"',
"name": "Monmouthshire County Council",
"accountid": "d95f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755126"',
"name": "Neath Port Talbot County Borough Council",
"accountid": "db5f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755128"',
"name": "Newport City Council",
"accountid": "dd5f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755130"',
"name": "Pembrokeshire County Council",
"accountid": "df5f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755132"',
"name": "Powys County Council",
"accountid": "e15f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755134"',
"name": "Rhondda Cynon Taf County Borough Council",
"accountid": "e35f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755136"',
"name": "Swansea Council",
"accountid": "e55f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755138"',
"name": "Torfaen County Borough Council",
"accountid": "e75f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755140"',
"name": "Vale of Glamorgan Council",
"accountid": "e95f6f84-49da-eb11-aabd-00224800d1bd",
},
{
"@odata.etag": 'W/"755142"',
"name": "Wrexham County Borough Council",
"accountid": "eb5f6f84-49da-eb11-aabd-00224800d1bd",
},
],
});
};
export default ApiResponse;
+7 -17
View File
@@ -13,6 +13,7 @@ import { wrapper } from "../store/store";
import Cookies from "cookies";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { getIncidents } from "../actions";
const Home = (props) => {
const { footerLinks, pages } = props;
@@ -40,25 +41,14 @@ const Home = (props) => {
};
// export const getServerSideProps = wrapper.getServerSideProps(
// async ({ locale, store, 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));
// }
// (store) =>
// async ({ query, req, res }) => {
// const incidents = await getIncidents;
// console.log(incidents);
// }
// );
// const mapStateToProps = (state) => {
// //console.log(state);
+48 -40
View File
@@ -1,10 +1,10 @@
import Link from "next/link";
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 NewAppeal from "../../components/newappeal";
import Footer from "../../components/footer";
import Errorpage from "../../components/errorpage";
import styles from "../../styles/Home.module.css";
@@ -12,70 +12,76 @@ import { useSelector, shallowEqual, connect } from "react-redux";
import { wrapper } from "../../store/store";
import Cookies from "cookies";
import { useRouter } from "next/router";
import { useState } from "react";
import useTranslation from "next-translate/useTranslation";
import jsonpath from "jsonpath";
import { reduxForm, formValueSelector } from "redux-form";
import CreateCase from "../../components/newappeal/createCase";
import xpath from "xpath";
import {
setAppealType,
setAppealTypeTitle,
setAppealTypeID,
setAppealLPA,
getAppealTypeObj,
} from "../../store/appealType/action";
import { getAppealsTypes, getLPA } from "../../actions";
import { setLPA } from "../../store/lpa/action";
const Home = (props) => {
const { footerLinks, pages } = props;
const { footerLinks, pages, formData } = props;
let { t, lang } = useTranslation();
const router = useRouter();
const { locale } = router;
const { appealtypes } = router.query;
const { appealType, LPAData } = props;
return (
<div>
<Head>
<title>
{t("newappeal:page-title")} - {t("common:service-name")}
{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} />
<NewAppeal />
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<div className="govuk-width-container">
<Banner />
<Breadcrumbs slug={appealtypes} />
<h1>New Appeal</h1>
<CreateCase
LPAData={props.LPAData}
appealType={props.setAppealType}
/>
</div>
</div>
</div>
<Footer footerLinks={footerLinks} />
</div>
</div>
);
};
// export const getServerSideProps = wrapper.getServerSideProps(
// async ({ locale, store, 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));
// }
// );
// const mapStateToProps = (state) => {
// //console.log(state);
// return {
// apiroot: state.apiroot,
// courseListContent: state.courseListContent.courseListContent,
// pages: state.pages.pages,
// footerLinks: state.footerLinks.footerLinks,
// regions: state.regions,
// sectors: state.sectors,
// form: state.form,
// };
// };
export const getServerSideProps = wrapper.getServerSideProps(
(store) =>
async ({ query, req, res }) => {
const appealTypeData = await getAppealsTypes();
const lpaData = await getLPA();
console.log("appeal types", appealTypeData);
console.log("lpa typeswwwww", lpaData);
store.dispatch(setAppealType(appealTypeData));
store.dispatch(setLPA(lpaData));
}
);
const mapStateToProps = (state) => {
return {
@@ -83,6 +89,8 @@ const mapStateToProps = (state) => {
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
LPAData: state.LPAData,
form: state.form,
};
};