added spinner to advanced search
This commit is contained in:
+59
-55
@@ -62,17 +62,17 @@ export const getSASToken = () => {
|
||||
"&skn=" +
|
||||
m_SasKeyName;
|
||||
|
||||
console.log("///////////////////////");
|
||||
console.log(
|
||||
"encodedURI:" + "https://" + m_ResourceURI + "/" + m_Path + "/"
|
||||
);
|
||||
console.log("WEBAPI_URL: " + WEBAPI_URL);
|
||||
console.log("m_ResourceURI: " + m_ResourceURI);
|
||||
console.log("m_Path: " + m_Path);
|
||||
console.log("m_SasKey: " + m_SasKey);
|
||||
console.log("m_SasKeyName: " + m_SasKeyName);
|
||||
console.log("token: " + token);
|
||||
console.log("///////////////////////");
|
||||
// console.log("///////////////////////");
|
||||
// console.log(
|
||||
// "encodedURI:" + "https://" + m_ResourceURI + "/" + m_Path + "/"
|
||||
// );
|
||||
// console.log("WEBAPI_URL: " + WEBAPI_URL);
|
||||
// console.log("m_ResourceURI: " + m_ResourceURI);
|
||||
// console.log("m_Path: " + m_Path);
|
||||
// console.log("m_SasKey: " + m_SasKey);
|
||||
// console.log("m_SasKeyName: " + m_SasKeyName);
|
||||
// console.log("token: " + token);
|
||||
// console.log("///////////////////////");
|
||||
return token;
|
||||
};
|
||||
|
||||
@@ -105,16 +105,16 @@ const crmHeadersReturn = {
|
||||
};
|
||||
|
||||
const azureHeaders = (SASToken) => {
|
||||
console.log({
|
||||
headers: {
|
||||
"OData-MaxVersion": "4.0",
|
||||
"OData-Version": "4.0",
|
||||
"Accept": "application/json",
|
||||
"Prefer": 'odata.include-annotations="*",return=representation',
|
||||
"Content-Type": "application/json",
|
||||
"ServiceBusAuthorization": SASToken,
|
||||
},
|
||||
});
|
||||
// console.log({
|
||||
// headers: {
|
||||
// "OData-MaxVersion": "4.0",
|
||||
// "OData-Version": "4.0",
|
||||
// "Accept": "application/json",
|
||||
// "Prefer": 'odata.include-annotations="*",return=representation',
|
||||
// "Content-Type": "application/json",
|
||||
// "ServiceBusAuthorization": SASToken,
|
||||
// },
|
||||
// });
|
||||
return {
|
||||
headers: {
|
||||
"OData-MaxVersion": "4.0",
|
||||
@@ -139,13 +139,13 @@ const azureHeaders = (SASToken) => {
|
||||
// };
|
||||
|
||||
export const getBasicSearch = (token, searchString) => {
|
||||
console.log("\n\n", token, searchString);
|
||||
//console.log("\n\n", token, searchString);
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=contains(title, '" +
|
||||
searchString +
|
||||
"') and pinswg_appealcasetype ne null &$count=true",
|
||||
"') and pinswg_appealcasetype ne null &$orderby=createdon desc&$count=true&$top=201",
|
||||
azureHeaders(token)
|
||||
)
|
||||
.then((res) => {
|
||||
@@ -165,7 +165,7 @@ export const getBasicDNSSearch = (token, searchString) => {
|
||||
return axios
|
||||
.get(
|
||||
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)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
@@ -174,8 +174,8 @@ export const getBasicDNSSearch = (token, searchString) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getAdvancedSearch = (searchString) => {
|
||||
console.log(searchString.caseReference);
|
||||
export const getAdvancedSearch = (token, searchString) => {
|
||||
//console.log(searchString.caseReference);
|
||||
|
||||
var queryString = "";
|
||||
|
||||
@@ -200,19 +200,19 @@ export const getAdvancedSearch = (searchString) => {
|
||||
searchString.apt
|
||||
: "";
|
||||
|
||||
console.log(
|
||||
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title&$filter=" +
|
||||
queryString +
|
||||
" &$count=true"
|
||||
);
|
||||
// console.log(
|
||||
// "incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title&$filter=" +
|
||||
// queryString +
|
||||
// " &$count=true"
|
||||
// );
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title&$filter=" +
|
||||
queryString +
|
||||
" &$count=true",
|
||||
" and pinswg_appealcasetype ne null &$orderby=createdon desc&$count=true&$top=201",
|
||||
|
||||
azureHeaders
|
||||
azureHeaders(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.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("api_root: ", BASE_URL);
|
||||
return axios
|
||||
@@ -259,8 +259,8 @@ export const getFormData = (whichForm) => {
|
||||
WEBAPI_URL +
|
||||
"systemforms?$select=formid,name,formxml,type,objecttypecode&$filter=(objecttypecode%20eq%20%27pinswg_" +
|
||||
whichForm +
|
||||
"%27and%20type%20eq%202)&$count=true",
|
||||
azureHeaders
|
||||
"%27and%20type%20eq%202)&$count=true&$top=201",
|
||||
azureHeaders(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
@@ -268,14 +268,14 @@ export const getFormData = (whichForm) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getMandatoryFields = (whichForm) => {
|
||||
export const getMandatoryFields = (token, whichForm) => {
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"EntityDefinitions(LogicalName='pinswg_" +
|
||||
whichForm +
|
||||
"')/Attributes?$count=true&$select=LogicalName,RequiredLevel",
|
||||
azureHeaders
|
||||
azureHeaders(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
@@ -283,14 +283,14 @@ export const getMandatoryFields = (whichForm) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getPickLists = (whichForm) => {
|
||||
export const getPickLists = (token, whichForm) => {
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"EntityDefinitions(LogicalName='pinswg_" +
|
||||
whichForm +
|
||||
"')/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet,GlobalOptionSet&$count=true",
|
||||
azureHeaders
|
||||
azureHeaders(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
@@ -298,12 +298,12 @@ export const getPickLists = (whichForm) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getAppealsTypes = () => {
|
||||
export const getAppealsTypes = (token) => {
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"stringmaps?$filter=attributename%20eq%20%27pinswg_appealcasetype%27&$count=true&$select=value,stringmapid,organizationid,attributevalue",
|
||||
azureHeaders
|
||||
azureHeaders(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.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'
|
||||
|
||||
export const getLPA = () => {
|
||||
export const getLPA = (token) => {
|
||||
// console.log("api_root: ", BASE_URL);
|
||||
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)
|
||||
.catch((error) => {
|
||||
console.log("thi serror", error);
|
||||
@@ -439,6 +442,7 @@ export const getPersonalAccount = () => {
|
||||
};
|
||||
|
||||
export const getAppealID = (
|
||||
token,
|
||||
caseReference,
|
||||
updateFormCollection,
|
||||
primaryAttribute
|
||||
@@ -454,7 +458,7 @@ export const getAppealID = (
|
||||
|
||||
console.log("proxy url", weburl);
|
||||
return axios
|
||||
.get(weburl, azureHeaders)
|
||||
.get(weburl, azureHeaders(token))
|
||||
.then((res) => {
|
||||
var appealID = res.data.value[0][primaryAttribute];
|
||||
return appealID;
|
||||
@@ -540,14 +544,14 @@ export const updateCase = async (
|
||||
});
|
||||
};
|
||||
|
||||
export const getMyCases = (loggedInUserId) => {
|
||||
export const getMyCases = (token, loggedInUserId) => {
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"incidents?$select=ticketnumber,casetypecode,createdon,_customerid_value,description,incidentid,pinswg_appealcasetype,_pinswg_assignedinspectrids_value,statecode,statuscode,title&$filter=_customerid_value eq " +
|
||||
loggedInUserId +
|
||||
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true&$top=3",
|
||||
azureHeaders
|
||||
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true&$top=3",
|
||||
azureHeaders(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
@@ -555,7 +559,7 @@ export const getMyCases = (loggedInUserId) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getMyRepresentations = () => {
|
||||
export const getMyRepresentations = (token) => {
|
||||
return (
|
||||
axios
|
||||
// .get(BASE_URL + "/api/lookups/myRepresentations", {
|
||||
@@ -564,7 +568,7 @@ export const getMyRepresentations = () => {
|
||||
.get(
|
||||
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",
|
||||
azureHeaders
|
||||
azureHeaders(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
@@ -573,7 +577,7 @@ export const getMyRepresentations = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export const getWatchedCases = () => {
|
||||
export const getWatchedCases = (token) => {
|
||||
return (
|
||||
axios
|
||||
|
||||
@@ -583,7 +587,7 @@ export const getWatchedCases = () => {
|
||||
.get(
|
||||
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",
|
||||
azureHeaders
|
||||
azureHeaders(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
@@ -592,7 +596,7 @@ export const getWatchedCases = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export const getAwaitingSubmission = () => {
|
||||
export const getAwaitingSubmission = (token) => {
|
||||
return axios
|
||||
.get(BASE_URL + "/api/lookups/awaitingSubmission", {
|
||||
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
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
@@ -611,7 +615,7 @@ export const getPortalModuelDetails = (appealType, caseReference) => {
|
||||
"?$filter=pinswg_name eq '" +
|
||||
caseReference +
|
||||
"'&$count=true",
|
||||
azureHeaders
|
||||
azureHeaders(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
|
||||
@@ -3,19 +3,26 @@ import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
|
||||
export default function CaseComment() {
|
||||
let { t } = useTranslation();
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
return (
|
||||
<div className="card" id="casescomment-card">
|
||||
<div className="card-body">
|
||||
<h3 className="heading-small card-heading">
|
||||
{t("home:casescomment-card-title")}
|
||||
</h3>
|
||||
<p className="govuk-body-s">{t("home:casescomment-card-paragraph-one")}</p>
|
||||
<p className="govuk-body-s">{t("home:casescomment-card-paragraph-two")}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
return (
|
||||
<div className="card" id="casescomment-card">
|
||||
<div className="card-body">
|
||||
<h3 className="heading-small card-heading">
|
||||
{t("home:casescomment-card-title")}
|
||||
</h3>
|
||||
<p className="govuk-body-s">
|
||||
{t("home:casescomment-card-paragraph-one")}{" "}
|
||||
<a href="mailto:Casework.PEDW@gov.wales">
|
||||
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 { connect } from "react-redux";
|
||||
import { Field, reduxForm } from "redux-form";
|
||||
import LoadingOverlay from "react-loading-overlay";
|
||||
|
||||
const required = (errorMsg) => (value) =>
|
||||
value || typeof value === "number" ? undefined : errorMsg;
|
||||
@@ -36,13 +37,11 @@ const RenderTextfield = ({
|
||||
}
|
||||
>
|
||||
<div id="basicSearch-hint" className="govuk-hint ">
|
||||
{hint1}
|
||||
<span className="govuk-body-m">{hint1}</span>
|
||||
|
||||
<br />
|
||||
<span className="govuk-body-s">
|
||||
<span className="govuk-!-font-weight-bold">
|
||||
{hint2}
|
||||
</span>{" "}
|
||||
CAS-00009-W8N6W4
|
||||
{hint2} CAS-00009-W8N6W4
|
||||
</span>
|
||||
</div>
|
||||
<label className="govuk-label " htmlFor={id} id={id + "_label"}>
|
||||
@@ -67,7 +66,16 @@ let CaseSearch = (props) => {
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||
|
||||
let spinnerState = () => {
|
||||
showSpinnerState == true
|
||||
? setShowSpinnerState(false)
|
||||
: setShowSpinnerState(true);
|
||||
};
|
||||
|
||||
const onHandleSubmit = (values) => {
|
||||
spinnerState();
|
||||
router.replace({
|
||||
pathname: "/searchresults",
|
||||
query: { q: values.basicSearch },
|
||||
@@ -76,43 +84,56 @@ let CaseSearch = (props) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="card" id="casesearch-card">
|
||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||
<div className="card-body">
|
||||
<h3 className="heading-small card-heading">
|
||||
{t("home:casesearch-card-title")}
|
||||
</h3>
|
||||
<>
|
||||
<div className="card" id="casesearch-card">
|
||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||
<div className="card-body">
|
||||
<h3 className="heading-small card-heading">
|
||||
{t("home:casesearch-card-title")}
|
||||
</h3>
|
||||
|
||||
<Field
|
||||
validate={[
|
||||
required(
|
||||
t("home:casesearch-search-validation-required")
|
||||
),
|
||||
minLength(
|
||||
t("home:casesearch-search-validation-minlength")
|
||||
),
|
||||
]}
|
||||
className="govuk-input"
|
||||
component={RenderTextfield}
|
||||
id="basicSearch"
|
||||
name="basicSearch"
|
||||
type="text"
|
||||
aria-describedby="basicSearch-hint"
|
||||
hint1={t("home:casesearch-card-search-hint")}
|
||||
hint2={t("home:casesearch-card-search-example-label")}
|
||||
/>
|
||||
<Field
|
||||
validate={[
|
||||
required(
|
||||
t(
|
||||
"home:casesearch-search-validation-required"
|
||||
)
|
||||
),
|
||||
minLength(
|
||||
t(
|
||||
"home:casesearch-search-validation-minlength"
|
||||
)
|
||||
),
|
||||
]}
|
||||
className="govuk-input"
|
||||
component={RenderTextfield}
|
||||
id="basicSearch"
|
||||
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">
|
||||
<button type="submit" className="govuk-button">
|
||||
{t("home:casesearch-card-button")}
|
||||
</button>
|
||||
<div className="govuk-form-group">
|
||||
<button type="submit" className="govuk-button">
|
||||
{t("home:casesearch-card-button")}
|
||||
</button>
|
||||
</div>
|
||||
<Link href="/advancedsearch">
|
||||
<a>{t("home:casesearch-card-advanced-link")}</a>
|
||||
</Link>
|
||||
</div>
|
||||
<Link href="/advancedsearch">
|
||||
<a>{t("home:casesearch-card-advanced-link")}</a>
|
||||
</Link>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
<LoadingOverlay
|
||||
active={showSpinnerState}
|
||||
spinner
|
||||
text={t("common:spinner-searching")}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,9 +2,17 @@ import Link from "next/link";
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import LoadingOverlay from "react-loading-overlay";
|
||||
|
||||
export default function Dns() {
|
||||
let { t } = useTranslation();
|
||||
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||
|
||||
let spinnerState = () => {
|
||||
showSpinnerState == true
|
||||
? setShowSpinnerState(false)
|
||||
: setShowSpinnerState(true);
|
||||
};
|
||||
return (
|
||||
<div className="card" id="casesearch-card">
|
||||
<div className="card-body">
|
||||
@@ -18,12 +26,22 @@ export default function Dns() {
|
||||
</div>
|
||||
<div className="govuk-form-group">
|
||||
<Link href="/dnsapplications">
|
||||
<a className="govuk-button">
|
||||
<a
|
||||
className="govuk-button"
|
||||
onClick={() => {
|
||||
spinnerState();
|
||||
}}
|
||||
>
|
||||
{t("home:dns-card-button")}
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
<LoadingOverlay
|
||||
active={showSpinnerState}
|
||||
spinner
|
||||
text={t("common:spinner-loading")}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -75,9 +75,8 @@ export default function Login() {
|
||||
</Link>
|
||||
</p>
|
||||
<p className="govuk-body-s">
|
||||
{t("home:login-card-forgotten-label")}{" "}
|
||||
<Link href="/">
|
||||
<a>{t("home:login-card-forgotten-link")}</a>
|
||||
<a>{t("home:login-card-forgotten-label")} </a>
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -16,11 +16,21 @@ export default function LoginSoon() {
|
||||
|
||||
<div className="govuk-form-group govuk-!-margin-top-4">
|
||||
<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 className="govuk-body-s">
|
||||
{t("home:login-comingsoon-temp-2")}
|
||||
</p>
|
||||
<br />
|
||||
<a
|
||||
target="_blank"
|
||||
href="https://gov.wales/planning-appeal-forms"
|
||||
>
|
||||
https://gov.wales/planning-appeal-forms
|
||||
</a>
|
||||
</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 jsonpath from "jsonpath";
|
||||
import data from "../../data/collections.json";
|
||||
import LoadingOverlay from "react-loading-overlay";
|
||||
|
||||
let AdvancedSearch = (props) => {
|
||||
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 { locale } = router;
|
||||
|
||||
@@ -219,8 +206,18 @@ let AdvancedSearch = (props) => {
|
||||
return collectionName[0];
|
||||
};
|
||||
|
||||
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||
|
||||
let spinnerState = () => {
|
||||
showSpinnerState == true
|
||||
? setShowSpinnerState(false)
|
||||
: setShowSpinnerState(true);
|
||||
};
|
||||
|
||||
const onHandleSubmit = (values) => {
|
||||
event.preventDefault();
|
||||
spinnerState();
|
||||
|
||||
console.log(values);
|
||||
// var appTypeCollection = values.appealTypes.split(",")[1];
|
||||
|
||||
@@ -255,151 +252,165 @@ let AdvancedSearch = (props) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="card" id="searchforcase-card">
|
||||
<div className="card-body">
|
||||
<div className="govuk-body-m ">
|
||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
|
||||
<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">
|
||||
<>
|
||||
<div>
|
||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="card" id="searchforcase-card">
|
||||
<div className="card-body">
|
||||
<div className="govuk-body-m ">
|
||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
|
||||
<h3 className="govuk-heading-m">
|
||||
{t(
|
||||
"search:sitelocation-legend"
|
||||
)}
|
||||
</h3>
|
||||
<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="address-line-1"
|
||||
htmlFor="caseRef"
|
||||
>
|
||||
{t(
|
||||
"search:address-line-one-label"
|
||||
"search:casereference-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">
|
||||
<label
|
||||
className="govuk-label"
|
||||
htmlFor="address-town"
|
||||
>
|
||||
{t("search:town-label")}
|
||||
</label>
|
||||
<input
|
||||
<Field
|
||||
name="caseRef"
|
||||
id="caseRef"
|
||||
component="input"
|
||||
className="govuk-input govuk-!-width-two-thirds"
|
||||
id="address-town"
|
||||
name="address-town"
|
||||
type="text"
|
||||
autoComplete="address-level2"
|
||||
label={t(
|
||||
"search:casereference-label"
|
||||
)}
|
||||
errormsg="Appeal type is required"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<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">
|
||||
<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">
|
||||
<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 className="govuk-form-group">
|
||||
<label
|
||||
className="govuk-label"
|
||||
htmlFor="address-town"
|
||||
>
|
||||
{t("search:town-label")}
|
||||
</label>
|
||||
<input
|
||||
className="govuk-input govuk-!-width-two-thirds"
|
||||
id="address-town"
|
||||
name="address-town"
|
||||
type="text"
|
||||
autoComplete="address-level2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<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 className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="govuk-form-group">
|
||||
<button
|
||||
type="submit"
|
||||
name="search"
|
||||
className="govuk-button"
|
||||
>
|
||||
Search
|
||||
</button>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="govuk-form-group">
|
||||
<button
|
||||
type="submit"
|
||||
name="search"
|
||||
className="govuk-button"
|
||||
>
|
||||
Search
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</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")}
|
||||
</h1>
|
||||
<p className="govuk-body">
|
||||
{t("search:searchresults-count-label", {
|
||||
count: resultsArr.length,
|
||||
})}
|
||||
{resultsArr.length > 200
|
||||
? t("search:searchresults-max-count-label")
|
||||
: t("search:searchresults-count-label", {
|
||||
count: resultsArr.length,
|
||||
})}
|
||||
.
|
||||
{typeof searchString != "undefined" ? (
|
||||
<>
|
||||
|
||||
@@ -20,8 +20,10 @@
|
||||
"social-bar-share-link": "Rhannu’r dudalen hon",
|
||||
"social-bar-share-via-link": "Rhannu’r dudalen hon ar",
|
||||
"breadcrumb-search-results": "Canlyniadau chwilio",
|
||||
"breadcrumb-advanced-search": "Advanced search",
|
||||
"breadcrumb-advanced-search-results": "Advanced search results",
|
||||
"breadcrumb-advanced-search": "Chwilio uwch",
|
||||
"breadcrumb-advanced-search-results": "Canlyniadau chwilio uwch",
|
||||
"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-comingsoon-temp-1": "W-First paragraph says something about being able to create accounts",
|
||||
"login-comingsoon-temp-2": "W-Second paragraph content to go here to explaine something else.",
|
||||
"login-card-title": "Mewngofnodi neu cofrestru",
|
||||
"login-card-title-temp": "Croeso",
|
||||
"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": "Gellir gofyn am ffurflenni apelio a chais trwy e-bost neu eu lawrlwytho gan ddilyn y ddolen isod.",
|
||||
"login-card-title": "Mewngofnodi i apelio yn erbyn penderfyniad cynllunio",
|
||||
"login-card-id-label": "Dynodydd Defnyddiwr (ID) Porth y Llywodraeth",
|
||||
"login-card-id-hint": "Gallai hyn fod hyd at 12 o gymeriadau.",
|
||||
"login-card-password-label": "Cyfrinair",
|
||||
"login-card-button": "Mewngofnodi",
|
||||
"login-card-register-label": "Cwsmer newydd wyf a hoffwn",
|
||||
"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",
|
||||
"casesearch-card-title": "Chwilio am achos",
|
||||
"casesearch-card-search-hint": "Chwiliwch drwy roi cyfeirnod 7 digid yr achos",
|
||||
"casesearch-card-search-example-label": "Enghraifft",
|
||||
"casesearch-card-button": "Cyflwyno Chwiliad",
|
||||
"casesearch-card-search-example-label": "Enghraifft:",
|
||||
"casesearch-card-button": "Cyflwyno chwiliad",
|
||||
"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-minlength": "Rhaid bod yn 4 nod neu fwy",
|
||||
"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-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.",
|
||||
"inspectorate-card-visit-label" : "Ymweld Yr Arolygiaeth Gynllunio",
|
||||
"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": "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-link": "Hafan",
|
||||
"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-button":"Gweld pob cais"
|
||||
"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-button": "Gweld pob cais"
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
"clear-all-button-label": "Clirio Pob Un",
|
||||
"searchresults-title-label": "Crynodeb o’r Achos ar gyfer",
|
||||
"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-count-label": "Fe wnaethoch chi chwilio am",
|
||||
"searchresults-site-address-label": "Cyfeiriad y Safle",
|
||||
|
||||
@@ -23,5 +23,7 @@
|
||||
"breadcrumb-advanced-search": "Advanced search",
|
||||
"breadcrumb-advanced-search-results": "Advanced search results",
|
||||
"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-comingsoon-temp-1": "First paragraph says something about being able to create accounts",
|
||||
"login-comingsoon-temp-2": "Second paragraph content to go here to explaine something else.",
|
||||
"login-card-title": "Log in or Register",
|
||||
"login-card-title-temp": "Welcome",
|
||||
"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": "Appeal and application forms can be requested by email or downloaded following the below link.",
|
||||
"login-card-title": "Sign in to appeal a planning decision",
|
||||
"login-card-id-label": "Government Gateway user ID",
|
||||
"login-card-id-hint": "This could be up to 12 characters.",
|
||||
"login-card-password-label": "Password",
|
||||
"login-card-button": "Sign in",
|
||||
"login-card-register-label": "I am a new user and would like to",
|
||||
"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",
|
||||
"casesearch-card-title": "Search for a case",
|
||||
"casesearch-card-search-hint": "Search by entering the 7 digit case reference number",
|
||||
"casesearch-card-search-example-label": "Example",
|
||||
"casesearch-card-button": "Submit Search",
|
||||
"casesearch-card-advanced-link": "Advanced Search",
|
||||
"casesearch-card-search-example-label": "Example:",
|
||||
"casesearch-card-button": "Submit search",
|
||||
"casesearch-card-advanced-link": "Advanced search",
|
||||
"casesearch-search-validation-required": "Required",
|
||||
"casesearch-search-validation-minlength": "Must be 4 characters or more",
|
||||
"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-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",
|
||||
"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.",
|
||||
"inspectorate-card-visit-label": "Visit the Planning Inspectorate",
|
||||
"inspectorate-card-visit-link": "Home",
|
||||
"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-button":"View all applications"
|
||||
"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-button": "View all applications"
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
"clear-all-button-label": "Clear all",
|
||||
"searchresults-title-label": "Search for a case",
|
||||
"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-count-label": "You searched for",
|
||||
"searchresults-site-address-label": "Site address",
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"react-datepicker": "^4.1.1",
|
||||
"react-dom": "17.0.2",
|
||||
"react-dropzone": "^11.3.4",
|
||||
"react-loading-overlay": "^1.0.1",
|
||||
"react-redux": "^7.2.4",
|
||||
"react-xml-parser": "^1.1.8",
|
||||
"redux-devtools-extension": "^2.13.9",
|
||||
|
||||
+12
-3
@@ -1,4 +1,5 @@
|
||||
import _ from "lodash";
|
||||
import { useState } from "react";
|
||||
import Head from "next/head";
|
||||
import Header from "../components/header";
|
||||
import Banner from "../components/banner";
|
||||
@@ -21,7 +22,13 @@ import {
|
||||
setAppealLPA,
|
||||
getAppealTypeObj,
|
||||
} 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";
|
||||
|
||||
const Home = (props) => {
|
||||
@@ -59,9 +66,11 @@ const Home = (props) => {
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) =>
|
||||
async ({ query, req, res }) => {
|
||||
const token = await getSASToken();
|
||||
|
||||
const [appealTypeData, lpaData, caseData] = await Promise.all([
|
||||
await getAppealsTypes(),
|
||||
await getLPA(),
|
||||
await getAppealsTypes(token),
|
||||
await getLPA(token),
|
||||
]);
|
||||
|
||||
store.dispatch(setAppealType(appealTypeData));
|
||||
|
||||
@@ -22,7 +22,11 @@ import {
|
||||
setSearchDetails,
|
||||
getSearchResultsObj,
|
||||
} from "../store/searchOutput/action";
|
||||
import { getAdvancedSearch, getBasicSearchDetails } from "../actions";
|
||||
import {
|
||||
getAdvancedSearch,
|
||||
getBasicSearchDetails,
|
||||
getSASToken,
|
||||
} from "../actions";
|
||||
|
||||
const Home = (props) => {
|
||||
const { footerLinks, pages } = props;
|
||||
@@ -63,10 +67,13 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
console.log("query-", query);
|
||||
//console.log("search array:", Object.entries(query));
|
||||
|
||||
let querystring;
|
||||
const token = await getSASToken();
|
||||
|
||||
const searchResultsObj = await getAdvancedSearch(query);
|
||||
const searchDetailsObj = await getSearchDetails(searchResultsObj);
|
||||
const searchResultsObj = await getAdvancedSearch(token, query);
|
||||
const searchDetailsObj = await getSearchDetails(
|
||||
token,
|
||||
searchResultsObj
|
||||
);
|
||||
// console.log(searchDetailsObj);
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
@@ -83,7 +90,7 @@ const getFormCollection = (formtype) => {
|
||||
return collectionName[0];
|
||||
};
|
||||
|
||||
const getSearchDetails = (searchResultsObj) => {
|
||||
const getSearchDetails = (token, searchResultsObj) => {
|
||||
//console.log(searchResultsObj);
|
||||
|
||||
let detailsArr = [];
|
||||
@@ -95,6 +102,7 @@ const getSearchDetails = (searchResultsObj) => {
|
||||
} else {
|
||||
detailsArr.push(
|
||||
getBasicSearchDetails(
|
||||
token,
|
||||
getFormCollection(
|
||||
"pinswg_" +
|
||||
searchDetail[
|
||||
|
||||
@@ -65,13 +65,13 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
|
||||
const searchResultsObj = await getBasicSearch(token, query.q);
|
||||
|
||||
console.log("sssss", searchResultsObj);
|
||||
//console.log("sssss", searchResultsObj);
|
||||
|
||||
const searchDetailsObj = await getSearchDetails(
|
||||
token,
|
||||
searchResultsObj
|
||||
);
|
||||
console.log(searchDetailsObj);
|
||||
//console.log(searchDetailsObj);
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
store.dispatch(setSearch(query.q));
|
||||
@@ -88,7 +88,7 @@ const getFormCollection = (formtype) => {
|
||||
};
|
||||
|
||||
const getSearchDetails = (token, searchResultsObj) => {
|
||||
console.log(searchResultsObj);
|
||||
//console.log(searchResultsObj);
|
||||
|
||||
let detailsArr = [];
|
||||
console.log("search results", searchResultsObj);
|
||||
|
||||
@@ -402,11 +402,11 @@ a.longLinkBreak {
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
.at-nav h3 {
|
||||
}
|
||||
// .at-nav h3 {
|
||||
// }
|
||||
|
||||
.at-nav__chapter {
|
||||
}
|
||||
// .at-nav__chapter {
|
||||
// }
|
||||
|
||||
.at-nav__section {
|
||||
cursor: pointer;
|
||||
@@ -1107,3 +1107,16 @@ ul#sharePageLinks.active {
|
||||
.react-autosuggest__suggestion--highlighted {
|
||||
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