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 ? ( +
+
+ +

+ About you +

+
+ + + + + + +
+
+ +

+ What is your address? +

+
+ + + + + + +
+
+ +
+
+ ) : ( + <> + +
+ + + + { + setPersonalDetailsComplete(false); + }} + className="govuk-link" + > + Go back + + +
+ + )} + + ); +}; + +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

+
+
+
First name
+
+ {/* {console.log( + props.props.form["personalDetailsForm"].values[ + "firstname" + ] + )} */} +
+
+ { + setPersonalDetailsComplete(false); + }} + > + Change + + first name + + +
+
+
+
Last name
+
+ {/* {console.log( + props.props.form["personalDetailsForm"].values[ + "firstname" + ] + )} */} +
+
+ { + setPersonalDetailsComplete(false); + }} + > + Change + + {" "} + last name + + +
+
+
+
Email address
+
+ {/* {console.log( + props.props.form["personalDetailsForm"].values[ + "firstname" + ] + )} */} +
+
+ { + setPersonalDetailsComplete(false); + }} + > + Change + + {" "} + email address + + +
+
+
+
Telephone
+
+ {/* {console.log( + props.props.form["personalDetailsForm"].values[ + "firstname" + ] + )} */} +
+
+ { + setPersonalDetailsComplete(false); + }} + > + Change + + telephone + + +
+
+
+
Company/Group
+
+ {/* {console.log( + props.props.form["personalDetailsForm"].values[ + "firstname" + ] + )} */} +
+
+ { + setPersonalDetailsComplete(false); + }} + > + Change + + {" "} + company/group + + +
+
+
+
+

Your address

+ +
+
Address Line 1
+
+ {/* {console.log( + props.props.form["personalDetailsForm"].values[ + "firstname" + ] + )} */} +
+
+ { + setPersonalDetailsComplete(false); + }} + > + Change + + {" "} + address line 1 + + +
+
+
+
Address line 2
+
+ {/* {console.log( + props.props.form["personalDetailsForm"].values[ + "firstname" + ] + )} */} +
+
+ { + setPersonalDetailsComplete(false); + }} + > + Change + + {" "} + address line 2 + + +
+
+
+
Town/City
+
+ {/* {console.log( + props.props.form["personalDetailsForm"].values[ + "firstname" + ] + )} */} +
+
+ { + setPersonalDetailsComplete(false); + }} + > + Change + + {" "} + town/city + + +
+
+
+
County
+
+ {/* {console.log( + props.props.form["personalDetailsForm"].values[ + "firstname" + ] + )} */} +
+
+ { + setPersonalDetailsComplete(false); + }} + > + Change + + {" "} + county + + +
+
+
+
Postcode
+
+ {/* {console.log( + props.props.form["personalDetailsForm"].values[ + "firstname" + ] + )} */} +
+
+ { + setPersonalDetailsComplete(false); + }} + > + Change + + {" "} + postcode + + +
+
+
+ + ); +}; + +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 ? ( + + ) : ( + "" + )} */} +
+
+ +

About you

+
+ + + + + + +
+
+ +

+ What is your address? +

+
+ + + + + + +
+ +
+ +
+
+ + ); +}; + +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/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 ( + <> +
    +
    +

    Your details

    +

    + You can change your address and contact details +

    + + +
    +
    +
    +
    +

    + Change your password +

    +

    You can change your password

    + + +
    +
    + + ); +} 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")} + + +
    + +
    + +
    +
    +
    + + +
    +
    +
    +

    Your account

    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    + ); +}; + +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) => {
    -
    -
    -
    -
    - - +
    +
    +
    + + +

    New Appeal

    -
    +
    - + +