@@ -43,6 +43,7 @@ const Breadcrumbs = (props) => {
|
||||
? 9
|
||||
: "";
|
||||
|
||||
var viewAllKey = currentView?.viewKey || router.query.viewKey;
|
||||
return (
|
||||
<>
|
||||
<nav
|
||||
@@ -475,24 +476,20 @@ const Breadcrumbs = (props) => {
|
||||
</Link>
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{currentView.currentView.viewKey ==
|
||||
{viewAllKey ==
|
||||
"awaitingSubmissionDetails" &&
|
||||
t(
|
||||
"myportal:awatitingsubmission-card-title"
|
||||
)}
|
||||
{currentView.currentView.viewKey ==
|
||||
"watchedCases" &&
|
||||
{viewAllKey == "watchedCases" &&
|
||||
t("myportal:watchedcases-card-title")}
|
||||
{currentView.currentView.viewKey ==
|
||||
"myCases" &&
|
||||
{viewAllKey == "myCases" &&
|
||||
t("myportal:mycases-card-title")}
|
||||
{currentView.currentView.viewKey ==
|
||||
"myRepresentations" &&
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
t(
|
||||
"myportal:myrepresentations-card-title"
|
||||
)}
|
||||
{currentView.currentView.viewKey ==
|
||||
"mySubmittedReps" &&
|
||||
{viewAllKey == "mySubmittedReps" &&
|
||||
"Submitted representations"}
|
||||
</li>
|
||||
</>
|
||||
|
||||
@@ -57,7 +57,6 @@ const CaseSummary = (props) => {
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const {
|
||||
appealTypeID,
|
||||
incidentid,
|
||||
caseReference,
|
||||
myCases,
|
||||
@@ -79,6 +78,7 @@ const CaseSummary = (props) => {
|
||||
docsOffline,
|
||||
} = props;
|
||||
|
||||
let appealTypeID = props.appealTypeID || router.query.appealType;
|
||||
const showLoginCheck =
|
||||
currentType == "directResultsObj" ? "true" : currentView.showLogin;
|
||||
const { data: session, status } = useSession();
|
||||
|
||||
@@ -34,11 +34,12 @@ const AwaitingSubmission = (props) => {
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
(router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
: "/myportal/viewall") +
|
||||
"?viewKey=awaitingSubmission"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -351,11 +351,12 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
(router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
: "/myportal/viewall") +
|
||||
"?viewKey=awaitingSubmission"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -29,11 +29,11 @@ const MyCases = (props) => {
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
(router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
: "/myportal/viewall") + "?viewKey=myCases"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -34,11 +34,12 @@ const MyRepresentations = (props) => {
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
(router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
: "/myportal/viewall") +
|
||||
"?viewKey=myRepresentations"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -33,11 +33,12 @@ const MyRepresentations = (props) => {
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
(router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
: "/myportal/viewall") +
|
||||
"?viewKey=myRepresentations"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -40,11 +40,12 @@ const MySubmittedReps = (props) => {
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
(router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
: "/myportal/viewall") +
|
||||
"?viewKey=mySubmittedReps"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -207,13 +207,19 @@ const TopThree = (props) => {
|
||||
showTopThreeArr[key].incidentid
|
||||
: router.locale == "cy"
|
||||
? "/fymhorth/achos/" +
|
||||
showTopThreeArr[key].pinswg_title +
|
||||
showTopThreeArr[key].ticketnumber +
|
||||
"?key=" +
|
||||
topThreeType
|
||||
topThreeType +
|
||||
"&appealType=" +
|
||||
showTopThreeArr[key]
|
||||
.pinswg_appealcasetype
|
||||
: "/myportal/case/" +
|
||||
showTopThreeArr[key].pinswg_title +
|
||||
showTopThreeArr[key].ticketnumber +
|
||||
"?key=" +
|
||||
topThreeType
|
||||
topThreeType +
|
||||
"&appealType=" +
|
||||
showTopThreeArr[key]
|
||||
.pinswg_appealcasetype
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
data-id={index}
|
||||
|
||||
@@ -77,18 +77,20 @@ const ViewAllResults = (props) => {
|
||||
};
|
||||
|
||||
let currentView = props.currentView.currentView;
|
||||
//console.log("currentView.viewKey:", typeof currentView.viewKey);
|
||||
//console.log("viewAllKey:", typeof viewAllKey);
|
||||
|
||||
// typeof currentView.viewKey == "undefined"
|
||||
// typeof viewAllKey == "undefined"
|
||||
// ? console.log("no currentview")
|
||||
// : console.log("has currentview");
|
||||
|
||||
var viewAllKey = currentView?.viewKey || router.query.viewKey;
|
||||
|
||||
var resultsArr =
|
||||
currentView.viewKey == "awaitingSubmissionDetails"
|
||||
viewAllKey == "awaitingSubmissionDetails"
|
||||
? props["awaitingSubmission"].awaitingSubmissionDetails.case
|
||||
: currentView.viewKey == "mySubmittedReps"
|
||||
? props[currentView.viewKey][currentView.viewKey]
|
||||
: props[currentView.viewKey][currentView.viewKey].value || [];
|
||||
: viewAllKey == "mySubmittedReps"
|
||||
? props[viewAllKey][viewAllKey]
|
||||
: props[viewAllKey][viewAllKey].value || [];
|
||||
|
||||
const [orderByState, setOrderbyState] = useState("createdon");
|
||||
const [fieldSortState, setfieldSortState] = useState("asc");
|
||||
@@ -105,11 +107,11 @@ const ViewAllResults = (props) => {
|
||||
}
|
||||
|
||||
var searchDetailsObj =
|
||||
currentView.viewKey == "awaitingSubmissionDetails"
|
||||
viewAllKey == "awaitingSubmissionDetails"
|
||||
? props["awaitingSubmission"].awaitingSubmissionDetails.value
|
||||
: currentView.viewKey == "myRepresentations"
|
||||
: viewAllKey == "myRepresentations"
|
||||
? props["myRepresentations"].myRepresentations.value
|
||||
: props[currentView.viewKey][currentView.viewKey + "Details"] || [];
|
||||
: props[viewAllKey][viewAllKey + "Details"] || [];
|
||||
|
||||
let resultsRowArr = [];
|
||||
const buildResultsRowArr = () => {
|
||||
@@ -117,15 +119,13 @@ const ViewAllResults = (props) => {
|
||||
let detailsObj = jsonpath({
|
||||
path:
|
||||
"$" +
|
||||
(currentView.viewKey == "myRepresentations"
|
||||
? ""
|
||||
: "..value") +
|
||||
(viewAllKey == "myRepresentations" ? "" : "..value") +
|
||||
'[?(@ && @.pinswg_name=="' +
|
||||
(currentView.viewKey == "awaitingSubmissionDetails"
|
||||
(viewAllKey == "awaitingSubmissionDetails"
|
||||
? item.title
|
||||
: currentView.viewKey == "watchedCases"
|
||||
: viewAllKey == "watchedCases"
|
||||
? item.ticketnumber
|
||||
: currentView.viewKey == "myRepresentations"
|
||||
: viewAllKey == "myRepresentations"
|
||||
? item.pinswg_name
|
||||
: item.pinswg_title) +
|
||||
'")]',
|
||||
@@ -137,7 +137,7 @@ const ViewAllResults = (props) => {
|
||||
//console.log(searchDetailsObj[key]);
|
||||
|
||||
// searchDetailsObj[key] =
|
||||
// currentView.viewKey == "myRepresentations"
|
||||
// viewAllKey == "myRepresentations"
|
||||
// ? searchDetailsObj[key].value[0]
|
||||
// : searchDetailsObj[key];
|
||||
|
||||
@@ -145,7 +145,7 @@ const ViewAllResults = (props) => {
|
||||
resultsRowArr.push(
|
||||
<div className="govuk-summary-list__row" key={key}>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
|
||||
{currentView.viewKey == "myCases" &&
|
||||
{viewAllKey == "myCases" &&
|
||||
resultsArr[key].pinswg_publishtoweb === false ? (
|
||||
<div className="cardModuleReference">
|
||||
{resultsArr[key].ticketnumber}{" "}
|
||||
@@ -155,8 +155,7 @@ const ViewAllResults = (props) => {
|
||||
<>
|
||||
<Link
|
||||
href={
|
||||
currentView.viewKey ==
|
||||
"myRepresentations"
|
||||
viewAllKey == "myRepresentations"
|
||||
? {
|
||||
pathname:
|
||||
"/myportal/representation",
|
||||
@@ -169,7 +168,7 @@ const ViewAllResults = (props) => {
|
||||
.repfile_name,
|
||||
},
|
||||
}
|
||||
: currentView.viewKey ==
|
||||
: viewAllKey ==
|
||||
"awaitingSubmissionDetails"
|
||||
? router.locale == "cy"
|
||||
? "/fymhorth/parhauigyflwyno"
|
||||
@@ -191,7 +190,7 @@ const ViewAllResults = (props) => {
|
||||
"&inid=" +
|
||||
resultsArr[key].incidentid +
|
||||
"&key=" +
|
||||
currentView.viewKey
|
||||
viewAllKey
|
||||
: router.locale == "cy"
|
||||
? myportal == true
|
||||
? "/fymhorth/achos"
|
||||
@@ -200,12 +199,12 @@ const ViewAllResults = (props) => {
|
||||
? "/myportal/case/" +
|
||||
resultsArr[key].ticketnumber +
|
||||
"?key=" +
|
||||
currentView.viewKey
|
||||
viewAllKey
|
||||
: "/case/" +
|
||||
resultsArr[key].ticketnumber
|
||||
}
|
||||
onClick={() => {
|
||||
currentView.viewKey == "watchedCases" &&
|
||||
viewAllKey == "watchedCases" &&
|
||||
setSearchResults(
|
||||
props.watchedCases.watchedCases
|
||||
),
|
||||
@@ -218,9 +217,8 @@ const ViewAllResults = (props) => {
|
||||
resultsArr[key]
|
||||
.ticketnumber,
|
||||
"currentReference":
|
||||
currentView.viewKey !=
|
||||
"watchedCases"
|
||||
? currentView.viewKey ==
|
||||
viewAllKey != "watchedCases"
|
||||
? viewAllKey ==
|
||||
"myRepresentations"
|
||||
? resultsArr[key]
|
||||
.caseRef
|
||||
@@ -230,11 +228,9 @@ const ViewAllResults = (props) => {
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
],
|
||||
|
||||
"currentType":
|
||||
currentView.viewKey,
|
||||
"currentType": viewAllKey,
|
||||
"incidentid":
|
||||
currentView.viewKey !=
|
||||
"watchedCases"
|
||||
viewAllKey != "watchedCases"
|
||||
? resultsArr[key]
|
||||
.incidentid
|
||||
: resultsArr[key][
|
||||
@@ -245,14 +241,14 @@ const ViewAllResults = (props) => {
|
||||
resultsArr[key]
|
||||
.pinswg_appealcasetype,
|
||||
"repDetails":
|
||||
currentView.viewKey ==
|
||||
viewAllKey ==
|
||||
"myRepresentations" &&
|
||||
resultsArr[key],
|
||||
}),
|
||||
setCurrentView({
|
||||
"viewName":
|
||||
currentView.viewName,
|
||||
"viewKey": currentView.viewKey,
|
||||
"viewKey": viewAllKey,
|
||||
});
|
||||
}}
|
||||
>
|
||||
@@ -262,9 +258,8 @@ const ViewAllResults = (props) => {
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{currentView.viewKey != "watchedCases"
|
||||
? currentView.viewKey ==
|
||||
"myRepresentations"
|
||||
{viewAllKey != "watchedCases"
|
||||
? viewAllKey == "myRepresentations"
|
||||
? resultsArr[key].caseRef
|
||||
: resultsArr[key].ticketnumber
|
||||
: resultsArr[key][
|
||||
@@ -275,7 +270,7 @@ const ViewAllResults = (props) => {
|
||||
detailsObj={detailsObj}
|
||||
appealType={item.pinswg_appealcasetype}
|
||||
/>
|
||||
{currentView.viewKey == "myRepresentations" && (
|
||||
{viewAllKey == "myRepresentations" && (
|
||||
<>
|
||||
<br />
|
||||
<span>
|
||||
@@ -291,14 +286,14 @@ const ViewAllResults = (props) => {
|
||||
{t("search:searchresults-site-address-label")}:
|
||||
</span>
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
||||
? searchDetailsObj[key].pinswg_siteaddressline1
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||
? detailsObj.pinswg_siteaddressline1
|
||||
: ""}
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
|
||||
? searchDetailsObj[key].value[0]
|
||||
.pinswg_siteaddressline1
|
||||
@@ -306,14 +301,14 @@ const ViewAllResults = (props) => {
|
||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||
? detailsObj.pinswg_siteaddressline1
|
||||
: ""}
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddressline1"
|
||||
) &&
|
||||
searchDetailsObj[key].pinswg_siteaddressline1 !=
|
||||
null && <br />}
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
_.has(
|
||||
searchDetailsObj[key].pinswg_siteaddressline1
|
||||
) &&
|
||||
@@ -323,25 +318,25 @@ const ViewAllResults = (props) => {
|
||||
detailsObj.pinswg_siteaddressline1 != null && (
|
||||
<br />
|
||||
)}
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
||||
? searchDetailsObj[key].pinswg_siteaddressline2
|
||||
: ""}
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
|
||||
? searchDetailsObj[key].pinswg_siteaddressline2
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||
? detailsObj.pinswg_siteaddressline2
|
||||
: ""}
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddressline2"
|
||||
) &&
|
||||
searchDetailsObj[key].pinswg_siteaddressline2 !=
|
||||
null && <br />}
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
_.has(
|
||||
searchDetailsObj[key].pinswg_siteaddressline2
|
||||
) &&
|
||||
@@ -351,25 +346,25 @@ const ViewAllResults = (props) => {
|
||||
detailsObj.pinswg_siteaddressline2 != null && (
|
||||
<br />
|
||||
)}
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
||||
? searchDetailsObj[key].pinswg_siteaddresstown
|
||||
: ""}
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
||||
? searchDetailsObj[key].pinswg_siteaddresstown
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_siteaddresstown")
|
||||
? detailsObj.pinswg_siteaddresstown
|
||||
: ""}
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddresstown"
|
||||
) &&
|
||||
searchDetailsObj[key].pinswg_siteaddresstown !=
|
||||
null && <br />}
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddresstown"
|
||||
@@ -378,18 +373,18 @@ const ViewAllResults = (props) => {
|
||||
null && <br />}
|
||||
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
||||
detailsObj.pinswg_siteaddresstown != null && <br />}
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
||||
? searchDetailsObj[key].pinswg_siteaddresscounty
|
||||
: ""}
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
||||
? searchDetailsObj[key].pinswg_siteaddresscounty
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_siteaddresscounty")
|
||||
? detailsObj.pinswg_siteaddresscounty
|
||||
: ""}
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddresscounty"
|
||||
@@ -400,7 +395,7 @@ const ViewAllResults = (props) => {
|
||||
detailsObj.pinswg_siteaddresscounty != null && (
|
||||
<br />
|
||||
)}
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddresspostcode"
|
||||
@@ -426,10 +421,9 @@ const ViewAllResults = (props) => {
|
||||
"pinswg_siteaddresspostcode",
|
||||
].map((field, idx) => {
|
||||
const isAwaitingSubmission =
|
||||
currentView.viewKey ===
|
||||
"awaitingSubmissionDetails";
|
||||
viewAllKey === "awaitingSubmissionDetails";
|
||||
const isMyRepresentations =
|
||||
currentView.viewKey === "myRepresentations";
|
||||
viewAllKey === "myRepresentations";
|
||||
const searchValue = _.get(
|
||||
searchDetailsObj,
|
||||
`${key}.${field}`
|
||||
@@ -457,11 +451,11 @@ const ViewAllResults = (props) => {
|
||||
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
||||
{viewAllKey == "awaitingSubmissionDetails"
|
||||
? t("search:searchresults-created-on-label")
|
||||
: t("search:searchresults-applicant-label")}
|
||||
</span>
|
||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
||||
{viewAllKey == "awaitingSubmissionDetails"
|
||||
? formatDates(item.createdon)
|
||||
: _.has(detailsObj, [
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
|
||||
@@ -469,7 +463,7 @@ const ViewAllResults = (props) => {
|
||||
? detailsObj[
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
: currentView.viewKey == "myRepresentations"
|
||||
: viewAllKey == "myRepresentations"
|
||||
? searchDetailsObj[key][
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
@@ -481,7 +475,7 @@ const ViewAllResults = (props) => {
|
||||
<span className="results-visually-hidden">
|
||||
{t("search:searchresults-authority-label")}:
|
||||
</span>
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
_.has(resultsArr[key], "pinswg_lpaname")
|
||||
? router.locale == "cy"
|
||||
? jsonpath({
|
||||
@@ -526,7 +520,7 @@ const ViewAllResults = (props) => {
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: currentView.viewKey == "myRepresentations"
|
||||
: viewAllKey == "myRepresentations"
|
||||
? searchDetailsObj[key].value
|
||||
: searchDetailsObj[key].value[0][
|
||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||
@@ -549,10 +543,10 @@ const ViewAllResults = (props) => {
|
||||
: resultsArr[key][
|
||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
(currentView.viewKey == "myRepresentations"
|
||||
(viewAllKey == "myRepresentations"
|
||||
? ""
|
||||
: "N/A")
|
||||
: currentView.viewKey == "myRepresentations" &&
|
||||
: viewAllKey == "myRepresentations" &&
|
||||
router.locale == "cy" &&
|
||||
jsonpath({
|
||||
path:
|
||||
@@ -570,7 +564,7 @@ const ViewAllResults = (props) => {
|
||||
{t("search:searchresults-case-type-label")}:
|
||||
</span>
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
||||
{viewAllKey == "awaitingSubmissionDetails"
|
||||
? router.locale == "cy"
|
||||
? jsonpath({
|
||||
path:
|
||||
@@ -599,11 +593,9 @@ const ViewAllResults = (props) => {
|
||||
: item[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
(currentView.viewKey == "myRepresentations"
|
||||
? ""
|
||||
: "N/A")}
|
||||
(viewAllKey == "myRepresentations" ? "" : "N/A")}
|
||||
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
(router.locale == "cy"
|
||||
? jsonpath({
|
||||
path:
|
||||
@@ -625,13 +617,13 @@ const ViewAllResults = (props) => {
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
{currentView.viewKey == "myRepresentations"
|
||||
{viewAllKey == "myRepresentations"
|
||||
? "Created"
|
||||
: t("search:searchresults-status-label")}
|
||||
:
|
||||
</span>
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
||||
{viewAllKey == "awaitingSubmissionDetails"
|
||||
? router.locale == "cy"
|
||||
? jsonpath({
|
||||
path:
|
||||
@@ -649,7 +641,7 @@ const ViewAllResults = (props) => {
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
}) || "N/A"
|
||||
: currentView.viewKey == "myRepresentations"
|
||||
: viewAllKey == "myRepresentations"
|
||||
? repRaisedDate(item.repfile_name) // ? router.locale == "cy"
|
||||
: // ? jsonpath({path:
|
||||
//
|
||||
@@ -687,7 +679,7 @@ const ViewAllResults = (props) => {
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] || "N/A"}
|
||||
</dd>
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" && (
|
||||
{viewAllKey == "awaitingSubmissionDetails" && (
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
|
||||
<button
|
||||
title={t(
|
||||
@@ -715,7 +707,7 @@ const ViewAllResults = (props) => {
|
||||
</button>
|
||||
</dd>
|
||||
)}
|
||||
{currentView.viewKey == "myRepresentations" && (
|
||||
{viewAllKey == "myRepresentations" && (
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
|
||||
<button
|
||||
title={t(
|
||||
@@ -745,7 +737,7 @@ const ViewAllResults = (props) => {
|
||||
</dd>
|
||||
)}
|
||||
|
||||
{currentView.viewKey == "watchedCases" && (
|
||||
{viewAllKey == "watchedCases" && (
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
|
||||
<button
|
||||
title={t(
|
||||
@@ -897,15 +889,15 @@ const ViewAllResults = (props) => {
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
t("myportal:awatitingsubmission-card-title")}
|
||||
{currentView.viewKey == "watchedCases" &&
|
||||
{viewAllKey == "watchedCases" &&
|
||||
t("myportal:watchedcases-card-title")}
|
||||
{currentView.viewKey == "myCases" &&
|
||||
{viewAllKey == "myCases" &&
|
||||
t("myportal:mycases-card-title")}
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
t("myportal:myrepresentations-card-title")}
|
||||
{currentView.viewKey == "mySubmittedReps" &&
|
||||
{viewAllKey == "mySubmittedReps" &&
|
||||
"Submitted representations"}
|
||||
</h1>
|
||||
|
||||
@@ -913,14 +905,13 @@ const ViewAllResults = (props) => {
|
||||
<h3>
|
||||
{" "}
|
||||
There are no{" "}
|
||||
{currentView.viewKey ==
|
||||
"awaitingSubmissionDetails" &&
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
t("myportal:awatitingsubmission-card-title")}
|
||||
{currentView.viewKey == "watchedCases" &&
|
||||
{viewAllKey == "watchedCases" &&
|
||||
t("myportal:watchedcases-card-title")}
|
||||
{currentView.viewKey == "myCases" &&
|
||||
{viewAllKey == "myCases" &&
|
||||
t("myportal:mycases-card-title")}
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
t("myportal:myrepresentations-card-title")}{" "}
|
||||
records
|
||||
</h3>
|
||||
@@ -932,7 +923,7 @@ const ViewAllResults = (props) => {
|
||||
type="button"
|
||||
onClick={() =>
|
||||
sortDataBy(
|
||||
currentView.viewKey ==
|
||||
viewAllKey ==
|
||||
"awaitingSubmissionDetails"
|
||||
? "title"
|
||||
: "pinswg_title"
|
||||
@@ -940,7 +931,7 @@ const ViewAllResults = (props) => {
|
||||
}
|
||||
className={
|
||||
orderByState ==
|
||||
(currentView.viewKey ==
|
||||
(viewAllKey ==
|
||||
"awaitingSubmissionDetails"
|
||||
? "title"
|
||||
: "pinswg_title")
|
||||
@@ -960,8 +951,7 @@ const ViewAllResults = (props) => {
|
||||
"search:searchresults-site-address-label"
|
||||
)}
|
||||
</dd>
|
||||
{currentView.viewKey ==
|
||||
"awaitingSubmissionDetails" ? (
|
||||
{viewAllKey == "awaitingSubmissionDetails" ? (
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
<button
|
||||
type="button"
|
||||
@@ -993,7 +983,7 @@ const ViewAllResults = (props) => {
|
||||
type="button"
|
||||
onClick={() =>
|
||||
sortDataBy(
|
||||
currentView.viewKey ==
|
||||
viewAllKey ==
|
||||
"awaitingSubmissionDetails"
|
||||
? "pinswg_lpaname"
|
||||
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
@@ -1001,7 +991,7 @@ const ViewAllResults = (props) => {
|
||||
}
|
||||
className={
|
||||
orderByState ==
|
||||
(currentView.viewKey ==
|
||||
(viewAllKey ==
|
||||
"awaitingSubmissionDetails"
|
||||
? "pinswg_lpaname"
|
||||
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue")
|
||||
@@ -1017,7 +1007,7 @@ const ViewAllResults = (props) => {
|
||||
</button>
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{currentView.viewKey !=
|
||||
{viewAllKey !=
|
||||
"awaitingSubmissionDetails" ? (
|
||||
<button
|
||||
type="button"
|
||||
@@ -1028,7 +1018,7 @@ const ViewAllResults = (props) => {
|
||||
}
|
||||
className={
|
||||
orderByState ==
|
||||
(currentView.viewKey ==
|
||||
(viewAllKey ==
|
||||
"awaitingSubmissionDetails"
|
||||
? "pinswg_lpaname"
|
||||
: "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue")
|
||||
@@ -1049,8 +1039,7 @@ const ViewAllResults = (props) => {
|
||||
)}{" "}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{currentView.viewKey ==
|
||||
"myRepresentations" ? (
|
||||
{viewAllKey == "myRepresentations" ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
|
||||
@@ -40,11 +40,12 @@ const WatchedCases = (props) => {
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
(router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall"
|
||||
: "/myportal/viewall") +
|
||||
"?viewKey=watchedCases"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { connect } from "react-redux";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import PaginationControl from "./pagination";
|
||||
|
||||
import { getBasicDNSSearchPaged } from "../../actions";
|
||||
import { getBasicDNSSearchPaged, getDNSCoords } from "../../actions";
|
||||
|
||||
import GoogleMapReact from "google-map-react";
|
||||
import { parseCookies } from "nookies";
|
||||
@@ -42,7 +42,6 @@ const DNSSearchResults = (props) => {
|
||||
setSearchDetails,
|
||||
advancedSearch,
|
||||
setCurrentPage,
|
||||
dnsCoords,
|
||||
myportal,
|
||||
watchedCases,
|
||||
setWatchedCases,
|
||||
@@ -59,86 +58,86 @@ const DNSSearchResults = (props) => {
|
||||
const [searchLoaded, setSearchLoaded] = useState(false);
|
||||
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||
|
||||
let dataArray = [];
|
||||
//push your Json Data in the array
|
||||
if (showMap == "true") {
|
||||
dnsCoords.map((item) => {
|
||||
let point = new OSPoint(
|
||||
item.pinswg_anticipatedgridrefnorthing ||
|
||||
item.pinswg_anticipatedgridreferencenorthingtext ||
|
||||
0,
|
||||
item.pinswg_anticipatedgridrefeasting ||
|
||||
item.pinswg_anticipatedgridreferenceeastingtext ||
|
||||
0
|
||||
);
|
||||
let siteCoords = point.toOSGB36();
|
||||
//console.log(siteCoords);
|
||||
//console.log(item);
|
||||
dataArray.push({
|
||||
appellant:
|
||||
item[
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||
],
|
||||
name: item.pinswg_projectname,
|
||||
lat: parseFloat(siteCoords.latitude),
|
||||
lng: parseFloat(siteCoords.longitude),
|
||||
title: item.pinswg_name,
|
||||
});
|
||||
});
|
||||
}
|
||||
// let dataArray = [];
|
||||
// //push your Json Data in the array
|
||||
// if (showMap == "true") {
|
||||
// dnsCoords.map((item) => {
|
||||
// let point = new OSPoint(
|
||||
// item.pinswg_anticipatedgridrefnorthing ||
|
||||
// item.pinswg_anticipatedgridreferencenorthingtext ||
|
||||
// 0,
|
||||
// item.pinswg_anticipatedgridrefeasting ||
|
||||
// item.pinswg_anticipatedgridreferenceeastingtext ||
|
||||
// 0
|
||||
// );
|
||||
// let siteCoords = point.toOSGB36();
|
||||
// //console.log(siteCoords);
|
||||
// //console.log(item);
|
||||
// dataArray.push({
|
||||
// appellant:
|
||||
// item[
|
||||
// "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||
// ],
|
||||
// name: item.pinswg_projectname,
|
||||
// lat: parseFloat(siteCoords.latitude),
|
||||
// lng: parseFloat(siteCoords.longitude),
|
||||
// title: item.pinswg_name,
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
|
||||
//console.log(dataArray);
|
||||
|
||||
const ModelsMap = (map, maps) => {
|
||||
//instantiate array that will hold your Json Data
|
||||
//console.log("here");
|
||||
var prev_infowindow = false;
|
||||
//Loop through the dataArray to create a marker per data using the coordinates in the json
|
||||
console.log(dataArray.length);
|
||||
for (let i = 0; i < dataArray.length; i++) {
|
||||
const infowindow = new google.maps.InfoWindow({
|
||||
content:
|
||||
"<div>" +
|
||||
(_.isEmpty(dataArray[i].name)
|
||||
? ""
|
||||
: dataArray[i].name.indexOf(";") > 0
|
||||
? router.locale == "cy"
|
||||
? dataArray[i].name.split(";")[1]
|
||||
: dataArray[i].name.split(";")[0]
|
||||
: dataArray[i].name) +
|
||||
"</div>" +
|
||||
(dataArray[i].appellant != null
|
||||
? "<div>" + dataArray[i].appellant + "</div>"
|
||||
: "") +
|
||||
"<div>" +
|
||||
dataArray[i].title +
|
||||
"</div>",
|
||||
});
|
||||
let marker = new maps.Marker({
|
||||
position: { lat: dataArray[i].lat, lng: dataArray[i].lng },
|
||||
title: _.isEmpty(dataArray[i].name)
|
||||
? ""
|
||||
: dataArray[i].name.indexOf(";") > 0
|
||||
? router.locale == "cy"
|
||||
? dataArray[i].name.split(";")[1]
|
||||
: dataArray[i].name.split(";")[0]
|
||||
: dataArray[i].name,
|
||||
map,
|
||||
});
|
||||
marker.addListener("click", () => {
|
||||
if (prev_infowindow) {
|
||||
prev_infowindow.close();
|
||||
}
|
||||
// const ModelsMap = (map, maps) => {
|
||||
// //instantiate array that will hold your Json Data
|
||||
// //console.log("here");
|
||||
// var prev_infowindow = false;
|
||||
// //Loop through the dataArray to create a marker per data using the coordinates in the json
|
||||
// console.log(dataArray.length);
|
||||
// for (let i = 0; i < dataArray.length; i++) {
|
||||
// const infowindow = new google.maps.InfoWindow({
|
||||
// content:
|
||||
// "<div>" +
|
||||
// (_.isEmpty(dataArray[i].name)
|
||||
// ? ""
|
||||
// : dataArray[i].name.indexOf(";") > 0
|
||||
// ? router.locale == "cy"
|
||||
// ? dataArray[i].name.split(";")[1]
|
||||
// : dataArray[i].name.split(";")[0]
|
||||
// : dataArray[i].name) +
|
||||
// "</div>" +
|
||||
// (dataArray[i].appellant != null
|
||||
// ? "<div>" + dataArray[i].appellant + "</div>"
|
||||
// : "") +
|
||||
// "<div>" +
|
||||
// dataArray[i].title +
|
||||
// "</div>",
|
||||
// });
|
||||
// let marker = new maps.Marker({
|
||||
// position: { lat: dataArray[i].lat, lng: dataArray[i].lng },
|
||||
// title: _.isEmpty(dataArray[i].name)
|
||||
// ? ""
|
||||
// : dataArray[i].name.indexOf(";") > 0
|
||||
// ? router.locale == "cy"
|
||||
// ? dataArray[i].name.split(";")[1]
|
||||
// : dataArray[i].name.split(";")[0]
|
||||
// : dataArray[i].name,
|
||||
// map,
|
||||
// });
|
||||
// marker.addListener("click", () => {
|
||||
// if (prev_infowindow) {
|
||||
// prev_infowindow.close();
|
||||
// }
|
||||
|
||||
prev_infowindow = infowindow;
|
||||
infowindow.open({
|
||||
anchor: marker,
|
||||
map,
|
||||
shouldFocus: true,
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
// prev_infowindow = infowindow;
|
||||
// infowindow.open({
|
||||
// anchor: marker,
|
||||
// map,
|
||||
// shouldFocus: true,
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
// };
|
||||
|
||||
let spinnerState = () => {
|
||||
showSpinnerState == true
|
||||
@@ -342,7 +341,7 @@ const DNSSearchResults = (props) => {
|
||||
appType ==
|
||||
"Developments of National Significance"
|
||||
? "DNS"
|
||||
: "SIPs";
|
||||
: "SIP";
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
@@ -379,7 +379,7 @@
|
||||
"MetadataId": "8d31911b-b8ea-ef11-ab08-00224800be9c",
|
||||
"appealTypeID": "846040002",
|
||||
"NavigationProperty": "pinswg_SIPSIds",
|
||||
"value": "SIPs"
|
||||
"value": "SIP"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -307,7 +307,7 @@ export default async function ApiProxy(req, res) {
|
||||
"appealTypeID": "846040002",
|
||||
"tmpNav": "pinswg_sipsid",
|
||||
"NavigationProperty": "pinswg_SIPSids",
|
||||
"value": "SIPs",
|
||||
"value": "SIP",
|
||||
},
|
||||
|
||||
{
|
||||
@@ -608,7 +608,7 @@ export default async function ApiProxy(req, res) {
|
||||
"pinswg_appealType": item.value,
|
||||
"incidentid":
|
||||
key[
|
||||
item.value == "SIPs"
|
||||
item.value == "SIP"
|
||||
? "_pinswg_sipscase_value"
|
||||
: "_" +
|
||||
item.NavigationProperty.toLowerCase() +
|
||||
|
||||
@@ -104,13 +104,18 @@ const CaseHome = (props) => {
|
||||
props.awaitingSubmission.awaitingSubmission
|
||||
}
|
||||
caseReference={
|
||||
props.currentView.caseReference.currentReference
|
||||
props.searchResultsObj.searchResultsObj.value[0]
|
||||
.ticketnumber
|
||||
}
|
||||
currentType={props.currentType}
|
||||
appealTypeID={
|
||||
props.currentView.caseReference.appealType
|
||||
props.searchResultsObj.searchResultsObj.value[0]
|
||||
.pinswg_appealcasetype
|
||||
}
|
||||
incidentid={
|
||||
props.searchResultsObj.searchResultsObj.value[0]
|
||||
.incidentid
|
||||
}
|
||||
incidentid={props.currentView.caseReference.incidentid}
|
||||
representationsObj={
|
||||
props.searchResultsObj.representationsObj
|
||||
}
|
||||
@@ -182,6 +187,15 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
? query.ticketnumber
|
||||
: query.ticketnumber.split("-").join(" ");
|
||||
|
||||
const pattern = /CAS-\d{5}-[A-Z0-9]{6}/;
|
||||
const match = query.ticketnumber.match(pattern);
|
||||
|
||||
if (match) {
|
||||
console.log("Match found!", match[0]);
|
||||
} else {
|
||||
console.log("No match.");
|
||||
}
|
||||
|
||||
const searchResultsObj = await getBasicSearch(developmentQuery);
|
||||
const searchDetailsObj = await getSearchDetails(searchResultsObj);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user