added representation, case flows
This commit is contained in:
@@ -167,7 +167,31 @@ const Breadcrumbs = (props) => {
|
||||
</Link>
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
Case Reference: CAS-00010-J9W6L5
|
||||
Case Reference:{" "}
|
||||
{
|
||||
props.props.currentView.caseReference
|
||||
.currentReference
|
||||
}
|
||||
</li>
|
||||
</>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{router.pathname == "/representation" ? (
|
||||
<>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
<Link href="/myportal">
|
||||
<a className="govuk-breadcrumbs__link">
|
||||
My Portal
|
||||
</a>
|
||||
</Link>
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
Make representation for:{" "}
|
||||
{
|
||||
props.props.currentView.caseReference
|
||||
.currentReference
|
||||
}
|
||||
</li>
|
||||
</>
|
||||
) : (
|
||||
|
||||
+14
-3
@@ -5,7 +5,7 @@ import useTranslation from "next-translate/useTranslation";
|
||||
import Summary from "./case/summary";
|
||||
import Documents from "./case/documents";
|
||||
|
||||
export default function CaseSummary({ children, pages }) {
|
||||
const CaseSummary = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -19,10 +19,21 @@ export default function CaseSummary({ children, pages }) {
|
||||
>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<Summary />
|
||||
<Summary
|
||||
myCases={props.myCases}
|
||||
myRepresentations={props.myRepresentations}
|
||||
watchedCases={props.watchedCases}
|
||||
awaitingSubmission={props.awaitingSubmission}
|
||||
caseReference={props.caseReference}
|
||||
currentType={props.currentType}
|
||||
searchResultsObj={props.searchResultsObj}
|
||||
searchString={props.searchString}
|
||||
/>
|
||||
<Documents />
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default CaseSummary;
|
||||
|
||||
@@ -0,0 +1,473 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import jsonpath from "jsonpath";
|
||||
import _ from "lodash";
|
||||
import { Field, FieldArray, reduxForm, formValueSelector } from "redux-form";
|
||||
import { connect } from "react-redux";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
|
||||
const MakeRepresentation = (props) => {
|
||||
let { t } = useTranslation();
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
|
||||
const files = acceptedFiles.map((file) => (
|
||||
<li key={file.path}>
|
||||
{file.path} - {file.size} bytes
|
||||
</li>
|
||||
));
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const {
|
||||
caseReference,
|
||||
myCases,
|
||||
myRepresentations,
|
||||
watchedCases,
|
||||
awaitingSubmission,
|
||||
searchResultsObj,
|
||||
currentType,
|
||||
} = props;
|
||||
const formObj = props.props.form;
|
||||
let setCaseQueryObj = props[currentType];
|
||||
var casesObj = {};
|
||||
|
||||
currentType == "searchResultsObj"
|
||||
? (casesObj = jsonpath.query(
|
||||
setCaseQueryObj,
|
||||
'$..[?(@.title=="' + caseReference + '")]'
|
||||
))
|
||||
: (casesObj = jsonpath.query(
|
||||
setCaseQueryObj,
|
||||
'$..[?(@.reference=="' + caseReference + '")]'
|
||||
));
|
||||
|
||||
casesObj = Object.assign({}, ...casesObj);
|
||||
|
||||
const RenderRepresentationCapacity = ({
|
||||
datafieldname,
|
||||
name,
|
||||
label,
|
||||
id,
|
||||
errorMsg,
|
||||
options,
|
||||
input: { onChange, value },
|
||||
meta: { touched, error },
|
||||
...custom
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={
|
||||
touched && error
|
||||
? "govuk-form-group govuk-form-group--error"
|
||||
: "govuk-form-group "
|
||||
}
|
||||
>
|
||||
<fieldset
|
||||
className="govuk-fieldset"
|
||||
aria-describedby={name + "-hint"}
|
||||
>
|
||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--s govuk-!-font-weight-regular">
|
||||
<label
|
||||
className="govuk-fieldset__heading govuk-body-m"
|
||||
id={id + "_label"}
|
||||
>
|
||||
{label}
|
||||
</label>
|
||||
</legend>
|
||||
{touched && error && (
|
||||
<span
|
||||
id={id + "-error"}
|
||||
className="govuk-error-message"
|
||||
>
|
||||
<span className="govuk-visually-hidden">
|
||||
Error:
|
||||
</span>{" "}
|
||||
{errorMsg}
|
||||
</span>
|
||||
)}
|
||||
<div className="govuk-radios govuk-radios--small">
|
||||
{Object.keys(options).map((key, index) => (
|
||||
<div
|
||||
className="govuk-radios__item"
|
||||
data-children-count={key}
|
||||
key={key}
|
||||
>
|
||||
<Field
|
||||
id={id + "_" + index}
|
||||
name={id}
|
||||
component="input"
|
||||
type="radio"
|
||||
className="govuk-radios__input"
|
||||
value={options[key]}
|
||||
/>
|
||||
<label
|
||||
className="govuk-label govuk-radios__label"
|
||||
htmlFor={id + "_" + index}
|
||||
>
|
||||
{options[key]}
|
||||
</label>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const { name, label } = props;
|
||||
const capacityOptionsArr = [
|
||||
"Appellant",
|
||||
"Agent",
|
||||
"Interested Party / Person",
|
||||
"Land Owner",
|
||||
];
|
||||
const required = (value) => (value ? undefined : "Required");
|
||||
|
||||
const RenderPickList = ({
|
||||
datafieldname,
|
||||
name,
|
||||
label,
|
||||
input,
|
||||
meta: { touched, errorStr },
|
||||
}) => {
|
||||
const dropdownObj = ["Final Comments", "Other", "Proof of Evidence"];
|
||||
|
||||
return (
|
||||
<div>
|
||||
<select
|
||||
{...input}
|
||||
className="govuk-select "
|
||||
id={name}
|
||||
name={name}
|
||||
>
|
||||
<option>Select...</option>
|
||||
{Object.keys(dropdownObj).map((key, index) => {
|
||||
return (
|
||||
<option key={key} value={dropdownObj[key]}>
|
||||
{dropdownObj[key]}
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
</select>
|
||||
|
||||
{touched && errorStr && <span>{errorStr}</span>}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const RenderTextfield = ({
|
||||
id,
|
||||
rows,
|
||||
datafieldname,
|
||||
name,
|
||||
label,
|
||||
input,
|
||||
errorMsg,
|
||||
type,
|
||||
className,
|
||||
meta: { touched, error },
|
||||
...custom
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
<label className="govuk-label " htmlFor={id} id={id + "_label"}>
|
||||
{label}
|
||||
</label>
|
||||
{touched && error && (
|
||||
<span id={id + "-error"} className="govuk-error-message">
|
||||
<span className="govuk-visually-hidden">Error:</span>{" "}
|
||||
{errorMsg}
|
||||
</span>
|
||||
)}
|
||||
<input
|
||||
{...input}
|
||||
className={className}
|
||||
name={name}
|
||||
id={id}
|
||||
type={type}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||
Make a representation
|
||||
</h1>
|
||||
|
||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9">
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
Appeal Reference
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{currentType == "searchResultsObj"
|
||||
? casesObj.title
|
||||
: casesObj.reference}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:summary-applicant-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{casesObj.appellantApplicant || ""}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:summary-agent-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
Mr A Agent
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:summary-site-address-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{casesObj.address1 || ""}
|
||||
<br />
|
||||
{casesObj.town || ""}
|
||||
|
||||
<br />
|
||||
{casesObj.postcode || ""}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
<div className="vo_hidden">
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h2 className="govuk-heading-m ">Your details</h2>
|
||||
<Field
|
||||
name="representationCapacity"
|
||||
datafieldname="representationCapacity"
|
||||
label="In what capacity do you wish to make representations on this case?"
|
||||
options={capacityOptionsArr}
|
||||
id="representationCapacity"
|
||||
className="govuk-radios__input"
|
||||
//validate={[required]}
|
||||
errorMsg="Select and option"
|
||||
component={RenderRepresentationCapacity}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="govuk-button-group">
|
||||
<Link href="/representation">
|
||||
<a className="govuk-button">Continue</a>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h2 className="govuk-heading-m ">Representation</h2>
|
||||
|
||||
<div className="govuk-form-group">
|
||||
<label
|
||||
className="govuk-label govuk-body-m"
|
||||
htmlFor="representationType"
|
||||
>
|
||||
What kind of representation are you making?
|
||||
</label>
|
||||
<Field
|
||||
name="representationType"
|
||||
component={RenderPickList}
|
||||
datafieldname="representationType"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="govuk-form-group">
|
||||
<p className="govuk-body">
|
||||
You can enter your comments in the space
|
||||
provided or attach a separate document.
|
||||
</p>
|
||||
<fieldset
|
||||
className="govuk-fieldset"
|
||||
aria-describedby="commentBox-hint"
|
||||
>
|
||||
<div
|
||||
id="commentBox-hint"
|
||||
className="govuk-hint"
|
||||
>
|
||||
My comments are set out in:*
|
||||
</div>
|
||||
<div
|
||||
className="govuk-checkboxes"
|
||||
data-module="govuk-checkboxes"
|
||||
>
|
||||
<div className="govuk-checkboxes__item">
|
||||
<Field
|
||||
className="govuk-checkboxes__input"
|
||||
id="commentBox"
|
||||
name="commentBox"
|
||||
value="email"
|
||||
data-aria-controls="commentBox"
|
||||
type="checkbox"
|
||||
component={RenderTextfield}
|
||||
/>
|
||||
<label
|
||||
className="govuk-label govuk-checkboxes__label"
|
||||
htmlFor="commentBox"
|
||||
>
|
||||
the box below{" "}
|
||||
</label>
|
||||
</div>
|
||||
<div
|
||||
className={
|
||||
_.isEmpty(
|
||||
formObj["representationForm"]
|
||||
)
|
||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden rr"
|
||||
: _.isEmpty(
|
||||
formObj[
|
||||
"representationForm"
|
||||
].values
|
||||
)
|
||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden q11 "
|
||||
: _.isEmpty(
|
||||
formObj[
|
||||
"representationForm"
|
||||
].values.commentBox
|
||||
)
|
||||
? formObj["representationForm"]
|
||||
.values.commentBox ==
|
||||
false
|
||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
||||
: "govuk-checkboxes__conditional"
|
||||
: "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden wwwaqqqq"
|
||||
}
|
||||
id="conditional-commentBox"
|
||||
>
|
||||
<div className="govuk-form-group">
|
||||
<textarea
|
||||
className="govuk-input govuk-!-width-two-thirds"
|
||||
rows="5"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-checkboxes__item">
|
||||
<Field
|
||||
className="govuk-checkboxes__input"
|
||||
id="documentBox"
|
||||
name="documentBox"
|
||||
value="email"
|
||||
data-aria-controls="documentBox"
|
||||
type="checkbox"
|
||||
component={RenderTextfield}
|
||||
/>
|
||||
<label
|
||||
className="govuk-label govuk-checkboxes__label"
|
||||
htmlFfor="documentBox"
|
||||
>
|
||||
separate documents
|
||||
</label>
|
||||
</div>
|
||||
<div
|
||||
className={
|
||||
_.isEmpty(
|
||||
formObj["representationForm"]
|
||||
)
|
||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden rr"
|
||||
: _.isEmpty(
|
||||
formObj[
|
||||
"representationForm"
|
||||
].values
|
||||
)
|
||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
||||
: _.isEmpty(
|
||||
formObj[
|
||||
"representationForm"
|
||||
].values.documentBox
|
||||
)
|
||||
? formObj["representationForm"]
|
||||
.values.documentBox ==
|
||||
false
|
||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
||||
: "govuk-checkboxes__conditional"
|
||||
: "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden"
|
||||
}
|
||||
id="conditional-documentBox"
|
||||
>
|
||||
<div className="govuk-form-group">
|
||||
<section className="container">
|
||||
<div
|
||||
{...getRootProps({
|
||||
className: "dropzone",
|
||||
})}
|
||||
>
|
||||
<input
|
||||
{...getInputProps()}
|
||||
/>
|
||||
<p>
|
||||
Drag and drop files here
|
||||
or click to select files
|
||||
</p>
|
||||
</div>
|
||||
<aside>
|
||||
<h4>Files</h4>
|
||||
<ul>{files}</ul>
|
||||
</aside>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>{" "}
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="govuk-button-group">
|
||||
<Link href="/representation">
|
||||
<a className="govuk-button">Continue</a>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
search: state.search,
|
||||
searchResultsObj: state.searchResultsObj,
|
||||
formData: state.formData,
|
||||
appealType: state.appealType,
|
||||
//form: state.form,
|
||||
};
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {};
|
||||
};
|
||||
|
||||
const selector = formValueSelector("representationForm");
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(
|
||||
reduxForm({
|
||||
form: "representationForm",
|
||||
destroyOnUnmount: false,
|
||||
})(MakeRepresentation)
|
||||
);
|
||||
+88
-33
@@ -1,18 +1,48 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import jsonpath from "jsonpath";
|
||||
import _ from "lodash";
|
||||
|
||||
export default function CaseSummary() {
|
||||
const CaseSummary = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const {
|
||||
caseReference,
|
||||
myCases,
|
||||
myRepresentations,
|
||||
watchedCases,
|
||||
awaitingSubmission,
|
||||
searchResultsObj,
|
||||
currentType,
|
||||
} = props;
|
||||
|
||||
let setCaseQueryObj = props[currentType];
|
||||
var casesObj = {};
|
||||
|
||||
currentType == "searchResultsObj"
|
||||
? (casesObj = jsonpath.query(
|
||||
setCaseQueryObj,
|
||||
'$..[?(@.title=="' + caseReference + '")]'
|
||||
))
|
||||
: (casesObj = jsonpath.query(
|
||||
setCaseQueryObj,
|
||||
'$..[?(@.reference=="' + caseReference + '")]'
|
||||
));
|
||||
|
||||
casesObj = Object.assign({}, ...casesObj);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||
Reference: CAS-00010-J9W6L5
|
||||
Reference:{" "}
|
||||
{currentType == "searchResultsObj"
|
||||
? casesObj.title
|
||||
: casesObj.reference}
|
||||
</h1>
|
||||
|
||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9">
|
||||
@@ -21,7 +51,7 @@ export default function CaseSummary() {
|
||||
{t("case:summary-applicant-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
Mr J Pocknell
|
||||
{casesObj.appellantApplicant || ""}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
@@ -29,7 +59,7 @@ export default function CaseSummary() {
|
||||
{t("case:summary-agent-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
Mr Cos Polito
|
||||
Mr A Agent
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
@@ -37,11 +67,12 @@ export default function CaseSummary() {
|
||||
{t("case:summary-site-address-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
72 Guild Street
|
||||
{casesObj.address1 || ""}
|
||||
<br />
|
||||
London
|
||||
{casesObj.town || ""}
|
||||
|
||||
<br />
|
||||
SE23 6FH
|
||||
{casesObj.postcode || ""}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
@@ -50,16 +81,17 @@ export default function CaseSummary() {
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="govuk-button-group">
|
||||
<Link href="/advancedsearch">
|
||||
<Link href="/representation">
|
||||
<a className="govuk-button">
|
||||
{t("case:summary-make-representation-label")}
|
||||
</a>
|
||||
</Link>
|
||||
<Link href="/advancedsearch">
|
||||
<a className="govuk-button govuk-button--secondary">
|
||||
{t("case:summary-back-button-label")}
|
||||
</a>
|
||||
</Link>
|
||||
<a
|
||||
onClick={() => router.back()}
|
||||
className="govuk-button govuk-button--secondary"
|
||||
>
|
||||
{t("case:summary-back-button-label")}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -78,7 +110,9 @@ export default function CaseSummary() {
|
||||
{t("case:summary-case-type-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
Planning Appeal (W){" "}
|
||||
{casesObj[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] || "N/A"}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
@@ -86,7 +120,7 @@ export default function CaseSummary() {
|
||||
{t("case:summary-lpa-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
Hastings Borough Council
|
||||
{casesObj.lpaname || ""}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
@@ -96,8 +130,8 @@ export default function CaseSummary() {
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
Erection of a two-storey chalet
|
||||
style detached dwelling
|
||||
{casesObj.caseDetails.caseSummary ||
|
||||
""}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
@@ -108,7 +142,8 @@ export default function CaseSummary() {
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{" "}
|
||||
Neale Oliver
|
||||
{casesObj.caseDetails.caseOfficer ||
|
||||
""}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
@@ -116,7 +151,8 @@ export default function CaseSummary() {
|
||||
{t("case:summary-procedure-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
Written representations
|
||||
{casesObj.caseDetails.procedure ||
|
||||
""}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
@@ -124,7 +160,9 @@ export default function CaseSummary() {
|
||||
{t("case:summary-status-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
In Progress
|
||||
{casesObj[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] || ""}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
@@ -132,10 +170,13 @@ export default function CaseSummary() {
|
||||
{t("case:summary-decision-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
Allowed
|
||||
{casesObj.caseDetails.decision ||
|
||||
""}
|
||||
<br />
|
||||
<Link href="/">
|
||||
<a>
|
||||
3272770 Appeal Decision.pdf
|
||||
{casesObj.caseDetails
|
||||
.outcome_document || ""}
|
||||
</a>
|
||||
</Link>
|
||||
</dd>
|
||||
@@ -147,7 +188,8 @@ export default function CaseSummary() {
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
Not Linked
|
||||
{casesObj.caseDetails
|
||||
.caseLinkStatus || ""}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
@@ -157,7 +199,8 @@ export default function CaseSummary() {
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
0
|
||||
{casesObj.caseDetails.linkedCases ||
|
||||
""}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
@@ -176,7 +219,8 @@ export default function CaseSummary() {
|
||||
{t("case:summary-start-date-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
26-May-21
|
||||
{casesObj.caseDates.start_date ||
|
||||
"N/A"}
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
@@ -187,7 +231,8 @@ export default function CaseSummary() {
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
02-Jun-21
|
||||
{casesObj.caseDates
|
||||
.questionnaireDue || "N/A"}
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
@@ -198,7 +243,8 @@ export default function CaseSummary() {
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
30-Jun-21
|
||||
{casesObj.caseDates.statementsDue ||
|
||||
"N/A"}
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
@@ -209,7 +255,9 @@ export default function CaseSummary() {
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
30-Jun-21
|
||||
{casesObj.caseDates
|
||||
.interestedPartyCommentsdue ||
|
||||
"N/A"}
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
@@ -220,7 +268,9 @@ export default function CaseSummary() {
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
14-Jul-21
|
||||
{casesObj.caseDates
|
||||
.appellantLPAFinalCommentsdue ||
|
||||
"N/A"}
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
@@ -231,7 +281,8 @@ export default function CaseSummary() {
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
N/A
|
||||
{casesObj.caseDates
|
||||
.inquiryEvidenceDue || "N/A"}
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
@@ -240,7 +291,8 @@ export default function CaseSummary() {
|
||||
{t("case:summary-event-date-label")}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
Date arranged
|
||||
{casesObj.caseDates.eventDate ||
|
||||
"N/A"}
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
@@ -251,7 +303,8 @@ export default function CaseSummary() {
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
Not yet decided
|
||||
{casesObj.caseDates.decisionDate ||
|
||||
"N/A"}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
@@ -273,4 +326,6 @@ export default function CaseSummary() {
|
||||
</div> */}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default CaseSummary;
|
||||
|
||||
+160
-79
@@ -1,6 +1,7 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function Footer(props) {
|
||||
let { t } = useTranslation();
|
||||
@@ -18,11 +19,80 @@ export default function Footer(props) {
|
||||
</li>
|
||||
));
|
||||
|
||||
const [showShareState, setShowShareState] = useState(false);
|
||||
|
||||
let shareState = () => {
|
||||
showShareState == true
|
||||
? setShowShareState(false)
|
||||
: setShowShareState(true);
|
||||
};
|
||||
|
||||
return (
|
||||
<footer className="govuk-footer " role="contentinfo">
|
||||
<>
|
||||
<div className="sharebar" id="sharebar">
|
||||
<div className="sharebar__components container-fluid">
|
||||
<div className="main__sharebar">
|
||||
<div
|
||||
className={
|
||||
showShareState
|
||||
? "block-share active"
|
||||
: "block-share"
|
||||
}
|
||||
>
|
||||
<button
|
||||
id="sharePage"
|
||||
aria-controls="sharePageLinks"
|
||||
aria-expanded="true"
|
||||
onClick={() => {
|
||||
shareState();
|
||||
}}
|
||||
>
|
||||
Share this page
|
||||
</button>
|
||||
<ul
|
||||
className={
|
||||
showShareState
|
||||
? "block-share active"
|
||||
: "block-share"
|
||||
}
|
||||
id="sharePageLinks"
|
||||
aria-labelledby="sharePage"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
href="https://twitter.com/intent/tweet?url=https%3A//gov.wales/"
|
||||
className="twitter"
|
||||
>
|
||||
<span className="vo_hidden">
|
||||
Share this page via{" "}
|
||||
</span>
|
||||
Twitter
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="https://www.facebook.com/sharer/sharer.php?u=https%3A//gov.wales/"
|
||||
className="facebook"
|
||||
>
|
||||
<span className="vo_hidden">
|
||||
Share this page via{" "}
|
||||
</span>
|
||||
Facebook
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="mailto:?body=https%3A//gov.wales/&subject=Shared%20from%20gov.wales"
|
||||
className="email"
|
||||
>
|
||||
<span className="vo_hidden">
|
||||
Share this page via{" "}
|
||||
</span>
|
||||
Email
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div
|
||||
id="sharebar__backtotop"
|
||||
className="btn--outlined btn--arrow-up"
|
||||
@@ -32,88 +102,99 @@ export default function Footer(props) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-width-container ">
|
||||
<div className="govuk-footer__meta">
|
||||
<div className="govuk-footer__meta-item govuk-footer__meta-item--grow">
|
||||
<h2 className="govuk-visually-hidden">Support links</h2>
|
||||
<nav role="navigation" aria-labelledby="footer_links">
|
||||
<ul
|
||||
className="govuk-footer__inline-list"
|
||||
id="footer_links"
|
||||
<footer className="govuk-footer " role="contentinfo">
|
||||
<div className="govuk-width-container ">
|
||||
<div className="govuk-footer__meta">
|
||||
<div className="govuk-footer__meta-item govuk-footer__meta-item--grow">
|
||||
<h2 className="govuk-visually-hidden">
|
||||
Support links
|
||||
</h2>
|
||||
<nav
|
||||
role="navigation"
|
||||
aria-labelledby="footer_links"
|
||||
>
|
||||
<li className="govuk-footer__inline-list-item">
|
||||
<a
|
||||
href="http://www.gov.uk/government/publications/appeals-casework-portal-documentation"
|
||||
id="aTermsConds"
|
||||
className="govuk-footer__link"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t(
|
||||
"common:footer-terms-conditions-link"
|
||||
)}
|
||||
</a>
|
||||
</li>
|
||||
<li className="govuk-footer__inline-list-item">
|
||||
<a
|
||||
href="https://www.gov.uk/government/publications/planning-inspectorate-privacy-notices"
|
||||
id="aPrivacy"
|
||||
className="govuk-footer__link"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t("common:footer-privacy-link")}
|
||||
</a>
|
||||
</li>
|
||||
<li className="govuk-footer__inline-list-item">
|
||||
<a
|
||||
href="https://www.gov.uk/guidance/appeals-casework-portal-privacy-cookies"
|
||||
id="aCookies"
|
||||
className="govuk-footer__link"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t("common:footer-cookies-link")}
|
||||
</a>
|
||||
</li>
|
||||
<li className="govuk-footer__inline-list-item">
|
||||
<a
|
||||
href="http://www.gov.uk/government/publications/appeals-casework-portal-documentation"
|
||||
className="govuk-footer__link"
|
||||
id="aAccess"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t("common:footer-accessibility-link")}
|
||||
</a>
|
||||
</li>
|
||||
<li className="govuk-footer__inline-list-item">
|
||||
<a
|
||||
href="http://www.gov.uk/guidance/feedback"
|
||||
id="feedback"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t("common:footer-feedback-link")}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div
|
||||
className="footer_logo container-fluid"
|
||||
id="footer_logo"
|
||||
>
|
||||
<a
|
||||
href="https://gov.wales/"
|
||||
className="footer__logo"
|
||||
id="footerlogo"
|
||||
<ul
|
||||
className="govuk-footer__inline-list"
|
||||
id="footer_links"
|
||||
>
|
||||
<li className="govuk-footer__inline-list-item">
|
||||
<a
|
||||
href="http://www.gov.uk/government/publications/appeals-casework-portal-documentation"
|
||||
id="aTermsConds"
|
||||
className="govuk-footer__link"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t(
|
||||
"common:footer-terms-conditions-link"
|
||||
)}
|
||||
</a>
|
||||
</li>
|
||||
<li className="govuk-footer__inline-list-item">
|
||||
<a
|
||||
href="https://www.gov.uk/government/publications/planning-inspectorate-privacy-notices"
|
||||
id="aPrivacy"
|
||||
className="govuk-footer__link"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t("common:footer-privacy-link")}
|
||||
</a>
|
||||
</li>
|
||||
<li className="govuk-footer__inline-list-item">
|
||||
<a
|
||||
href="https://www.gov.uk/guidance/appeals-casework-portal-privacy-cookies"
|
||||
id="aCookies"
|
||||
className="govuk-footer__link"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t("common:footer-cookies-link")}
|
||||
</a>
|
||||
</li>
|
||||
<li className="govuk-footer__inline-list-item">
|
||||
<a
|
||||
href="http://www.gov.uk/government/publications/appeals-casework-portal-documentation"
|
||||
className="govuk-footer__link"
|
||||
id="aAccess"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t(
|
||||
"common:footer-accessibility-link"
|
||||
)}
|
||||
</a>
|
||||
</li>
|
||||
<li className="govuk-footer__inline-list-item">
|
||||
<a
|
||||
href="http://www.gov.uk/guidance/feedback"
|
||||
id="feedback"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t("common:footer-feedback-link")}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div
|
||||
className="footer_logo container-fluid"
|
||||
id="footer_logo"
|
||||
>
|
||||
<span className="visually-hidden">Home</span>
|
||||
</a>
|
||||
<a
|
||||
href="https://gov.wales/"
|
||||
className="footer__logo"
|
||||
id="footerlogo"
|
||||
>
|
||||
<span className="visually-hidden">
|
||||
Home
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</footer>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ const Header = (props) => {
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const { setLogout } = props;
|
||||
const noSignoutLink = ["/", "/logout"];
|
||||
|
||||
return (
|
||||
<header
|
||||
@@ -98,9 +99,8 @@ const Header = (props) => {
|
||||
</div>
|
||||
<div className="content">
|
||||
<ul>
|
||||
{router.pathname == "/logout" ? (
|
||||
""
|
||||
) : router.pathname == "/" ? (
|
||||
{noSignoutLink.includes(router.pathname) ==
|
||||
true ? (
|
||||
""
|
||||
) : (
|
||||
<li>
|
||||
@@ -157,8 +157,9 @@ const Header = (props) => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="fullNav">
|
||||
{router.pathname != "/" ||
|
||||
router.pathname != "/logout" ? (
|
||||
{noSignoutLink.includes(router.pathname) == true ? (
|
||||
""
|
||||
) : (
|
||||
<Link href="/logout">
|
||||
<a
|
||||
onClick={() => {
|
||||
@@ -169,8 +170,6 @@ const Header = (props) => {
|
||||
{t("common:signout-label")}
|
||||
</a>
|
||||
</Link>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
|
||||
<Link
|
||||
|
||||
@@ -11,7 +11,7 @@ export default function SkipLink(props) {
|
||||
</Head>
|
||||
|
||||
<div className="">
|
||||
<Header courseName="Appeals Casework Portal" />
|
||||
<Header courseName="Planning Casework Portal" />
|
||||
<div className="govuk-width-container">
|
||||
<Banner />
|
||||
<main
|
||||
|
||||
@@ -23,6 +23,7 @@ const AwaitingSubmission = (props) => {
|
||||
showTopThree={
|
||||
props.awaitingSubmission.awaitingSubmission
|
||||
}
|
||||
topThreeType={"awaitingSubmission"}
|
||||
/>
|
||||
</div>
|
||||
<div className="cardVieAll">
|
||||
|
||||
@@ -18,7 +18,10 @@ const MyCases = (props) => {
|
||||
{t("myportal:mycases-card-title")}
|
||||
</h3>
|
||||
<div className="cardModuleContainer">
|
||||
<TopThree showTopThree={props.myCases.myCases} />
|
||||
<TopThree
|
||||
showTopThree={props.myCases.myCases}
|
||||
topThreeType={"myCases"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="cardVieAll">
|
||||
|
||||
@@ -21,6 +21,7 @@ const MyRepresentations = (props) => {
|
||||
<div className="cardModuleContainer">
|
||||
<TopThree
|
||||
showTopThree={props.myRepresentations.myRepresentations}
|
||||
topThreeType={"myRepresentations"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,35 +1,73 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { setCurrentReference } from "../../store/currentView/action";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
const TopThree = (props) => {
|
||||
let { t } = useTranslation();
|
||||
const { showTopThree } = props;
|
||||
const { showTopThree, setCurrentReference, topThreeType } = props;
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
let topthreeRow = [];
|
||||
|
||||
for (var i = 0; i < 3; i++)
|
||||
topthreeRow.push(
|
||||
<div className="cardModuleItem" key={i}>
|
||||
<div className="cardModuleDetails">
|
||||
<div className="cardModuleReference">
|
||||
<b>Case reference:</b>{" "}
|
||||
<Link href="/case">
|
||||
<a>{props.showTopThree.value[i].reference}</a>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="carModuleAddress">
|
||||
<b>Address: </b> {props.showTopThree.value[i].address}
|
||||
for (var i = 0; i < 3; i++) {
|
||||
(function (i) {
|
||||
topthreeRow.push(
|
||||
<div className="cardModuleItem" key={i}>
|
||||
<div className="cardModuleDetails">
|
||||
<div className="cardModuleReference">
|
||||
<b>Case reference:</b>{" "}
|
||||
<Link href="/case">
|
||||
<a
|
||||
data-id={i}
|
||||
onClick={() => {
|
||||
setCurrentReference({
|
||||
"currentReference":
|
||||
showTopThree.value[i].reference,
|
||||
"currentType": topThreeType,
|
||||
});
|
||||
}}
|
||||
>
|
||||
{showTopThree.value[i].reference}
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
{topThreeType != "awaitingSubmission" ? (
|
||||
<div className="carModuleAddress">
|
||||
<b>Address: </b>
|
||||
{showTopThree.value[i].address1}
|
||||
</div>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
|
||||
{topThreeType == "awaitingSubmission" ? (
|
||||
<div className="carModuleAddress">
|
||||
Make Representation on Case Incomplete, not
|
||||
submitted
|
||||
</div>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</div>
|
||||
<div className="cardModuleRemoveCase"> —</div>
|
||||
</div>
|
||||
<div className="cardModuleRemoveCase"> —</div>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
})(i);
|
||||
}
|
||||
|
||||
return <>{topthreeRow}</>;
|
||||
};
|
||||
|
||||
export default TopThree;
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
setCurrentReference: (currentReference) => {
|
||||
dispatch(setCurrentReference(currentReference));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(null, mapDispatchToProps)(TopThree);
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { setCurrentReference } from "../../store/currentView/action";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
const ViewAllResults = (props) => {
|
||||
const { searchString, searchResultsObj, currentView, setCurrentReference } =
|
||||
props;
|
||||
|
||||
export default function ViewAllResults(props) {
|
||||
const { searchString, searchResultsObj, currentView } = props;
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -18,7 +22,15 @@ export default function ViewAllResults(props) {
|
||||
<div className="govuk-summary-list__row" key={key}>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-!-padding-left-2">
|
||||
<Link href="/case">
|
||||
<a>
|
||||
<a
|
||||
onClick={() => {
|
||||
setCurrentReference({
|
||||
"currentReference":
|
||||
resultsArr[index].reference,
|
||||
"currentType": currentView.viewKey,
|
||||
});
|
||||
}}
|
||||
>
|
||||
<span className="results-visually-hidden">
|
||||
Case Reference:
|
||||
</span>
|
||||
@@ -102,12 +114,25 @@ export default function ViewAllResults(props) {
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="govuk-button-group">
|
||||
<Link href="/myportal">
|
||||
<a className="govuk-button">Back</a>
|
||||
</Link>
|
||||
<a
|
||||
onClick={() => router.back()}
|
||||
className="govuk-button"
|
||||
>
|
||||
Back
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
setCurrentReference: (currentReference) => {
|
||||
dispatch(setCurrentReference(currentReference));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(null, mapDispatchToProps)(ViewAllResults);
|
||||
|
||||
@@ -19,7 +19,10 @@ const WatchedCases = (props) => {
|
||||
{t("myportal:watchedcases-card-title")}
|
||||
</h3>
|
||||
<div className="cardModuleContainer">
|
||||
<TopThree showTopThree={props.watchedCases.watchedCases} />
|
||||
<TopThree
|
||||
showTopThree={props.watchedCases.watchedCases}
|
||||
topThreeType={"watchedCases"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="cardVieAll">
|
||||
|
||||
@@ -157,17 +157,52 @@ let CreateCase = (props) => {
|
||||
return (
|
||||
<option
|
||||
key={key}
|
||||
value={optionsObj[
|
||||
key
|
||||
].Label.LocalizedLabels[0].Label.replace(
|
||||
/[\s\-\+\(\)\,]/g,
|
||||
""
|
||||
).toLowerCase()}
|
||||
>
|
||||
{
|
||||
optionsObj[key].Label
|
||||
.LocalizedLabels[0].Label
|
||||
value={
|
||||
_.isEmpty(
|
||||
optionsObj[key].Label
|
||||
)
|
||||
? ""
|
||||
: _.isEmpty(
|
||||
optionsObj[key]
|
||||
.Label
|
||||
.LocalizedLabels
|
||||
)
|
||||
? ""
|
||||
: _.isEmpty(
|
||||
optionsObj[key]
|
||||
.Label
|
||||
.LocalizedLabels[0]
|
||||
.Label
|
||||
)
|
||||
? ""
|
||||
: optionsObj[
|
||||
key
|
||||
].Label.LocalizedLabels[0].Label.replace(
|
||||
/[\s\-\+\(\)\,]/g,
|
||||
""
|
||||
).toLowerCase()
|
||||
}
|
||||
>
|
||||
{_.isEmpty(optionsObj[key])
|
||||
? ""
|
||||
: _.isEmpty(
|
||||
optionsObj[key].Label
|
||||
)
|
||||
? ""
|
||||
: _.isEmpty(
|
||||
optionsObj[key].Label
|
||||
.LocalizedLabels
|
||||
)
|
||||
? ""
|
||||
: _.isEmpty(
|
||||
optionsObj[key].Label
|
||||
.LocalizedLabels[0]
|
||||
.Label
|
||||
)
|
||||
? ""
|
||||
: optionsObj[key].Label
|
||||
.LocalizedLabels[0]
|
||||
.Label}
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { useContext } from "react";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import Summary from "./case/representation";
|
||||
|
||||
const CaseSummary = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
return (
|
||||
<main
|
||||
className="govuk-main-wrapper govuk-main-wrapper--auto-spacing"
|
||||
id="main-content"
|
||||
role="main"
|
||||
>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<Summary
|
||||
myCases={props.myCases}
|
||||
myRepresentations={props.myRepresentations}
|
||||
watchedCases={props.watchedCases}
|
||||
awaitingSubmission={props.awaitingSubmission}
|
||||
caseReference={props.caseReference}
|
||||
currentType={props.currentType}
|
||||
searchResultsObj={props.searchResultsObj}
|
||||
searchString={props.searchString}
|
||||
props={props.props}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
};
|
||||
|
||||
export default CaseSummary;
|
||||
@@ -1,15 +1,17 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { setCurrentReference } from "../../store/currentView/action";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
export default function SearchResults(props) {
|
||||
const { searchString, searchResultsObj } = props;
|
||||
const SearchResults = (props) => {
|
||||
const { searchString, searchResultsObj, setCurrentReference } = props;
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
var resultsArr = props.searchResultsObj.searchResultsObj.value || [{}];
|
||||
var resultsArr = searchResultsObj.value || [{}];
|
||||
const resultRow = Object.keys(resultsArr).map((key, index) => {
|
||||
<div className="govuk-summary-list__row">
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-!-padding-left-2">
|
||||
@@ -58,9 +60,7 @@ export default function SearchResults(props) {
|
||||
</h1>
|
||||
<p className="govuk-body">
|
||||
{t("search:searchresults-count-label", {
|
||||
count: props.searchResultsObj.searchResultsObj[
|
||||
"@odata.count"
|
||||
].toString(),
|
||||
count: searchResultsObj["@odata.count"].toString(),
|
||||
})}
|
||||
. You searched for <em>"{searchString}"</em>
|
||||
</p>
|
||||
@@ -91,7 +91,16 @@ export default function SearchResults(props) {
|
||||
<div className="govuk-summary-list__row" key={key}>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-!-padding-left-2">
|
||||
<Link href="/case">
|
||||
<a>
|
||||
<a
|
||||
onClick={() => {
|
||||
setCurrentReference({
|
||||
"currentReference":
|
||||
item.title,
|
||||
"currentType":
|
||||
"searchResultsObj",
|
||||
});
|
||||
}}
|
||||
>
|
||||
<span className="results-visually-hidden">
|
||||
Case Reference:
|
||||
</span>
|
||||
@@ -151,4 +160,14 @@ export default function SearchResults(props) {
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
setCurrentReference: (currentReference) => {
|
||||
dispatch(setCurrentReference(currentReference));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(null, mapDispatchToProps)(SearchResults);
|
||||
|
||||
@@ -20,7 +20,10 @@ export default function Search(props) {
|
||||
>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<SearchResults searchString={searchString} searchResultsObj={searchResultsObj}/>
|
||||
<SearchResults
|
||||
searchString={searchString}
|
||||
searchResultsObj={searchResultsObj.searchResultsObj}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-grid-row">
|
||||
@@ -31,13 +34,12 @@ export default function Search(props) {
|
||||
{t("search:searchresults-search-button-label")}
|
||||
</a>
|
||||
</Link>
|
||||
<Link href="/advancedsearch">
|
||||
<a className="govuk-button govuk-button--secondary">
|
||||
{t(
|
||||
"search:searchresults-new-search-button-label"
|
||||
)}
|
||||
</a>
|
||||
</Link>
|
||||
<a
|
||||
onClick={() => router.back()}
|
||||
className="govuk-button govuk-button--secondary"
|
||||
>
|
||||
{t("search:searchresults-new-search-button-label")}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user