Merge branch 'Development' into SIPS-Development
This commit is contained in:
@@ -37,9 +37,8 @@ const AwaitingSubmission = (props) => {
|
||||
(router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall") +
|
||||
"?viewKey=awaitingSubmission"
|
||||
"/fymhorth/gweldpopeth?key=awaitingSubmission"
|
||||
: "/myportal/viewall?key=awaitingSubmission"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -351,12 +351,11 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
href={
|
||||
(router.locale != "en"
|
||||
router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall") +
|
||||
"?viewKey=awaitingSubmissionDetails"
|
||||
"/fymhorth/gweldpopeth?key=awaitingSubmissionDetails"
|
||||
: "/myportal/viewall?key=awaitingSubmissionDetails"
|
||||
}
|
||||
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") + "?viewKey=myCases"
|
||||
"/fymhorth/gweldpopeth?key=myCases"
|
||||
: "/myportal/viewall?key=myCases"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -34,12 +34,11 @@ const MyRepresentations = (props) => {
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
href={
|
||||
(router.locale != "en"
|
||||
router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall") +
|
||||
"?viewKey=myRepresentations"
|
||||
"/fymhorth/gweldpopeth?key=myRepresentations"
|
||||
: "/myportal/viewall?key=myRepresentations"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -36,9 +36,8 @@ const MyRepresentations = (props) => {
|
||||
(router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall") +
|
||||
"?viewKey=myRepresentations"
|
||||
"/fymhorth/gweldpopeth?key=myRepresentations"
|
||||
: "/myportal/viewall?key=myRepresentations"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -40,12 +40,11 @@ const MySubmittedReps = (props) => {
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
href={
|
||||
(router.locale != "en"
|
||||
router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall") +
|
||||
"?viewKey=mySubmittedReps"
|
||||
"/fymhorth/gweldpopeth?key=mySubmittedReps"
|
||||
: "/myportal/viewall?key=mySubmittedReps"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
@@ -43,6 +43,11 @@ const ServiceBanner = (props) => {
|
||||
{portalLogoLink.includes(router.pathname) ? (
|
||||
<Link href={"/myportal"}>
|
||||
<img
|
||||
className={
|
||||
router.locale == "cy"
|
||||
? "serviceTitle cy"
|
||||
: "serviceTitle"
|
||||
}
|
||||
src={
|
||||
router.locale == "cy"
|
||||
? "/assets/images/planning-casework-cy.svg"
|
||||
@@ -57,6 +62,11 @@ const ServiceBanner = (props) => {
|
||||
</Link>
|
||||
) : (
|
||||
<img
|
||||
className={
|
||||
router.locale == "cy"
|
||||
? "serviceTitle cy"
|
||||
: "serviceTitle"
|
||||
}
|
||||
src={
|
||||
router.locale == "cy"
|
||||
? "/assets/images/planning-casework-cy.svg"
|
||||
|
||||
@@ -119,7 +119,9 @@ const TopThree = (props) => {
|
||||
deleteWatchedCases(caseID)
|
||||
.then((data) => data)
|
||||
.then(() => {
|
||||
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
||||
getWatchedCasesProxy(
|
||||
props.accountDetails.loggedinUserId
|
||||
).then((data) => {
|
||||
let showWatchedCases = (submittedArr) => {
|
||||
const required = submittedArr.value.filter((el) => {
|
||||
return (
|
||||
@@ -134,19 +136,15 @@ const TopThree = (props) => {
|
||||
});
|
||||
};
|
||||
|
||||
data = showWatchedCases(data);
|
||||
let filteredWatchedCases = showWatchedCases(data);
|
||||
|
||||
data.value.sort(function compare(a, b) {
|
||||
var dateA = new Date(a.createdon);
|
||||
var dateB = new Date(b.createdon);
|
||||
return dateB - dateA;
|
||||
});
|
||||
setWatchedCases(data),
|
||||
getDetailsProxy(data, "myWatchedCases").then(
|
||||
(data) => {
|
||||
setWatchedCasesDetails(data);
|
||||
}
|
||||
);
|
||||
setWatchedCases(filteredWatchedCases),
|
||||
getDetailsProxy(
|
||||
filteredWatchedCases,
|
||||
"myWatchedCases"
|
||||
).then((data) => {
|
||||
setWatchedCasesDetails(data);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -328,9 +326,8 @@ const TopThree = (props) => {
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
],
|
||||
: showTopThreeArr[key]
|
||||
.ticketnumber,
|
||||
"currentType": topThreeType,
|
||||
|
||||
"incidentid": getIncidentId(
|
||||
@@ -344,15 +341,18 @@ const TopThree = (props) => {
|
||||
});
|
||||
}}
|
||||
>
|
||||
{topThreeType != "watchedCases"
|
||||
{showTopThreeArr[key].pinswg_title}
|
||||
{/* {topThreeType != "watchedCases"
|
||||
? topThreeType != "myRepresentations"
|
||||
? showTopThreeArr[key].ticketnumber
|
||||
? topThreeType == "mySubmittedReps"
|
||||
? showTopThreeArr[key].pinswg_title
|
||||
: showTopThreeArr[key].ticketnumber
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
]}{" "}
|
||||
]}{" "} */}
|
||||
</Link>
|
||||
)}
|
||||
{topThreeType == "watchedCases" && !props.myReps && (
|
||||
|
||||
@@ -193,21 +193,26 @@ const TopThree = (props) => {
|
||||
{showTopThreeArr[key].hasOwnProperty("repComplete") ? (
|
||||
<b>{showTopThreeArr[key].pinswg_name}</b>
|
||||
) : (
|
||||
<Link
|
||||
<span
|
||||
// href="#"
|
||||
href={{
|
||||
pathname:
|
||||
router.locale == "cy"
|
||||
? "/fymhorth/representation"
|
||||
: "/myportal/representation",
|
||||
query: {
|
||||
case: showTopThreeArr[key].caseRef,
|
||||
state: "edit",
|
||||
created:
|
||||
showTopThreeArr[key].repfile_name,
|
||||
},
|
||||
}}
|
||||
// href={{
|
||||
// pathname:
|
||||
// router.locale == "cy"
|
||||
// ? "/fymhorth/representation"
|
||||
// : "/myportal/representation",
|
||||
// query: {
|
||||
// case: showTopThreeArr[key].ticketnumber,
|
||||
// state: "edit",
|
||||
// created:
|
||||
// showTopThreeArr[key].repfile_name,
|
||||
// },
|
||||
// }}
|
||||
className="govuk-link--no-underline"
|
||||
style={{
|
||||
color: "#0360a6",
|
||||
cursor: "pointer",
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
data-id={index}
|
||||
onClick={() => {
|
||||
setCurrentReference({
|
||||
@@ -223,10 +228,24 @@ const TopThree = (props) => {
|
||||
"repDetails": showTopThreeArr[key],
|
||||
});
|
||||
isLPA && setRepresentationCapacity("LPA");
|
||||
router.push({
|
||||
pathname:
|
||||
router.locale == "cy"
|
||||
? "/fymhorth/representation"
|
||||
: "/myportal/representation",
|
||||
query: {
|
||||
case: showTopThreeArr[key]
|
||||
.ticketnumber,
|
||||
state: "edit",
|
||||
created:
|
||||
showTopThreeArr[key]
|
||||
.repfile_name,
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
{showTopThreeArr[key].pinswg_name}
|
||||
</Link>
|
||||
</span>
|
||||
)}
|
||||
{!showTopThreeArr[key].hasOwnProperty(
|
||||
"repComplete"
|
||||
@@ -234,13 +253,13 @@ const TopThree = (props) => {
|
||||
<div className="deleteCase">
|
||||
<button
|
||||
title={t(
|
||||
"case:do-you-want-to-delete-case-label"
|
||||
"case:do-you-want-to-delete-rep-label"
|
||||
)}
|
||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
"case:do-you-want-to-delete-case-label"
|
||||
"case:do-you-want-to-delete-rep-label"
|
||||
) +
|
||||
showTopThreeArr[key]
|
||||
.pinswg_name +
|
||||
@@ -253,7 +272,7 @@ const TopThree = (props) => {
|
||||
props.accountDetails
|
||||
.containerID,
|
||||
showTopThreeArr[key]
|
||||
.pinswg_name,
|
||||
.ticketnumber,
|
||||
showTopThreeArr[key]
|
||||
.repfile_name
|
||||
);
|
||||
|
||||
+111
-129
@@ -78,21 +78,23 @@ const ViewAllResults = (props) => {
|
||||
return dateObj.toLocaleString();
|
||||
};
|
||||
|
||||
let currentView = props.currentView.currentView;
|
||||
//console.log("viewAllKey:", typeof viewAllKey);
|
||||
let viewKeyFromUrl = router.query.key;
|
||||
|
||||
// typeof viewAllKey == "undefined"
|
||||
let currentView = props.currentView.currentView;
|
||||
//console.log("currentViewKey:", typeof currentViewKey);
|
||||
|
||||
// typeof currentViewKey == "undefined"
|
||||
// ? console.log("no currentview")
|
||||
// : console.log("has currentview");
|
||||
|
||||
var viewAllKey = currentView?.viewKey || router.query.viewKey;
|
||||
let currentViewKey = currentView.viewKey || viewKeyFromUrl;
|
||||
|
||||
var resultsArr =
|
||||
viewAllKey == "awaitingSubmissionDetails"
|
||||
currentViewKey == "awaitingSubmissionDetails"
|
||||
? props["awaitingSubmission"].awaitingSubmissionDetails.case
|
||||
: viewAllKey == "mySubmittedReps"
|
||||
? props[viewAllKey][viewAllKey]
|
||||
: props[viewAllKey][viewAllKey].value || [];
|
||||
: currentViewKey == "mySubmittedReps"
|
||||
? props[currentViewKey][currentViewKey]
|
||||
: props[currentViewKey][currentViewKey].value || [];
|
||||
|
||||
const [orderByState, setOrderbyState] = useState("createdon");
|
||||
const [fieldSortState, setfieldSortState] = useState("asc");
|
||||
@@ -109,11 +111,11 @@ const ViewAllResults = (props) => {
|
||||
}
|
||||
|
||||
var searchDetailsObj =
|
||||
viewAllKey == "awaitingSubmissionDetails"
|
||||
currentViewKey == "awaitingSubmissionDetails"
|
||||
? props["awaitingSubmission"].awaitingSubmissionDetails.value
|
||||
: viewAllKey == "myRepresentations"
|
||||
: currentViewKey == "myRepresentations"
|
||||
? props["myRepresentations"].myRepresentations.value
|
||||
: props[viewAllKey][viewAllKey + "Details"] || [];
|
||||
: props[currentViewKey][currentViewKey + "Details"] || [];
|
||||
|
||||
let resultsRowArr = [];
|
||||
|
||||
@@ -145,13 +147,13 @@ const ViewAllResults = (props) => {
|
||||
let detailsObj = jsonpath({
|
||||
path:
|
||||
"$" +
|
||||
(viewAllKey == "myRepresentations" ? "" : "..value") +
|
||||
(currentViewKey == "myRepresentations" ? "" : "..value") +
|
||||
'[?(@ && @.pinswg_name=="' +
|
||||
(viewAllKey == "awaitingSubmissionDetails"
|
||||
(currentViewKey == "awaitingSubmissionDetails"
|
||||
? item.title
|
||||
: viewAllKey == "watchedCases"
|
||||
: currentViewKey == "watchedCases"
|
||||
? item.ticketnumber
|
||||
: viewAllKey == "myRepresentations"
|
||||
: currentViewKey == "myRepresentations"
|
||||
? item.pinswg_name
|
||||
: item.pinswg_title) +
|
||||
'")]',
|
||||
@@ -163,7 +165,7 @@ const ViewAllResults = (props) => {
|
||||
//console.log(searchDetailsObj[key]);
|
||||
|
||||
// searchDetailsObj[key] =
|
||||
// viewAllKey == "myRepresentations"
|
||||
// currentViewKey == "myRepresentations"
|
||||
// ? searchDetailsObj[key].value[0]
|
||||
// : searchDetailsObj[key];
|
||||
|
||||
@@ -171,7 +173,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">
|
||||
{viewAllKey == "myCases" &&
|
||||
{currentViewKey == "myCases" &&
|
||||
resultsArr[key].pinswg_publishtoweb === false ? (
|
||||
<>
|
||||
<div className="cardModuleReference">
|
||||
@@ -210,7 +212,7 @@ const ViewAllResults = (props) => {
|
||||
<>
|
||||
<Link
|
||||
href={
|
||||
viewAllKey == "myRepresentations"
|
||||
currentViewKey == "myRepresentations"
|
||||
? {
|
||||
pathname:
|
||||
"/myportal/representation",
|
||||
@@ -223,7 +225,7 @@ const ViewAllResults = (props) => {
|
||||
.repfile_name,
|
||||
},
|
||||
}
|
||||
: viewAllKey ==
|
||||
: currentViewKey ==
|
||||
"awaitingSubmissionDetails"
|
||||
? router.locale == "cy"
|
||||
? "/fymhorth/parhauigyflwyno"
|
||||
@@ -245,25 +247,25 @@ const ViewAllResults = (props) => {
|
||||
"&inid=" +
|
||||
resultsArr[key].incidentid +
|
||||
"&key=" +
|
||||
viewAllKey
|
||||
currentViewKey
|
||||
: router.locale == "cy"
|
||||
? myportal == true
|
||||
? "/fymhorth/achos" +
|
||||
resultsArr[key].ticketnumber +
|
||||
"?key=" +
|
||||
currentView.viewKey
|
||||
currentViewKey
|
||||
: "/achos" +
|
||||
resultsArr[key].ticketnumber
|
||||
: myportal == true
|
||||
? "/myportal/case/" +
|
||||
resultsArr[key].ticketnumber +
|
||||
"?key=" +
|
||||
viewAllKey
|
||||
currentViewKey
|
||||
: "/case/" +
|
||||
resultsArr[key].ticketnumber
|
||||
}
|
||||
onClick={() => {
|
||||
viewAllKey == "watchedCases" &&
|
||||
currentViewKey == "watchedCases" &&
|
||||
setSearchResults(
|
||||
props.watchedCases.watchedCases
|
||||
),
|
||||
@@ -276,8 +278,9 @@ const ViewAllResults = (props) => {
|
||||
resultsArr[key]
|
||||
.ticketnumber,
|
||||
"currentReference":
|
||||
viewAllKey != "watchedCases"
|
||||
? viewAllKey ==
|
||||
currentViewKey !=
|
||||
"watchedCases"
|
||||
? currentViewKey ==
|
||||
"myRepresentations"
|
||||
? resultsArr[key]
|
||||
.caseRef
|
||||
@@ -287,9 +290,10 @@ const ViewAllResults = (props) => {
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
],
|
||||
|
||||
"currentType": viewAllKey,
|
||||
"currentType": currentViewKey,
|
||||
"incidentid":
|
||||
viewAllKey != "watchedCases"
|
||||
currentViewKey !=
|
||||
"watchedCases"
|
||||
? resultsArr[key]
|
||||
.incidentid
|
||||
: resultsArr[key][
|
||||
@@ -300,14 +304,14 @@ const ViewAllResults = (props) => {
|
||||
resultsArr[key]
|
||||
.pinswg_appealcasetype,
|
||||
"repDetails":
|
||||
viewAllKey ==
|
||||
currentViewKey ==
|
||||
"myRepresentations" &&
|
||||
resultsArr[key],
|
||||
}),
|
||||
setCurrentView({
|
||||
"viewName":
|
||||
currentView.viewName,
|
||||
"viewKey": viewAllKey,
|
||||
"viewKey": currentViewKey,
|
||||
});
|
||||
}}
|
||||
>
|
||||
@@ -317,35 +321,25 @@ const ViewAllResults = (props) => {
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{viewAllKey != "watchedCases"
|
||||
? viewAllKey == "myRepresentations"
|
||||
{currentViewKey != "watchedCases"
|
||||
? currentViewKey == "myRepresentations"
|
||||
? resultsArr[key].caseRef
|
||||
: resultsArr[key].ticketnumber
|
||||
: currentViewKey ==
|
||||
"awaitingSubmissionDetails"
|
||||
? resultsArr[key].title
|
||||
: resultsArr[key].pinswg_title
|
||||
: resultsArr[key][
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
]}
|
||||
</Link>
|
||||
<RepsOnResults
|
||||
detailsObj={detailsObj}
|
||||
appealType={item.pinswg_appealcasetype}
|
||||
/>
|
||||
{viewAllKey == "myRepresentations" && (
|
||||
{currentViewKey == "myRepresentations" && (
|
||||
<>
|
||||
<span className="govuk-body govuk-!-font-size-14">
|
||||
<br />
|
||||
<span>
|
||||
{resultsArr[key].representationType}
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
{viewAllKey == "mySubmittedReps" && (
|
||||
<>
|
||||
<span className="govuk-body govuk-!-font-size-14">
|
||||
{item.pinswg_representationtype}{" "}
|
||||
{formatDates(
|
||||
item.pinswg_representationsubmitted
|
||||
)}
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</dd>
|
||||
@@ -354,14 +348,14 @@ const ViewAllResults = (props) => {
|
||||
{t("search:searchresults-site-address-label")}:
|
||||
</span>
|
||||
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
||||
? searchDetailsObj[key].pinswg_siteaddressline1
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||
? detailsObj.pinswg_siteaddressline1
|
||||
: ""}
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
{currentViewKey == "myRepresentations" &&
|
||||
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
|
||||
? searchDetailsObj[key].value[0]
|
||||
.pinswg_siteaddressline1
|
||||
@@ -369,14 +363,14 @@ const ViewAllResults = (props) => {
|
||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||
? detailsObj.pinswg_siteaddressline1
|
||||
: ""}
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddressline1"
|
||||
) &&
|
||||
searchDetailsObj[key].pinswg_siteaddressline1 !=
|
||||
null && <br />}
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
{currentViewKey == "myRepresentations" &&
|
||||
_.has(
|
||||
searchDetailsObj[key].pinswg_siteaddressline1
|
||||
) &&
|
||||
@@ -386,25 +380,25 @@ const ViewAllResults = (props) => {
|
||||
detailsObj.pinswg_siteaddressline1 != null && (
|
||||
<br />
|
||||
)}
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
||||
? searchDetailsObj[key].pinswg_siteaddressline2
|
||||
: ""}
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
{currentViewKey == "myRepresentations" &&
|
||||
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
|
||||
? searchDetailsObj[key].pinswg_siteaddressline2
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||
? detailsObj.pinswg_siteaddressline2
|
||||
: ""}
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddressline2"
|
||||
) &&
|
||||
searchDetailsObj[key].pinswg_siteaddressline2 !=
|
||||
null && <br />}
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
{currentViewKey == "myRepresentations" &&
|
||||
_.has(
|
||||
searchDetailsObj[key].pinswg_siteaddressline2
|
||||
) &&
|
||||
@@ -414,25 +408,25 @@ const ViewAllResults = (props) => {
|
||||
detailsObj.pinswg_siteaddressline2 != null && (
|
||||
<br />
|
||||
)}
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
||||
? searchDetailsObj[key].pinswg_siteaddresstown
|
||||
: ""}
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
{currentViewKey == "myRepresentations" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
||||
? searchDetailsObj[key].pinswg_siteaddresstown
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_siteaddresstown")
|
||||
? detailsObj.pinswg_siteaddresstown
|
||||
: ""}
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddresstown"
|
||||
) &&
|
||||
searchDetailsObj[key].pinswg_siteaddresstown !=
|
||||
null && <br />}
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
{currentViewKey == "myRepresentations" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddresstown"
|
||||
@@ -441,18 +435,18 @@ const ViewAllResults = (props) => {
|
||||
null && <br />}
|
||||
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
||||
detailsObj.pinswg_siteaddresstown != null && <br />}
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
||||
? searchDetailsObj[key].pinswg_siteaddresscounty
|
||||
: ""}
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
{currentViewKey == "myRepresentations" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
||||
? searchDetailsObj[key].pinswg_siteaddresscounty
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_siteaddresscounty")
|
||||
? detailsObj.pinswg_siteaddresscounty
|
||||
: ""}
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddresscounty"
|
||||
@@ -463,7 +457,7 @@ const ViewAllResults = (props) => {
|
||||
detailsObj.pinswg_siteaddresscounty != null && (
|
||||
<br />
|
||||
)}
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddresspostcode"
|
||||
@@ -494,9 +488,9 @@ const ViewAllResults = (props) => {
|
||||
"pinswg_projectlocation",
|
||||
].map((field, idx) => {
|
||||
const isAwaitingSubmission =
|
||||
viewAllKey === "awaitingSubmissionDetails";
|
||||
currentViewKey === "awaitingSubmissionDetails";
|
||||
const isMyRepresentations =
|
||||
viewAllKey === "myRepresentations";
|
||||
currentViewKey === "myRepresentations";
|
||||
const searchValue = _.get(
|
||||
searchDetailsObj,
|
||||
`${key}.${field} `
|
||||
@@ -524,11 +518,11 @@ const ViewAllResults = (props) => {
|
||||
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
{viewAllKey == "awaitingSubmissionDetails"
|
||||
{currentViewKey == "awaitingSubmissionDetails"
|
||||
? t("search:searchresults-created-on-label")
|
||||
: t("search:searchresults-applicant-label")}
|
||||
</span>
|
||||
{viewAllKey == "awaitingSubmissionDetails"
|
||||
{currentViewKey == "awaitingSubmissionDetails"
|
||||
? formatDates(item.createdon)
|
||||
: _.has(detailsObj, [
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
|
||||
@@ -536,7 +530,7 @@ const ViewAllResults = (props) => {
|
||||
? detailsObj[
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
: viewAllKey == "myRepresentations"
|
||||
: currentViewKey == "myRepresentations"
|
||||
? searchDetailsObj[key][
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
@@ -548,7 +542,7 @@ const ViewAllResults = (props) => {
|
||||
<span className="results-visually-hidden">
|
||||
{t("search:searchresults-authority-label")}:
|
||||
</span>
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(resultsArr[key], "pinswg_lpaname")
|
||||
? router.locale == "cy"
|
||||
? jsonpath({
|
||||
@@ -593,7 +587,7 @@ const ViewAllResults = (props) => {
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: viewAllKey == "myRepresentations"
|
||||
: currentViewKey == "myRepresentations"
|
||||
? searchDetailsObj[key].value
|
||||
: searchDetailsObj[key].value[0][
|
||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||
@@ -616,10 +610,10 @@ const ViewAllResults = (props) => {
|
||||
: resultsArr[key][
|
||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
(viewAllKey == "myRepresentations"
|
||||
(currentViewKey == "myRepresentations"
|
||||
? ""
|
||||
: "N/A")
|
||||
: viewAllKey == "myRepresentations" &&
|
||||
: currentViewKey == "myRepresentations" &&
|
||||
router.locale == "cy" &&
|
||||
jsonpath({
|
||||
path:
|
||||
@@ -637,7 +631,7 @@ const ViewAllResults = (props) => {
|
||||
{t("search:searchresults-case-type-label")}:
|
||||
</span>
|
||||
|
||||
{viewAllKey == "awaitingSubmissionDetails"
|
||||
{currentViewKey == "awaitingSubmissionDetails"
|
||||
? router.locale == "cy"
|
||||
? jsonpath({
|
||||
path:
|
||||
@@ -666,9 +660,11 @@ const ViewAllResults = (props) => {
|
||||
: item[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
(viewAllKey == "myRepresentations" ? "" : "N/A")}
|
||||
(currentViewKey == "myRepresentations"
|
||||
? ""
|
||||
: "N/A")}
|
||||
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
{currentViewKey == "myRepresentations" &&
|
||||
(router.locale == "cy"
|
||||
? jsonpath({
|
||||
path:
|
||||
@@ -690,13 +686,13 @@ const ViewAllResults = (props) => {
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
{viewAllKey == "myRepresentations"
|
||||
{currentViewKey == "myRepresentations"
|
||||
? "Created"
|
||||
: t("search:searchresults-status-label")}
|
||||
:
|
||||
</span>
|
||||
|
||||
{viewAllKey == "awaitingSubmissionDetails"
|
||||
{currentViewKey == "awaitingSubmissionDetails"
|
||||
? router.locale == "cy"
|
||||
? jsonpath({
|
||||
path:
|
||||
@@ -714,7 +710,7 @@ const ViewAllResults = (props) => {
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
}) || "N/A"
|
||||
: viewAllKey == "myRepresentations"
|
||||
: currentViewKey == "myRepresentations"
|
||||
? repRaisedDate(item.repfile_name) // ? router.locale == "cy"
|
||||
: // ? jsonpath({path:
|
||||
//
|
||||
@@ -752,13 +748,13 @@ const ViewAllResults = (props) => {
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] || "N/A"}
|
||||
</dd>
|
||||
{viewAllKey == "awaitingSubmissionDetails" && (
|
||||
{currentViewKey == "awaitingSubmissionDetails" && (
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
|
||||
<button
|
||||
title={t(
|
||||
"case:do-you-want-to-delete-case-label"
|
||||
)}
|
||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||
className=" cardModuleRemoveCase govuk-summary-list__actionLink"
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
@@ -780,13 +776,13 @@ const ViewAllResults = (props) => {
|
||||
</button>
|
||||
</dd>
|
||||
)}
|
||||
{viewAllKey == "myRepresentations" && (
|
||||
{currentViewKey == "myRepresentations" && (
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
|
||||
<button
|
||||
title={t(
|
||||
"case:do-you-want-to-delete-case-label"
|
||||
"case:do-you-want-to-delete-rep-label"
|
||||
)}
|
||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||
className=" cardModuleRemoveCase govuk-summary-list__actionLink "
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
@@ -810,14 +806,13 @@ const ViewAllResults = (props) => {
|
||||
</dd>
|
||||
)}
|
||||
|
||||
{viewAllKey == "watchedCases" && (
|
||||
<dd
|
||||
className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem govuk-!-font-size-14 govuk-summary-list__action"
|
||||
style={{ display: "flex", flexDirection: "column" }}
|
||||
>
|
||||
{currentViewKey == "watchedCases" && (
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
|
||||
<button
|
||||
title={t("case:stop-watching-case-link")}
|
||||
className=" govuk-summary-list__actionLink watched_link"
|
||||
title={t(
|
||||
"case:do-you-want-to-delete-case-label"
|
||||
)}
|
||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
@@ -996,27 +991,6 @@ const ViewAllResults = (props) => {
|
||||
.then((data) => data)
|
||||
.then(() => {
|
||||
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
||||
let showWatchedCases = (submittedArr) => {
|
||||
const required = submittedArr.value.filter((el) => {
|
||||
return (
|
||||
el.pinswg_representationsubmitted == null
|
||||
);
|
||||
});
|
||||
|
||||
let newObj = {};
|
||||
return Object.assign(newObj, {
|
||||
"@odata.count": required.length,
|
||||
"value": required,
|
||||
});
|
||||
};
|
||||
|
||||
data = showWatchedCases(data);
|
||||
|
||||
data.value.sort(function compare(a, b) {
|
||||
var dateA = new Date(a.createdon);
|
||||
var dateB = new Date(b.createdon);
|
||||
return dateB - dateA;
|
||||
});
|
||||
setWatchedCases(data),
|
||||
getDetailsProxy(data, "myWatchedCases")
|
||||
.then((data) => {
|
||||
@@ -1109,15 +1083,15 @@ const ViewAllResults = (props) => {
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||
t("myportal:awatitingsubmission-card-title")}
|
||||
{viewAllKey == "watchedCases" &&
|
||||
{currentViewKey == "watchedCases" &&
|
||||
t("myportal:watchedcases-card-title")}
|
||||
{viewAllKey == "myCases" &&
|
||||
{currentViewKey == "myCases" &&
|
||||
t("myportal:mycases-card-title")}
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
{currentViewKey == "myRepresentations" &&
|
||||
t("myportal:myrepresentations-card-title")}
|
||||
{viewAllKey == "mySubmittedReps" &&
|
||||
{currentViewKey == "mySubmittedReps" &&
|
||||
"Submitted representations"}
|
||||
</h1>
|
||||
|
||||
@@ -1125,13 +1099,13 @@ const ViewAllResults = (props) => {
|
||||
<h3>
|
||||
{" "}
|
||||
There are no{" "}
|
||||
{viewAllKey == "awaitingSubmissionDetails" &&
|
||||
{currentViewKey == "awaitingSubmissionDetails" &&
|
||||
t("myportal:awatitingsubmission-card-title")}
|
||||
{viewAllKey == "watchedCases" &&
|
||||
{currentViewKey == "watchedCases" &&
|
||||
t("myportal:watchedcases-card-title")}
|
||||
{viewAllKey == "myCases" &&
|
||||
{currentViewKey == "myCases" &&
|
||||
t("myportal:mycases-card-title")}
|
||||
{viewAllKey == "myRepresentations" &&
|
||||
{currentViewKey == "myRepresentations" &&
|
||||
t("myportal:myrepresentations-card-title")}{" "}
|
||||
records
|
||||
</h3>
|
||||
@@ -1143,7 +1117,7 @@ const ViewAllResults = (props) => {
|
||||
type="button"
|
||||
onClick={() =>
|
||||
sortDataBy(
|
||||
viewAllKey ==
|
||||
currentViewKey ==
|
||||
"awaitingSubmissionDetails"
|
||||
? "title"
|
||||
: "pinswg_title"
|
||||
@@ -1151,7 +1125,7 @@ const ViewAllResults = (props) => {
|
||||
}
|
||||
className={
|
||||
orderByState ==
|
||||
(viewAllKey ==
|
||||
(currentViewKey ==
|
||||
"awaitingSubmissionDetails"
|
||||
? "title"
|
||||
: "pinswg_title")
|
||||
@@ -1171,7 +1145,8 @@ const ViewAllResults = (props) => {
|
||||
"search:searchresults-site-address-label"
|
||||
)}
|
||||
</dd>
|
||||
{viewAllKey == "awaitingSubmissionDetails" ? (
|
||||
{currentViewKey ==
|
||||
"awaitingSubmissionDetails" ? (
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
<button
|
||||
type="button"
|
||||
@@ -1203,7 +1178,7 @@ const ViewAllResults = (props) => {
|
||||
type="button"
|
||||
onClick={() =>
|
||||
sortDataBy(
|
||||
viewAllKey ==
|
||||
currentViewKey ==
|
||||
"awaitingSubmissionDetails"
|
||||
? "pinswg_lpaname"
|
||||
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
@@ -1211,7 +1186,7 @@ const ViewAllResults = (props) => {
|
||||
}
|
||||
className={
|
||||
orderByState ==
|
||||
(viewAllKey ==
|
||||
(currentViewKey ==
|
||||
"awaitingSubmissionDetails"
|
||||
? "pinswg_lpaname"
|
||||
: "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue")
|
||||
@@ -1227,7 +1202,7 @@ const ViewAllResults = (props) => {
|
||||
</button>
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{viewAllKey !=
|
||||
{currentViewKey !=
|
||||
"awaitingSubmissionDetails" ? (
|
||||
<button
|
||||
type="button"
|
||||
@@ -1238,7 +1213,7 @@ const ViewAllResults = (props) => {
|
||||
}
|
||||
className={
|
||||
orderByState ==
|
||||
(viewAllKey ==
|
||||
(currentViewKey ==
|
||||
"awaitingSubmissionDetails"
|
||||
? "pinswg_lpaname"
|
||||
: "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue")
|
||||
@@ -1259,7 +1234,7 @@ const ViewAllResults = (props) => {
|
||||
)}{" "}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{viewAllKey == "myRepresentations" ? (
|
||||
{currentViewKey == "myRepresentations" ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
@@ -1279,6 +1254,13 @@ const ViewAllResults = (props) => {
|
||||
t("search:searchresults-status-label")
|
||||
)}
|
||||
</dd>
|
||||
|
||||
{(currentViewKey == "watchedCases" ||
|
||||
currentViewKey ==
|
||||
"awaitingSubmissionDetails" ||
|
||||
currentViewKey == "myRepresentations") && (
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action"></dd>
|
||||
)}
|
||||
</div>
|
||||
{showSpinnerState == true ? (
|
||||
<div className="govuk-summary-list__row">
|
||||
|
||||
@@ -31,6 +31,7 @@ const WatchedCases = (props) => {
|
||||
currentView={props.currentView}
|
||||
myReps={props.myReps}
|
||||
props={props}
|
||||
accountDetails={props.accountDetails}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -40,12 +41,11 @@ const WatchedCases = (props) => {
|
||||
<div className="cardVieAll">
|
||||
<Link
|
||||
href={
|
||||
(router.locale != "en"
|
||||
router.locale != "en"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/fymhorth/gweldpopeth"
|
||||
: "/myportal/viewall") +
|
||||
"?viewKey=watchedCases"
|
||||
"/fymhorth/gweldpopeth?key=watchedCases"
|
||||
: "/myportal/viewall?key=watchedCases"
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
|
||||
Reference in New Issue
Block a user