added spinner to advanced search
This commit is contained in:
+59
-55
@@ -62,17 +62,17 @@ export const getSASToken = () => {
|
|||||||
"&skn=" +
|
"&skn=" +
|
||||||
m_SasKeyName;
|
m_SasKeyName;
|
||||||
|
|
||||||
console.log("///////////////////////");
|
// console.log("///////////////////////");
|
||||||
console.log(
|
// console.log(
|
||||||
"encodedURI:" + "https://" + m_ResourceURI + "/" + m_Path + "/"
|
// "encodedURI:" + "https://" + m_ResourceURI + "/" + m_Path + "/"
|
||||||
);
|
// );
|
||||||
console.log("WEBAPI_URL: " + WEBAPI_URL);
|
// console.log("WEBAPI_URL: " + WEBAPI_URL);
|
||||||
console.log("m_ResourceURI: " + m_ResourceURI);
|
// console.log("m_ResourceURI: " + m_ResourceURI);
|
||||||
console.log("m_Path: " + m_Path);
|
// console.log("m_Path: " + m_Path);
|
||||||
console.log("m_SasKey: " + m_SasKey);
|
// console.log("m_SasKey: " + m_SasKey);
|
||||||
console.log("m_SasKeyName: " + m_SasKeyName);
|
// console.log("m_SasKeyName: " + m_SasKeyName);
|
||||||
console.log("token: " + token);
|
// console.log("token: " + token);
|
||||||
console.log("///////////////////////");
|
// console.log("///////////////////////");
|
||||||
return token;
|
return token;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -105,16 +105,16 @@ const crmHeadersReturn = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const azureHeaders = (SASToken) => {
|
const azureHeaders = (SASToken) => {
|
||||||
console.log({
|
// console.log({
|
||||||
headers: {
|
// headers: {
|
||||||
"OData-MaxVersion": "4.0",
|
// "OData-MaxVersion": "4.0",
|
||||||
"OData-Version": "4.0",
|
// "OData-Version": "4.0",
|
||||||
"Accept": "application/json",
|
// "Accept": "application/json",
|
||||||
"Prefer": 'odata.include-annotations="*",return=representation',
|
// "Prefer": 'odata.include-annotations="*",return=representation',
|
||||||
"Content-Type": "application/json",
|
// "Content-Type": "application/json",
|
||||||
"ServiceBusAuthorization": SASToken,
|
// "ServiceBusAuthorization": SASToken,
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
return {
|
return {
|
||||||
headers: {
|
headers: {
|
||||||
"OData-MaxVersion": "4.0",
|
"OData-MaxVersion": "4.0",
|
||||||
@@ -139,13 +139,13 @@ const azureHeaders = (SASToken) => {
|
|||||||
// };
|
// };
|
||||||
|
|
||||||
export const getBasicSearch = (token, searchString) => {
|
export const getBasicSearch = (token, searchString) => {
|
||||||
console.log("\n\n", token, searchString);
|
//console.log("\n\n", token, searchString);
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=contains(title, '" +
|
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=contains(title, '" +
|
||||||
searchString +
|
searchString +
|
||||||
"') and pinswg_appealcasetype ne null &$count=true",
|
"') and pinswg_appealcasetype ne null &$orderby=createdon desc&$count=true&$top=201",
|
||||||
azureHeaders(token)
|
azureHeaders(token)
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@@ -165,7 +165,7 @@ export const getBasicDNSSearch = (token, searchString) => {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype eq 846040011&$count=true",
|
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype eq 846040011&$orderby=createdon desc&$count=true",
|
||||||
azureHeaders(token)
|
azureHeaders(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
@@ -174,8 +174,8 @@ export const getBasicDNSSearch = (token, searchString) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getAdvancedSearch = (searchString) => {
|
export const getAdvancedSearch = (token, searchString) => {
|
||||||
console.log(searchString.caseReference);
|
//console.log(searchString.caseReference);
|
||||||
|
|
||||||
var queryString = "";
|
var queryString = "";
|
||||||
|
|
||||||
@@ -200,19 +200,19 @@ export const getAdvancedSearch = (searchString) => {
|
|||||||
searchString.apt
|
searchString.apt
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
console.log(
|
// console.log(
|
||||||
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title&$filter=" +
|
// "incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title&$filter=" +
|
||||||
queryString +
|
// queryString +
|
||||||
" &$count=true"
|
// " &$count=true"
|
||||||
);
|
// );
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title&$filter=" +
|
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title&$filter=" +
|
||||||
queryString +
|
queryString +
|
||||||
" &$count=true",
|
" and pinswg_appealcasetype ne null &$orderby=createdon desc&$count=true&$top=201",
|
||||||
|
|
||||||
azureHeaders
|
azureHeaders(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -251,7 +251,7 @@ export const getBasicDNSSearchDetails = (token, appealType, caseReference) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getFormData = (whichForm) => {
|
export const getFormData = (token, whichForm) => {
|
||||||
//console.log("got to axios", whichForm);
|
//console.log("got to axios", whichForm);
|
||||||
//console.log("api_root: ", BASE_URL);
|
//console.log("api_root: ", BASE_URL);
|
||||||
return axios
|
return axios
|
||||||
@@ -259,8 +259,8 @@ export const getFormData = (whichForm) => {
|
|||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"systemforms?$select=formid,name,formxml,type,objecttypecode&$filter=(objecttypecode%20eq%20%27pinswg_" +
|
"systemforms?$select=formid,name,formxml,type,objecttypecode&$filter=(objecttypecode%20eq%20%27pinswg_" +
|
||||||
whichForm +
|
whichForm +
|
||||||
"%27and%20type%20eq%202)&$count=true",
|
"%27and%20type%20eq%202)&$count=true&$top=201",
|
||||||
azureHeaders
|
azureHeaders(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -268,14 +268,14 @@ export const getFormData = (whichForm) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getMandatoryFields = (whichForm) => {
|
export const getMandatoryFields = (token, whichForm) => {
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"EntityDefinitions(LogicalName='pinswg_" +
|
"EntityDefinitions(LogicalName='pinswg_" +
|
||||||
whichForm +
|
whichForm +
|
||||||
"')/Attributes?$count=true&$select=LogicalName,RequiredLevel",
|
"')/Attributes?$count=true&$select=LogicalName,RequiredLevel",
|
||||||
azureHeaders
|
azureHeaders(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -283,14 +283,14 @@ export const getMandatoryFields = (whichForm) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getPickLists = (whichForm) => {
|
export const getPickLists = (token, whichForm) => {
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"EntityDefinitions(LogicalName='pinswg_" +
|
"EntityDefinitions(LogicalName='pinswg_" +
|
||||||
whichForm +
|
whichForm +
|
||||||
"')/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet,GlobalOptionSet&$count=true",
|
"')/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet,GlobalOptionSet&$count=true",
|
||||||
azureHeaders
|
azureHeaders(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -298,12 +298,12 @@ export const getPickLists = (whichForm) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getAppealsTypes = () => {
|
export const getAppealsTypes = (token) => {
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"stringmaps?$filter=attributename%20eq%20%27pinswg_appealcasetype%27&$count=true&$select=value,stringmapid,organizationid,attributevalue",
|
"stringmaps?$filter=attributename%20eq%20%27pinswg_appealcasetype%27&$count=true&$select=value,stringmapid,organizationid,attributevalue",
|
||||||
azureHeaders
|
azureHeaders(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -413,10 +413,13 @@ export const getAppealTypeDetail = (caseReference, appealcasetype) => {
|
|||||||
};
|
};
|
||||||
//https://devcrm2016.llcdt.gov.wales/DVPINS/api/data/v8.2/pinswg_planningappeals78s?$filter=pinswg_name eq 'CAS-00015-L7J9H1'
|
//https://devcrm2016.llcdt.gov.wales/DVPINS/api/data/v8.2/pinswg_planningappeals78s?$filter=pinswg_name eq 'CAS-00015-L7J9H1'
|
||||||
|
|
||||||
export const getLPA = () => {
|
export const getLPA = (token) => {
|
||||||
// console.log("api_root: ", BASE_URL);
|
// console.log("api_root: ", BASE_URL);
|
||||||
return axios
|
return axios
|
||||||
.get(WEBAPI_URL + "accounts?$count=true&$select=name", azureHeaders)
|
.get(
|
||||||
|
WEBAPI_URL + "accounts?$count=true&$select=name",
|
||||||
|
azureHeaders(token)
|
||||||
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log("thi serror", error);
|
console.log("thi serror", error);
|
||||||
@@ -439,6 +442,7 @@ export const getPersonalAccount = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getAppealID = (
|
export const getAppealID = (
|
||||||
|
token,
|
||||||
caseReference,
|
caseReference,
|
||||||
updateFormCollection,
|
updateFormCollection,
|
||||||
primaryAttribute
|
primaryAttribute
|
||||||
@@ -454,7 +458,7 @@ export const getAppealID = (
|
|||||||
|
|
||||||
console.log("proxy url", weburl);
|
console.log("proxy url", weburl);
|
||||||
return axios
|
return axios
|
||||||
.get(weburl, azureHeaders)
|
.get(weburl, azureHeaders(token))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
var appealID = res.data.value[0][primaryAttribute];
|
var appealID = res.data.value[0][primaryAttribute];
|
||||||
return appealID;
|
return appealID;
|
||||||
@@ -540,14 +544,14 @@ export const updateCase = async (
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getMyCases = (loggedInUserId) => {
|
export const getMyCases = (token, loggedInUserId) => {
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"incidents?$select=ticketnumber,casetypecode,createdon,_customerid_value,description,incidentid,pinswg_appealcasetype,_pinswg_assignedinspectrids_value,statecode,statuscode,title&$filter=_customerid_value eq " +
|
"incidents?$select=ticketnumber,casetypecode,createdon,_customerid_value,description,incidentid,pinswg_appealcasetype,_pinswg_assignedinspectrids_value,statecode,statuscode,title&$filter=_customerid_value eq " +
|
||||||
loggedInUserId +
|
loggedInUserId +
|
||||||
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true&$top=3",
|
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true&$top=3",
|
||||||
azureHeaders
|
azureHeaders(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -555,7 +559,7 @@ export const getMyCases = (loggedInUserId) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getMyRepresentations = () => {
|
export const getMyRepresentations = (token) => {
|
||||||
return (
|
return (
|
||||||
axios
|
axios
|
||||||
// .get(BASE_URL + "/api/lookups/myRepresentations", {
|
// .get(BASE_URL + "/api/lookups/myRepresentations", {
|
||||||
@@ -564,7 +568,7 @@ export const getMyRepresentations = () => {
|
|||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype ne null &$count=true&$top=3",
|
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype ne null &$count=true&$top=3",
|
||||||
azureHeaders
|
azureHeaders(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -573,7 +577,7 @@ export const getMyRepresentations = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getWatchedCases = () => {
|
export const getWatchedCases = (token) => {
|
||||||
return (
|
return (
|
||||||
axios
|
axios
|
||||||
|
|
||||||
@@ -583,7 +587,7 @@ export const getWatchedCases = () => {
|
|||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype ne null &$count=true&$top=3",
|
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype ne null &$count=true&$top=3",
|
||||||
azureHeaders
|
azureHeaders(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -592,7 +596,7 @@ export const getWatchedCases = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getAwaitingSubmission = () => {
|
export const getAwaitingSubmission = (token) => {
|
||||||
return axios
|
return axios
|
||||||
.get(BASE_URL + "/api/lookups/awaitingSubmission", {
|
.get(BASE_URL + "/api/lookups/awaitingSubmission", {
|
||||||
httpsAgent: new https.Agent({ rejectUnauthorized: false }),
|
httpsAgent: new https.Agent({ rejectUnauthorized: false }),
|
||||||
@@ -603,7 +607,7 @@ export const getAwaitingSubmission = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getPortalModuelDetails = (appealType, caseReference) => {
|
export const getPortalModuelDetails = (token, appealType, caseReference) => {
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
@@ -611,7 +615,7 @@ export const getPortalModuelDetails = (appealType, caseReference) => {
|
|||||||
"?$filter=pinswg_name eq '" +
|
"?$filter=pinswg_name eq '" +
|
||||||
caseReference +
|
caseReference +
|
||||||
"'&$count=true",
|
"'&$count=true",
|
||||||
azureHeaders
|
azureHeaders(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|||||||
@@ -3,19 +3,26 @@ import { useRouter } from "next/router";
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|
||||||
export default function CaseComment() {
|
export default function CaseComment() {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
return (
|
return (
|
||||||
<div className="card" id="casescomment-card">
|
<div className="card" id="casescomment-card">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<h3 className="heading-small card-heading">
|
<h3 className="heading-small card-heading">
|
||||||
{t("home:casescomment-card-title")}
|
{t("home:casescomment-card-title")}
|
||||||
</h3>
|
</h3>
|
||||||
<p className="govuk-body-s">{t("home:casescomment-card-paragraph-one")}</p>
|
<p className="govuk-body-s">
|
||||||
<p className="govuk-body-s">{t("home:casescomment-card-paragraph-two")}</p>
|
{t("home:casescomment-card-paragraph-one")}{" "}
|
||||||
</div>
|
<a href="mailto:Casework.PEDW@gov.wales">
|
||||||
</div>
|
Casework.PEDW@gov.wales
|
||||||
);
|
</a>
|
||||||
|
</p>
|
||||||
|
<p className="govuk-body-s">
|
||||||
|
{t("home:casescomment-card-paragraph-two")}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { useRouter } from "next/router";
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Field, reduxForm } from "redux-form";
|
import { Field, reduxForm } from "redux-form";
|
||||||
|
import LoadingOverlay from "react-loading-overlay";
|
||||||
|
|
||||||
const required = (errorMsg) => (value) =>
|
const required = (errorMsg) => (value) =>
|
||||||
value || typeof value === "number" ? undefined : errorMsg;
|
value || typeof value === "number" ? undefined : errorMsg;
|
||||||
@@ -36,13 +37,11 @@ const RenderTextfield = ({
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div id="basicSearch-hint" className="govuk-hint ">
|
<div id="basicSearch-hint" className="govuk-hint ">
|
||||||
{hint1}
|
<span className="govuk-body-m">{hint1}</span>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<span className="govuk-body-s">
|
<span className="govuk-body-s">
|
||||||
<span className="govuk-!-font-weight-bold">
|
{hint2} CAS-00009-W8N6W4
|
||||||
{hint2}
|
|
||||||
</span>{" "}
|
|
||||||
CAS-00009-W8N6W4
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<label className="govuk-label " htmlFor={id} id={id + "_label"}>
|
<label className="govuk-label " htmlFor={id} id={id + "_label"}>
|
||||||
@@ -67,7 +66,16 @@ let CaseSearch = (props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
|
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||||
|
|
||||||
|
let spinnerState = () => {
|
||||||
|
showSpinnerState == true
|
||||||
|
? setShowSpinnerState(false)
|
||||||
|
: setShowSpinnerState(true);
|
||||||
|
};
|
||||||
|
|
||||||
const onHandleSubmit = (values) => {
|
const onHandleSubmit = (values) => {
|
||||||
|
spinnerState();
|
||||||
router.replace({
|
router.replace({
|
||||||
pathname: "/searchresults",
|
pathname: "/searchresults",
|
||||||
query: { q: values.basicSearch },
|
query: { q: values.basicSearch },
|
||||||
@@ -76,43 +84,56 @@ let CaseSearch = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card" id="casesearch-card">
|
<>
|
||||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
<div className="card" id="casesearch-card">
|
||||||
<div className="card-body">
|
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||||
<h3 className="heading-small card-heading">
|
<div className="card-body">
|
||||||
{t("home:casesearch-card-title")}
|
<h3 className="heading-small card-heading">
|
||||||
</h3>
|
{t("home:casesearch-card-title")}
|
||||||
|
</h3>
|
||||||
|
|
||||||
<Field
|
<Field
|
||||||
validate={[
|
validate={[
|
||||||
required(
|
required(
|
||||||
t("home:casesearch-search-validation-required")
|
t(
|
||||||
),
|
"home:casesearch-search-validation-required"
|
||||||
minLength(
|
)
|
||||||
t("home:casesearch-search-validation-minlength")
|
),
|
||||||
),
|
minLength(
|
||||||
]}
|
t(
|
||||||
className="govuk-input"
|
"home:casesearch-search-validation-minlength"
|
||||||
component={RenderTextfield}
|
)
|
||||||
id="basicSearch"
|
),
|
||||||
name="basicSearch"
|
]}
|
||||||
type="text"
|
className="govuk-input"
|
||||||
aria-describedby="basicSearch-hint"
|
component={RenderTextfield}
|
||||||
hint1={t("home:casesearch-card-search-hint")}
|
id="basicSearch"
|
||||||
hint2={t("home:casesearch-card-search-example-label")}
|
name="basicSearch"
|
||||||
/>
|
type="text"
|
||||||
|
aria-describedby="basicSearch-hint"
|
||||||
|
hint1={t("home:casesearch-card-search-hint")}
|
||||||
|
hint2={t(
|
||||||
|
"home:casesearch-card-search-example-label"
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<button type="submit" className="govuk-button">
|
<button type="submit" className="govuk-button">
|
||||||
{t("home:casesearch-card-button")}
|
{t("home:casesearch-card-button")}
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
|
<Link href="/advancedsearch">
|
||||||
|
<a>{t("home:casesearch-card-advanced-link")}</a>
|
||||||
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<Link href="/advancedsearch">
|
</form>
|
||||||
<a>{t("home:casesearch-card-advanced-link")}</a>
|
<LoadingOverlay
|
||||||
</Link>
|
active={showSpinnerState}
|
||||||
</div>
|
spinner
|
||||||
</form>
|
text={t("common:spinner-searching")}
|
||||||
</div>
|
/>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,17 @@ import Link from "next/link";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import LoadingOverlay from "react-loading-overlay";
|
||||||
|
|
||||||
export default function Dns() {
|
export default function Dns() {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||||
|
|
||||||
|
let spinnerState = () => {
|
||||||
|
showSpinnerState == true
|
||||||
|
? setShowSpinnerState(false)
|
||||||
|
: setShowSpinnerState(true);
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<div className="card" id="casesearch-card">
|
<div className="card" id="casesearch-card">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
@@ -18,12 +26,22 @@ export default function Dns() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<Link href="/dnsapplications">
|
<Link href="/dnsapplications">
|
||||||
<a className="govuk-button">
|
<a
|
||||||
|
className="govuk-button"
|
||||||
|
onClick={() => {
|
||||||
|
spinnerState();
|
||||||
|
}}
|
||||||
|
>
|
||||||
{t("home:dns-card-button")}
|
{t("home:dns-card-button")}
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<LoadingOverlay
|
||||||
|
active={showSpinnerState}
|
||||||
|
spinner
|
||||||
|
text={t("common:spinner-loading")}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,9 +75,8 @@ export default function Login() {
|
|||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
<p className="govuk-body-s">
|
<p className="govuk-body-s">
|
||||||
{t("home:login-card-forgotten-label")}{" "}
|
|
||||||
<Link href="/">
|
<Link href="/">
|
||||||
<a>{t("home:login-card-forgotten-link")}</a>
|
<a>{t("home:login-card-forgotten-label")} </a>
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,11 +16,21 @@ export default function LoginSoon() {
|
|||||||
|
|
||||||
<div className="govuk-form-group govuk-!-margin-top-4">
|
<div className="govuk-form-group govuk-!-margin-top-4">
|
||||||
<p className="govuk-body-s">
|
<p className="govuk-body-s">
|
||||||
{t("home:login-comingsoon-temp-1")}
|
{t("home:login-comingsoon-temp-1")}{" "}
|
||||||
|
<a href="mailto:Casework.PEDW@gov.wales">
|
||||||
|
Casework.PEDW@gov.wales
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<p className="govuk-body-s">
|
<p className="govuk-body-s">
|
||||||
{t("home:login-comingsoon-temp-2")}
|
{t("home:login-comingsoon-temp-2")}
|
||||||
</p>
|
</p>
|
||||||
|
<br />
|
||||||
|
<a
|
||||||
|
target="_blank"
|
||||||
|
href="https://gov.wales/planning-appeal-forms"
|
||||||
|
>
|
||||||
|
https://gov.wales/planning-appeal-forms
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+149
-138
@@ -6,24 +6,11 @@ import { reduxForm, formValueSelector, Field } from "redux-form";
|
|||||||
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
import data from "../../data/collections.json";
|
import data from "../../data/collections.json";
|
||||||
|
import LoadingOverlay from "react-loading-overlay";
|
||||||
|
|
||||||
let AdvancedSearch = (props) => {
|
let AdvancedSearch = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const [query, setQuery] = useState("");
|
|
||||||
const handleParam = (setValue) => (e) => setValue(e.target.value);
|
|
||||||
|
|
||||||
const advancedSearch = (event) => {
|
|
||||||
event.preventDefault();
|
|
||||||
console.log(query);
|
|
||||||
// /searchresults
|
|
||||||
|
|
||||||
router.push({
|
|
||||||
pathname: "/searchresults",
|
|
||||||
query: { q: query },
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
@@ -219,8 +206,18 @@ let AdvancedSearch = (props) => {
|
|||||||
return collectionName[0];
|
return collectionName[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||||
|
|
||||||
|
let spinnerState = () => {
|
||||||
|
showSpinnerState == true
|
||||||
|
? setShowSpinnerState(false)
|
||||||
|
: setShowSpinnerState(true);
|
||||||
|
};
|
||||||
|
|
||||||
const onHandleSubmit = (values) => {
|
const onHandleSubmit = (values) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
spinnerState();
|
||||||
|
|
||||||
console.log(values);
|
console.log(values);
|
||||||
// var appTypeCollection = values.appealTypes.split(",")[1];
|
// var appTypeCollection = values.appealTypes.split(",")[1];
|
||||||
|
|
||||||
@@ -255,151 +252,165 @@ let AdvancedSearch = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<>
|
||||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
<div>
|
||||||
<div className="govuk-grid-row">
|
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-row">
|
||||||
<div className="card" id="searchforcase-card">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="card-body">
|
<div className="card" id="searchforcase-card">
|
||||||
<div className="govuk-body-m ">
|
<div className="card-body">
|
||||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
|
<div className="govuk-body-m ">
|
||||||
<h1 className="govuk-fieldset__heading govuk-heading-m">
|
|
||||||
{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"
|
|
||||||
// validate={[required]}
|
|
||||||
label={t(
|
|
||||||
"search:casereference-label"
|
|
||||||
)}
|
|
||||||
errormsg="Appeal type is required"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Field
|
|
||||||
name="appealTypes"
|
|
||||||
id="appealTypes"
|
|
||||||
component={RenderAppealTypeList}
|
|
||||||
optionsObj={appealOptionsObj}
|
|
||||||
// validate={[required]}
|
|
||||||
label="Select an appeal type"
|
|
||||||
errormsg="Appeal type is required"
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="lpaTypes"
|
|
||||||
id="lpaTypes"
|
|
||||||
component={RenderLPAList}
|
|
||||||
optionsObj={lpaOptionsObj}
|
|
||||||
//validate={[required]}
|
|
||||||
label={t("search:lpa-label")}
|
|
||||||
errormsg="Local authority is required"
|
|
||||||
/>
|
|
||||||
<fieldset className="govuk-fieldset">
|
|
||||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
|
||||||
<h3 className="govuk-heading-m">
|
<h1 className="govuk-fieldset__heading govuk-heading-m">
|
||||||
{t(
|
{t("search:search-title-label")}
|
||||||
"search:sitelocation-legend"
|
</h1>
|
||||||
)}
|
|
||||||
</h3>
|
|
||||||
</legend>
|
</legend>
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<label
|
<label
|
||||||
className="govuk-label"
|
className="govuk-label"
|
||||||
htmlFor="address-line-1"
|
htmlFor="caseRef"
|
||||||
>
|
>
|
||||||
{t(
|
{t(
|
||||||
"search:address-line-one-label"
|
"search:casereference-label"
|
||||||
)}
|
)}
|
||||||
</label>
|
</label>
|
||||||
<input
|
|
||||||
className="govuk-input"
|
|
||||||
id="address-line-1"
|
|
||||||
name="address-line-1"
|
|
||||||
type="text"
|
|
||||||
autoComplete="address-line1"
|
|
||||||
onChange={handleParam(setQuery)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-form-group">
|
<Field
|
||||||
<label
|
name="caseRef"
|
||||||
className="govuk-label"
|
id="caseRef"
|
||||||
htmlFor="address-town"
|
component="input"
|
||||||
>
|
|
||||||
{t("search:town-label")}
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
className="govuk-input govuk-!-width-two-thirds"
|
className="govuk-input govuk-!-width-two-thirds"
|
||||||
id="address-town"
|
label={t(
|
||||||
name="address-town"
|
"search:casereference-label"
|
||||||
type="text"
|
)}
|
||||||
autoComplete="address-level2"
|
errormsg="Appeal type is required"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="govuk-form-group">
|
<Field
|
||||||
<label
|
name="appealTypes"
|
||||||
className="govuk-label"
|
id="appealTypes"
|
||||||
htmlFor="address-county"
|
component={RenderAppealTypeList}
|
||||||
>
|
optionsObj={appealOptionsObj}
|
||||||
{t("search:county-label")}
|
// validate={[required]}
|
||||||
</label>
|
label="Select an appeal type"
|
||||||
<input
|
errormsg="Appeal type is required"
|
||||||
className="govuk-input govuk-!-width-two-thirds"
|
/>
|
||||||
id="address-county"
|
<Field
|
||||||
name="address-county"
|
name="lpaTypes"
|
||||||
type="text"
|
id="lpaTypes"
|
||||||
/>
|
component={RenderLPAList}
|
||||||
</div>
|
optionsObj={lpaOptionsObj}
|
||||||
|
//validate={[required]}
|
||||||
|
label={t("search:lpa-label")}
|
||||||
|
errormsg="Local authority is required"
|
||||||
|
/>
|
||||||
|
{/* <fieldset className="govuk-fieldset">
|
||||||
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
|
||||||
|
<h3 className="govuk-heading-m">
|
||||||
|
{t(
|
||||||
|
"search:sitelocation-legend"
|
||||||
|
)}
|
||||||
|
</h3>
|
||||||
|
</legend>
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<label
|
||||||
|
className="govuk-label"
|
||||||
|
htmlFor="address-line-1"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"search:address-line-one-label"
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
className="govuk-input"
|
||||||
|
id="address-line-1"
|
||||||
|
name="address-line-1"
|
||||||
|
type="text"
|
||||||
|
autoComplete="address-line1"
|
||||||
|
onChange={handleParam(
|
||||||
|
setQuery
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<label
|
<label
|
||||||
className="govuk-label"
|
className="govuk-label"
|
||||||
htmlFor="address-postcode"
|
htmlFor="address-town"
|
||||||
>
|
>
|
||||||
{t("search:postcode-label")}
|
{t("search:town-label")}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
className="govuk-input govuk-input--width-10"
|
className="govuk-input govuk-!-width-two-thirds"
|
||||||
id="address-postcode"
|
id="address-town"
|
||||||
name="address-postcode"
|
name="address-town"
|
||||||
type="text"
|
type="text"
|
||||||
autoComplete="postal-code"
|
autoComplete="address-level2"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<label
|
||||||
|
className="govuk-label"
|
||||||
|
htmlFor="address-county"
|
||||||
|
>
|
||||||
|
{t("search:county-label")}
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
className="govuk-input govuk-!-width-two-thirds"
|
||||||
|
id="address-county"
|
||||||
|
name="address-county"
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<label
|
||||||
|
className="govuk-label"
|
||||||
|
htmlFor="address-postcode"
|
||||||
|
>
|
||||||
|
{t("search:postcode-label")}
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
className="govuk-input govuk-input--width-10"
|
||||||
|
id="address-postcode"
|
||||||
|
name="address-postcode"
|
||||||
|
type="text"
|
||||||
|
autoComplete="postal-code"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
*/}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-form-group">
|
||||||
<div className="govuk-form-group">
|
<button
|
||||||
<button
|
type="submit"
|
||||||
type="submit"
|
name="search"
|
||||||
name="search"
|
className="govuk-button"
|
||||||
className="govuk-button"
|
>
|
||||||
>
|
Search
|
||||||
Search
|
</button>
|
||||||
</button>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
</form>
|
</div>
|
||||||
</div>
|
{/* <div id="" className="spinnermodal">
|
||||||
|
|
||||||
|
</div> */}
|
||||||
|
<LoadingOverlay
|
||||||
|
active={showSpinnerState}
|
||||||
|
spinner
|
||||||
|
text={t("common:spinner-searching")}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -183,9 +183,11 @@ const SearchResults = (props) => {
|
|||||||
{t("search:searchresults-title-label")}
|
{t("search:searchresults-title-label")}
|
||||||
</h1>
|
</h1>
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
{t("search:searchresults-count-label", {
|
{resultsArr.length > 200
|
||||||
count: resultsArr.length,
|
? t("search:searchresults-max-count-label")
|
||||||
})}
|
: t("search:searchresults-count-label", {
|
||||||
|
count: resultsArr.length,
|
||||||
|
})}
|
||||||
.
|
.
|
||||||
{typeof searchString != "undefined" ? (
|
{typeof searchString != "undefined" ? (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
"common"
|
"common"
|
||||||
],
|
],
|
||||||
"/": [
|
"/": [
|
||||||
|
"common",
|
||||||
"home"
|
"home"
|
||||||
],
|
],
|
||||||
"/myportal": [
|
"/myportal": [
|
||||||
|
|||||||
@@ -20,8 +20,10 @@
|
|||||||
"social-bar-share-link": "Rhannu’r dudalen hon",
|
"social-bar-share-link": "Rhannu’r dudalen hon",
|
||||||
"social-bar-share-via-link": "Rhannu’r dudalen hon ar",
|
"social-bar-share-via-link": "Rhannu’r dudalen hon ar",
|
||||||
"breadcrumb-search-results": "Canlyniadau chwilio",
|
"breadcrumb-search-results": "Canlyniadau chwilio",
|
||||||
"breadcrumb-advanced-search": "Advanced search",
|
"breadcrumb-advanced-search": "Chwilio uwch",
|
||||||
"breadcrumb-advanced-search-results": "Advanced search results",
|
"breadcrumb-advanced-search-results": "Canlyniadau chwilio uwch",
|
||||||
"breadcrumb-my-portal": "Fy mhorth",
|
"breadcrumb-my-portal": "Fy mhorth",
|
||||||
"breadcrumb-case-reference": "Cyfeirnod Achos"
|
"breadcrumb-case-reference": "Cyfeirnod Achos",
|
||||||
|
"spinner-loading": "Llwytho...",
|
||||||
|
"spinner-searching": "Chwilio..."
|
||||||
}
|
}
|
||||||
+13
-13
@@ -1,29 +1,29 @@
|
|||||||
{
|
{
|
||||||
"login-card-title-temp": "W-Log in or Register soon",
|
"login-card-title-temp": "Croeso",
|
||||||
"login-comingsoon-temp-1": "W-First paragraph says something about being able to create accounts",
|
"login-comingsoon-temp-1": "Mae'r wefan hon yn dal i gael ei datblygu, os ydych am gyflwyno apêl neu gais newydd, cyflwynwch hi, ynghyd ag unrhyw ddogfennaeth berthnasol, i ",
|
||||||
"login-comingsoon-temp-2": "W-Second paragraph content to go here to explaine something else.",
|
"login-comingsoon-temp-2": "Gellir gofyn am ffurflenni apelio a chais trwy e-bost neu eu lawrlwytho gan ddilyn y ddolen isod.",
|
||||||
"login-card-title": "Mewngofnodi neu cofrestru",
|
"login-card-title": "Mewngofnodi i apelio yn erbyn penderfyniad cynllunio",
|
||||||
"login-card-id-label": "Dynodydd Defnyddiwr (ID) Porth y Llywodraeth",
|
"login-card-id-label": "Dynodydd Defnyddiwr (ID) Porth y Llywodraeth",
|
||||||
"login-card-id-hint": "Gallai hyn fod hyd at 12 o gymeriadau.",
|
"login-card-id-hint": "Gallai hyn fod hyd at 12 o gymeriadau.",
|
||||||
"login-card-password-label": "Cyfrinair",
|
"login-card-password-label": "Cyfrinair",
|
||||||
"login-card-button": "Mewngofnodi",
|
"login-card-button": "Mewngofnodi",
|
||||||
"login-card-register-label": "Cwsmer newydd wyf a hoffwn",
|
"login-card-register-label": "Cwsmer newydd wyf a hoffwn",
|
||||||
"login-card-register-link": "Gofrestru",
|
"login-card-register-link": "Gofrestru",
|
||||||
"login-card-forgotten-label": "Wedi anghofio eich cyfrinair neu'ch enw defnyddiwr?",
|
"login-card-forgotten-label": "Rwyf wedi anghofio fy nghyfrinair",
|
||||||
"login-card-forgotten-link": "Cliciwch yma",
|
"login-card-forgotten-link": "Cliciwch yma",
|
||||||
"casesearch-card-title": "Chwilio am achos",
|
"casesearch-card-title": "Chwilio am achos",
|
||||||
"casesearch-card-search-hint": "Chwiliwch drwy roi cyfeirnod 7 digid yr achos",
|
"casesearch-card-search-hint": "Chwiliwch drwy roi cyfeirnod 7 digid yr achos",
|
||||||
"casesearch-card-search-example-label": "Enghraifft",
|
"casesearch-card-search-example-label": "Enghraifft:",
|
||||||
"casesearch-card-button": "Cyflwyno Chwiliad",
|
"casesearch-card-button": "Cyflwyno chwiliad",
|
||||||
"casesearch-card-advanced-link": "Fel arall, gallwch chwilio gan ddefnyddio ein meini prawf eraill gyda'n chwiliad uwch",
|
"casesearch-card-advanced-link": "Fel arall, gallwch chwilio gan ddefnyddio ein meini prawf eraill gyda'n chwiliad uwch",
|
||||||
"casesearch-search-validation-required": "Angenrheidiol",
|
"casesearch-search-validation-required": "Angenrheidiol",
|
||||||
"casesearch-search-validation-minlength": "Rhaid bod yn 4 nod neu fwy",
|
"casesearch-search-validation-minlength": "Rhaid bod yn 4 nod neu fwy",
|
||||||
"casescomment-card-title": "Gwneud sylw ar achos",
|
"casescomment-card-title": "Gwneud sylw ar achos",
|
||||||
"casescomment-card-paragraph-one": "Chwiliwch am eich achos a chliciwch y botwm 'Gwneud Sylw'. Y ffordd orau o roi sylwadau ar achos cyfredol yw trwy gofrestru gyda ni'n gyntaf gan fod hynny'n gwneud olrhain achosion a chyflwyno sylwadau yn haws.",
|
"casescomment-card-paragraph-one": "Yn syml, chwiliwch am eich achos i weld y ddogfennaeth sy'n gysylltiedig â'r achos. Yna cyflwynwch eich cynrychiolaeth i ",
|
||||||
"casescomment-card-paragraph-two": "Yn achos apeliadau deiliaid tai ac apeliadau masnachol, nid yw partïon â buddiant yn gallu gwneud sylwadau yn y cam apelio. Caiff unrhyw sylwadau a wneir yn y cam ymgeisio eu darparu gan yr awdurdod cynllunio lleol ac fe'u hystyrir gan yr Arolygydd.",
|
"casescomment-card-paragraph-two": "Ar gyfer apeliadau Deiliaid Tai a Masnachol, ni all partïon â diddordeb gyflwyno sylwadau yn ystod y cam apelio. Bydd unrhyw sylwadau a wneir yn ystod y cam ymgeisio yn cael eu darparu gan yr awdurdod cynllunio lleol a'u hystyried gan yr arolygydd.",
|
||||||
"inspectorate-card-visit-label" : "Ymweld Yr Arolygiaeth Gynllunio",
|
"inspectorate-card-visit-label": "Ymweld Yr Arolygiaeth Gynllunio",
|
||||||
"inspectorate-card-visit-link": "Hafan",
|
"inspectorate-card-visit-link": "Hafan",
|
||||||
"dns-card-title":"Datblygiadau o Arwyddocâd Cenedlaethol",
|
"dns-card-title": "Datblygiadau o Arwyddocâd Cenedlaethol",
|
||||||
"dns-card-paragraph":"Mae Datblygiad o Arwyddocâd Cenedlaethol (DAC) yn fath o gais cynllunio ar gyfer prosiect seilwaith mawr sydd o bwysigrwydd cenedlaethol yng Nghymru. Yn y fan hon, gallwch gael gwybod am geisiadau DAC arfaethedig. Rheolir y safle hwn gan yr Arolygiaeth Gynllunio.",
|
"dns-card-paragraph": "Mae Datblygiad o Arwyddocâd Cenedlaethol (DAC) yn fath o gais cynllunio ar gyfer prosiect seilwaith mawr sydd o bwysigrwydd cenedlaethol yng Nghymru. Yn y fan hon, gallwch gael gwybod am geisiadau DAC arfaethedig. Rheolir y safle hwn gan yr Arolygiaeth Gynllunio.",
|
||||||
"dns-card-button":"Gweld pob cais"
|
"dns-card-button": "Gweld pob cais"
|
||||||
}
|
}
|
||||||
@@ -47,6 +47,7 @@
|
|||||||
"clear-all-button-label": "Clirio Pob Un",
|
"clear-all-button-label": "Clirio Pob Un",
|
||||||
"searchresults-title-label": "Crynodeb o’r Achos ar gyfer",
|
"searchresults-title-label": "Crynodeb o’r Achos ar gyfer",
|
||||||
"searchresults-count-label": "Cafodd eich chwiliad {{count}} o ganlyniadau",
|
"searchresults-count-label": "Cafodd eich chwiliad {{count}} o ganlyniadau",
|
||||||
|
"searchresults-max-count-label": "Dychwelodd eich chwiliad fwy na 200 o ganlyniadau. Mireiniwch eich chwiliad. Mae'r 200 achos diweddaraf yn cael eu harddangos",
|
||||||
"searchresults-case-reference-label": "Cyfeirnod yr Achos",
|
"searchresults-case-reference-label": "Cyfeirnod yr Achos",
|
||||||
"searchresults-case-count-label": "Fe wnaethoch chi chwilio am",
|
"searchresults-case-count-label": "Fe wnaethoch chi chwilio am",
|
||||||
"searchresults-site-address-label": "Cyfeiriad y Safle",
|
"searchresults-site-address-label": "Cyfeiriad y Safle",
|
||||||
|
|||||||
@@ -23,5 +23,7 @@
|
|||||||
"breadcrumb-advanced-search": "Advanced search",
|
"breadcrumb-advanced-search": "Advanced search",
|
||||||
"breadcrumb-advanced-search-results": "Advanced search results",
|
"breadcrumb-advanced-search-results": "Advanced search results",
|
||||||
"breadcrumb-my-portal": "My portal",
|
"breadcrumb-my-portal": "My portal",
|
||||||
"breadcrumb-case-reference": "Case Reference"
|
"breadcrumb-case-reference": "Case Reference",
|
||||||
|
"spinner-loading": "Loading...",
|
||||||
|
"spinner-searching": "Searching..."
|
||||||
}
|
}
|
||||||
+14
-14
@@ -1,29 +1,29 @@
|
|||||||
{
|
{
|
||||||
"login-card-title-temp": "Log in or Register soon",
|
"login-card-title-temp": "Welcome",
|
||||||
"login-comingsoon-temp-1": "First paragraph says something about being able to create accounts",
|
"login-comingsoon-temp-1": "This website is still in development, if you wish to submit a new appeal or application please submit it, along with any relevant documentation, to ",
|
||||||
"login-comingsoon-temp-2": "Second paragraph content to go here to explaine something else.",
|
"login-comingsoon-temp-2": "Appeal and application forms can be requested by email or downloaded following the below link.",
|
||||||
"login-card-title": "Log in or Register",
|
"login-card-title": "Sign in to appeal a planning decision",
|
||||||
"login-card-id-label": "Government Gateway user ID",
|
"login-card-id-label": "Government Gateway user ID",
|
||||||
"login-card-id-hint": "This could be up to 12 characters.",
|
"login-card-id-hint": "This could be up to 12 characters.",
|
||||||
"login-card-password-label": "Password",
|
"login-card-password-label": "Password",
|
||||||
"login-card-button": "Sign in",
|
"login-card-button": "Sign in",
|
||||||
"login-card-register-label": "I am a new user and would like to",
|
"login-card-register-label": "I am a new user and would like to",
|
||||||
"login-card-register-link": "Register",
|
"login-card-register-link": "Register",
|
||||||
"login-card-forgotten-label": "Forgotten your password or username?",
|
"login-card-forgotten-label": "I have forgotten my password",
|
||||||
"login-card-forgotten-link": "Click here",
|
"login-card-forgotten-link": "Click here",
|
||||||
"casesearch-card-title": "Search for a case",
|
"casesearch-card-title": "Search for a case",
|
||||||
"casesearch-card-search-hint": "Search by entering the 7 digit case reference number",
|
"casesearch-card-search-hint": "Search by entering the 7 digit case reference number",
|
||||||
"casesearch-card-search-example-label": "Example",
|
"casesearch-card-search-example-label": "Example:",
|
||||||
"casesearch-card-button": "Submit Search",
|
"casesearch-card-button": "Submit search",
|
||||||
"casesearch-card-advanced-link": "Advanced Search",
|
"casesearch-card-advanced-link": "Advanced search",
|
||||||
"casesearch-search-validation-required": "Required",
|
"casesearch-search-validation-required": "Required",
|
||||||
"casesearch-search-validation-minlength": "Must be 4 characters or more",
|
"casesearch-search-validation-minlength": "Must be 4 characters or more",
|
||||||
"casescomment-card-title": "Comment on a case",
|
"casescomment-card-title": "Comment on a case",
|
||||||
"casescomment-card-paragraph-one": "Simply search for your case and click on the 'Make Representation' button. The best way to comment on an existing case is to register with us first as that makes it easier to track cases and submit comments.",
|
"casescomment-card-paragraph-one": "Simply search for your case to view the documentation associated to the case. Then submit your representation to ",
|
||||||
"casescomment-card-paragraph-two": "For Householder and Commercial appeals, interested parties are unable to make representations at appeal stage. Any representations made at application stage will be provided by the local planning authority and considered by the Inspector.",
|
"casescomment-card-paragraph-two": "For Householder and Commercial appeals, interested parties are unable to make representations at appeal stage. Any representations made at application stage will be provided by the local planning authority and considered by the inspector.",
|
||||||
"inspectorate-card-visit-label" : "Visit the Planning Inspectorate",
|
"inspectorate-card-visit-label": "Visit the Planning Inspectorate",
|
||||||
"inspectorate-card-visit-link": "Home",
|
"inspectorate-card-visit-link": "Home",
|
||||||
"dns-card-title":"Developments of National Significance",
|
"dns-card-title": "Developments of National Significance",
|
||||||
"dns-card-paragraph":"A Development of National Significance (DNS) is a type of planning application for a large infrastructure project of national importance in Wales. Here you can find out about proposed DNS applications. This site is managed by the Planning Inspectorate.",
|
"dns-card-paragraph": "A Development of National Significance (DNS) is a type of planning application for a large infrastructure project of national importance in Wales. Here you can find out about proposed DNS applications. This site is managed by the Planning Inspectorate.",
|
||||||
"dns-card-button":"View all applications"
|
"dns-card-button": "View all applications"
|
||||||
}
|
}
|
||||||
@@ -47,6 +47,7 @@
|
|||||||
"clear-all-button-label": "Clear all",
|
"clear-all-button-label": "Clear all",
|
||||||
"searchresults-title-label": "Search for a case",
|
"searchresults-title-label": "Search for a case",
|
||||||
"searchresults-count-label": "Your search returned {{count}} results",
|
"searchresults-count-label": "Your search returned {{count}} results",
|
||||||
|
"searchresults-max-count-label": "Your searched returned more than 200 results. Please refine your search. The most recent 200 cases are displayed",
|
||||||
"searchresults-case-reference-label": "Case reference",
|
"searchresults-case-reference-label": "Case reference",
|
||||||
"searchresults-case-count-label": "You searched for",
|
"searchresults-case-count-label": "You searched for",
|
||||||
"searchresults-site-address-label": "Site address",
|
"searchresults-site-address-label": "Site address",
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
"react-datepicker": "^4.1.1",
|
"react-datepicker": "^4.1.1",
|
||||||
"react-dom": "17.0.2",
|
"react-dom": "17.0.2",
|
||||||
"react-dropzone": "^11.3.4",
|
"react-dropzone": "^11.3.4",
|
||||||
|
"react-loading-overlay": "^1.0.1",
|
||||||
"react-redux": "^7.2.4",
|
"react-redux": "^7.2.4",
|
||||||
"react-xml-parser": "^1.1.8",
|
"react-xml-parser": "^1.1.8",
|
||||||
"redux-devtools-extension": "^2.13.9",
|
"redux-devtools-extension": "^2.13.9",
|
||||||
|
|||||||
+12
-3
@@ -1,4 +1,5 @@
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
import { useState } from "react";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import Header from "../components/header";
|
import Header from "../components/header";
|
||||||
import Banner from "../components/banner";
|
import Banner from "../components/banner";
|
||||||
@@ -21,7 +22,13 @@ import {
|
|||||||
setAppealLPA,
|
setAppealLPA,
|
||||||
getAppealTypeObj,
|
getAppealTypeObj,
|
||||||
} from "../store/appealType/action";
|
} from "../store/appealType/action";
|
||||||
import { getAppealsTypes, getLPA, updateCase, createCase } from "../actions";
|
import {
|
||||||
|
getAppealsTypes,
|
||||||
|
getLPA,
|
||||||
|
updateCase,
|
||||||
|
createCase,
|
||||||
|
getSASToken,
|
||||||
|
} from "../actions";
|
||||||
import { setLPA } from "../store/lpa/action";
|
import { setLPA } from "../store/lpa/action";
|
||||||
|
|
||||||
const Home = (props) => {
|
const Home = (props) => {
|
||||||
@@ -59,9 +66,11 @@ const Home = (props) => {
|
|||||||
export const getServerSideProps = wrapper.getServerSideProps(
|
export const getServerSideProps = wrapper.getServerSideProps(
|
||||||
(store) =>
|
(store) =>
|
||||||
async ({ query, req, res }) => {
|
async ({ query, req, res }) => {
|
||||||
|
const token = await getSASToken();
|
||||||
|
|
||||||
const [appealTypeData, lpaData, caseData] = await Promise.all([
|
const [appealTypeData, lpaData, caseData] = await Promise.all([
|
||||||
await getAppealsTypes(),
|
await getAppealsTypes(token),
|
||||||
await getLPA(),
|
await getLPA(token),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
store.dispatch(setAppealType(appealTypeData));
|
store.dispatch(setAppealType(appealTypeData));
|
||||||
|
|||||||
@@ -22,7 +22,11 @@ import {
|
|||||||
setSearchDetails,
|
setSearchDetails,
|
||||||
getSearchResultsObj,
|
getSearchResultsObj,
|
||||||
} from "../store/searchOutput/action";
|
} from "../store/searchOutput/action";
|
||||||
import { getAdvancedSearch, getBasicSearchDetails } from "../actions";
|
import {
|
||||||
|
getAdvancedSearch,
|
||||||
|
getBasicSearchDetails,
|
||||||
|
getSASToken,
|
||||||
|
} from "../actions";
|
||||||
|
|
||||||
const Home = (props) => {
|
const Home = (props) => {
|
||||||
const { footerLinks, pages } = props;
|
const { footerLinks, pages } = props;
|
||||||
@@ -63,10 +67,13 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
console.log("query-", query);
|
console.log("query-", query);
|
||||||
//console.log("search array:", Object.entries(query));
|
//console.log("search array:", Object.entries(query));
|
||||||
|
|
||||||
let querystring;
|
const token = await getSASToken();
|
||||||
|
|
||||||
const searchResultsObj = await getAdvancedSearch(query);
|
const searchResultsObj = await getAdvancedSearch(token, query);
|
||||||
const searchDetailsObj = await getSearchDetails(searchResultsObj);
|
const searchDetailsObj = await getSearchDetails(
|
||||||
|
token,
|
||||||
|
searchResultsObj
|
||||||
|
);
|
||||||
// console.log(searchDetailsObj);
|
// console.log(searchDetailsObj);
|
||||||
store.dispatch(setSearchResults(searchResultsObj));
|
store.dispatch(setSearchResults(searchResultsObj));
|
||||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||||
@@ -83,7 +90,7 @@ const getFormCollection = (formtype) => {
|
|||||||
return collectionName[0];
|
return collectionName[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
const getSearchDetails = (searchResultsObj) => {
|
const getSearchDetails = (token, searchResultsObj) => {
|
||||||
//console.log(searchResultsObj);
|
//console.log(searchResultsObj);
|
||||||
|
|
||||||
let detailsArr = [];
|
let detailsArr = [];
|
||||||
@@ -95,6 +102,7 @@ const getSearchDetails = (searchResultsObj) => {
|
|||||||
} else {
|
} else {
|
||||||
detailsArr.push(
|
detailsArr.push(
|
||||||
getBasicSearchDetails(
|
getBasicSearchDetails(
|
||||||
|
token,
|
||||||
getFormCollection(
|
getFormCollection(
|
||||||
"pinswg_" +
|
"pinswg_" +
|
||||||
searchDetail[
|
searchDetail[
|
||||||
|
|||||||
@@ -65,13 +65,13 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
|
|
||||||
const searchResultsObj = await getBasicSearch(token, query.q);
|
const searchResultsObj = await getBasicSearch(token, query.q);
|
||||||
|
|
||||||
console.log("sssss", searchResultsObj);
|
//console.log("sssss", searchResultsObj);
|
||||||
|
|
||||||
const searchDetailsObj = await getSearchDetails(
|
const searchDetailsObj = await getSearchDetails(
|
||||||
token,
|
token,
|
||||||
searchResultsObj
|
searchResultsObj
|
||||||
);
|
);
|
||||||
console.log(searchDetailsObj);
|
//console.log(searchDetailsObj);
|
||||||
store.dispatch(setSearchResults(searchResultsObj));
|
store.dispatch(setSearchResults(searchResultsObj));
|
||||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||||
store.dispatch(setSearch(query.q));
|
store.dispatch(setSearch(query.q));
|
||||||
@@ -88,7 +88,7 @@ const getFormCollection = (formtype) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getSearchDetails = (token, searchResultsObj) => {
|
const getSearchDetails = (token, searchResultsObj) => {
|
||||||
console.log(searchResultsObj);
|
//console.log(searchResultsObj);
|
||||||
|
|
||||||
let detailsArr = [];
|
let detailsArr = [];
|
||||||
console.log("search results", searchResultsObj);
|
console.log("search results", searchResultsObj);
|
||||||
|
|||||||
@@ -402,11 +402,11 @@ a.longLinkBreak {
|
|||||||
font-size: 19px;
|
font-size: 19px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.at-nav h3 {
|
// .at-nav h3 {
|
||||||
}
|
// }
|
||||||
|
|
||||||
.at-nav__chapter {
|
// .at-nav__chapter {
|
||||||
}
|
// }
|
||||||
|
|
||||||
.at-nav__section {
|
.at-nav__section {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -1107,3 +1107,16 @@ ul#sharePageLinks.active {
|
|||||||
.react-autosuggest__suggestion--highlighted {
|
.react-autosuggest__suggestion--highlighted {
|
||||||
background-color: #c3c3c3;
|
background-color: #c3c3c3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// loading spinner
|
||||||
|
|
||||||
|
._loading_overlay_wrapper {
|
||||||
|
&._loading_overlay_wrapper--active {
|
||||||
|
min-height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user