diff --git a/components/account/changepassword.js b/components/account/changepassword.js
index 54bf59ee..20d173a9 100644
--- a/components/account/changepassword.js
+++ b/components/account/changepassword.js
@@ -1,3 +1,4 @@
+import Link from "next/link";
import _ from "lodash";
import React, { useState } from "react";
import { useRouter } from "next/router";
@@ -9,17 +10,6 @@ import {
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,
@@ -69,7 +59,14 @@ const RenderTextfield = ({
};
const ChangePassword = (props) => {
- const { footerLinks, pages, handleSubmit, value } = props;
+ const {
+ footerLinks,
+ pages,
+ handleSubmit,
+ value,
+ setPasswordUpdated,
+ passwordUpdated,
+ } = props;
let { t, lang } = useTranslation();
const router = useRouter();
@@ -78,74 +75,65 @@ const ChangePassword = (props) => {
let errorsobj = {};
const onHandleSubmit = (values) => {
- console.log(values);
+ setPasswordUpdated(true);
};
const required = (value) => (value ? undefined : "Is required");
- const matchInput = (input, allInputs) => {
- return input === allInputs.password
- ? undefined
- : "Passwords do not match";
- };
+ const passwordsMustMatch = (value, allValues) =>
+ value !== allValues.newpassword ? "Passwords do not match" : undefined;
- 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"
+ const minLength = (min) => (value) =>
+ value && value.length < min
+ ? `Must be at least ${min} characters`
: undefined;
const [hasErrors, setHasErrors] = useState("");
return (
<>
- {/* {hasErrors == true ? (
-
+ + Go to My Portal + +
+ > + )} > ); }; diff --git a/components/account/personaldetails.js b/components/account/personaldetails.js index f88fc88b..78701686 100644 --- a/components/account/personaldetails.js +++ b/components/account/personaldetails.js @@ -10,18 +10,9 @@ import { 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"; +import PersonalDetailsComplete from "./personaldetailsComplete"; const RenderTextfield = ({ id, @@ -71,7 +62,12 @@ const RenderTextfield = ({ }; const PersonalDetails = (props) => { - const { footerLinks, pages, handleSubmit, value } = props; + const { + handleSubmit, + value, + setPersonalDetailsComplete, + setAccountUpdatedComplete, + } = props; let { t, lang } = useTranslation(); const router = useRouter(); @@ -79,10 +75,6 @@ const PersonalDetails = (props) => { 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) @@ -98,178 +90,155 @@ const PersonalDetails = (props) => { const [hasErrors, setHasErrors] = useState(""); - const [personalDetailsComplete, setPersonalDetailsComplete] = - useState(false); + const onHandleSubmit = (values) => { + setPersonalDetailsComplete(true); + }; return ( <> - {/* {hasErrors == true ? ( -Your details have been updated
+ ++ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi a + metus non quam mollis egestas. Integer ac leo cursus, laoreet + nulla sed, tempus tellus. Mauris condimentum erat arcu. +
+ ++ + Return to My Portal + +
+ > + ); +}; + +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)); + }, + }; +}; + +export default connect( + mapStateToProps, + mapDispatchToProps +)(PersonalDetailsComplete); diff --git a/components/account/registerCheck.js b/components/account/registerCheck.js new file mode 100644 index 00000000..6e2c4f78 --- /dev/null +++ b/components/account/registerCheck.js @@ -0,0 +1,310 @@ +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 RegisterFormCheck = (props) => { + const { + footerLinks, + pages, + handleSubmit, + value, + setRegisterFormComplete, + setAccountCreatedComplete, + } = props; + let { t, lang } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + return ( + <> +Check that the details you entered are correct.
+We have sent you a confirmation email.
+ ++ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi a + metus non quam mollis egestas. Integer ac leo cursus, laoreet + nulla sed, tempus tellus. Mauris condimentum erat arcu. +
++ Sed imperdiet dignissim ipsum. Orci varius natoque penatibus et + magnis dis parturient montes, nascetur ridiculus mus. In id leo + in turpis aliquam venenatis ut non erat. Ut est arcu, luctus sit + amet pretium sed, iaculis non purus. Etiam dictum tortor commodo + luctus rhoncus. +
+ ++ + Login to My Portal + +
+ > + ); +}; + +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)); + }, + }; +}; + +export default connect(mapStateToProps, mapDispatchToProps)(RegisterComplete); diff --git a/components/account/registerform.js b/components/account/registerform.js index b751f88a..9fcf8128 100644 --- a/components/account/registerform.js +++ b/components/account/registerform.js @@ -9,17 +9,9 @@ import { 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 RegisterFormCheck from "./registerCheck"; +import RegisterComplete from "./registerComplete"; const RenderTextfield = ({ id, @@ -69,7 +61,12 @@ const RenderTextfield = ({ }; const RegisterForm = (props) => { - const { footerLinks, pages, handleSubmit, value } = props; + const { + handleSubmit, + value, + setRegisterFormComplete, + setAccountCreatedComplete, + } = props; let { t, lang } = useTranslation(); const router = useRouter(); @@ -77,10 +74,6 @@ const RegisterForm = (props) => { 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) @@ -96,139 +89,148 @@ const RegisterForm = (props) => { const [hasErrors, setHasErrors] = useState(""); + const onHandleSubmit = (values) => { + setRegisterFormComplete(true); + }; + return ( <> - {/* {hasErrors == true ? ( -+ 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. +
-- 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. -
++ You should not enter a group + name. You need only enter your + partner's name on the + appeal form itself as an + additional appellant. +
-- You should not enter a group name. - You need only enter your - partner's name on the appeal - form itself as an additional - appellant. -
+- 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. -
-+ 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. +
+