Removed proxy and added api calls, has gov gateway auth

This commit is contained in:
2022-01-20 10:56:26 +00:00
parent 6f37064eba
commit 5a536e158c
127 changed files with 5829 additions and 3097 deletions
+4 -3
View File
@@ -82,10 +82,11 @@ let PersonalDetails = (props) => {
let errorsobj = {};
const required = (value) => (value ? undefined : "Is required");
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 email = (value) =>
value && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(value)
? "Invalid email address"
: undefined;
value && !emailRegex.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(
+12 -2
View File
@@ -23,6 +23,7 @@ const RenderTextfield = ({
input,
type,
errorMsg,
disabled,
meta: { touched, error },
...custom
}) => {
@@ -39,6 +40,7 @@ const RenderTextfield = ({
name={name}
id={id}
type={type}
disabled={disabled}
/>
{touched && error && (
<span
@@ -69,6 +71,8 @@ const RegisterForm = (props) => {
value,
setRegisterFormComplete,
setAccountCreatedComplete,
loggedInUserEmail,
emailaddress1,
} = props;
let { t, lang } = useTranslation();
@@ -135,7 +139,8 @@ const RegisterForm = (props) => {
<h2 className="govuk-fieldset__heading">
{t(
"account:register-new-account-sub-heading-1"
)}
)}{" "}
{loggedInUserEmail}
</h2>
</legend>
<Field
@@ -176,6 +181,7 @@ const RegisterForm = (props) => {
label={t(
"account:register-new-account-email-address-label"
)}
disabled
/>
<Field
name="telephone1"
@@ -327,13 +333,16 @@ const RegisterForm = (props) => {
);
};
const mapStateToProps = (state) => {
const mapStateToProps = (state, props) => {
return {
search: state.search,
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
//form: state.form,
initialValues: {
emailaddress1: props.loggedInUserEmail,
},
};
};
@@ -353,6 +362,7 @@ export default connect(
)(
reduxForm({
form: "accountRegisterForm",
enableReinitialize: true,
destroyOnUnmount: false,
})(RegisterForm)
);
+65 -8
View File
@@ -107,10 +107,7 @@ const Breadcrumbs = (props) => {
) : (
""
)}
{router.pathname ==
(router.locale == "cy"
? "/canlyniadauchwilio"
: "/searchresults") ? (
{router.pathname == "/searchresults" ? (
<>
<li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-search-results")}
@@ -128,6 +125,28 @@ const Breadcrumbs = (props) => {
) : (
""
)}
{router.pathname == "/myportal/advancedsearch" ? (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
: "/myportal"
}
>
<a className="govuk-breadcrumbs__link">
{t("common:breadcrumb-my-portal")}
</a>
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-advanced-search")}
</li>
</>
) : (
""
)}
{router.pathname == "/advancedsearchresults" ? (
<>
{" "}
@@ -156,6 +175,47 @@ const Breadcrumbs = (props) => {
) : (
""
)}
{router.pathname ==
"/myportal/advancedsearchresults" ? (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
: "/myportal"
}
>
<a className="govuk-breadcrumbs__link">
{t("common:breadcrumb-my-portal")}
</a>
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? router.locale +
"/myportal/advancedsearch"
: "/myportal/advancedsearch"
}
>
<a className="govuk-breadcrumbs__link">
{t(
"common:breadcrumb-advanced-search"
)}
</a>
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{t(
"common:breadcrumb-advanced-search-results"
)}
</li>
</>
) : (
""
)}
{router.pathname == "/newappeal" ? (
<>
<li className="govuk-breadcrumbs__list-item">
@@ -442,10 +502,7 @@ const Breadcrumbs = (props) => {
) : (
""
)}
{router.pathname ==
(router.locale == "cy"
? "/manyliondns"
: "/dnsdetails") ? (
{router.pathname == "/dnsdetails" ? (
<>
<li className="govuk-breadcrumbs__list-item">
<Link
+12 -31
View File
@@ -12,11 +12,10 @@ import CryptoJS from "crypto-js";
import {
getBasicSearch,
getBasicSearchDetails,
getSearchDocumentDetails1,
getSearchDocumentHistory1,
getSearchDocumentHistory1Paged,
getSearchDocumentDetails1Paged,
getToken,
getSearchDocumentDetails,
getSearchDocumentHistory,
getSearchDocumentHistoryPaged,
getSearchDocumentDetailsPaged,
} from "../../actions";
import {
@@ -105,9 +104,9 @@ const DocumentDetails = (props) => {
>
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<a
href={encryptDocReference(
detailsObj.pinswg_isharedocumentreference
)}
href={
detailsObj.pinswg_hashlink
}
>
<span className="results-visually-hidden">
{t(
@@ -191,23 +190,9 @@ const DocumentDetails = (props) => {
);
};
const WORDKEY = process.env.NEXT_PUBLIC_HASHKEY;
const encryptDocReference = (documentRef) => {
var hashlink = CryptoJS.HmacSHA256(
"documents/download/" + documentRef,
CryptoJS.enc.Hex.parse(WORDKEY)
);
hashlink = hashlink.toString(CryptoJS.enc.Hex);
return (
"/api/proxy/documents/download/" + documentRef + "?hash=" + hashlink
);
};
useEffect(() => {
const docDetailsObj = async () => {
let docObj = await getSearchDocumentDetails1(incidentid)
let docObj = await getSearchDocumentDetails(incidentid)
.then((data) => {
//console.log(data);
setDocumentDetails(data);
@@ -239,7 +224,7 @@ const DocumentDetails = (props) => {
console.log(historyDetail.pinswg_documentid);
} else {
historyArr.push(
getSearchDocumentHistory1(
getSearchDocumentHistory(
historyDetail.pinswg_documentid
)
);
@@ -252,8 +237,7 @@ const DocumentDetails = (props) => {
}, [incidentid, setDocumentHistory, setDocumentDetails]);
const getDocumentResults = (pageNumber) => {
//console.log(advancedSearch, searchString, pageNumber);
getSearchDocumentDetails1Paged(incidentid, pageNumber)
getSearchDocumentDetailsPaged(incidentid, pageNumber)
.then((data) => {
//console.log(data);
setDocumentDetails(data);
@@ -269,10 +253,7 @@ const DocumentDetails = (props) => {
};
const getDocumentDetails = async () => {
let docObj = await getSearchDocumentDetails1Paged(
incidentid,
pageNumber
)
let docObj = await getSearchDocumentDetailsPaged(incidentid, pageNumber)
.then((data) => {
//console.log(data);
setDocumentDetails(data);
@@ -303,7 +284,7 @@ const DocumentDetails = (props) => {
console.log(historyDetail.pinswg_documentid);
} else {
historyArr.push(
getSearchDocumentHistory1Paged(
getSearchDocumentHistoryPaged(
historyDetail.pinswg_documentid,
pageNumber
)
+1 -6
View File
@@ -73,12 +73,7 @@ const RepresentationList = (props) => {
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
}
>
<a href={detailsObj.pinswg_hashlink}>
<span className="results-visually-hidden">
{t("case:documents-name-label")}:
</span>
+30 -33
View File
@@ -121,23 +121,28 @@ const CaseSummary = (props) => {
] || "not entered"}
</dd>
</div>
{_.has(detailsObj, "pinswg_agentcontactname") ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-agent-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_agentcontactname"
)
? detailsObj.pinswg_agentcontactname
: ""}
</dd>
</div>
) : (
""
)}
{detailsObj.pinswg_agentcontactname != null &&
(_.has(
detailsObj,
"pinswg_agentcontactname"
) ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-agent-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(
detailsObj,
"pinswg_agentcontactname"
)
? detailsObj.pinswg_agentcontactname
: ""}
</dd>
</div>
) : (
""
))}
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-site-address-label")}
@@ -235,7 +240,7 @@ const CaseSummary = (props) => {
<div>
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<h1>Not details currently held</h1>
<h1>{t("case:summary-no-details-label")}</h1>
</div>
</div>
</div>
@@ -601,23 +606,15 @@ const CaseSummary = (props) => {
<Link
href={
router.locale == "cy"
? "/achos"
: "/case"
? "/canlyniadauchwilio?q=" +
item.title +
"&lk=1"
: "/searchresults?q=" +
item.title +
"&lk=1"
}
>
<a
onClick={() => {
setCurrentReference({
"currentReference": item.title,
"currentType":
"searchResultsObj",
"incidentid": item.incidentid,
});
}}
className=""
>
{item.title}
</a>
<a className="">{item.title}</a>
</Link>
</li>
);
+43 -38
View File
@@ -128,12 +128,12 @@ const Pinswg_dnsid = (props) => {
transLookup,
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
@@ -245,44 +245,49 @@ const Pinswg_dnsid = (props) => {
detailsObj.pinswg_recommendation +
'")].value_cy'
)
: detailsObj.pinswg_recommendation ||
t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-website-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj.pinswg_webaddress +
'")].value_cy'
)
: (
<a
target="_blank"
rel="noreferrer"
href={
detailsObj.pinswg_webaddress
}
>
{
detailsObj.pinswg_webaddress
}
</a>
) ||
t(
"case:summary-no-date-entered-label"
)}
: detailsObj.pinswg_recommendation}
</dd>
</div>
{detailsObj.pinswg_webaddress != null && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-website-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj.pinswg_webaddress +
'")].value_cy'
)
: (
<a
target="_blank"
rel="noreferrer"
href={
detailsObj.pinswg_webaddress.indexOf(
"https://"
)
? "https://" +
detailsObj.pinswg_webaddress
: detailsObj.pinswg_webaddress
}
>
{
detailsObj.pinswg_webaddress
}
</a>
) ||
t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
)}
</dl>
</div>
</div>
@@ -250,26 +250,28 @@ const Pinswg_electricityactid = (props) => {
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-website-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj.pinswg_webaddress +
'")].value_cy'
)
: detailsObj.pinswg_webaddress ||
t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
{detailsObj.pinswg_webaddress != null && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-website-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj.pinswg_webaddress +
'")].value_cy'
)
: detailsObj.pinswg_webaddress ||
t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
)}
</dl>
</div>
</div>
@@ -250,26 +250,28 @@ const Pinswg_harbourrevisionorderid = (props) => {
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-website-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj.pinswg_webaddress +
'")].value_cy'
)
: detailsObj.pinswg_webaddress ||
t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
{detailsObj.pinswg_webaddress != null && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-website-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj.pinswg_webaddress +
'")].value_cy'
)
: detailsObj.pinswg_webaddress ||
t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
)}
</dl>
</div>
</div>
@@ -102,26 +102,28 @@ const Pinswg_transportandworkactid = (props) => {
)}
</dd>
</div>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-website-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj.pinswg_webaddress +
'")].value_cy'
)
: detailsObj.pinswg_webaddress ||
t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
{detailsObj.pinswg_webaddress != null && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-website-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
detailsObj.pinswg_webaddress +
'")].value_cy'
)
: detailsObj.pinswg_webaddress ||
t(
"case:summary-no-date-entered-label"
)}
</dd>
</div>
)}
</dl>
</div>
</div>
+31 -12
View File
@@ -20,7 +20,7 @@ const CookieManagementMain = (props) => {
Object.assign(values, {
"essential": "accepted",
"usage": usageState,
"communications": communicationsState,
// "communications": communicationsState,
"settings": settingsState,
});
@@ -42,14 +42,15 @@ const CookieManagementMain = (props) => {
";expires=Thu, 01 Jan 1970 00:00:01 GMT";
}
usageState == "revoked" && delete_cookie("CookiePolicy", "/"),
delete_cookie("_ga", "/"),
usageState == "revoked" && delete_cookie("_ga", "/"),
delete_cookie("_gid", "/");
cookie.set("planning_casework", true, {
expires: expDate,
path: "/",
});
setSavedState(true);
};
let cookieCheck = parseCookies();
@@ -59,14 +60,16 @@ const CookieManagementMain = (props) => {
? {}
: JSON.parse(cookieCheck.CookiePolicy);
const [savedState, setSavedState] = useState(false);
const [usageState, setUsageState] = useState(
typeof cookieCheck.CookiePolicy == "undefined" ? null : cookieObj.usage
);
const [communicationsState, setCommunicationsState] = useState(
typeof cookieCheck.CookiePolicy == "undefined"
? null
: cookieObj.communications
);
// const [communicationsState, setCommunicationsState] = useState(
// typeof cookieCheck.CookiePolicy == "undefined"
// ? null
// : cookieObj.communications
// );
const [settingsState, setSettingsState] = useState(
typeof cookieCheck.CookiePolicy == "undefined"
? null
@@ -78,9 +81,9 @@ const CookieManagementMain = (props) => {
case "usage":
setUsageState(value);
break;
case "communications":
setCommunicationsState(value);
break;
// case "communications":
// setCommunicationsState(value);
// break;
case "settings":
setSettingsState(value);
break;
@@ -102,6 +105,22 @@ const CookieManagementMain = (props) => {
{t("cookies:cookie-title-heading")}
</h1>
<hr className="govuk-section-break govuk-section-break--visible" />
{savedState && (
<div
id="cookieSettingsMessageSuccess"
className="govuk-inset-text paragraph--type--call-out-message call-out-type-positive-alert-message"
>
<h2 className="govuk-heading-l">
<strong>
{t("cookies:cookie-saved-heading")}
</strong>
</h2>
<p className="govuk-body">
{t("cookies:cookie-saved-paragraph")}
</p>
</div>
)}
{typeof cookieCheck.CookiePolicy == "undefined" ? (
<>
<div className="govuk-inset-text paragraph--type--call-out-message">
@@ -455,7 +474,7 @@ const mapStateToProps = (state) => {
return {
initialValues: {
usage: state.accountDetails.cookieObj.usage,
communications: state.accountDetails.cookieObj.communications,
//communications: state.accountDetails.cookieObj.communications,
settings: state.accountDetails.cookieObj.settings,
},
};
+6 -10
View File
@@ -219,11 +219,9 @@ export default function Footer(props) {
<li className="govuk-footer__inline-list-item">
<Link
href={
router.locale == "cy"
? "/preifatrwydd"
: "/privacy"
}
href={t(
"common:footer-privacy-link"
)}
>
<a
id="aPrivacy"
@@ -238,11 +236,9 @@ export default function Footer(props) {
<li className="govuk-footer__inline-list-item">
<Link
href={
router.locale == "cy"
? "/telerau-ac-amodau"
: "/terms-and-conditions"
}
href={t(
"common:footer-terms-conditions-link"
)}
>
<a
id="aTermsConds"
+23 -21
View File
@@ -101,7 +101,7 @@ export default function AccessibilityCY() {
<li>
Anfonwch neges e-bost at:{" "}
<a
className="govuk-link--no-underline govuk-!-font-weight-bold"
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
href="mailto:PEDW.GwaithAchos@llyw.cymru"
>
PEDW.GwaithAchos@llyw.cymru
@@ -110,7 +110,7 @@ export default function AccessibilityCY() {
<li>
Ffoniwch:{" "}
<a
className="govuk-link--no-underline govuk-!-font-weight-bold"
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
href="tel:03000 604400"
>
03000 604400
@@ -128,7 +128,7 @@ export default function AccessibilityCY() {
ffoniwch ni neu anfonwch neges e-bost atom i gael
cyfarwyddiadau;{" "}
<a
className="govuk-link--no-underline govuk-!-font-weight-bold"
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
href="https://llyw.cymru/penderfyndiadau-cynllunio-ac-amgylchedd-cymru/cysylltwch-ni"
>
Cysylltwch â Ni
@@ -174,9 +174,14 @@ export default function AccessibilityCY() {
<h3>Statws cydymffurfio</h3>
<p>
Maer wefan hon yn cydymffurfion rhannol â Chanllawiau
Hygyrchedd Cynnwys y We (WCAG) fersiwn 2.1 safon Lefel AA,
o ganlyniad ir achosion o ddiffyg
Maer wefan hon yn cydymffurfion rhannol â{" "}
<a
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
href="https://www.w3.org/TR/WCAG21/"
>
Chanllawiau Hygyrchedd Cynnwys y We (WCAG) fersiwn 2.1
</a>{" "}
safon Lefel AA, o ganlyniad ir achosion o ddiffyg
cydymffurfio/eithriadau neur achosion o ddiffyg
cydymffurfio ac eithriadau] a restrir isod.
</p>
@@ -184,26 +189,23 @@ export default function AccessibilityCY() {
<h3>Diffyg cydymffurfio âr rheoliadau hygyrchedd</h3>
<p>
Nid oes testun amgen ar gyfer rhai delweddau, felly ni all
pobl syn defnyddio rhaglen darllen sgrin gael at y
wybodaeth. Mae hyn yn methu maen prawf llwyddiant 1.1.1
(cynnwys nad ywn destun).
</p>
<p>
Bwriadwn ychwanegu testun amgen at yr holl ddelweddau erbyn
mis Medi 2020. Pan fyddwn yn cyhoeddi cynnwys newydd, byddwn
yn sicrhau bod ein defnydd o ddelweddaun bodloni safonau
hygyrchedd.
Mae rhai or dogfennau a gyhoeddir ar-lein trwyr gwasanaeth
hwn yn cynnwys diagramau cynllunio syn dechnegol eu natur i
raddau helaeth. Er y cydnabyddwn efallai na fydd pob agwedd
ar gynnwys or fath yn gwbl hygyrch, rydym wedi ceisio eu
gwella trwy gynyddu maint y testun sylfaenol lle y bon
bosibl, ac ychwanegu disgrifiadau testun ystyrlon i ategu
unrhyw wybodaeth weledol bwysig.
</p>
<h3>Paratoir datganiad hygyrchedd hwn</h3>
<p>
Paratowyd y datganiad hwn ar [TBC]. Fei hadolygwyd
ddiwethaf ar [TBC when signed off].
Paratowyd y datganiad hwn ar 22/11/2021. Fei hadolygwyd
ddiwethaf ar 02/12/2021.
</p>
<p>
{/* <p>
Profwyd y wefan hon ddiwethaf ar [TBC]. Cynhaliwyd y prawf
gan [add name of organisation that carried out test, or
indicate that you did your own testing].
@@ -217,8 +219,8 @@ export default function AccessibilityCY() {
<p>
Gallwch ddarllen yr adroddiad llawn ar y prawf hygyrchedd
[add link to report].
</p>
[add link to report].
</p>*/}
</div>
</div>
);
+23 -19
View File
@@ -96,7 +96,7 @@ export default function AccessibilityEN() {
<li>
Email:{" "}
<a
className="govuk-link--no-underline govuk-!-font-weight-bold"
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
href="mailto:PEDW.Casework@gov.wales"
>
PEDW.Casework@gov.wales
@@ -105,7 +105,7 @@ export default function AccessibilityEN() {
<li>
Call:{" "}
<a
className="govuk-link--no-underline govuk-!-font-weight-bold"
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
href="tel:03000 604400"
>
03000 604400
@@ -150,7 +150,7 @@ export default function AccessibilityEN() {
<p>
Find out how to{" "}
<a
className="govuk-link--no-underline govuk-!-font-weight-bold"
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
href="https://gov.wales/planning-and-environment-decisions-wales/contact-us"
>
contact us
@@ -171,33 +171,37 @@ export default function AccessibilityEN() {
<h3>Compliance status</h3>
<p>
This website is partially compliant with the Web Content
Accessibility Guidelines version 2.1 Level AA standard,
due to the non-compliances/the exemptions or the
non-compliances and exemptions] listed below.
This website is partially compliant with the{" "}
<a
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
href="https://www.w3.org/TR/WCAG21/"
>
Web Content Accessibility Guidelines version 2.1
</a>
Level AA standard, due to the non-compliances listed
below.
</p>
<h3>Non-compliance with the accessibility regulations</h3>
<p>
Some images do not have a text alternative, so people using
a screen reader cannot access the information. This fails
WCAG 2.1 success criterion 1.1.1 (non-text content).
</p>
<p>
We plan to add text alternatives for all images by September
2020. When we publish new content well make sure our use of
images meets accessibility standards.
Some documents published online via this service contain
planning diagrams that are largely technical in nature.
While we acknowledge that all aspects of such content may
not be fully accessible, we have endeavoured to improve them
by increasing the base text size where possible, and adding
meaningful text descriptions to supplement any important
visual information.
</p>
<h3>Preparation of this accessibility statement</h3>
<p>
This statement was prepared on [TBC]. It was last reviewed
on [TBC when signed off].
This statement was prepared on 22/11/2021. It was last
reviewed on 02/12/2021.
</p>
<p>
{/* <p>
This website was last tested on [TBC]. The test was carried
out by [add name of organisation that carried out test, or
indicate that you did your own testing].
@@ -212,7 +216,7 @@ export default function AccessibilityEN() {
<p>
You can read the full accessibility test report [add link to
report].
</p>
</p> */}
</div>
</div>
);
File diff suppressed because it is too large Load Diff
+17 -16
View File
@@ -757,20 +757,23 @@ export default function PrivacyEN() {
We provide your information to the relevant Welsh
Minister who make the final decision on the applications
and appeals we examine via:
<ul>
<li>
The Department for Business, Energy, and
Industrial Strategy
</li>
<li>The Department for Transport</li>
<li>
The Department for Environment, Food and Rural
Affairs and
</li>
<li>
The Ministry of Housing, Communities and Local
Government.
</li>
</ul>
</li>
<li>
The Department for Business, Energy, and Industrial
Strategy
</li>
<li>The Department for Transport</li>
<li>
The Department for Environment, Food and Rural Affairs
and
</li>
<li>
The Ministry of Housing, Communities and Local
Government.
</li>
<li>
For fairness to the other parties interested in a case,
we need to share your representations as indicated
@@ -857,9 +860,7 @@ export default function PrivacyEN() {
This will normally be set out in our guidance, but if you
have specific queries or concerns in respect of a particular
case then please contact the case officer who, if necessary,
will discuss the matter with - process to be established,
can this be internal to PEDW or should it be sent up the
line?.
will discuss the matter with PEDW.
</p>
<h3>10. Do we use any data processors? </h3>
<p>
+3
View File
@@ -30,6 +30,9 @@ const Header = (props) => {
"/dnsdetails",
"/404",
"/account/register",
"/myportal/error",
"/accessibility",
"/details-about-cookies",
];
const hasContactLink = [
"/dns",
-1
View File
@@ -92,7 +92,6 @@ let CaseSearch = (props) => {
? "/canlyniadauchwilio"
: "/searchresults",
query: { q: values.basicSearch.trim() },
shallow: true,
});
};
+145 -41
View File
@@ -108,8 +108,15 @@ const RenderPasswordfield = ({
let Login = (props) => {
let { t } = useTranslation();
const { handleSubmit, pristine, reset, submitting, setLoggedInUserId } =
props;
const {
handleSubmit,
pristine,
reset,
submitting,
setLoggedInUserId,
GG_CLIENT_ID,
GG_REDIRECT_URI,
} = props;
const router = useRouter();
const { locale } = router;
@@ -117,6 +124,17 @@ let Login = (props) => {
// const [showSpinnerState, setShowSpinnerState] = useState(false);
const [validLoginID, setValidLoginID] = useState(null);
// console.log(
// "built login url path:",
// props.govGateway.config.authorization_endpoint +
// "?response_type=code&scope=openid&client_id=" +
// GG_CLIENT_ID +
// "&redirect_uri=" +
// GG_REDIRECT_URI +
// "&ui_locales=" +
// (router.locale == "cy" ? "cy" : "en-GB")
// );
// let spinnerState = () => {
// showSpinnerState == true
// ? setShowSpinnerState(false)
@@ -161,13 +179,35 @@ let Login = (props) => {
: "";
}, [cookies.pinsUser, router]);
const govGatwayLoginRedirect = () => {
let ggUrl =
props.govGateway.config.authorization_endpoint +
"?response_type=code&scope=openid&client_id=" +
GG_CLIENT_ID +
"&redirect_uri=" +
GG_REDIRECT_URI +
"&ui_locales=" +
(router.locale == "cy" ? "cy" : "en-GB");
console.log("login Url:", ggUrl);
router.replace(ggUrl);
};
const govGatwayForgottenLink = () => {
let ggUrl =
props.govGateway.config.authorization_endpoint +
"/login/forgot-password";
router.replace(ggUrl);
};
return (
<div className="card" id="login-card">
<form onSubmit={handleSubmit(onHandleSubmit)}>
<div className="card-body active">
<h3 className="heading-small card-heading">
{t("home:login-card-title")}
</h3>
<div className="card-body active">
<h3 className="heading-small card-heading">
{t("home:login-card-title")}
</h3>{" "}
<form onSubmit={handleSubmit(onHandleSubmit)}>
{validLoginID == false && (
<div className="govuk-error-message govuk-form-group--error">
Incorrect username or password
@@ -210,46 +250,109 @@ let Login = (props) => {
/>
<div className="govuk-form-group">
{/* <Link
href={
router.locale == "cy"
? "/fymhorth"
: "/myportal"
}
>
<a className="govuk-button">
{t("home:login-card-button")}
</a>
</Link> */}
<button type="submit" className="govuk-button">
{t("home:login-card-button")}
</button>
</div>
<div className="govuk-form-group govuk-!-margin-top-4">
<p className="govuk-body-s">
{t("home:login-card-register-label")}{" "}
<Link
href={
router.locale == "cy"
? "/cyfrif/cofrestr"
: "/account/register"
}
</form>
<div className="govuk-form-group govuk-!-margin-top-4">
<p className="govuk-body-xs">
<a
onClick={() => {
govGatwayLoginRedirect();
}}
className="govuk-button withChevron govuk-button-cta"
>
{t("home:login-via-gov-gateway-label")}
</a>
</p>
<p className="govuk-body-s">
{t("home:login-card-register-label")}{" "}
<Link
href={
router.locale == "cy"
? "/cyfrif/cofrestr"
: "/account/register"
}
>
<a className="govuk-link--no-underline">
{t("home:login-card-register-link")}
</a>
</Link>
</p>
<p className="govuk-body-s">
<a
onClick={() => {
govGatwayForgottenLink();
}}
className="govuk-link--no-underline"
>
{t("home:login-card-forgotten-label")}{" "}
</a>
</p>
<hr className="govuk-!-margin-bottom-4" />
<p className="govuk-body-s">
{t("home:login-comingsoon-temp-2")}
</p>
<ul>
<li>
<a
className="govuk-link--no-underline"
target="_blank"
href={t("home:login-comingsoon-forms-link-1")}
rel="noreferrer"
>
<a className="govuk-link--no-underline">
{t("home:login-card-register-link")}
</a>
</Link>
</p>
<p className="govuk-body-s">
<Link href="/">
<a className="govuk-link--no-underline">
{t("home:login-card-forgotten-label")}{" "}
</a>
</Link>
</p>
</div>
{t("home:login-comingsoon-forms-label-1")}
</a>
</li>
<li>
{" "}
<a
className="govuk-link--no-underline"
target="_blank"
href={t("home:login-comingsoon-forms-link-2")}
rel="noreferrer"
>
{t("home:login-comingsoon-forms-label-2")}
</a>
</li>
<li>
{" "}
<a
className="govuk-link--no-underline"
target="_blank"
href={t("home:login-comingsoon-forms-link-3")}
rel="noreferrer"
>
{t("home:login-comingsoon-forms-label-3")}
</a>
</li>
<li>
{" "}
<a
className="govuk-link--no-underline"
target="_blank"
href={t("home:login-comingsoon-forms-link-4")}
rel="noreferrer"
>
{t("home:login-comingsoon-forms-label-4")}
</a>
</li>
</ul>
<br />
<p className="govuk-body-s">
{t("home:login-comingsoon-email-link-label")}{" "}
<a
href={"mailto:" + t("home:login-contact-email")}
className="govuk-link--no-underline"
>
{t("home:login-contact-email")}
</a>
</p>
</div>
</form>
</div>
{/* <LoadingOverlay
active={showSpinnerState}
spinner
@@ -271,6 +374,7 @@ const mapStateToProps = (state) => {
watchedCases: state.watchedCases,
myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission,
govGateway: state.govGateway,
};
};
+11 -3
View File
@@ -9,9 +9,10 @@ import Inspectorate from "./homepage/inspectorate";
import CaseComment from "./homepage/casecomment";
import Dns from "./homepage/dns";
export default function MainHome({ children, pages, showLogin }) {
const MainHome = (props) => {
let { t } = useTranslation();
const { showLogin, GG_REDIRECT_URI, GG_CLIENT_ID } = props;
const router = useRouter();
const { locale } = router;
@@ -28,11 +29,18 @@ export default function MainHome({ children, pages, showLogin }) {
<CaseSearch />
<CaseComment />
<Dns />
{showLogin == "true" && <Login />}
{showLogin == "true" && (
<Login
GG_CLIENT_ID={GG_CLIENT_ID}
GG_REDIRECT_URI={GG_REDIRECT_URI}
/>
)}
{/* <Inspectorate /> */}
</div>
</div>
</div>
</main>
);
}
};
export default MainHome;
+122 -39
View File
@@ -9,6 +9,11 @@ import AwaitingSubmission from "./myportal/awaitingsubmission";
import MyRepresentations from "./myportal/myrepresentations";
import WatchedCases from "./myportal/watchedcases";
import YourAccount from "./myportal/youraccount";
import { parseCookies, setCookie, destroyCookie } from "nookies";
import IdleTimer from "react-idle-timer";
import TimeoutModal from "../components/timeoutmodal";
import { useState } from "react";
const MyPortal = (props) => {
let { t } = useTranslation();
@@ -16,49 +21,127 @@ const MyPortal = (props) => {
const router = useRouter();
const { locale } = router;
const [showModal, setShowModal] = useState(false);
const inactiveTimeOut = 12000; // in seconds
const reminderTimeout = 60; // in seconds
let idleTimer = null;
let logoutTimer = null;
let onIdle = () => {
togglePopup();
logoutTimer = setTimeout(() => {
handleLogout();
}, 1000 * reminderTimeout * 1);
};
let togglePopup = () => {
showModal == true ? setShowModal(false) : setShowModal(true);
};
let handleStayLoggedIn = () => {
if (logoutTimer) {
clearTimeout(logoutTimer);
logoutTimer = null;
}
idleTimer.reset();
togglePopup();
};
const handleLogout = () => {
console.log("////////////", "\n", "logout", "\n", "//////////");
destroyCookie({}, "pinsUser"),
window.localStorage.clear(),
router.replace(props.ggLogout);
};
return (
<main className="" id="main-content" role="main">
<div className="servicebanner govuk-!-margin-bottom-4">
<h1>
<img
src={
router.locale == "cy"
? "/assets/images/my-portal-cy.svg"
: "/assets/images/my-portal-en.svg"
}
alt={router.locale == "cy" ? "Fy mhorth" : "My Portal"}
/>
<img
className="pedw_logo"
src="/assets/images/pedw_logo.png"
alt={
router.locale == "cy"
? "Penderfyniadau Cynllunio ac Amgylchedd Cymru"
: "Planning & Environment Decisions Wales"
}
/>
</h1>
</div>
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<div className="flex-container grid-row govuk-body ">
<MakeNewAppeal />
<MyCases myCases={props.myCases} />
<SearchCases />
<AwaitingSubmission
awaitingSubmission={props.awaitingSubmission}
<>
<main className="" id="main-content" role="main">
<div className="servicebanner myportal govuk-!-margin-bottom-4">
<h1>
<img
src={
router.locale == "cy"
? "/assets/images/planning-casework-cy.svg"
: "/assets/images/planning-casework-en.svg"
}
alt={
router.locale == "cy"
? "Fy mhorth"
: "My Portal"
}
/>
<MyRepresentations
myRepresentations={props.myRepresentations}
/>
<WatchedCases watchedCases={props.watchedCases} />
</div>
<div className="flex-container grid-row govuk-body ">
<YourAccount />
</h1>
<div className="serviceBanner_userDetails">
<img
className="user_logo"
src="/assets/images/user.svg"
alt={router.locale == "cy" ? "Defnyddiwr" : "User"}
/>{" "}
<div className="serviceBanner_userDetails_name">
{props.accountDetails.accountDetails.firstname}{" "}
{props.accountDetails.accountDetails.lastname}
</div>
<div>
<Link
href={
router.locale == "cy"
? "/allgofnodi"
: "/logout"
}
>
<a
onClick={() => {
handleLogout();
}}
className="govuk-header__link govuk-!-margin-right-3"
>
{t("common:signout-label")}
</a>
</Link>
</div>
</div>
</div>
</div>
</main>
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<div className="flex-container grid-row govuk-body ">
<MakeNewAppeal />
<MyCases myCases={props.myCases} />
<SearchCases />
<AwaitingSubmission
awaitingSubmission={props.awaitingSubmission}
/>
<MyRepresentations
myRepresentations={props.myRepresentations}
/>
<WatchedCases watchedCases={props.watchedCases} />
</div>
<div className="flex-container grid-row govuk-body ">
<YourAccount />
</div>
</div>
</div>
</main>
<IdleTimer
ref={(ref) => {
idleTimer = ref;
}}
element={document}
stopOnIdle={true}
onActive={console.log(" bbis active", idleTimer)}
onIdle={onIdle}
timeout={1000 * inactiveTimeOut * 1}
/>
<TimeoutModal
remainingCountdown={reminderTimeout}
showModal={showModal}
togglePopup={togglePopup}
handleStayLoggedIn={handleStayLoggedIn}
/>
</>
);
};
+29 -26
View File
@@ -6,7 +6,6 @@ import { setCurrentReference } from "../../store/currentView/action";
import { connect } from "react-redux";
import { parseCookies } from "nookies";
import {
getToken,
getWatchedCasesProxy,
getPortalModuleDetailsProxy,
deleteWatchedCases,
@@ -37,26 +36,21 @@ const TopThree = (props) => {
let showTopThreeArr = showTopThree.value;
const deleteItem = (caseID, topThreeType) => {
let token = getToken();
let cookies = parseCookies();
topThreeType == "watchedCases" &&
deleteWatchedCases(caseID)
.then((data) => data)
.then(() => {
getWatchedCasesProxy(token, cookies.pinsUser).then(
(data) => {
setWatchedCases(data),
getDetails(token, data, "myWatchedCases").then(
(data) => {
setWatchedCasesDetails(data);
}
);
}
);
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
setWatchedCases(data),
getDetails(data, "myWatchedCases").then((data) => {
setWatchedCasesDetails(data);
});
});
});
};
const getDetails = (token, resultsObj, detailsType) => {
const getDetails = (resultsObj, detailsType) => {
//console.log(resultsObj);
let detailsArr = [];
resultsObj = resultsObj.value;
@@ -72,7 +66,6 @@ const TopThree = (props) => {
} else {
detailsArr.push(
getPortalModuleDetailsProxy(
token,
getFormCollectionByID(
searchDetail.pinswg_appealcasetype
).LogicalCollectionName,
@@ -89,6 +82,24 @@ const TopThree = (props) => {
return Promise.all(detailsArr);
};
const getIncidentId = (topThreeType, objArr) => {
switch (topThreeType) {
case "myCases":
return objArr.incidentid;
break;
case "watchedCases":
return objArr._pinswg_watchedcase_value;
break;
case "myRepresentations":
return objArr.ticketnumber;
break;
case "awaitingSubmission":
break;
default:
// code block
}
};
let topThreeOnlyArr = showTopThreeArr.slice(0, 3);
Object.keys(topThreeOnlyArr).map((key, index) => {
topthreeRow.push(
@@ -126,18 +137,10 @@ const TopThree = (props) => {
],
"currentType": topThreeType,
"incidentid":
topThreeType != "watchedCases"
? topThreeType !=
"myRepresentations"
? showTopThreeArr[key]
._pinswg_case_value
: showTopThreeArr[key][
" _pinswg_watchedcase_value"
]
: showTopThreeArr[key][
" _pinswg_watchedcase_value"
],
"incidentid": getIncidentId(
topThreeType,
showTopThreeArr[key]
),
"appealType":
showTopThreeArr[key]
+2 -2
View File
@@ -29,10 +29,10 @@ const ViewAllResults = (props) => {
<Link
href={
router.locale == "cy"
? myportal == "true"
? myportal == true
? "/fymhorth/achos"
: "/achos"
: myportal == "true"
: myportal == true
? "/myportal/case"
: "/case"
}
+81 -24
View File
@@ -9,6 +9,14 @@ import data from "../../data/collections.json";
import LoadingOverlay from "react-loading-overlay";
import transLookup from "../../data/lookuptranslations.json";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
export const minLength = (errorMsg) => (value) =>
value && value.length < 4
? errorMsg //`Must be ${min} characters or more`
: undefined;
let AdvancedSearch = (props) => {
let { t } = useTranslation();
@@ -37,6 +45,53 @@ let AdvancedSearch = (props) => {
? [{}]
: props.LPAData.LPAData.value;
const RenderTextfield = ({
id,
className,
rows,
datafieldname,
name,
label,
input,
hint1,
hint2,
hint3,
meta: { touched, error },
...custom
}) => {
return (
<>
<div className="govuk-form-group">
<div id="basicSearch-hint" className="govuk-hint ">
<label className="govuk-label" htmlFor="caseRef">
{t("search:casereference-label")}
</label>
</div>
<div>
<input
{...input}
className={className}
name={name}
id={id}
/>
{touched && error && (
<span
id={id + "-error"}
className="govuk-error-message govuk-form-group--error"
>
<span className="govuk-visually-hidden">
Error:
</span>{" "}
{error}
</span>
)}
</div>
</div>
</>
);
};
const RenderLPAList = ({
name,
id,
@@ -216,8 +271,6 @@ let AdvancedSearch = (props) => {
);
};
const required = (value) => (value ? undefined : "Required");
// const [showSpinnerState, setShowSpinnerState] = useState(false);
// let spinnerState = () => {
@@ -252,8 +305,8 @@ let AdvancedSearch = (props) => {
router.replace(
(router.locale == "cy"
? "/canlyniadauchwiliouwch"
: "/advancedsearchresults") + searchString,
? "/fymhorth/canlyniadauchwiliouwch"
: "/myportal/advancedsearchresults") + searchString,
null,
{
shallow: true,
@@ -275,27 +328,31 @@ let AdvancedSearch = (props) => {
{t("search:search-title-label")}
</h1>
</legend>
<div className="govuk-form-group">
<label
className="govuk-label"
htmlFor="caseRef"
>
{t(
"search:casereference-label"
)}
</label>
<Field
name="caseRef"
id="caseRef"
component="input"
className="govuk-input govuk-!-width-two-thirds"
label={t(
"search:casereference-label"
)}
errormsg="Appeal type is required"
/>
</div>
<Field
validate={[
minLength(
t(
"myportal:searchcases-validation-minlength"
)
),
]}
className="govuk-input govuk-!-width-two-thirds"
component={RenderTextfield}
id="caseRef"
name="caseRef"
type="text"
aria-describedby="caseRef-hint"
hint1={t(
"myportal:searchcases-card-search-hint"
)}
hint2={t(
"myportal:searchcases-card-search-example-label-1"
)}
hint3={t(
"myportal:searchcases-card-search-example-label-2"
)}
/>
<Field
name="appealTypes"
-1
View File
@@ -260,7 +260,6 @@ const DNSSearchResults = (props) => {
getBasicDNSSearchPaged(pageNumber)
.then((data) => {
//console.log(data);
setSearchResults(data);
return data;
})
+43 -46
View File
@@ -39,7 +39,6 @@ import {
import {
createWatchedCases,
getToken,
getWatchedCasesProxy,
getPortalModuleDetailsProxy,
deleteWatchedCases,
@@ -58,6 +57,7 @@ const SearchResults = (props) => {
watchedCases,
setWatchedCases,
setWatchedCasesDetails,
isLinkedCase,
} = props;
let { t } = useTranslation();
@@ -77,8 +77,6 @@ const SearchResults = (props) => {
const cookies = parseCookies();
const selectWatchedCase = (loggedInUser, incidentID, appealType) => {
let token = getToken();
let updateBody = {
"pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")",
"pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")",
@@ -88,13 +86,11 @@ const SearchResults = (props) => {
createWatchedCases(updateBody)
.then((data) => data)
.then(() => {
getWatchedCasesProxy(token, cookies.pinsUser).then((data) => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
setWatchedCases(data),
getDetails(token, data, "myWatchedCases").then(
(data) => {
setWatchedCasesDetails(data);
}
);
getDetails(data, "myWatchedCases").then((data) => {
setWatchedCasesDetails(data);
});
});
});
};
@@ -109,26 +105,21 @@ const SearchResults = (props) => {
};
const deleteItem = (caseID, topThreeType) => {
let token = getToken();
let cookies = parseCookies();
topThreeType == "watchedCases" &&
deleteWatchedCases(caseID)
.then((data) => data)
.then(() => {
getWatchedCasesProxy(token, cookies.pinsUser).then(
(data) => {
setWatchedCases(data),
getDetails(token, data, "myWatchedCases").then(
(data) => {
setWatchedCasesDetails(data);
}
);
}
);
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
setWatchedCases(data),
getDetails(data, "myWatchedCases").then((data) => {
setWatchedCasesDetails(data);
});
});
});
};
const getDetails = (token, resultsObj, detailsType) => {
const getDetails = (resultsObj, detailsType) => {
//console.log(resultsObj);
let detailsArr = [];
resultsObj = resultsObj.value;
@@ -144,7 +135,6 @@ const SearchResults = (props) => {
} else {
detailsArr.push(
getPortalModuleDetailsProxy(
token,
getFormCollectionByID(
searchDetail.pinswg_appealcasetype
).LogicalCollectionName,
@@ -184,7 +174,7 @@ const SearchResults = (props) => {
<dd className="govuk-summary-list__key govuk-!-font-size-16">
{t("search:searchresults-status-label")}
</dd>
{myportal == "true" && (
{myportal == true && (
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action"></dd>
)}
</div>
@@ -201,10 +191,10 @@ const SearchResults = (props) => {
<Link
href={
router.locale == "cy"
? myportal == "true"
? myportal == true
? "/fymhorth/achos"
: "/achos"
: myportal == "true"
: myportal == true
? "/myportal/case"
: "/case"
}
@@ -378,7 +368,7 @@ const SearchResults = (props) => {
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
</dd>
{myportal == "true" && (
{myportal == true && (
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
{isWatchedCase(item.incidentid).length >
0 ==
@@ -501,27 +491,34 @@ const SearchResults = (props) => {
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
{t("search:searchresults-title-label")}
{isLinkedCase
? t("search:searchresults-title-label-linked-case")
: t("search:searchresults-title-label")}
</h1>
<p className="govuk-body">
{resultsArr.length > 200
? t("search:searchresults-max-count-label")
: t("search:searchresults-count-label", {
count: searchResultsObj["@odata.count"],
})}
.
{advancedSearch != true ? (
<>
<span>
{t("search:searchresults-case-count-label")}{" "}
{" "}
<em>&quot;{searchString}&quot;</em>
</span>
</>
) : (
""
)}
</p>
{!isLinkedCase && (
<p className="govuk-body">
{resultsArr.length > 200
? t("search:searchresults-max-count-label")
: t("search:searchresults-count-label", {
count: searchResultsObj["@odata.count"],
})}
.
{advancedSearch != true ? (
<>
<span>
{t(
"search:searchresults-case-count-label"
)}{" "}
{" "}
<em>&quot;{searchString}&quot;</em>
</span>
</>
) : (
""
)}
</p>
)}
{resultsArr.length > 0 ? (
ResultsView(resultsArr)
) : (
+2
View File
@@ -13,6 +13,7 @@ export default function Search(props) {
advancedSearch,
myportal,
watchedCases,
isLinkedCase,
} = props;
let { t } = useTranslation();
@@ -48,6 +49,7 @@ export default function Search(props) {
}
myportal={myportal}
watchedCases={watchedCases}
isLinkedCase={isLinkedCase}
/>
</div>
</div>
+3 -2
View File
@@ -9,6 +9,7 @@ export default function ServiceBanner() {
<div className="servicebanner">
<h1>
<img
className="govuk-!-margin-top-4"
src={
router.locale == "cy"
? "/assets/images/planning-casework-cy.svg"
@@ -16,7 +17,7 @@ export default function ServiceBanner() {
}
alt="Planning casework"
/>
<img
{/* <img
className="pedw_logo"
src="/assets/images/pedw_logo.png"
alt={
@@ -24,7 +25,7 @@ export default function ServiceBanner() {
? "Penderfyniadau Cynllunio ac Amgylchedd Cymru"
: "Planning & Environment Decisions Wales"
}
/>
/> */}
</h1>
</div>
);
+29
View File
@@ -0,0 +1,29 @@
import React from "react";
import { useState, useEffect } from "react";
const TimeoutModal = (props) => {
const { showModal, handleStayLoggedIn, remainingCountdown } = props;
return (
<div className={showModal == false ? "modal fade" : "modal fade show"}>
<div backdrop="static" className="modal-dialog">
<div className="modal-content">
<h3>
Your session is about to expire in {remainingCountdown}{" "}
seconds due to inactivity. You will be redirected to the
login page.
</h3>
<button
className="govuk-button"
onClick={handleStayLoggedIn}
>
Stay Logged In
</button>
</div>
</div>
<div className="modal-backdrop fade show"></div>
</div>
);
};
export default TimeoutModal;
+2 -1
View File
@@ -1,8 +1,9 @@
import React, { Fragment } from "react";
export const Tracking = ({ googleTagManagerID }) => (
export const Tracking = ({ googleTagManagerID, nonce }) => (
<Fragment>
<script
nonce={nonce}
dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
+19 -3
View File
@@ -27,10 +27,9 @@ export const getFormCollectionByID = (appealTypeID) => {
/*
* Get the details of a case from the appeal type
* @param String token
* @param object searchResultsObj
*/
export const getSearchDetails = (token, searchResultsObj) => {
export const getSearchDetails = (searchResultsObj) => {
//console.log(searchResultsObj);
let detailsArr = [];
@@ -45,7 +44,6 @@ export const getSearchDetails = (token, searchResultsObj) => {
//console.log(formMeta);
detailsArr.push(
getBasicSearchDetails(
token,
formMeta.LogicalCollectionName,
searchDetail.title,
formMeta.PrimaryIdAttribute,
@@ -90,3 +88,21 @@ export const getSearchDetailsPaged = (searchResultsObj) => {
// console.log(detailsArr);
return Promise.all(detailsArr);
};
// export const absoluteUrl = (req, setLocalhost) => {
// var protocol = "https:";
// var host = req
// ? req.headers["x-forwarded-host"] || req.headers["host"]
// : window.location.host;
// if (host.indexOf("localhost") > -1) {
// if (setLocalhost) host = setLocalhost;
// protocol = "http:";
// }
// return {
// protocol: protocol,
// host: host,
// origin: protocol + "//" + host,
// };
// };