added in a key to be used when right clicked on link
This commit is contained in:
@@ -37,8 +37,8 @@ const AwaitingSubmission = (props) => {
|
|||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth"
|
"/fymhorth/gweldpopeth?key=awaitingSubmission"
|
||||||
: "/myportal/viewall"
|
: "/myportal/viewall?key=awaitingSubmission"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -354,8 +354,8 @@ const AwaitingSubmissionFromBlob = (props) => {
|
|||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth"
|
"/fymhorth/gweldpopeth?key=awaitingSubmissionDetails"
|
||||||
: "/myportal/viewall"
|
: "/myportal/viewall?key=awaitingSubmissionDetails"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ const MyCases = (props) => {
|
|||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth"
|
"/fymhorth/gweldpopeth?key=myCases"
|
||||||
: "/myportal/viewall"
|
: "/myportal/viewall?key=myCases"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ const MyRepresentations = (props) => {
|
|||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth"
|
"/fymhorth/gweldpopeth?key=myRepresentations"
|
||||||
: "/myportal/viewall"
|
: "/myportal/viewall?key=myRepresentations"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ const MyRepresentations = (props) => {
|
|||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth"
|
"/fymhorth/gweldpopeth?key=myRepresentations"
|
||||||
: "/myportal/viewall"
|
: "/myportal/viewall?key=myRepresentations"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ const MySubmittedReps = (props) => {
|
|||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth"
|
"/fymhorth/gweldpopeth?key=mySubmittedReps"
|
||||||
: "/myportal/viewall"
|
: "/myportal/viewall?key=mySubmittedReps"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -76,19 +76,23 @@ const ViewAllResults = (props) => {
|
|||||||
return dateObj.toLocaleString();
|
return dateObj.toLocaleString();
|
||||||
};
|
};
|
||||||
|
|
||||||
let currentView = props.currentView.currentView;
|
let viewKeyFromUrl = router.query.key;
|
||||||
//console.log("currentView.viewKey:", typeof currentView.viewKey);
|
|
||||||
|
|
||||||
// typeof currentView.viewKey == "undefined"
|
let currentView = props.currentView.currentView;
|
||||||
|
//console.log("currentViewKey:", typeof currentViewKey);
|
||||||
|
|
||||||
|
// typeof currentViewKey == "undefined"
|
||||||
// ? console.log("no currentview")
|
// ? console.log("no currentview")
|
||||||
// : console.log("has currentview");
|
// : console.log("has currentview");
|
||||||
|
|
||||||
|
let currentViewKey = currentView.viewKey || viewKeyFromUrl;
|
||||||
|
|
||||||
var resultsArr =
|
var resultsArr =
|
||||||
currentView.viewKey == "awaitingSubmissionDetails"
|
currentViewKey == "awaitingSubmissionDetails"
|
||||||
? props["awaitingSubmission"].awaitingSubmissionDetails.case
|
? props["awaitingSubmission"].awaitingSubmissionDetails.case
|
||||||
: currentView.viewKey == "mySubmittedReps"
|
: currentViewKey == "mySubmittedReps"
|
||||||
? props[currentView.viewKey][currentView.viewKey]
|
? props[currentViewKey][currentViewKey]
|
||||||
: props[currentView.viewKey][currentView.viewKey].value || [];
|
: props[currentViewKey][currentViewKey].value || [];
|
||||||
|
|
||||||
const [orderByState, setOrderbyState] = useState("createdon");
|
const [orderByState, setOrderbyState] = useState("createdon");
|
||||||
const [fieldSortState, setfieldSortState] = useState("asc");
|
const [fieldSortState, setfieldSortState] = useState("asc");
|
||||||
@@ -105,11 +109,11 @@ const ViewAllResults = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var searchDetailsObj =
|
var searchDetailsObj =
|
||||||
currentView.viewKey == "awaitingSubmissionDetails"
|
currentViewKey == "awaitingSubmissionDetails"
|
||||||
? props["awaitingSubmission"].awaitingSubmissionDetails.value
|
? props["awaitingSubmission"].awaitingSubmissionDetails.value
|
||||||
: currentView.viewKey == "myRepresentations"
|
: currentViewKey == "myRepresentations"
|
||||||
? props["myRepresentations"].myRepresentations.value
|
? props["myRepresentations"].myRepresentations.value
|
||||||
: props[currentView.viewKey][currentView.viewKey + "Details"] || [];
|
: props[currentViewKey][currentViewKey + "Details"] || [];
|
||||||
|
|
||||||
let resultsRowArr = [];
|
let resultsRowArr = [];
|
||||||
const buildResultsRowArr = () => {
|
const buildResultsRowArr = () => {
|
||||||
@@ -117,15 +121,13 @@ const ViewAllResults = (props) => {
|
|||||||
let detailsObj = jsonpath({
|
let detailsObj = jsonpath({
|
||||||
path:
|
path:
|
||||||
"$" +
|
"$" +
|
||||||
(currentView.viewKey == "myRepresentations"
|
(currentViewKey == "myRepresentations" ? "" : "..value") +
|
||||||
? ""
|
|
||||||
: "..value") +
|
|
||||||
'[?(@ && @.pinswg_name=="' +
|
'[?(@ && @.pinswg_name=="' +
|
||||||
(currentView.viewKey == "awaitingSubmissionDetails"
|
(currentViewKey == "awaitingSubmissionDetails"
|
||||||
? item.title
|
? item.title
|
||||||
: currentView.viewKey == "watchedCases"
|
: currentViewKey == "watchedCases"
|
||||||
? item.ticketnumber
|
? item.ticketnumber
|
||||||
: currentView.viewKey == "myRepresentations"
|
: currentViewKey == "myRepresentations"
|
||||||
? item.pinswg_name
|
? item.pinswg_name
|
||||||
: item.pinswg_title) +
|
: item.pinswg_title) +
|
||||||
'")]',
|
'")]',
|
||||||
@@ -137,7 +139,7 @@ const ViewAllResults = (props) => {
|
|||||||
//console.log(searchDetailsObj[key]);
|
//console.log(searchDetailsObj[key]);
|
||||||
|
|
||||||
// searchDetailsObj[key] =
|
// searchDetailsObj[key] =
|
||||||
// currentView.viewKey == "myRepresentations"
|
// currentViewKey == "myRepresentations"
|
||||||
// ? searchDetailsObj[key].value[0]
|
// ? searchDetailsObj[key].value[0]
|
||||||
// : searchDetailsObj[key];
|
// : searchDetailsObj[key];
|
||||||
|
|
||||||
@@ -145,7 +147,7 @@ const ViewAllResults = (props) => {
|
|||||||
resultsRowArr.push(
|
resultsRowArr.push(
|
||||||
<div className="govuk-summary-list__row" key={key}>
|
<div className="govuk-summary-list__row" key={key}>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
|
||||||
{currentView.viewKey == "myCases" &&
|
{currentViewKey == "myCases" &&
|
||||||
resultsArr[key].pinswg_publishtoweb === false ? (
|
resultsArr[key].pinswg_publishtoweb === false ? (
|
||||||
<div className="cardModuleReference">
|
<div className="cardModuleReference">
|
||||||
{resultsArr[key].ticketnumber}{" "}
|
{resultsArr[key].ticketnumber}{" "}
|
||||||
@@ -155,8 +157,7 @@ const ViewAllResults = (props) => {
|
|||||||
<>
|
<>
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
currentView.viewKey ==
|
currentViewKey == "myRepresentations"
|
||||||
"myRepresentations"
|
|
||||||
? {
|
? {
|
||||||
pathname:
|
pathname:
|
||||||
"/myportal/representation",
|
"/myportal/representation",
|
||||||
@@ -169,7 +170,7 @@ const ViewAllResults = (props) => {
|
|||||||
.repfile_name,
|
.repfile_name,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
: currentView.viewKey ==
|
: currentViewKey ==
|
||||||
"awaitingSubmissionDetails"
|
"awaitingSubmissionDetails"
|
||||||
? router.locale == "cy"
|
? router.locale == "cy"
|
||||||
? "/fymhorth/parhauigyflwyno"
|
? "/fymhorth/parhauigyflwyno"
|
||||||
@@ -191,25 +192,25 @@ const ViewAllResults = (props) => {
|
|||||||
"&inid=" +
|
"&inid=" +
|
||||||
resultsArr[key].incidentid +
|
resultsArr[key].incidentid +
|
||||||
"&key=" +
|
"&key=" +
|
||||||
currentView.viewKey
|
currentViewKey
|
||||||
: router.locale == "cy"
|
: router.locale == "cy"
|
||||||
? myportal == true
|
? myportal == true
|
||||||
? "/fymhorth/achos" +
|
? "/fymhorth/achos" +
|
||||||
resultsArr[key].ticketnumber +
|
resultsArr[key].ticketnumber +
|
||||||
"?key=" +
|
"?key=" +
|
||||||
currentView.viewKey
|
currentViewKey
|
||||||
: "/achos" +
|
: "/achos" +
|
||||||
resultsArr[key].ticketnumber
|
resultsArr[key].ticketnumber
|
||||||
: myportal == true
|
: myportal == true
|
||||||
? "/myportal/case/" +
|
? "/myportal/case/" +
|
||||||
resultsArr[key].ticketnumber +
|
resultsArr[key].ticketnumber +
|
||||||
"?key=" +
|
"?key=" +
|
||||||
currentView.viewKey
|
currentViewKey
|
||||||
: "/case/" +
|
: "/case/" +
|
||||||
resultsArr[key].ticketnumber
|
resultsArr[key].ticketnumber
|
||||||
}
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
currentView.viewKey == "watchedCases" &&
|
currentViewKey == "watchedCases" &&
|
||||||
setSearchResults(
|
setSearchResults(
|
||||||
props.watchedCases.watchedCases
|
props.watchedCases.watchedCases
|
||||||
),
|
),
|
||||||
@@ -222,9 +223,9 @@ const ViewAllResults = (props) => {
|
|||||||
resultsArr[key]
|
resultsArr[key]
|
||||||
.ticketnumber,
|
.ticketnumber,
|
||||||
"currentReference":
|
"currentReference":
|
||||||
currentView.viewKey !=
|
currentViewKey !=
|
||||||
"watchedCases"
|
"watchedCases"
|
||||||
? currentView.viewKey ==
|
? currentViewKey ==
|
||||||
"myRepresentations"
|
"myRepresentations"
|
||||||
? resultsArr[key]
|
? resultsArr[key]
|
||||||
.caseRef
|
.caseRef
|
||||||
@@ -234,10 +235,9 @@ const ViewAllResults = (props) => {
|
|||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
],
|
],
|
||||||
|
|
||||||
"currentType":
|
"currentType": currentViewKey,
|
||||||
currentView.viewKey,
|
|
||||||
"incidentid":
|
"incidentid":
|
||||||
currentView.viewKey !=
|
currentViewKey !=
|
||||||
"watchedCases"
|
"watchedCases"
|
||||||
? resultsArr[key]
|
? resultsArr[key]
|
||||||
.incidentid
|
.incidentid
|
||||||
@@ -249,14 +249,14 @@ const ViewAllResults = (props) => {
|
|||||||
resultsArr[key]
|
resultsArr[key]
|
||||||
.pinswg_appealcasetype,
|
.pinswg_appealcasetype,
|
||||||
"repDetails":
|
"repDetails":
|
||||||
currentView.viewKey ==
|
currentViewKey ==
|
||||||
"myRepresentations" &&
|
"myRepresentations" &&
|
||||||
resultsArr[key],
|
resultsArr[key],
|
||||||
}),
|
}),
|
||||||
setCurrentView({
|
setCurrentView({
|
||||||
"viewName":
|
"viewName":
|
||||||
currentView.viewName,
|
currentView.viewName,
|
||||||
"viewKey": currentView.viewKey,
|
"viewKey": currentViewKey,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -266,11 +266,10 @@ const ViewAllResults = (props) => {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
{currentView.viewKey != "watchedCases"
|
{currentViewKey != "watchedCases"
|
||||||
? currentView.viewKey ==
|
? currentViewKey == "myRepresentations"
|
||||||
"myRepresentations"
|
|
||||||
? resultsArr[key].caseRef
|
? resultsArr[key].caseRef
|
||||||
: currentView.viewKey ==
|
: currentViewKey ==
|
||||||
"awaitingSubmissionDetails"
|
"awaitingSubmissionDetails"
|
||||||
? resultsArr[key].title
|
? resultsArr[key].title
|
||||||
: resultsArr[key].pinswg_title
|
: resultsArr[key].pinswg_title
|
||||||
@@ -278,7 +277,7 @@ const ViewAllResults = (props) => {
|
|||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]}
|
]}
|
||||||
</Link>
|
</Link>
|
||||||
{currentView.viewKey == "myRepresentations" && (
|
{currentViewKey == "myRepresentations" && (
|
||||||
<>
|
<>
|
||||||
<br />
|
<br />
|
||||||
<span>
|
<span>
|
||||||
@@ -296,14 +295,14 @@ const ViewAllResults = (props) => {
|
|||||||
{t("search:searchresults-site-address-label")}:
|
{t("search:searchresults-site-address-label")}:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
||||||
? searchDetailsObj[key].pinswg_siteaddressline1
|
? searchDetailsObj[key].pinswg_siteaddressline1
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||||
? detailsObj.pinswg_siteaddressline1
|
? detailsObj.pinswg_siteaddressline1
|
||||||
: ""}
|
: ""}
|
||||||
{currentView.viewKey == "myRepresentations" &&
|
{currentViewKey == "myRepresentations" &&
|
||||||
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
|
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
|
||||||
? searchDetailsObj[key].value[0]
|
? searchDetailsObj[key].value[0]
|
||||||
.pinswg_siteaddressline1
|
.pinswg_siteaddressline1
|
||||||
@@ -311,14 +310,14 @@ const ViewAllResults = (props) => {
|
|||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||||
? detailsObj.pinswg_siteaddressline1
|
? detailsObj.pinswg_siteaddressline1
|
||||||
: ""}
|
: ""}
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
"pinswg_siteaddressline1"
|
"pinswg_siteaddressline1"
|
||||||
) &&
|
) &&
|
||||||
searchDetailsObj[key].pinswg_siteaddressline1 !=
|
searchDetailsObj[key].pinswg_siteaddressline1 !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{currentView.viewKey == "myRepresentations" &&
|
{currentViewKey == "myRepresentations" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key].pinswg_siteaddressline1
|
searchDetailsObj[key].pinswg_siteaddressline1
|
||||||
) &&
|
) &&
|
||||||
@@ -328,25 +327,25 @@ const ViewAllResults = (props) => {
|
|||||||
detailsObj.pinswg_siteaddressline1 != null && (
|
detailsObj.pinswg_siteaddressline1 != null && (
|
||||||
<br />
|
<br />
|
||||||
)}
|
)}
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
||||||
? searchDetailsObj[key].pinswg_siteaddressline2
|
? searchDetailsObj[key].pinswg_siteaddressline2
|
||||||
: ""}
|
: ""}
|
||||||
{currentView.viewKey == "myRepresentations" &&
|
{currentViewKey == "myRepresentations" &&
|
||||||
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
|
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
|
||||||
? searchDetailsObj[key].pinswg_siteaddressline2
|
? searchDetailsObj[key].pinswg_siteaddressline2
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||||
? detailsObj.pinswg_siteaddressline2
|
? detailsObj.pinswg_siteaddressline2
|
||||||
: ""}
|
: ""}
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
"pinswg_siteaddressline2"
|
"pinswg_siteaddressline2"
|
||||||
) &&
|
) &&
|
||||||
searchDetailsObj[key].pinswg_siteaddressline2 !=
|
searchDetailsObj[key].pinswg_siteaddressline2 !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{currentView.viewKey == "myRepresentations" &&
|
{currentViewKey == "myRepresentations" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key].pinswg_siteaddressline2
|
searchDetailsObj[key].pinswg_siteaddressline2
|
||||||
) &&
|
) &&
|
||||||
@@ -356,25 +355,25 @@ const ViewAllResults = (props) => {
|
|||||||
detailsObj.pinswg_siteaddressline2 != null && (
|
detailsObj.pinswg_siteaddressline2 != null && (
|
||||||
<br />
|
<br />
|
||||||
)}
|
)}
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
||||||
? searchDetailsObj[key].pinswg_siteaddresstown
|
? searchDetailsObj[key].pinswg_siteaddresstown
|
||||||
: ""}
|
: ""}
|
||||||
{currentView.viewKey == "myRepresentations" &&
|
{currentViewKey == "myRepresentations" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
||||||
? searchDetailsObj[key].pinswg_siteaddresstown
|
? searchDetailsObj[key].pinswg_siteaddresstown
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresstown")
|
{_.has(detailsObj, "pinswg_siteaddresstown")
|
||||||
? detailsObj.pinswg_siteaddresstown
|
? detailsObj.pinswg_siteaddresstown
|
||||||
: ""}
|
: ""}
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
"pinswg_siteaddresstown"
|
"pinswg_siteaddresstown"
|
||||||
) &&
|
) &&
|
||||||
searchDetailsObj[key].pinswg_siteaddresstown !=
|
searchDetailsObj[key].pinswg_siteaddresstown !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{currentView.viewKey == "myRepresentations" &&
|
{currentViewKey == "myRepresentations" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
"pinswg_siteaddresstown"
|
"pinswg_siteaddresstown"
|
||||||
@@ -383,18 +382,18 @@ const ViewAllResults = (props) => {
|
|||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
||||||
detailsObj.pinswg_siteaddresstown != null && <br />}
|
detailsObj.pinswg_siteaddresstown != null && <br />}
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
||||||
? searchDetailsObj[key].pinswg_siteaddresscounty
|
? searchDetailsObj[key].pinswg_siteaddresscounty
|
||||||
: ""}
|
: ""}
|
||||||
{currentView.viewKey == "myRepresentations" &&
|
{currentViewKey == "myRepresentations" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
||||||
? searchDetailsObj[key].pinswg_siteaddresscounty
|
? searchDetailsObj[key].pinswg_siteaddresscounty
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresscounty")
|
{_.has(detailsObj, "pinswg_siteaddresscounty")
|
||||||
? detailsObj.pinswg_siteaddresscounty
|
? detailsObj.pinswg_siteaddresscounty
|
||||||
: ""}
|
: ""}
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
"pinswg_siteaddresscounty"
|
"pinswg_siteaddresscounty"
|
||||||
@@ -405,7 +404,7 @@ const ViewAllResults = (props) => {
|
|||||||
detailsObj.pinswg_siteaddresscounty != null && (
|
detailsObj.pinswg_siteaddresscounty != null && (
|
||||||
<br />
|
<br />
|
||||||
)}
|
)}
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
"pinswg_siteaddresspostcode"
|
"pinswg_siteaddresspostcode"
|
||||||
@@ -431,10 +430,9 @@ const ViewAllResults = (props) => {
|
|||||||
"pinswg_siteaddresspostcode",
|
"pinswg_siteaddresspostcode",
|
||||||
].map((field, idx) => {
|
].map((field, idx) => {
|
||||||
const isAwaitingSubmission =
|
const isAwaitingSubmission =
|
||||||
currentView.viewKey ===
|
currentViewKey === "awaitingSubmissionDetails";
|
||||||
"awaitingSubmissionDetails";
|
|
||||||
const isMyRepresentations =
|
const isMyRepresentations =
|
||||||
currentView.viewKey === "myRepresentations";
|
currentViewKey === "myRepresentations";
|
||||||
const searchValue = _.get(
|
const searchValue = _.get(
|
||||||
searchDetailsObj,
|
searchDetailsObj,
|
||||||
`${key}.${field}`
|
`${key}.${field}`
|
||||||
@@ -462,11 +460,11 @@ const ViewAllResults = (props) => {
|
|||||||
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
{currentViewKey == "awaitingSubmissionDetails"
|
||||||
? t("search:searchresults-created-on-label")
|
? t("search:searchresults-created-on-label")
|
||||||
: t("search:searchresults-applicant-label")}
|
: t("search:searchresults-applicant-label")}
|
||||||
</span>
|
</span>
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
{currentViewKey == "awaitingSubmissionDetails"
|
||||||
? formatDates(item.createdon)
|
? formatDates(item.createdon)
|
||||||
: _.has(detailsObj, [
|
: _.has(detailsObj, [
|
||||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
|
||||||
@@ -474,7 +472,7 @@ const ViewAllResults = (props) => {
|
|||||||
? detailsObj[
|
? detailsObj[
|
||||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
]
|
||||||
: currentView.viewKey == "myRepresentations"
|
: currentViewKey == "myRepresentations"
|
||||||
? searchDetailsObj[key][
|
? searchDetailsObj[key][
|
||||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
]
|
||||||
@@ -486,7 +484,7 @@ const ViewAllResults = (props) => {
|
|||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t("search:searchresults-authority-label")}:
|
{t("search:searchresults-authority-label")}:
|
||||||
</span>
|
</span>
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(resultsArr[key], "pinswg_lpaname")
|
_.has(resultsArr[key], "pinswg_lpaname")
|
||||||
? router.locale == "cy"
|
? router.locale == "cy"
|
||||||
? jsonpath({
|
? jsonpath({
|
||||||
@@ -531,7 +529,7 @@ const ViewAllResults = (props) => {
|
|||||||
json: transLookup,
|
json: transLookup,
|
||||||
eval: true,
|
eval: true,
|
||||||
})
|
})
|
||||||
: currentView.viewKey == "myRepresentations"
|
: currentViewKey == "myRepresentations"
|
||||||
? searchDetailsObj[key].value
|
? searchDetailsObj[key].value
|
||||||
: searchDetailsObj[key].value[0][
|
: searchDetailsObj[key].value[0][
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
@@ -554,10 +552,10 @@ const ViewAllResults = (props) => {
|
|||||||
: resultsArr[key][
|
: resultsArr[key][
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] ||
|
] ||
|
||||||
(currentView.viewKey == "myRepresentations"
|
(currentViewKey == "myRepresentations"
|
||||||
? ""
|
? ""
|
||||||
: "N/A")
|
: "N/A")
|
||||||
: currentView.viewKey == "myRepresentations" &&
|
: currentViewKey == "myRepresentations" &&
|
||||||
router.locale == "cy" &&
|
router.locale == "cy" &&
|
||||||
jsonpath({
|
jsonpath({
|
||||||
path:
|
path:
|
||||||
@@ -575,7 +573,7 @@ const ViewAllResults = (props) => {
|
|||||||
{t("search:searchresults-case-type-label")}:
|
{t("search:searchresults-case-type-label")}:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
{currentViewKey == "awaitingSubmissionDetails"
|
||||||
? router.locale == "cy"
|
? router.locale == "cy"
|
||||||
? jsonpath({
|
? jsonpath({
|
||||||
path:
|
path:
|
||||||
@@ -604,11 +602,11 @@ const ViewAllResults = (props) => {
|
|||||||
: item[
|
: item[
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
] ||
|
] ||
|
||||||
(currentView.viewKey == "myRepresentations"
|
(currentViewKey == "myRepresentations"
|
||||||
? ""
|
? ""
|
||||||
: "N/A")}
|
: "N/A")}
|
||||||
|
|
||||||
{currentView.viewKey == "myRepresentations" &&
|
{currentViewKey == "myRepresentations" &&
|
||||||
(router.locale == "cy"
|
(router.locale == "cy"
|
||||||
? jsonpath({
|
? jsonpath({
|
||||||
path:
|
path:
|
||||||
@@ -630,13 +628,13 @@ const ViewAllResults = (props) => {
|
|||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{currentView.viewKey == "myRepresentations"
|
{currentViewKey == "myRepresentations"
|
||||||
? "Created"
|
? "Created"
|
||||||
: t("search:searchresults-status-label")}
|
: t("search:searchresults-status-label")}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
{currentViewKey == "awaitingSubmissionDetails"
|
||||||
? router.locale == "cy"
|
? router.locale == "cy"
|
||||||
? jsonpath({
|
? jsonpath({
|
||||||
path:
|
path:
|
||||||
@@ -654,7 +652,7 @@ const ViewAllResults = (props) => {
|
|||||||
json: transLookup,
|
json: transLookup,
|
||||||
eval: true,
|
eval: true,
|
||||||
}) || "N/A"
|
}) || "N/A"
|
||||||
: currentView.viewKey == "myRepresentations"
|
: currentViewKey == "myRepresentations"
|
||||||
? repRaisedDate(item.repfile_name) // ? router.locale == "cy"
|
? repRaisedDate(item.repfile_name) // ? router.locale == "cy"
|
||||||
: // ? jsonpath({path:
|
: // ? jsonpath({path:
|
||||||
//
|
//
|
||||||
@@ -692,7 +690,7 @@ const ViewAllResults = (props) => {
|
|||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"}
|
] || "N/A"}
|
||||||
</dd>
|
</dd>
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" && (
|
{currentViewKey == "awaitingSubmissionDetails" && (
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
<button
|
<button
|
||||||
title={t(
|
title={t(
|
||||||
@@ -720,7 +718,7 @@ const ViewAllResults = (props) => {
|
|||||||
</button>
|
</button>
|
||||||
</dd>
|
</dd>
|
||||||
)}
|
)}
|
||||||
{currentView.viewKey == "myRepresentations" && (
|
{currentViewKey == "myRepresentations" && (
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
<button
|
<button
|
||||||
title={t(
|
title={t(
|
||||||
@@ -750,7 +748,7 @@ const ViewAllResults = (props) => {
|
|||||||
</dd>
|
</dd>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{currentView.viewKey == "watchedCases" && (
|
{currentViewKey == "watchedCases" && (
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
<button
|
<button
|
||||||
title={t(
|
title={t(
|
||||||
@@ -924,15 +922,15 @@ const ViewAllResults = (props) => {
|
|||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||||
t("myportal:awatitingsubmission-card-title")}
|
t("myportal:awatitingsubmission-card-title")}
|
||||||
{currentView.viewKey == "watchedCases" &&
|
{currentViewKey == "watchedCases" &&
|
||||||
t("myportal:watchedcases-card-title")}
|
t("myportal:watchedcases-card-title")}
|
||||||
{currentView.viewKey == "myCases" &&
|
{currentViewKey == "myCases" &&
|
||||||
t("myportal:mycases-card-title")}
|
t("myportal:mycases-card-title")}
|
||||||
{currentView.viewKey == "myRepresentations" &&
|
{currentViewKey == "myRepresentations" &&
|
||||||
t("myportal:myrepresentations-card-title")}
|
t("myportal:myrepresentations-card-title")}
|
||||||
{currentView.viewKey == "mySubmittedReps" &&
|
{currentViewKey == "mySubmittedReps" &&
|
||||||
"Submitted representations"}
|
"Submitted representations"}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
@@ -940,14 +938,13 @@ const ViewAllResults = (props) => {
|
|||||||
<h3>
|
<h3>
|
||||||
{" "}
|
{" "}
|
||||||
There are no{" "}
|
There are no{" "}
|
||||||
{currentView.viewKey ==
|
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||||
"awaitingSubmissionDetails" &&
|
|
||||||
t("myportal:awatitingsubmission-card-title")}
|
t("myportal:awatitingsubmission-card-title")}
|
||||||
{currentView.viewKey == "watchedCases" &&
|
{currentViewKey == "watchedCases" &&
|
||||||
t("myportal:watchedcases-card-title")}
|
t("myportal:watchedcases-card-title")}
|
||||||
{currentView.viewKey == "myCases" &&
|
{currentViewKey == "myCases" &&
|
||||||
t("myportal:mycases-card-title")}
|
t("myportal:mycases-card-title")}
|
||||||
{currentView.viewKey == "myRepresentations" &&
|
{currentViewKey == "myRepresentations" &&
|
||||||
t("myportal:myrepresentations-card-title")}{" "}
|
t("myportal:myrepresentations-card-title")}{" "}
|
||||||
records
|
records
|
||||||
</h3>
|
</h3>
|
||||||
@@ -959,7 +956,7 @@ const ViewAllResults = (props) => {
|
|||||||
type="button"
|
type="button"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
sortDataBy(
|
sortDataBy(
|
||||||
currentView.viewKey ==
|
currentViewKey ==
|
||||||
"awaitingSubmissionDetails"
|
"awaitingSubmissionDetails"
|
||||||
? "title"
|
? "title"
|
||||||
: "pinswg_title"
|
: "pinswg_title"
|
||||||
@@ -967,7 +964,7 @@ const ViewAllResults = (props) => {
|
|||||||
}
|
}
|
||||||
className={
|
className={
|
||||||
orderByState ==
|
orderByState ==
|
||||||
(currentView.viewKey ==
|
(currentViewKey ==
|
||||||
"awaitingSubmissionDetails"
|
"awaitingSubmissionDetails"
|
||||||
? "title"
|
? "title"
|
||||||
: "pinswg_title")
|
: "pinswg_title")
|
||||||
@@ -987,7 +984,7 @@ const ViewAllResults = (props) => {
|
|||||||
"search:searchresults-site-address-label"
|
"search:searchresults-site-address-label"
|
||||||
)}
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
{currentView.viewKey ==
|
{currentViewKey ==
|
||||||
"awaitingSubmissionDetails" ? (
|
"awaitingSubmissionDetails" ? (
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
<button
|
<button
|
||||||
@@ -1020,7 +1017,7 @@ const ViewAllResults = (props) => {
|
|||||||
type="button"
|
type="button"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
sortDataBy(
|
sortDataBy(
|
||||||
currentView.viewKey ==
|
currentViewKey ==
|
||||||
"awaitingSubmissionDetails"
|
"awaitingSubmissionDetails"
|
||||||
? "pinswg_lpaname"
|
? "pinswg_lpaname"
|
||||||
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
@@ -1028,7 +1025,7 @@ const ViewAllResults = (props) => {
|
|||||||
}
|
}
|
||||||
className={
|
className={
|
||||||
orderByState ==
|
orderByState ==
|
||||||
(currentView.viewKey ==
|
(currentViewKey ==
|
||||||
"awaitingSubmissionDetails"
|
"awaitingSubmissionDetails"
|
||||||
? "pinswg_lpaname"
|
? "pinswg_lpaname"
|
||||||
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue")
|
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue")
|
||||||
@@ -1044,7 +1041,7 @@ const ViewAllResults = (props) => {
|
|||||||
</button>
|
</button>
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
{currentView.viewKey !=
|
{currentViewKey !=
|
||||||
"awaitingSubmissionDetails" ? (
|
"awaitingSubmissionDetails" ? (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -1055,7 +1052,7 @@ const ViewAllResults = (props) => {
|
|||||||
}
|
}
|
||||||
className={
|
className={
|
||||||
orderByState ==
|
orderByState ==
|
||||||
(currentView.viewKey ==
|
(currentViewKey ==
|
||||||
"awaitingSubmissionDetails"
|
"awaitingSubmissionDetails"
|
||||||
? "pinswg_lpaname"
|
? "pinswg_lpaname"
|
||||||
: "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue")
|
: "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue")
|
||||||
@@ -1076,8 +1073,7 @@ const ViewAllResults = (props) => {
|
|||||||
)}{" "}
|
)}{" "}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
{currentView.viewKey ==
|
{currentViewKey == "myRepresentations" ? (
|
||||||
"myRepresentations" ? (
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
@@ -1098,11 +1094,10 @@ const ViewAllResults = (props) => {
|
|||||||
)}
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
{(currentView.viewKey == "watchedCases" ||
|
{(currentViewKey == "watchedCases" ||
|
||||||
currentView.viewKey ==
|
currentViewKey ==
|
||||||
"awaitingSubmissionDetails" ||
|
"awaitingSubmissionDetails" ||
|
||||||
currentView.viewKey ==
|
currentViewKey == "myRepresentations") && (
|
||||||
"myRepresentations") && (
|
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action"></dd>
|
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action"></dd>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ const WatchedCases = (props) => {
|
|||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth"
|
"/fymhorth/gweldpopeth?key=watchedCases"
|
||||||
: "/myportal/viewall"
|
: "/myportal/viewall?key=watchedCases"
|
||||||
}
|
}
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user