@@ -73,11 +73,22 @@ const RepAgent = (props) => {
|
|||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<label className="govuk-label govuk-body-m">
|
<label className="govuk-label govuk-body-m">
|
||||||
Representation Type:{" "}
|
{t("myrepresentations:representation-type")}:{" "}
|
||||||
{
|
{router.locale == "cy"
|
||||||
formObj.representationForm.values
|
? formObj.representationForm.values
|
||||||
.representationType
|
.representationType == "Questionnaire"
|
||||||
}{" "}
|
? "Holiadur"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType ==
|
||||||
|
"Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType}
|
||||||
</label>
|
</label>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -73,11 +73,22 @@ const RepAppellant = (props) => {
|
|||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<label className="govuk-label govuk-body-m">
|
<label className="govuk-label govuk-body-m">
|
||||||
Representation Type:{" "}
|
{t("myrepresentations:representation-type")}:{" "}
|
||||||
{
|
{router.locale == "cy"
|
||||||
formObj.representationForm.values
|
? formObj.representationForm.values
|
||||||
.representationType
|
.representationType == "Questionnaire"
|
||||||
}{" "}
|
? "Holiadur"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType ==
|
||||||
|
"Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType}
|
||||||
</label>
|
</label>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -210,7 +210,18 @@ const RepCompleteSubmit = (props) => {
|
|||||||
</dt>
|
</dt>
|
||||||
|
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{repFormData.representationType}
|
{router.locale == "cy"
|
||||||
|
? repFormData.representationType ==
|
||||||
|
"Questionnaire"
|
||||||
|
? "Holiadur"
|
||||||
|
: repFormData.representationType ==
|
||||||
|
"Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: repFormData.representationType ==
|
||||||
|
"Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: repFormData.representationType
|
||||||
|
: repFormData.representationType}
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dd className="govuk-summary-list__actions">
|
<dd className="govuk-summary-list__actions">
|
||||||
|
|||||||
@@ -475,6 +475,8 @@ export const RenderPickList = ({
|
|||||||
...custom
|
...custom
|
||||||
}) => {
|
}) => {
|
||||||
console.log(custom.disabled);
|
console.log(custom.disabled);
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
@@ -503,11 +505,20 @@ export const RenderPickList = ({
|
|||||||
disabled={custom.disabled}
|
disabled={custom.disabled}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
>
|
>
|
||||||
<option>Select...</option>
|
<option>{t("common:drop-down-select")}</option>
|
||||||
{Object.keys(optionsArr).map((key, index) => {
|
{Object.keys(optionsArr).map((key, index) => {
|
||||||
return (
|
return (
|
||||||
<option key={key} value={optionsArr[key]}>
|
<option key={key} value={optionsArr[key]}>
|
||||||
{optionsArr[key]}
|
{router.locale == "cy"
|
||||||
|
? optionsArr[key] == "Questionnaire"
|
||||||
|
? "Holiadur"
|
||||||
|
: optionsArr[key] == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: optionsArr[key] ==
|
||||||
|
"Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: optionsArr[key]
|
||||||
|
: optionsArr[key]}
|
||||||
</option>
|
</option>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -73,11 +73,22 @@ const RepInterestedPartyPerson = (props) => {
|
|||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<label className="govuk-label govuk-body-m">
|
<label className="govuk-label govuk-body-m">
|
||||||
Representation Type:{" "}
|
{t("myrepresentations:representation-type")}:{" "}
|
||||||
{
|
{router.locale == "cy"
|
||||||
formObj.representationForm.values
|
? formObj.representationForm.values
|
||||||
.representationType
|
.representationType == "Questionnaire"
|
||||||
}{" "}
|
? "Holiadur"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType ==
|
||||||
|
"Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType}
|
||||||
</label>
|
</label>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -266,71 +266,24 @@ let RepLPA = (props) => {
|
|||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<label className="govuk-label govuk-body-m">
|
<label className="govuk-label govuk-body-m">
|
||||||
Representation Type:{" "}
|
{t("myrepresentations:representation-type")}:{" "}
|
||||||
{
|
{router.locale == "cy"
|
||||||
formObj.representationForm.values
|
? formObj.representationForm.values
|
||||||
.representationType
|
.representationType == "Questionnaire"
|
||||||
}{" "}
|
? "Holiadur"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType == "Statement"
|
||||||
|
? "Datganiad"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType ==
|
||||||
|
"Final comments"
|
||||||
|
? "Sylwadau terfynol"
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType
|
||||||
|
: formObj.representationForm.values
|
||||||
|
.representationType}
|
||||||
</label>
|
</label>
|
||||||
)}
|
)}
|
||||||
{/* {!formObj["representationForm"].hasOwnProperty("values") ||
|
|
||||||
typeof formObj.representationForm.values
|
|
||||||
.representationType == "undefined" ? (
|
|
||||||
<>
|
|
||||||
<h2 className="govuk-heading-m ">
|
|
||||||
{typeof props.representationType !=
|
|
||||||
"undefined" ||
|
|
||||||
typeof formObj.representationForm.values
|
|
||||||
.representationType != "undefined"
|
|
||||||
? props.representationType ==
|
|
||||||
"Questionnaire"
|
|
||||||
? locale == "cy"
|
|
||||||
? "Holiadur"
|
|
||||||
: props.representationType
|
|
||||||
: props.representationType
|
|
||||||
: locale == "cy"
|
|
||||||
? "Cynrychioliadau"
|
|
||||||
: "Representation"}{" "}
|
|
||||||
{locale == "cy"
|
|
||||||
? "o ACLI am a"
|
|
||||||
: "from an LPA for a"}{" "}
|
|
||||||
{locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.attributevalue=="' +
|
|
||||||
currentView.caseReference
|
|
||||||
.appealType +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: getFormCollectionByID(
|
|
||||||
currentView.caseReference.appealType
|
|
||||||
).value}
|
|
||||||
</h2>
|
|
||||||
<label
|
|
||||||
className="govuk-label govuk-body-m"
|
|
||||||
htmlFor="representationType"
|
|
||||||
>
|
|
||||||
{t(
|
|
||||||
"myrepresentations:representation-from-an-lpa-heading"
|
|
||||||
)}
|
|
||||||
</label>
|
|
||||||
<Field
|
|
||||||
id="representationType"
|
|
||||||
name="representationType"
|
|
||||||
component={RenderPickList}
|
|
||||||
datafieldname="representationType"
|
|
||||||
optionsArr={appellantApplicantRepresentationArr}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<label className="govuk-label govuk-body-m">
|
|
||||||
Representation Type:{" "}
|
|
||||||
{
|
|
||||||
formObj.representationForm.values
|
|
||||||
.representationType
|
|
||||||
}{" "}
|
|
||||||
</label>
|
|
||||||
)} */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ const CaseSummary = (props) => {
|
|||||||
)}
|
)}
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
Last modified
|
{t("case:summary-last-modified-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{detailsObj.modifiedon > casesObj.modifiedon
|
{detailsObj.modifiedon > casesObj.modifiedon
|
||||||
@@ -492,7 +492,28 @@ const CaseSummary = (props) => {
|
|||||||
<div className="govuk-grid-column-full govuk-!-padding-left-0">
|
<div className="govuk-grid-column-full govuk-!-padding-left-0">
|
||||||
<div className="govuk-button-group">
|
<div className="govuk-button-group">
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
The
|
{t(
|
||||||
|
"case:representation-date-passed-label",
|
||||||
|
{
|
||||||
|
startDate:
|
||||||
|
formatDates(
|
||||||
|
detailsObj.pinswg_startdate
|
||||||
|
),
|
||||||
|
endDate:
|
||||||
|
props
|
||||||
|
.currentView
|
||||||
|
.caseReference
|
||||||
|
.appealType ==
|
||||||
|
846040019
|
||||||
|
? formatDates(
|
||||||
|
detailsObj.pinswg_statementduedate
|
||||||
|
)
|
||||||
|
: formatDates(
|
||||||
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
|
),
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
{/* The
|
||||||
representation
|
representation
|
||||||
period for
|
period for
|
||||||
this appeal
|
this appeal
|
||||||
@@ -511,12 +532,11 @@ const CaseSummary = (props) => {
|
|||||||
)
|
)
|
||||||
: formatDates(
|
: formatDates(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)}
|
)} */}
|
||||||
<br />
|
<br />{" "}
|
||||||
You can make
|
{t(
|
||||||
a
|
"case:representation-date-passed-additional-label"
|
||||||
representation
|
)}{" "}
|
||||||
by emailing{" "}
|
|
||||||
<Link href="mailto:pedw.casework@gov.wales">
|
<Link href="mailto:pedw.casework@gov.wales">
|
||||||
pedw.casework@gov.wales
|
pedw.casework@gov.wales
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const MyRepresentations = (props) => {
|
|||||||
<div className="card" id="my-representations-card">
|
<div className="card" id="my-representations-card">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<h3 className="heading-small card-heading">
|
<h3 className="heading-small card-heading">
|
||||||
{t("myportal:myrepresentations-card-title")}dd
|
{t("myportal:myrepresentations-card-title")}
|
||||||
</h3>
|
</h3>
|
||||||
<div className="cardModuleContainer">
|
<div className="cardModuleContainer">
|
||||||
<TopThree
|
<TopThree
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ const TopThree = (props) => {
|
|||||||
|
|
||||||
const deleteRepItem = (containerID, caseID, repfile) => {
|
const deleteRepItem = (containerID, caseID, repfile) => {
|
||||||
let cookies = parseCookies();
|
let cookies = parseCookies();
|
||||||
console.log("sssss", containerID, caseID, repfile);
|
//console.log("sssss", containerID, caseID, repfile);
|
||||||
|
|
||||||
deleteMyRepresentationsFromBlob(containerID, caseID, repfile)
|
deleteMyRepresentationsFromBlob(containerID, caseID, repfile)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
@@ -209,11 +209,14 @@ const TopThree = (props) => {
|
|||||||
<div className="cardModuleItem" key={index}>
|
<div className="cardModuleItem" key={index}>
|
||||||
<div className="cardModuleDetails">
|
<div className="cardModuleDetails">
|
||||||
<div className="cardModuleReference">
|
<div className="cardModuleReference">
|
||||||
<b>{t("myportal:case-reference")}:</b>{" "}
|
<b>{t("myportal:case-reference")}:</b>
|
||||||
<Link
|
<Link
|
||||||
// href="#"
|
// href="#"
|
||||||
href={{
|
href={{
|
||||||
pathname: "/myportal/representation",
|
pathname:
|
||||||
|
router.locale == "cy"
|
||||||
|
? "/fymhorth/representation"
|
||||||
|
: "/myportal/representation",
|
||||||
query: {
|
query: {
|
||||||
case: showTopThreeArr[key].caseRef,
|
case: showTopThreeArr[key].caseRef,
|
||||||
state: "edit",
|
state: "edit",
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const WatchedCases = (props) => {
|
|||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<h3 className="heading-small card-heading">
|
<h3 className="heading-small card-heading">
|
||||||
{props.myReps
|
{props.myReps
|
||||||
? "Submitted representations"
|
? t("myportal:submitted-reps-card-title")
|
||||||
: t("myportal:watchedcases-card-title")}
|
: t("myportal:watchedcases-card-title")}
|
||||||
</h3>
|
</h3>
|
||||||
<div className="cardModuleContainer">
|
<div className="cardModuleContainer">
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
"summary-site-address-label": "Cyfeiriad y Safle",
|
"summary-site-address-label": "Cyfeiriad y Safle",
|
||||||
"summary-description-label": "Disgrifiad",
|
"summary-description-label": "Disgrifiad",
|
||||||
"summary-case-stage-label": "Cyfnod Achos",
|
"summary-case-stage-label": "Cyfnod Achos",
|
||||||
|
"summary-last-modified-label": "Addaswyd ddiwethaf",
|
||||||
"summary-make-representation-label": "Cyflwyno cynrychiolaeth",
|
"summary-make-representation-label": "Cyflwyno cynrychiolaeth",
|
||||||
"summary-back-button-label": "Ewch yn ôl",
|
"summary-back-button-label": "Ewch yn ôl",
|
||||||
"summary-case-details-label": "Manylion yr Achos",
|
"summary-case-details-label": "Manylion yr Achos",
|
||||||
@@ -93,5 +94,7 @@
|
|||||||
"trying-to-watch-case-redirect-label": "Fe'ch anogir nawr i fewngofnodi",
|
"trying-to-watch-case-redirect-label": "Fe'ch anogir nawr i fewngofnodi",
|
||||||
"you-have-stopped-watching-label": "Ydych chi am roi'r gorau i wylio achos ",
|
"you-have-stopped-watching-label": "Ydych chi am roi'r gorau i wylio achos ",
|
||||||
"do-you-want-to-delete-case-label": "Ydych chi am ddileu achos",
|
"do-you-want-to-delete-case-label": "Ydych chi am ddileu achos",
|
||||||
"do-you-want-to-delete-case-disclaimer-label": "Unwaith y caiff ei dileu, bydd yr holl wybodaeth a gyflwynwyd gennych yn cael ei cholli."
|
"do-you-want-to-delete-case-disclaimer-label": "Unwaith y caiff ei dileu, bydd yr holl wybodaeth a gyflwynwyd gennych yn cael ei cholli.",
|
||||||
|
"representation-date-passed-label": "Y cyfnod cynrychioli ar gyfer yr apêl hon yw rhwng {{startDate}} a {{endDate}}",
|
||||||
|
"representation-date-passed-additional-label": "Gallwch wneud sylw drwy e-bostio,"
|
||||||
}
|
}
|
||||||
@@ -22,6 +22,7 @@
|
|||||||
"awatitingsubmission-card-title": "Eto i’w gyflwyno",
|
"awatitingsubmission-card-title": "Eto i’w gyflwyno",
|
||||||
"myrepresentations-card-title": "Cyflwyniadau'r achos",
|
"myrepresentations-card-title": "Cyflwyniadau'r achos",
|
||||||
"watchedcases-card-title": "Achosion a gwylio",
|
"watchedcases-card-title": "Achosion a gwylio",
|
||||||
|
"submitted-reps-card-title": "Sylwadau a gyflwynwyd",
|
||||||
"case-reference": "Cyfeirnod achos",
|
"case-reference": "Cyfeirnod achos",
|
||||||
"temp-reference": "Cyfeirnod Dros Dro",
|
"temp-reference": "Cyfeirnod Dros Dro",
|
||||||
"case-address": "Cyfeiriad",
|
"case-address": "Cyfeiriad",
|
||||||
|
|||||||
@@ -211,5 +211,6 @@
|
|||||||
"statement-signed-label": "Llofnodwyd",
|
"statement-signed-label": "Llofnodwyd",
|
||||||
"statement-date-label": "Dyddiad",
|
"statement-date-label": "Dyddiad",
|
||||||
"statement-onbehalf-label": "Ar ran",
|
"statement-onbehalf-label": "Ar ran",
|
||||||
"final-comments-label": "Sylwadau terfynol"
|
"final-comments-label": "Sylwadau terfynol",
|
||||||
|
"representation-type": "Math o gynrychiolaeth"
|
||||||
}
|
}
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
"summary-site-address-label": "Site Address",
|
"summary-site-address-label": "Site Address",
|
||||||
"summary-description-label": "Description",
|
"summary-description-label": "Description",
|
||||||
"summary-case-stage-label": "Case Stage",
|
"summary-case-stage-label": "Case Stage",
|
||||||
|
"summary-last-modified-label": "Last modified",
|
||||||
"summary-make-representation-label": "Make representation",
|
"summary-make-representation-label": "Make representation",
|
||||||
"summary-back-button-label": "Go back",
|
"summary-back-button-label": "Go back",
|
||||||
"summary-case-details-label": "Case Details",
|
"summary-case-details-label": "Case Details",
|
||||||
@@ -93,5 +94,7 @@
|
|||||||
"trying-to-watch-case-redirect-label": "You will now be prompted to sign in",
|
"trying-to-watch-case-redirect-label": "You will now be prompted to sign in",
|
||||||
"you-have-stopped-watching-label": "Do you want to stop watching case ",
|
"you-have-stopped-watching-label": "Do you want to stop watching case ",
|
||||||
"do-you-want-to-delete-case-label": "Do you want to delete case ",
|
"do-you-want-to-delete-case-label": "Do you want to delete case ",
|
||||||
"do-you-want-to-delete-case-disclaimer-label": "Once deleted all information you have submited, will be lost."
|
"do-you-want-to-delete-case-disclaimer-label": "Once deleted all information you have submited, will be lost.",
|
||||||
|
"representation-date-passed-label": "The representation period for this appeal is between {{startDate}} and {{endDate}}",
|
||||||
|
"representation-date-passed-additional-label": "You can make a representation by emailing,"
|
||||||
}
|
}
|
||||||
@@ -22,6 +22,7 @@
|
|||||||
"awatitingsubmission-card-title": "Awaiting submission",
|
"awatitingsubmission-card-title": "Awaiting submission",
|
||||||
"myrepresentations-card-title": "My representations",
|
"myrepresentations-card-title": "My representations",
|
||||||
"watchedcases-card-title": "Watched cases",
|
"watchedcases-card-title": "Watched cases",
|
||||||
|
"submitted-reps-card-title": "Submitted representations",
|
||||||
"case-reference": "Case reference",
|
"case-reference": "Case reference",
|
||||||
"temp-reference": "Temporary reference",
|
"temp-reference": "Temporary reference",
|
||||||
"case-address": "Address",
|
"case-address": "Address",
|
||||||
|
|||||||
@@ -212,5 +212,6 @@
|
|||||||
"statement-signed-label": "Signed",
|
"statement-signed-label": "Signed",
|
||||||
"statement-date-label": "Date",
|
"statement-date-label": "Date",
|
||||||
"statement-onbehalf-label": "On behalf of",
|
"statement-onbehalf-label": "On behalf of",
|
||||||
"final-comments-label": "Final comments"
|
"final-comments-label": "Final comments",
|
||||||
|
"representation-type": "Representation type"
|
||||||
}
|
}
|
||||||
@@ -151,6 +151,10 @@ module.exports = {
|
|||||||
source: "/fymhorth/achos/id/:slug",
|
source: "/fymhorth/achos/id/:slug",
|
||||||
destination: "/myportal/case/id/:slug",
|
destination: "/myportal/case/id/:slug",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
source: "/fymhorth/achos/:slug",
|
||||||
|
destination: "/myportal/case/:slug",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
source: "/fymhorth/gweldpopeth",
|
source: "/fymhorth/gweldpopeth",
|
||||||
destination: "/myportal/viewall",
|
destination: "/myportal/viewall",
|
||||||
@@ -159,6 +163,10 @@ module.exports = {
|
|||||||
source: "/fymhorth/:slug",
|
source: "/fymhorth/:slug",
|
||||||
destination: "/myportal/:slug",
|
destination: "/myportal/:slug",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
source: "/fymhorth/cynrychiolaeth",
|
||||||
|
destination: "/myportal/representation",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
source: "/allgofnodi",
|
source: "/allgofnodi",
|
||||||
destination: "/logout",
|
destination: "/logout",
|
||||||
|
|||||||
+3
-36
@@ -24,18 +24,11 @@ const SignIn = (props) => {
|
|||||||
"/api/auth/signin/email";
|
"/api/auth/signin/email";
|
||||||
|
|
||||||
const [buttonDisabled, setButtonDisabled] = useState(false);
|
const [buttonDisabled, setButtonDisabled] = useState(false);
|
||||||
const [hasError, setHasError] = useState(false);
|
|
||||||
const emailRegex =
|
|
||||||
/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/gi;
|
|
||||||
|
|
||||||
const handleSubmit = async (event) => {
|
const handleSubmit = async (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
setButtonDisabled(true);
|
||||||
//!emailRegex.test(event.currentTarget[2].value) && setHasError(true);
|
event.target.submit();
|
||||||
|
|
||||||
!emailRegex.test(event.currentTarget[2].value)
|
|
||||||
? (setHasError(true), setButtonDisabled(true))
|
|
||||||
: (setButtonDisabled(true), event.target.submit());
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -67,13 +60,7 @@ const SignIn = (props) => {
|
|||||||
action="/api/auth/signin/email"
|
action="/api/auth/signin/email"
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
>
|
>
|
||||||
<div
|
<div className={"govuk-form-group "}>
|
||||||
className={
|
|
||||||
hasError
|
|
||||||
? "govuk-form-group govuk-form-group--error"
|
|
||||||
: "govuk-form-group "
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<input
|
<input
|
||||||
className="govuk-input"
|
className="govuk-input"
|
||||||
name="csrfToken"
|
name="csrfToken"
|
||||||
@@ -93,32 +80,12 @@ const SignIn = (props) => {
|
|||||||
>
|
>
|
||||||
{t("auth:auth-email-label")}
|
{t("auth:auth-email-label")}
|
||||||
</label>
|
</label>
|
||||||
{hasError && (
|
|
||||||
<span
|
|
||||||
id={"email-error"}
|
|
||||||
className="govuk-error-message"
|
|
||||||
>
|
|
||||||
<span className="govuk-visually-hidden">
|
|
||||||
Error:
|
|
||||||
</span>{" "}
|
|
||||||
Enter a valid email address
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<input
|
<input
|
||||||
className="govuk-input govuk-!-width-three-quarters"
|
className="govuk-input govuk-!-width-three-quarters"
|
||||||
type="email"
|
type="email"
|
||||||
id="email"
|
id="email"
|
||||||
name="email"
|
name="email"
|
||||||
onBlur={(e) => {
|
|
||||||
!emailRegex.test(
|
|
||||||
e.currentTarget.value
|
|
||||||
)
|
|
||||||
? (setHasError(true),
|
|
||||||
setButtonDisabled(true))
|
|
||||||
: (setHasError(false),
|
|
||||||
setButtonDisabled(false));
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
|
|
||||||
const watchedCases = await getWatchedCases(loggedInUser);
|
const watchedCases = await getWatchedCases(loggedInUser);
|
||||||
|
|
||||||
console.log("sssss", loggedInUser);
|
//console.log("sssss", loggedInUser);
|
||||||
|
|
||||||
const [accountDetails, searchDetailsObj, watchedCasesDetails] =
|
const [accountDetails, searchDetailsObj, watchedCasesDetails] =
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
|||||||
Reference in New Issue
Block a user