diff --git a/actions/index.js b/actions/index.js
index 137f0666..89f544b9 100644
--- a/actions/index.js
+++ b/actions/index.js
@@ -202,6 +202,21 @@ export const getLPA = () => {
});
};
+export const getPersonalAccount = () => {
+ console.log("api_root: ", BASE_URL);
+ return axios
+
+ .get(
+ BASE_URL + "/api/lookups/personaldetails",
+ //.get("https://devcrm2016.llcdt.gov.wales/DVPINS/api/data/v8.2/contacts?$select=name",
+ { httpsAgent: new https.Agent({ rejectUnauthorized: false }) }
+ )
+ .then((res) => res.data)
+ .catch((error) => {
+ console.log("thi serror", error);
+ });
+};
+
function makeid(length) {
var result = "";
var characters =
diff --git a/components/account/changepassword.js b/components/account/changepassword.js
new file mode 100644
index 00000000..54bf59ee
--- /dev/null
+++ b/components/account/changepassword.js
@@ -0,0 +1,181 @@
+import _ from "lodash";
+import React, { useState } from "react";
+import { useRouter } from "next/router";
+import useTranslation from "next-translate/useTranslation";
+import {
+ Field,
+ reduxForm,
+ formValueSelector,
+ getFormSubmitErrors,
+} from "redux-form";
+import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
+import {
+ Textfield,
+ DateField,
+ DateFieldPicker,
+ YesNofield,
+ PickList,
+ MultiLinefield,
+ NumericField,
+ ReadOnlyfield,
+ DecimalField,
+} from "../elements";
+
+const RenderTextfield = ({
+ id,
+ className,
+ rows,
+ datafieldname,
+ name,
+ label,
+ input,
+ type,
+ errorMsg,
+ meta: { touched, error },
+ ...custom
+}) => {
+ return (
+ <>
+
+
+ {touched && error && (
+
+ Error:{" "}
+ {touched &&
+ ((error && (
+ {errorMsg ? errorMsg : error}
+ )) ||
+ (warning && {warning}))}
+
+ )}
+
+
+ >
+ );
+};
+
+const ChangePassword = (props) => {
+ const { footerLinks, pages, handleSubmit, value } = props;
+ let { t, lang } = useTranslation();
+
+ const router = useRouter();
+ const { locale } = router;
+
+ let errorsobj = {};
+
+ const onHandleSubmit = (values) => {
+ console.log(values);
+ };
+
+ const required = (value) => (value ? undefined : "Is required");
+
+ const matchInput = (input, allInputs) => {
+ return input === allInputs.password
+ ? undefined
+ : "Passwords do not match";
+ };
+
+ const email = (value) =>
+ value && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(value)
+ ? "Invalid email address"
+ : undefined;
+ const phoneNumber = (value) =>
+ value &&
+ !/^(?:(?:\(?(?:0(?:0|11)\)?[\s-]?\(?|\+)44\)?[\s-]?(?:\(?0\)?[\s-]?)?)|(?:\(?0))(?:(?:\d{5}\)?[\s-]?\d{4,5})|(?:\d{4}\)?[\s-]?(?:\d{5}|\d{3}[\s-]?\d{3}))|(?:\d{3}\)?[\s-]?\d{3}[\s-]?\d{3,4})|(?:\d{2}\)?[\s-]?\d{4}[\s-]?\d{4}))(?:[\s-]?(?:x|ext\.?|\#)\d{3,4})?$/i.test(
+ value
+ )
+ ? "Invalid phone number"
+ : undefined;
+
+ const [hasErrors, setHasErrors] = useState("");
+
+ return (
+ <>
+ {/* {hasErrors == true ? (
+
+ ) : (
+ ""
+ )} */}
+
+ >
+ );
+};
+
+const mapStateToProps = (state) => {
+ return {
+ search: state.search,
+ searchResultsObj: state.searchResultsObj,
+ formData: state.formData,
+ appealType: state.appealType,
+ //form: state.form,
+ };
+};
+
+const mapDispatchToProps = (dispatch) => {
+ return {
+ setCurrentSection: (currentSection) => {
+ dispatch(setCurrentSection(currentSection));
+ },
+ };
+};
+
+const selector = formValueSelector("changepasswordForm"); // <-- same as form name
+
+export default connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(
+ reduxForm({
+ form: "changepasswordForm",
+ destroyOnUnmount: false,
+ })(ChangePassword)
+);
diff --git a/components/account/personaldetails.js b/components/account/personaldetails.js
new file mode 100644
index 00000000..f88fc88b
--- /dev/null
+++ b/components/account/personaldetails.js
@@ -0,0 +1,314 @@
+import _ from "lodash";
+import Link from "next/link";
+import React, { useState } from "react";
+import { useRouter } from "next/router";
+import useTranslation from "next-translate/useTranslation";
+import {
+ Field,
+ reduxForm,
+ formValueSelector,
+ getFormSubmitErrors,
+} from "redux-form";
+import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
+import {
+ Textfield,
+ DateField,
+ DateFieldPicker,
+ YesNofield,
+ PickList,
+ MultiLinefield,
+ NumericField,
+ ReadOnlyfield,
+ DecimalField,
+} from "../elements";
+import BuildCheckPersonalDetails from "./personaldetailsCheck";
+
+const RenderTextfield = ({
+ id,
+ className,
+ rows,
+ datafieldname,
+ name,
+ label,
+ input,
+ type,
+ errorMsg,
+ meta: { touched, error },
+ ...custom
+}) => {
+ return (
+ <>
+
+
+ {touched && error && (
+
+ Error:{" "}
+ {touched &&
+ ((error && (
+ {errorMsg ? errorMsg : error}
+ )) ||
+ (warning && {warning}))}
+
+ )}
+
+
+ >
+ );
+};
+
+const PersonalDetails = (props) => {
+ const { footerLinks, pages, handleSubmit, value } = props;
+ let { t, lang } = useTranslation();
+
+ const router = useRouter();
+ const { locale } = router;
+
+ let errorsobj = {};
+
+ const onHandleSubmit = (values) => {
+ console.log(values);
+ };
+
+ const required = (value) => (value ? undefined : "Is required");
+ const email = (value) =>
+ value && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(value)
+ ? "Invalid email address"
+ : undefined;
+ const phoneNumber = (value) =>
+ value &&
+ !/^(?:(?:\(?(?:0(?:0|11)\)?[\s-]?\(?|\+)44\)?[\s-]?(?:\(?0\)?[\s-]?)?)|(?:\(?0))(?:(?:\d{5}\)?[\s-]?\d{4,5})|(?:\d{4}\)?[\s-]?(?:\d{5}|\d{3}[\s-]?\d{3}))|(?:\d{3}\)?[\s-]?\d{3}[\s-]?\d{3,4})|(?:\d{2}\)?[\s-]?\d{4}[\s-]?\d{4}))(?:[\s-]?(?:x|ext\.?|\#)\d{3,4})?$/i.test(
+ value
+ )
+ ? "Invalid phone number"
+ : undefined;
+
+ const [hasErrors, setHasErrors] = useState("");
+
+ const [personalDetailsComplete, setPersonalDetailsComplete] =
+ useState(false);
+
+ return (
+ <>
+ {/* {hasErrors == true ? (
+
+ ) : (
+ ""
+ )} */}
+
+ {personalDetailsComplete == false ? (
+
+ ) : (
+ <>
+
+
+ >
+ )}
+ >
+ );
+};
+
+const mapStateToProps = (state) => {
+ return {
+ search: state.search,
+ searchResultsObj: state.searchResultsObj,
+ formData: state.formData,
+ appealType: state.appealType,
+ accountDetails: state.accountDetails,
+ //form: state.form,
+ };
+};
+
+const mapDispatchToProps = (dispatch) => {
+ return {
+ setCurrentSection: (currentSection) => {
+ dispatch(setCurrentSection(currentSection));
+ },
+ };
+};
+
+const selector = formValueSelector("personalDetailsForm"); // <-- same as form name
+
+export default connect(mapStateToProps, mapDispatchToProps, (state) => ({
+ initialValues: state.accountDetails.accountDetails.data,
+ search: state.search,
+ searchResultsObj: state.searchResultsObj,
+ formData: state.formData,
+ appealType: state.appealType,
+ accountDetails: state.accountDetails,
+ form: state.form,
+ // pull initial values from account reducer
+}))(
+ reduxForm({
+ form: "personalDetailsForm",
+ enableReinitialize: true, // this is needed!!
+ destroyOnUnmount: false,
+ })(PersonalDetails)
+);
diff --git a/components/account/personaldetailsCheck.js b/components/account/personaldetailsCheck.js
new file mode 100644
index 00000000..e1150161
--- /dev/null
+++ b/components/account/personaldetailsCheck.js
@@ -0,0 +1,311 @@
+import _ from "lodash";
+import React, { useState } from "react";
+import { useRouter } from "next/router";
+import useTranslation from "next-translate/useTranslation";
+import {
+ Field,
+ reduxForm,
+ formValueSelector,
+ getFormSubmitErrors,
+} from "redux-form";
+import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
+
+const BuildCheckPersonalDetails = (props) => {
+ const {
+ footerLinks,
+ pages,
+ handleSubmit,
+ value,
+ setPersonalDetailsComplete,
+ } = props;
+ let { t, lang } = useTranslation();
+
+ const router = useRouter();
+ const { locale } = router;
+
+ return (
+ <>
+ About you
+
+
+
+
+
+
+
+
+ Your address
+
+
+
+
+
+
+
+ >
+ );
+};
+
+const mapStateToProps = (state) => {
+ return {
+ search: state.search,
+ searchResultsObj: state.searchResultsObj,
+ formData: state.formData,
+ appealType: state.appealType,
+ accountDetails: state.accountDetails,
+ //form: state.form,
+ };
+};
+
+const mapDispatchToProps = (dispatch) => {
+ return {
+ setCurrentSection: (currentSection) => {
+ dispatch(setCurrentSection(currentSection));
+ },
+ };
+};
+
+const selector = formValueSelector("personalDetailsForm"); // <-- same as form name
+
+export default connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(BuildCheckPersonalDetails);
diff --git a/components/account/registerform.js b/components/account/registerform.js
new file mode 100644
index 00000000..b751f88a
--- /dev/null
+++ b/components/account/registerform.js
@@ -0,0 +1,264 @@
+import _ from "lodash";
+import React, { useState } from "react";
+import { useRouter } from "next/router";
+import useTranslation from "next-translate/useTranslation";
+import {
+ Field,
+ reduxForm,
+ formValueSelector,
+ getFormSubmitErrors,
+} from "redux-form";
+import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
+import {
+ Textfield,
+ DateField,
+ DateFieldPicker,
+ YesNofield,
+ PickList,
+ MultiLinefield,
+ NumericField,
+ ReadOnlyfield,
+ DecimalField,
+} from "../elements";
+
+const RenderTextfield = ({
+ id,
+ className,
+ rows,
+ datafieldname,
+ name,
+ label,
+ input,
+ type,
+ errorMsg,
+ meta: { touched, error },
+ ...custom
+}) => {
+ return (
+ <>
+
+
+ {touched && error && (
+
+ Error:{" "}
+ {touched &&
+ ((error && (
+ {errorMsg ? errorMsg : error}
+ )) ||
+ (warning && {warning}))}
+
+ )}
+
+
+ >
+ );
+};
+
+const RegisterForm = (props) => {
+ const { footerLinks, pages, handleSubmit, value } = props;
+ let { t, lang } = useTranslation();
+
+ const router = useRouter();
+ const { locale } = router;
+
+ let errorsobj = {};
+
+ const onHandleSubmit = (values) => {
+ console.log(values);
+ };
+
+ const required = (value) => (value ? undefined : "Is required");
+ const email = (value) =>
+ value && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(value)
+ ? "Invalid email address"
+ : undefined;
+ const phoneNumber = (value) =>
+ value &&
+ !/^(?:(?:\(?(?:0(?:0|11)\)?[\s-]?\(?|\+)44\)?[\s-]?(?:\(?0\)?[\s-]?)?)|(?:\(?0))(?:(?:\d{5}\)?[\s-]?\d{4,5})|(?:\d{4}\)?[\s-]?(?:\d{5}|\d{3}[\s-]?\d{3}))|(?:\d{3}\)?[\s-]?\d{3}[\s-]?\d{3,4})|(?:\d{2}\)?[\s-]?\d{4}[\s-]?\d{4}))(?:[\s-]?(?:x|ext\.?|\#)\d{3,4})?$/i.test(
+ value
+ )
+ ? "Invalid phone number"
+ : undefined;
+
+ const [hasErrors, setHasErrors] = useState("");
+
+ return (
+ <>
+ {/* {hasErrors == true ? (
+
+ ) : (
+ ""
+ )} */}
+
+ >
+ );
+};
+
+const mapStateToProps = (state) => {
+ return {
+ search: state.search,
+ searchResultsObj: state.searchResultsObj,
+ formData: state.formData,
+ appealType: state.appealType,
+ //form: state.form,
+ };
+};
+
+const mapDispatchToProps = (dispatch) => {
+ return {
+ setCurrentSection: (currentSection) => {
+ dispatch(setCurrentSection(currentSection));
+ },
+ };
+};
+
+const selector = formValueSelector("accountRegisterForm"); // <-- same as form name
+
+export default connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(
+ reduxForm({
+ form: "accountRegisterForm",
+ destroyOnUnmount: false,
+ })(RegisterForm)
+);
diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js
index aa86ae8b..15455839 100644
--- a/components/breadcrumbs.js
+++ b/components/breadcrumbs.js
@@ -166,6 +166,38 @@ const Breadcrumbs = (props) => {
) : (
""
)}
+ {router.pathname == "/account/personaldetails" ? (
+ <>
+
+
+
+ My Portal
+
+
+
+
+ Your account
+
+ >
+ ) : (
+ ""
+ )}
+ {router.pathname == "/account/changepassword" ? (
+ <>
+
+
+
+ My Portal
+
+
+
+
+ Update your password
+
+ >
+ ) : (
+ ""
+ )}
{!_.isEmpty(slug) ? (
<>
diff --git a/components/elements/index.js b/components/elements/index.js
index 7f8d1e2c..8b3409a8 100644
--- a/components/elements/index.js
+++ b/components/elements/index.js
@@ -43,7 +43,7 @@ const RenderTextfield = ({
};
export function Textfield(props) {
- const { name, label } = props;
+ const { name, label, validate } = props;
const required = (value) => (value ? undefined : "Required");
return (
diff --git a/components/header.js b/components/header.js
index f44a131c..a355acc5 100644
--- a/components/header.js
+++ b/components/header.js
@@ -60,7 +60,7 @@ export default function Header({ courseName }) {
-
diff --git a/components/homepage/login.js b/components/homepage/login.js
index c4bae971..b741d6c3 100644
--- a/components/homepage/login.js
+++ b/components/homepage/login.js
@@ -70,7 +70,7 @@ export default function Login() {
{t("home:login-card-register-label")}{" "}
-
+
{t("home:login-card-register-link")}
diff --git a/components/myportal.js b/components/myportal.js
index 8bc002cf..3f65ea8e 100644
--- a/components/myportal.js
+++ b/components/myportal.js
@@ -2,41 +2,41 @@ import Link from "next/link";
import { useRouter } from "next/router";
import { useContext } from "react";
import useTranslation from "next-translate/useTranslation";
-import MakeNewAppeal from "./myportal/makenewappeal";
-import MyCases from "./myportal/mycases";
-import SearchCases from "./myportal/searchcases";
-import AwaitingSubmission from "./myportal/awaitingsubmission";
-import MyRepresentations from "./myportal/myrepresentations";
-import WatchedCases from "./myportal/watchedcases";
-
-
-
+import MakeNewAppeal from "./myportal/makenewappeal";
+import MyCases from "./myportal/mycases";
+import SearchCases from "./myportal/searchcases";
+import AwaitingSubmission from "./myportal/awaitingsubmission";
+import MyRepresentations from "./myportal/myrepresentations";
+import WatchedCases from "./myportal/watchedcases";
+import YourAccount from "./myportal/youraccount";
export default function MyPortal({ children, pages }) {
- let { t } = useTranslation();
+ let { t } = useTranslation();
- const router = useRouter();
- const { locale } = router;
+ const router = useRouter();
+ const { locale } = router;
- return (
-
-
-
- );
-}
\ No newline at end of file
+ return (
+
+
+
+ );
+}
diff --git a/components/myportal/youraccount.js b/components/myportal/youraccount.js
new file mode 100644
index 00000000..e5819793
--- /dev/null
+++ b/components/myportal/youraccount.js
@@ -0,0 +1,46 @@
+import Link from "next/link";
+import { useRouter } from "next/router";
+import useTranslation from "next-translate/useTranslation";
+
+export default function YourAccount() {
+ let { t } = useTranslation();
+
+ const router = useRouter();
+ const { locale } = router;
+ return (
+ <>
+
+
+ >
+ );
+}
diff --git a/components/newappeal/buildcheckrow.js b/components/newappeal/buildcheckrow.js
index 415e12e5..145abfc8 100644
--- a/components/newappeal/buildcheckrow.js
+++ b/components/newappeal/buildcheckrow.js
@@ -51,27 +51,11 @@ let BuildCheckRow = (props) => {
{rows[0].value}
- {fieldtype[0].value ==
- "{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}"
- ? props.props.form["appealForm"].values[
- datafieldname[0].value
- ] != null
- ? props.props.form["appealForm"].values[
- datafieldname[0].value
- ].getDate() +
- "/" +
- (props.props.form["appealForm"].values[
- datafieldname[0].value
- ].getMonth() +
- 1) +
- "/" +
- props.props.form["appealForm"].values[
- datafieldname[0].value
- ].getFullYear()
- : ""
- : props.props.form["appealForm"].values[
- datafieldname[0].value
- ]}
+ {
+ props.props.form["appealForm"].values[
+ datafieldname[0].value
+ ]
+ }
{
+ const { footerLinks, pages, formData } = props;
+ let { t, lang } = useTranslation();
+
+ const router = useRouter();
+ const { locale } = router;
+ const { appealtypes } = router.query;
+
+ const { appealType, LPAData } = props;
+
+ return (
+
+
+
+ {t("search:page-title")} - {t("common:service-name")}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Change password
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+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 {
+ search: state.search,
+ searchResultsObj: state.searchResultsObj,
+ formData: state.formData,
+ appealType: state.appealType,
+ LPAData: state.LPAData,
+ form: state.form,
+ };
+};
+
+export default connect(mapStateToProps)(Home);
diff --git a/pages/account/personaldetails.js b/pages/account/personaldetails.js
new file mode 100644
index 00000000..837aa2b6
--- /dev/null
+++ b/pages/account/personaldetails.js
@@ -0,0 +1,94 @@
+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 Footer from "../../components/footer";
+
+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 PersonalDetails from "../../components/account/personaldetails";
+import xpath from "xpath";
+import { setAccountDetails } from "../../store/accountDetails/action";
+import { getPersonalAccount } from "../../actions";
+import { setLPA } from "../../store/lpa/action";
+
+const Home = (props) => {
+ const { footerLinks, formData } = props;
+ let { t, lang } = useTranslation();
+
+ const router = useRouter();
+ const { locale } = router;
+ const { appealtypes } = router.query;
+
+ const { appealType, LPAData } = props;
+
+ return (
+
+
+
+ {t("search:page-title")} - {t("common:service-name")}
+
+
+
+
+ );
+};
+
+export const getServerSideProps = wrapper.getServerSideProps(
+ (store) =>
+ async ({ query, req, res }) => {
+ const accountDetails = await getPersonalAccount();
+ console.log("perosnal: ", accountDetails);
+ store.dispatch(setAccountDetails(accountDetails));
+ }
+);
+
+const mapStateToProps = (state) => {
+ return {
+ search: state.search,
+ searchResultsObj: state.searchResultsObj,
+ formData: state.formData,
+ appealType: state.appealType,
+ LPAData: state.LPAData,
+ form: state.form,
+ accountDetails: state.accountDetails,
+ };
+};
+
+export default connect(mapStateToProps)(Home);
diff --git a/pages/account/register.js b/pages/account/register.js
new file mode 100644
index 00000000..5c80398e
--- /dev/null
+++ b/pages/account/register.js
@@ -0,0 +1,152 @@
+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 Footer from "../../components/footer";
+
+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 RegisterForm from "../../components/account/registerform";
+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, formData } = props;
+ let { t, lang } = useTranslation();
+
+ const router = useRouter();
+ const { locale } = router;
+ const { appealtypes } = router.query;
+
+ const { appealType, LPAData } = props;
+
+ return (
+
+
+
+ {t("search:page-title")} - {t("common:service-name")}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Create a new account
+
+
+
+
+
+ Help
+
+
+
+ Companies or submissions by more
+ than one individual (groups)
+
+
+
+ If you are submitting an appeal or
+ representation from a company e.g.
+ "Acme Inc" or a group of
+ people e.g. "Residents of 1-10
+ High street", you should enter
+ the name of the company or group in
+ the Company/Group field. You will be
+ deemed as acting as their
+ representative.
+
+
+
+ Enforcement appeals by married/civil
+ partnership couples
+
+
+
+ You should not enter a group name.
+ You need only enter your
+ partner's name on the appeal
+ form itself as an additional
+ appellant.
+
+
+
+ Other appeals by married/civil
+ partnership couples
+
+
+
+ For any other type of appeal, for
+ example a planning appeal, you
+ should enter a group name when
+ creating your account e.g. "Mr
+ and Mrs Smith", if that is the
+ name on the application.
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+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 {
+ search: state.search,
+ searchResultsObj: state.searchResultsObj,
+ formData: state.formData,
+ appealType: state.appealType,
+ LPAData: state.LPAData,
+ form: state.form,
+ };
+};
+
+export default connect(mapStateToProps)(Home);
diff --git a/pages/api/lookups/personaldetails.js b/pages/api/lookups/personaldetails.js
new file mode 100644
index 00000000..57583333
--- /dev/null
+++ b/pages/api/lookups/personaldetails.js
@@ -0,0 +1,17 @@
+const ApiResponse = (req, res) => {
+ res.statusCode = 200;
+ res.json({
+ data: {
+ firstname: "Steve",
+ lastname: "Johnson",
+ email: "steve@test.co.uk",
+ telephone: "0000000000",
+ companygroup: "Test Company",
+ addressline1: "1 Test Street",
+ towncity: "TestTown",
+ county: "Test County",
+ postcode: "TN12 12N",
+ },
+ });
+};
+export default ApiResponse;
diff --git a/pages/newappeal/[appealtypes].js b/pages/newappeal/[appealtypes].js
index 9819027c..c8a077e3 100644
--- a/pages/newappeal/[appealtypes].js
+++ b/pages/newappeal/[appealtypes].js
@@ -111,15 +111,15 @@ let Home = (props) => {
-
-
-
-
+
+
+
+
{props.appealType.currentSection == 9999 ? (
) : props.appealType.currentSection ==
@@ -141,8 +141,9 @@ let Home = (props) => {
props={props}
/>
)}
-
-
+
+
+
diff --git a/pages/newappeal/index.js b/pages/newappeal/index.js
index 2c517816..f5570892 100644
--- a/pages/newappeal/index.js
+++ b/pages/newappeal/index.js
@@ -49,26 +49,27 @@ const Home = (props) => {
-
-
diff --git a/store/accountDetails/action.js b/store/accountDetails/action.js
new file mode 100644
index 00000000..f106d058
--- /dev/null
+++ b/store/accountDetails/action.js
@@ -0,0 +1,17 @@
+export const AccountDetailsDataActionTypes = {
+ GETACCOUNTDETAILSDATA: "GETACCOUNTDETAILSDATA",
+ SETACCOUNTDETAILSDATA: "SETACCOUNTDETAILSDATA",
+};
+
+export const getAccountDetailsObj = () => (dispatch) => {
+ return dispatch({
+ type: AccountDetailsDataActionTypes.GETACCOUNTDETAILSDATA,
+ });
+};
+
+export const setAccountDetails = (accountDetails) => (dispatch) => {
+ return dispatch({
+ type: AccountDetailsDataActionTypes.SETACCOUNTDETAILSDATA,
+ accountDetails: accountDetails,
+ });
+};
diff --git a/store/accountDetails/reducer.js b/store/accountDetails/reducer.js
new file mode 100644
index 00000000..71ac673b
--- /dev/null
+++ b/store/accountDetails/reducer.js
@@ -0,0 +1,20 @@
+import { AccountDetailsDataActionTypes } from "./action";
+
+const AccountDetailsDataInitialState = {
+ accountDetails: {},
+};
+
+export default function reducer(
+ state = AccountDetailsDataInitialState,
+ action
+) {
+ switch (action.type) {
+ case AccountDetailsDataActionTypes.SETACCOUNTDETAILSDATA:
+ return {
+ ...state,
+ accountDetails: action.accountDetails,
+ };
+ default:
+ return state;
+ }
+}
diff --git a/store/store.js b/store/store.js
index 324f1e2f..83769736 100644
--- a/store/store.js
+++ b/store/store.js
@@ -6,6 +6,7 @@ import searchResultsObj from "./searchOutput/reducer";
import formData from "./formData/reducer";
import appealType from "./appealType/reducer";
import LPAData from "./lpa/reducer";
+import accountDetails from "./accountDetails/reducer";
import { reducer as formReducer } from "redux-form";
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
@@ -16,6 +17,7 @@ const combinedReducer = combineReducers({
formData,
appealType,
LPAData,
+ accountDetails,
form: formReducer,
});
@@ -81,8 +83,9 @@ const makeStore = ({ isServer }) => {
"searchResults",
"formData",
"appealType",
- "form",
"LPAData",
+ "accountDetails",
+ "form",
],
storage,
stateReconciler: autoMergeLevel2, // if needed, use a safer storage
diff --git a/styles/sass/patterns/_card.scss b/styles/sass/patterns/_card.scss
index 5492b870..1ebdd33d 100644
--- a/styles/sass/patterns/_card.scss
+++ b/styles/sass/patterns/_card.scss
@@ -22,7 +22,7 @@
}
&.card-3 {
- flex-basis: 44%;
+ flex-basis: 46%;
min-height: 300px;
// &:nth-child(3n-1) {
@@ -41,7 +41,7 @@
margin-left: 3%;
}
&.card-3 {
- flex-basis: 31%;
+ flex-basis: 31.1%;
min-height: 300px;
&:nth-child(2n-2) {
diff --git a/styles/sass/welshgov/_application.scss b/styles/sass/welshgov/_application.scss
index b0211858..9f52ce25 100644
--- a/styles/sass/welshgov/_application.scss
+++ b/styles/sass/welshgov/_application.scss
@@ -106,6 +106,109 @@ a {
color: #fff;
box-shadow: none;
}
+
+ //nav drop down
+
+ .mobileNav {
+ display: none;
+
+ @media screen and (max-width: 900px) {
+ display: block;
+ position: relative;
+ clear: both;
+ margin-top: 40px;
+ margin-right: -10px;
+
+ .mobileMenu {
+ float: left;
+ position: relative;
+ }
+ .mobileMenu label {
+ background-color: black;
+ padding: 10px 30px;
+ cursor: pointer;
+ text-align: center;
+ display: block;
+ position: relative;
+ }
+ .mobileMenu label i {
+ font-style: normal;
+ font-size: 10px;
+ color: white;
+ position: absolute;
+ right: 18px;
+ top: 13px;
+ }
+ .mobileMenu [type="radio"] {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ opacity: 0;
+ margin: 0;
+ z-index: 1;
+ }
+
+ .content {
+ position: absolute;
+ top: 100%;
+ opacity: 0;
+ background: #333;
+ color: white;
+ padding: 20px 10px;
+ width: 140px;
+ right: 0px;
+ }
+ .content ul {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ }
+ .content a {
+ color: white;
+ display: block;
+ white-space: nowrap;
+ text-decoration: none;
+ border-bottom: 1px solid #999;
+ padding: 5px;
+ padding: 20px 10px;
+
+ &.govuk-header__link {
+ background-color: inherit;
+ }
+ }
+ [type="radio"]:checked ~ label {
+ z-index: 2;
+ }
+ [type="radio"]:checked ~ label ~ .content {
+ z-index: 1;
+ opacity: 1;
+ }
+
+ .close-mobileMenu {
+ position: absolute;
+ z-index: -1;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ }
+ .close-mobileMenu label {
+ background: #333;
+ color: white;
+ }
+ [type="radio"]:checked ~ label ~ .close-mobileMenu {
+ z-index: 3;
+ }
+ }
+ }
+ .fullNav {
+ display: block;
+ @media screen and (max-width: 900px) {
+ display: none;
+ }
+ }
}
.header__logo {
@@ -126,10 +229,10 @@ a {
width: 22% !important;
}
-nav {
- // margin-top: 60px;
- // margin-bottom: 40px;
-}
+// nav {
+// // margin-top: 60px;
+// // margin-bottom: 40px;
+// }
.govuk-footer {
padding-top: 0px;