updated cookie manger added cookie policy
This commit is contained in:
@@ -562,6 +562,15 @@ const Breadcrumbs = (props) => {
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{router.pathname == "/details-about-cookies" ? (
|
||||
<>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{t("cookies:cookie-policy-title-heading")}
|
||||
</li>
|
||||
</>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{!_.isEmpty(slug) ? (
|
||||
<>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
|
||||
+12
-4
@@ -6,7 +6,8 @@ import Summary from "./case/summary";
|
||||
import Documents from "./case/documents";
|
||||
import RepresentationList from "./case/representationList";
|
||||
|
||||
const CaseSummary = (props) => {
|
||||
const Case = (props) => {
|
||||
const { showRepresentations } = props;
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -43,12 +44,19 @@ const CaseSummary = (props) => {
|
||||
documentDetailsObj={props.documentDetailsObj}
|
||||
documentHistoryObj={props.documentHistoryObj}
|
||||
/>
|
||||
|
||||
<RepresentationList />
|
||||
{showRepresentations == "true" && (
|
||||
<RepresentationList
|
||||
incidentid={props.incidentid}
|
||||
caseReference={props.caseReference}
|
||||
representationsObj={props.representationsObj}
|
||||
documentDetailsObj={props.documentDetailsObj}
|
||||
documentHistoryObj={props.documentHistoryObj}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
};
|
||||
|
||||
export default CaseSummary;
|
||||
export default Case;
|
||||
|
||||
@@ -249,7 +249,7 @@ const DocumentDetails = (props) => {
|
||||
//console.log("getting details", data);
|
||||
return getDocumentHistory(data.value).then((data) => {
|
||||
setDocumentHistory(data);
|
||||
setShowSpinnerState(false);
|
||||
//setShowSpinnerState(false);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -7,35 +7,249 @@ import jsonpath from "jsonpath";
|
||||
import _ from "lodash";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import LoadingOverlay from "react-loading-overlay";
|
||||
import { getRepresentations } from "../../actions";
|
||||
import { setRepresentations } from "../../store/searchOutput/action";
|
||||
import PaginationControl from "./pagination";
|
||||
|
||||
const RepresentationList = (props) => {
|
||||
const { incidentid, representationsObj, setRepresentations } = props;
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||
// const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||
|
||||
let spinnerState = () => {
|
||||
showSpinnerState == true
|
||||
? setShowSpinnerState(false)
|
||||
: setShowSpinnerState(true);
|
||||
// let spinnerState = () => {
|
||||
// showSpinnerState == true
|
||||
// ? setShowSpinnerState(false)
|
||||
// : setShowSpinnerState(true);
|
||||
// };
|
||||
|
||||
var representationsArr = representationsObj || [];
|
||||
|
||||
const RepresentationsView = (representationsArr) => {
|
||||
//console.log(documentDetailsArr);
|
||||
|
||||
representationsArr = representationsArr.value;
|
||||
return (
|
||||
<>
|
||||
<p>
|
||||
{representationsObj["@odata.count"] > 1
|
||||
? t("case:documents-count-label-1")
|
||||
: t("case:documents-count-label-1a")}{" "}
|
||||
{representationsObj["@odata.count"]}{" "}
|
||||
{
|
||||
representationsObj["@odata.count"] > 1
|
||||
? "representations " //t("case:documents-count-label-2")
|
||||
: "representations " //t("case:documents-count-label-2a")
|
||||
}
|
||||
</p>
|
||||
<dl className="documentList govuk-summary-list govuk-!-margin-bottom-9 results">
|
||||
<div className="govuk-summary-list__row results-headings">
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16 ">
|
||||
{
|
||||
"Type of representation" //t("case:documents-name-label")
|
||||
}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{t("case:documents-doc-type-label")}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{t("case:documents-date-published-label")}
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
{representationsArr.map((item, key) => {
|
||||
let detailsObj = jsonpath.query(
|
||||
item,
|
||||
"$..[?(@.pinswg_representationsid=='" +
|
||||
incidentid +
|
||||
"')]"
|
||||
);
|
||||
detailsObj = item;
|
||||
|
||||
console.log(detailsObj);
|
||||
|
||||
return (
|
||||
<div className="govuk-summary-list__row" key={key}>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||
<a
|
||||
href={
|
||||
"/api/proxy/documents/download/" +
|
||||
detailsObj.pinswg_isharedocumentreference
|
||||
}
|
||||
>
|
||||
<span className="results-visually-hidden">
|
||||
{t("case:documents-name-label")}:
|
||||
</span>
|
||||
{
|
||||
detailsObj[
|
||||
"pinswg_whatkind@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
}
|
||||
</a>
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
{t("case:documents-doc-type-label")}:
|
||||
</span>
|
||||
|
||||
{router.locale == "cy"
|
||||
? jsonpath.query(
|
||||
transLookup,
|
||||
'$..[?(@.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy'
|
||||
)
|
||||
: detailsObj[
|
||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
)}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
{t(
|
||||
"case:documents-date-published-label"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
|
||||
{formatDates(
|
||||
detailsObj[
|
||||
"createdon@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
)}
|
||||
</dd>
|
||||
{/* <dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
{t("case:documents-size-label")}:
|
||||
</span>
|
||||
92
|
||||
</dd> */}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</dl>
|
||||
{/* <PaginationControl
|
||||
currentPage={currentPage}
|
||||
searchResultsObj={documentDetailsObj}
|
||||
// spinnerState={spinnerState}
|
||||
getDocumentResults={getDocumentResults}
|
||||
/> */}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const representationDetailsObj = async () => {
|
||||
let docObj = await getRepresentations(incidentid).then((data) => {
|
||||
console.log(data);
|
||||
setRepresentationSearchState(true);
|
||||
setRepresentations(data);
|
||||
return data;
|
||||
});
|
||||
|
||||
return docObj;
|
||||
};
|
||||
const representationResultsObj = representationDetailsObj();
|
||||
}, [incidentid, setRepresentations]);
|
||||
|
||||
function formatDates(dateObj) {
|
||||
var dateObj = new Date(dateObj);
|
||||
var dd = String(dateObj.getDate()).padStart(2, "0");
|
||||
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
|
||||
var yyyy = dateObj.getFullYear();
|
||||
|
||||
return dd + "/" + mm + "/" + yyyy;
|
||||
}
|
||||
|
||||
const pagesCount = Math.ceil(representationsObj["@odata.count"] / 10);
|
||||
|
||||
let currentPage = 0;
|
||||
|
||||
currentPage = decodeURI(representationsObj["@odata.nextLink"]).split(
|
||||
"skiptoken="
|
||||
)[1];
|
||||
currentPage =
|
||||
typeof currentPage != "undefined"
|
||||
? parseInt(
|
||||
decodeURI(currentPage)
|
||||
.split('pagenumber="')[1]
|
||||
.slice(
|
||||
0,
|
||||
decodeURI(currentPage)
|
||||
.split('pagenumber="')[1]
|
||||
.indexOf('"')
|
||||
) - 1
|
||||
)
|
||||
: pagesCount;
|
||||
|
||||
//const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||
|
||||
// let spinnerState = () => {
|
||||
// showSpinnerState == true
|
||||
// ? setShowSpinnerState(false)
|
||||
// : setShowSpinnerState(true);
|
||||
// };
|
||||
|
||||
const [showReperesentationSearchState, setRepresentationSearchState] =
|
||||
useState(false);
|
||||
|
||||
let representationSearchState = () => {
|
||||
showReperesentationSearchState == true
|
||||
? setRepresentationSearchState(false)
|
||||
: setRepresentationSearchState(true);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="card">
|
||||
<div className="govuk-grid-row card-body">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h2>Representations</h2>
|
||||
{_.isEmpty(representationsObj) ? (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-two-thirds">
|
||||
<h3>
|
||||
{showReperesentationSearchState == false
|
||||
? "Checking for representations "
|
||||
: t(
|
||||
"case:documents-non-available-label"
|
||||
)}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
RepresentationsView(representationsArr)
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<LoadingOverlay
|
||||
{/* <LoadingOverlay
|
||||
active={showSpinnerState}
|
||||
spinner
|
||||
text={t("common:spinner-searching")}
|
||||
/>
|
||||
/> */}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default RepresentationList;
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
...state,
|
||||
};
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
setRepresentations: (representationObj) => {
|
||||
dispatch(setRepresentations(representationObj));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(RepresentationList);
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
|
||||
const CookiePolicy = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const { whichError } = props;
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
return (
|
||||
<main
|
||||
className="govuk-main-wrapper govuk-!-padding-top-9 govuk-main-wrapper--auto-spacing"
|
||||
id="main-content"
|
||||
role="main"
|
||||
>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||
{t("cookies:cookie-policy-title-heading")}
|
||||
</h1>
|
||||
<div class="page__intro">
|
||||
<p className="govuk-body">
|
||||
{t("cookies:cookie-policy-intro-paragraph")}
|
||||
</p>
|
||||
</div>
|
||||
<h2 className="govuk-heading-l ">
|
||||
{t("cookies:cookie-policy-sub-heading-one")}
|
||||
</h2>
|
||||
|
||||
<p className="govuk-body">
|
||||
{t("cookies:cookie-policy-paragraph-one")}
|
||||
</p>
|
||||
|
||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9 results">
|
||||
<div class="govuk-summary-list__row results-headings">
|
||||
<dd class="govuk-summary-list__key govuk-!-font-size-16 results_wider ">
|
||||
{t("cookies:cookie-policy-list-heading-one")}
|
||||
</dd>
|
||||
<dd class="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{t("cookies:cookie-policy-list-heading-two")}
|
||||
</dd>
|
||||
<dd class="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{t("cookies:cookie-policy-list-heading-three")}
|
||||
</dd>
|
||||
<dd class="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{t("cookies:cookie-policy-list-heading-four")}
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
<div class="govuk-summary-list__row">
|
||||
<dd class="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||
<span class="results-visually-hidden">
|
||||
{t(
|
||||
"cookies:cookie-policy-list-heading-one"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{t(
|
||||
"cookies:cookie-policy-list-row-one-item-one"
|
||||
)}
|
||||
</dd>
|
||||
<dd class="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span class="results-visually-hidden">
|
||||
{t(
|
||||
"cookies:cookie-policy-list-heading-two"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{t(
|
||||
"cookies:cookie-policy-list-row-one-item-two"
|
||||
)}
|
||||
</dd>
|
||||
<dd class="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span class="results-visually-hidden">
|
||||
{t(
|
||||
"cookies:cookie-policy-list-heading-three"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{t(
|
||||
"cookies:cookie-policy-list-row-one-item-three"
|
||||
)}
|
||||
</dd>
|
||||
<dd class="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span class="results-visually-hidden">
|
||||
{t(
|
||||
"cookies:cookie-policy-list-heading-four"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{t(
|
||||
"cookies:cookie-policy-list-row-one-item-four"
|
||||
)}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="govuk-summary-list__row">
|
||||
<dd class="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||
<span class="results-visually-hidden">
|
||||
{t(
|
||||
"cookies:cookie-policy-list-heading-one"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{t(
|
||||
"cookies:cookie-policy-list-row-two-item-one"
|
||||
)}
|
||||
</dd>
|
||||
<dd class="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span class="results-visually-hidden">
|
||||
{t(
|
||||
"cookies:cookie-policy-list-heading-two"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{t(
|
||||
"cookies:cookie-policy-list-row-two-item-two"
|
||||
)}{" "}
|
||||
</dd>
|
||||
<dd class="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span class="results-visually-hidden">
|
||||
{t(
|
||||
"cookies:cookie-policy-list-heading-three"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{t(
|
||||
"cookies:cookie-policy-list-row-two-item-three"
|
||||
)}
|
||||
</dd>
|
||||
<dd class="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span class="results-visually-hidden">
|
||||
{t(
|
||||
"cookies:cookie-policy-list-heading-four"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{t(
|
||||
"cookies:cookie-policy-list-row-two-item-four"
|
||||
)}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<p className="govuk-body">
|
||||
{t("cookies:cookie-policy-browser-find-out-more")}{" "}
|
||||
<a
|
||||
href={t(
|
||||
"cookies:cookie-policy-browser-find-out-more"
|
||||
)}
|
||||
>
|
||||
{t(
|
||||
"cookies:cookie-policy-browser-find-out-more-link"
|
||||
)}
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
|
||||
<h2 className="govuk-heading-l ">
|
||||
{t("cookies:cookie-policy-sub-heading-two")}
|
||||
</h2>
|
||||
|
||||
<p className="govuk-body">
|
||||
{t("cookies:cookie-policy-paragraph-two")}
|
||||
</p>
|
||||
|
||||
<p className="govuk-body">
|
||||
{t("cookies:cookie-policy-paragraph-three")}
|
||||
<a href="https://policies.google.com/privacy">
|
||||
{t("cookies:cookie-policy-paragraph-three-link-a")}
|
||||
</a>
|
||||
, {t("cookies:cookie-policy-paragraph-three-a")}{" "}
|
||||
<a href="https://policies.google.com/terms">
|
||||
{t("cookies:cookie-policy-paragraph-three-link-b")}
|
||||
</a>{" "}
|
||||
{t("cookies:cookie-policy-paragraph-three-b")}
|
||||
</p>
|
||||
|
||||
<p className="govuk-body">
|
||||
{t("cookies:cookie-policy-paragraph-four")}
|
||||
</p>
|
||||
|
||||
<p className="govuk-body">
|
||||
{t("cookies:cookie-policy-paragraph-five")}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
};
|
||||
|
||||
export default CookiePolicy;
|
||||
@@ -28,7 +28,7 @@ const CookieManagementMain = (props) => {
|
||||
let expDate = new Date(now);
|
||||
expDate.setDate(now.getDate() + 365);
|
||||
|
||||
cookie.set("pinsCookiePolicy", JSON.stringify(values).toString(), {
|
||||
cookie.set("CookiePolicy", JSON.stringify(values).toString(), {
|
||||
expires: expDate,
|
||||
});
|
||||
cookie.set("planning_casework", true, {
|
||||
@@ -39,22 +39,20 @@ const CookieManagementMain = (props) => {
|
||||
let cookieCheck = parseCookies();
|
||||
|
||||
let cookieObj =
|
||||
typeof cookieCheck.pinsCookiePolicy == "undefined"
|
||||
typeof cookieCheck.CookiePolicy == "undefined"
|
||||
? {}
|
||||
: JSON.parse(cookieCheck.pinsCookiePolicy);
|
||||
: JSON.parse(cookieCheck.CookiePolicy);
|
||||
|
||||
const [usageState, setUsageState] = useState(
|
||||
typeof cookieCheck.pinsCookiePolicy == "undefined"
|
||||
? null
|
||||
: cookieObj.usage
|
||||
typeof cookieCheck.CookiePolicy == "undefined" ? null : cookieObj.usage
|
||||
);
|
||||
const [communicationsState, setCommunicationsState] = useState(
|
||||
typeof cookieCheck.pinsCookiePolicy == "undefined"
|
||||
typeof cookieCheck.CookiePolicy == "undefined"
|
||||
? null
|
||||
: cookieObj.communications
|
||||
);
|
||||
const [settingsState, setSettingsState] = useState(
|
||||
typeof cookieCheck.pinsCookiePolicy == "undefined"
|
||||
typeof cookieCheck.CookiePolicy == "undefined"
|
||||
? null
|
||||
: cookieObj.settings
|
||||
);
|
||||
@@ -88,7 +86,7 @@ const CookieManagementMain = (props) => {
|
||||
{t("cookies:cookie-title-heading")}
|
||||
</h1>
|
||||
<hr className="govuk-section-break govuk-section-break--visible" />
|
||||
{typeof cookieCheck.pinsCookiePolicy == "undefined" ? (
|
||||
{typeof cookieCheck.CookiePolicy == "undefined" ? (
|
||||
<>
|
||||
<div className="govuk-inset-text paragraph--type--call-out-message">
|
||||
<h2 className="govuk-heading-l">
|
||||
@@ -107,8 +105,7 @@ const CookieManagementMain = (props) => {
|
||||
|
||||
<div
|
||||
className={
|
||||
typeof cookieCheck.pinsCookiePolicy !=
|
||||
"undefined"
|
||||
typeof cookieCheck.CookiePolicy != "undefined"
|
||||
? "govuk-body govuk-!-margin-top-5"
|
||||
: "govuk-body"
|
||||
}
|
||||
@@ -226,7 +223,7 @@ const CookieManagementMain = (props) => {
|
||||
</div>
|
||||
</legend>
|
||||
</fieldset>
|
||||
<fieldset className="govuk-fieldset">
|
||||
{/* <fieldset className="govuk-fieldset">
|
||||
<legend className="govuk-fieldset__legend">
|
||||
<h4 className="govuk-!-font-size-27">
|
||||
{t(
|
||||
@@ -297,7 +294,7 @@ const CookieManagementMain = (props) => {
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</fieldset> */}
|
||||
|
||||
<fieldset className="govuk-fieldset">
|
||||
<legend className="govuk-fieldset__legend">
|
||||
@@ -399,16 +396,17 @@ const CookieManagementMain = (props) => {
|
||||
)}
|
||||
</p>
|
||||
<p className="govuk-body">
|
||||
<a
|
||||
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
|
||||
<Link
|
||||
href={t(
|
||||
"cookies:cookie-settings-essential-link"
|
||||
)}
|
||||
>
|
||||
{t(
|
||||
"cookies:cookie-settings-essential-link-label"
|
||||
)}
|
||||
</a>
|
||||
<a className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold">
|
||||
{t(
|
||||
"cookies:cookie-settings-essential-link-label"
|
||||
)}
|
||||
</a>
|
||||
</Link>
|
||||
</p>
|
||||
</legend>
|
||||
</fieldset>
|
||||
|
||||
Reference in New Issue
Block a user