Merge branch 'Development' into SIPS-Development

This commit is contained in:
2025-08-20 12:11:55 +01:00
71 changed files with 1683 additions and 443 deletions
+30 -29
View File
@@ -497,20 +497,27 @@ const Breadcrumbs = (props) => {
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
{viewAllKey ==
{(currentView.currentView.viewKey ||
router.query.key) ==
"awaitingSubmissionDetails" &&
t(
"myportal:awatitingsubmission-card-title"
)}
{viewAllKey == "watchedCases" &&
{(currentView.currentView.viewKey ||
router.query.key) == "watchedCases" &&
t("myportal:watchedcases-card-title")}
{viewAllKey == "myCases" &&
{(currentView.currentView.viewKey ||
router.query.key) == "myCases" &&
t("myportal:mycases-card-title")}
{viewAllKey == "myRepresentations" &&
{(currentView.currentView.viewKey ||
router.query.key) ==
"myRepresentations" &&
t(
"myportal:myrepresentations-card-title"
)}
{viewAllKey == "mySubmittedReps" &&
{(currentView.currentView.viewKey ||
router.query.key) ==
"mySubmittedReps" &&
"Submitted representations"}
</li>
</>
@@ -545,19 +552,13 @@ const Breadcrumbs = (props) => {
<li className="govuk-breadcrumbs__list-item">
<Link
href={
router.locale != "en"
? router.locale +
"/searchresults?q=" +
props.props.search
.searchString
: "/searchresults?q=" +
props.props.search
.searchString
"/searchresults?q=" +
props.props.search.searchString
}
onClick={() => {
// spinnerState();
router.back();
}}
// onClick={() => {
// // spinnerState();
// router.back();
// }}
className="govuk-breadcrumbs__link"
>
{t("common:breadcrumb-search-results")}
@@ -724,10 +725,10 @@ const Breadcrumbs = (props) => {
</li>
<li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-case-reference")}:{" "}
{
props.props.currentView.caseReference
.currentReference
}
{props.props.currentView.caseReference
.currentReference ||
props.props.searchResultsObj
.searchResultsObj.value[0].title}
</li>
</>
)}
@@ -811,10 +812,10 @@ const Breadcrumbs = (props) => {
</li>
<li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-case-reference")}:{" "}
{
props.props.currentView.caseReference
.currentReference
}
{props.props.currentView.caseReference
.currentReference ||
props.props.searchResultsObj
.searchResultsObj.value[0].title}
</li>
</>
)}
@@ -1075,10 +1076,10 @@ const Breadcrumbs = (props) => {
</li>
<li className="govuk-breadcrumbs__list-item">
{t("common:breadcrumb-case-reference")}:{" "}
{
props.props.currentView.caseReference
.currentReference
}
{props.props.currentView.caseReference
.currentReference ||
props.props.searchResultsObj
.searchResultsObj.value[0].title}
</li>
</>
)}
+1
View File
@@ -27,6 +27,7 @@ const Case = (props) => {
watchedCasesDetails={props.watchedCasesDetails}
awaitingSubmission={props.awaitingSubmission}
caseReference={props.caseReference}
ticketnumber={props.ticketnumber}
currentType={props.currentType}
appealTypeID={props.appealTypeID}
searchResultsObj={props.searchResultsObj}
+7 -6
View File
@@ -19,7 +19,7 @@ import { setCurrentPage } from "../../store/currentView/action";
import { setDocumentDetails } from "../../store/searchOutput/action";
const DocumentDetails = (props) => {
let { t } = useTranslation();
let { t, lang } = useTranslation();
const firstRender = useRef(false);
const {
incidentid,
@@ -419,7 +419,7 @@ const DocumentDetails = (props) => {
] +
'")].value_cy',
json: transLookup,
sanbox: {},
eval: true,
})
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
@@ -507,7 +507,7 @@ const DocumentDetails = (props) => {
</p>
<div>
<button onClick={clearCheckboxes}>
{t("case:documents-clear-filter-label")}
{t("search:clear-filter-button-label")}
</button>
</div>
<div className="govuk-checkboxes govuk-checkboxes--small">
@@ -584,8 +584,8 @@ const DocumentDetails = (props) => {
'$..[?(@ && @.value=="' +
item.pinswg_isharedocumentlocationsLabel +
'")].value_cy',
jsonL: transLookup,
sanbox: {},
json: transLookup,
eval: true,
})
: item.pinswg_isharedocumentlocationsLabel ||
t(
@@ -611,7 +611,7 @@ const DocumentDetails = (props) => {
setCurrentPage(1);
}}
>
{t("case:documents-filter-button")}
{t("search:filter-documents-label")}
</button>
</div>
{documentDetailsObj["@odata.count"] > 5 && (
@@ -1068,6 +1068,7 @@ const DocumentDetails = (props) => {
orderByState,
getDocumentTypes,
getDocumentResults,
lang,
]);
return (
<div className="govuk-grid-row">
+27
View File
@@ -65,6 +65,7 @@ let MakeRepresentation = (props) => {
showQuestionnaireSection,
initialValues,
setCurrentReference,
ticketnumber,
} = props;
const formObj = props.props.form;
let setCaseQueryObj = props[currentType] || {};
@@ -427,6 +428,12 @@ let MakeRepresentation = (props) => {
currentType={currentType}
casesObj={casesObj}
caseReference={caseReference}
ticketnumber={ticketnumber}
setRepFileName={setRepFileName}
updateRepresentation={updateRepresentation}
setSavingStatus={setSavingStatus}
savingStatus={savingStatus}
setCurrentReference={setCurrentReference}
/>
);
}
@@ -590,6 +597,26 @@ let MakeRepresentation = (props) => {
return deduplicate(mergedFiles);
};
const buildAddressStr = (detailsObj) => {
const toTitleCase = (str) =>
str.toLowerCase().replace(/\b\w/g, (char) => char.toUpperCase());
return [
detailsObj?.pinswg_siteaddressline1 ||
detailsObj?.pinswg_addressline1,
detailsObj?.pinswg_siteaddressline2 ||
detailsObj?.pinswg_addressline2,
detailsObj?.pinswg_siteaddresstown ||
detailsObj?.pinswg_addresstown,
detailsObj?.pinswg_siteaddresspostcode ||
detailsObj?.pinswg_postcode,
detailsObj?.pinswg_siteaddresscounty ||
detailsObj?.pinswg_addresscounty,
]
.filter((v) => !!v && v.trim()) // remove empty/whitespace-only values
.map((v) => toTitleCase(v.trim())) // title-case each segment
.join(" ");
};
const updateRepresentation = async (
values,
sendSavedEmail,
@@ -197,7 +197,8 @@ const RepAgent = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
props.props.caseReference
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={
@@ -189,7 +189,10 @@ const RepAppellant = (props) => {
label={t(
"myrepresentations:add-files-label"
)}
ticketnumber={props.props.caseReference}
ticketnumber={
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={
props.currentView.fileList
@@ -36,6 +36,9 @@ let RepCapacitySelection = (props) => {
currentType={currentType}
casesObj={casesObj}
caseReference={props.props.caseReference}
ticketnumber={
props.props.currentView.caseReference.ticketnumber
}
searchResultsObj={props.props.searchResultsObj}
myRepresentations={props.props.myRepresentations}
props={props}
@@ -65,7 +65,7 @@ const RepComplete = (props) => {
),
sendRepCompleteMessage(
props.props.props.props.accountDetails.containerID,
props.props.currentView.caseReference.currentReference,
props.props.currentView.caseReference.ticketnumber,
props.repFormData.repfile_name
),
sendEmail(templateId, emailAddress, personalisation, reference),
@@ -10,7 +10,7 @@ const RepDetails = (props) => {
const { currentType, casesObj, appealType } = props;
let { caseReference } = props;
let { caseReference, ticketnumber } = props;
let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit"
@@ -29,7 +29,7 @@ const RepDetails = (props) => {
: caseReference;
detailsObj = jsonpath({
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseDetailsObj,
eval: true,
});
@@ -189,7 +189,8 @@ const RepInterestedPartyPerson = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
props.props.caseReference
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={
@@ -354,7 +354,7 @@ let RepLPA = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
props.props.caseReference
props.currentView.caseReference.ticketnumber
}
hint={"sdsd"}
fileList={
@@ -34,6 +34,7 @@ let RepLPACapacitySelection = (props) => {
casesObj={casesObj}
detailsObj={detailsObj}
caseReference={props.props.caseReference}
ticketnumber={props.props.ticketnumber}
searchResultsObj={props.props.searchResultsObj}
props={props.props}
/>{" "}
@@ -8,7 +8,7 @@ const RepLPADetails = (props) => {
const router = useRouter();
const { locale } = router;
const { currentType, casesObj, caseReference } = props;
const { currentType, casesObj, caseReference, ticketnumber } = props;
let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit"
@@ -21,7 +21,7 @@ const RepLPADetails = (props) => {
var detailsObj = {};
detailsObj = jsonpath({
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseDetailsObj,
eval: true,
});
@@ -84,7 +84,10 @@ const RepLandOwner = (props) => {
label={t(
"myrepresentations:add-files-label"
)}
ticketnumber={props.props.caseReference}
ticketnumber={
props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={[]}
setFilesForRepresentation={[]}
@@ -1213,7 +1213,10 @@ let Enforcement_Questionnaire = (props) => {
name={"representationDocuments"}
id={"representationDocuments"}
label={t("myrepresentations:add-files-label")}
ticketnumber={props.props.props.caseReference}
ticketnumber={
props.props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={
props.currentView.fileList
@@ -1022,7 +1022,10 @@ let S78_Questionnaire = (props) => {
name={"representationDocuments"}
id={"representationDocuments"}
label={t("myrepresentations:add-files-label")}
ticketnumber={props.props.props.caseReference}
ticketnumber={
props.props.currentView.caseReference
.ticketnumber
}
hint={"sdsd"}
fileList={
props.currentView.fileList
+14 -6
View File
@@ -76,6 +76,7 @@ const CaseSummary = (props) => {
currentView,
messagesObj,
docsOffline,
ticketnumber,
} = props;
let appealTypeID = props.appealTypeID || router.query.appealType;
@@ -233,13 +234,13 @@ const CaseSummary = (props) => {
currentType == "searchResultsObj"
? (casesObj = jsonpath({
path: '$..[?(@ && @.title=="' + caseReference + '")]',
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: searchResultsObj,
eval: true,
}))
: currentType == "watchedCases"
? (casesObj = jsonpath({
path: '$..[?(@ && @.pinswg_title=="' + caseReference + '")]',
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseQueryObj,
eval: true,
}))
@@ -251,7 +252,7 @@ const CaseSummary = (props) => {
}))
: currentType == "directResultsObj"
? (casesObj = jsonpath({
path: '$..[?(@ && @.ticketnumber=="' + caseReference + '")]',
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
json: setCaseQueryObj,
eval: true,
}))
@@ -1867,7 +1868,10 @@ const CaseSummary = (props) => {
id="case-documents"
>
<Documents
incidentid={props.incidentid}
incidentid={
props.incidentid ||
setCaseQueryObj.value[0].incidentid
}
caseReference={props.caseReference}
searchResultsObj={props.searchResultsObj}
searchDetailsObj={props.searchDetailsObj}
@@ -1937,7 +1941,9 @@ const CaseSummary = (props) => {
currentView,
showMap
) {
const id = getFormCollectionByID(appealTypeID).PrimaryIdAttribute;
const id = getFormCollectionByID(
appealTypeID || setCaseQueryObj.value[0].pinswg_appealcasetype
).PrimaryIdAttribute;
const Component = CaseTypes[capitalizeFirstLetter(id)];
@@ -1955,7 +1961,9 @@ const CaseSummary = (props) => {
useEffect(() => {
const linkCaseObj = async () => {
let docObj = await getLinkedCases(incidentid).then((data) => {
let docObj = await getLinkedCases(
incidentid || setCaseQueryObj.value[0].incidentid
).then((data) => {
//console.log(data);
setCurrentLinkedCases(data);
return data;
@@ -129,7 +129,6 @@ const Pinswg_dnsid = (props) => {
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
+9 -2
View File
@@ -4,8 +4,14 @@ import CRMError from "./crmError";
import DNSSearchResults from "./search/dnssearchresults";
export default function Search(props) {
const { searchString, searchResultsObj, myportal, watchedCases, showMap } =
props;
const {
searchString,
searchResultsObj,
myportal,
watchedCases,
showMap,
showLoginCheck,
} = props;
let { t } = useTranslation();
const router = useRouter();
@@ -41,6 +47,7 @@ export default function Search(props) {
myportal={myportal}
watchedCases={watchedCases}
showMap={showMap}
showLoginCheck={showLoginCheck}
/>
</div>
</div>
+2 -20
View File
@@ -8,17 +8,7 @@ export default function CaseComment() {
const { locale } = router;
return (
<div id="casescomment-card">
<div className="card-body card-body govuk-!-padding-top-0">
<h3 className="heading-small card-heading">
{t("home:casescomment-card-title")}
</h3>
<p className="gouk-body-s">
{t("home:casescomment-card-paragraph-three")}
</p>
<p className="gouk-body-s">
{t("home:casescomment-card-paragraph-four")}
</p>
<div className="card-body card-body govuk-!-padding-top-4">
<p className="govuk-body-s">
{t("home:casescomment-card-paragraph-one")}{" "}
<a
@@ -28,15 +18,7 @@ export default function CaseComment() {
{t("home:login-contact-email")}
</a>
</p>
<p className="govuk-body-s">
{t("home:casescomment-card-paragraph-two")}
</p>
<h3 className="heading-small card-heading">
{t("home:watch-case-card-title")}
</h3>
<p className="govuk-body-s">
{t("home:watch-case-paragraph-one")}
</p>
{/* <p className="govuk-body-s">
{t("home:casescomment-card-paragraph-two")}
</p> */}
+27 -44
View File
@@ -78,49 +78,24 @@ let Login = (props) => {
<p className="govuk-body-s">
{t("home:signin-benefits-paragraph")}
</p>
<h3 className="heading-small card-heading">
{/* {t("home:login-card-title")} */}
{t("home:login-card-title-temp")}
</h3>{" "}
{/* <div className="govuk-form-group govuk-!-margin-top-4">
<div className="govuk-body">
{session && "Signed in as " + session.user?.email}
</div>
<br />
{!session && (
<button
className="govuk-button withChevron govuk-button-cta"
type="button"
onClick={
() => signInButton()
// signIn("email", {
// callbackUrl:
// (router.locale != "en"
// ? "/cy"
// : "") + "/",
// })
}
>
{t("home:login-via-nextuth-label")}
</button>
)}
{session && (
<button
className="govuk-button"
type="button"
onClick={() => signOut()}
>
Magic Link Sign Out
</button>
)}
</div> */}
<p className="govuk-body-s">
{t("home:login-comingsoon-temp-1")}{" "}
</p>
{/* <p className="govuk-body-s">
{t("home:login-comingsoon-temp-1a")}{" "}
</p> */}
<ul className="cardList-nobullet">
<li className="govuk-body-s">
{" "}
<strong>
{" "}
{t("home:login-card-title-temp")}{" "}
</strong>{" "}
{t("home:login-comingsoon-temp-1")}
</li>
<li>
<strong>{t("home:casescomment-card-title")}</strong>{" "}
{t("home:casescomment-card-paragraph-two")}
</li>
<li>
<strong> {t("home:watch-case-card-title")}</strong>{" "}
{t("home:watch-case-paragraph-one")}
</li>
</ul>
<div className="govuk-form-group govuk-!-margin-top-4">
<p className="govuk-body-s">
{t("home:login-comingsoon-temp-2")}
@@ -178,9 +153,17 @@ let Login = (props) => {
</a>
</li>
</ul>
<p className="govuk-body-s">
{t("home:casescomment-card-paragraph-one")}{" "}
<a
href={"mailto:" + t("home:login-contact-email")}
className="govuk-link--no-underline"
>
{t("home:login-contact-email")}
</a>
</p>
</div>
</div>
<CaseComment />
</div>
</>
);
+1
View File
@@ -168,6 +168,7 @@ const MyPortal = (props) => {
watchedCases={props.watchedCases}
isLPA={isLPA}
myReps={false}
accountDetails={props.accountDetails}
/>
)}
{props.myRepresentations.hasOwnProperty(
+2 -3
View File
@@ -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={() => {
+3 -3
View File
@@ -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={() => {
+3 -4
View File
@@ -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={() => {
+10
View File
@@ -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"
+19 -19
View File
@@ -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 && (
+36 -17
View File
@@ -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
View File
@@ -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">
+4 -4
View File
@@ -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={() => {
+1
View File
@@ -22,6 +22,7 @@ const CaseRepresentation = (props) => {
watchedCases={props.watchedCases}
awaitingSubmission={props.awaitingSubmission}
caseReference={props.caseReference}
ticketnumber={props.ticketnumber}
currentType={props.currentType}
searchResultsObj={props.searchResultsObj}
searchDetailsObj={props.searchDetailsObj}
+2 -2
View File
@@ -311,8 +311,8 @@ const SearchResults = (props) => {
resultsArrPaged.map((item, key) => {
let detailsObj = jsonpath({
path:
'$..value[?(@ && @.pinswg_name=="' +
item.pinswg_name +
'$..value[?(@ && @.ticketnumber=="' +
item.ticketnumber +
'")]',
json: searchDetailsObj,
+52 -2
View File
@@ -32,6 +32,7 @@ import {
setWatchedCasesDetails,
} from "../../store/watchedCases/action";
import { getDetailsProxy, getSearchDetailsPaged } from "../utils";
import { signIn, useSession } from "next-auth/react";
const DNSSearchResults = (props) => {
const {
@@ -48,11 +49,13 @@ const DNSSearchResults = (props) => {
setWatchedCases,
setWatchedCasesDetails,
showMap,
showLoginCheck,
} = props;
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const { data: session } = useSession();
var resultsArr = searchResultsObj.value || [];
@@ -378,8 +381,8 @@ const DNSSearchResults = (props) => {
resultsArr.map((item, key) => {
let detailsObj = jsonpath({
path:
'$..value[?(@ && @.pinswg_name=="' +
item.title +
'$..value[?(@ && @.ticketnumber=="' +
item.ticketnumber +
'")]',
json: searchDetailsObj,
eval: true,
@@ -443,6 +446,8 @@ const DNSSearchResults = (props) => {
"appealType":
item.pinswg_appealcasetype,
"showMap": showMap,
"showLoginCheck":
props.showLoginCheck,
});
}}
>
@@ -744,6 +749,51 @@ const DNSSearchResults = (props) => {
)}
</dd>
)}
{(showLoginCheck == "true" ||
showLoginCheck == true) &&
!session && (
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
<span className="results-visually-hidden">
{t(
"case:watch-this-case-link"
)}
</span>
<button
className="govuk-summary-list__actionLink watchLink"
onClick={() => {
confirm(
t(
"case:trying-to-watch-case-label"
) +
item.title +
"\n\n" +
t(
"case:trying-to-watch-case-redirect-label"
)
) &&
// signIn("email");
signIn(
undefined,
{
callbackUrl:
"/myportal/searchresults?q=" +
searchString +
"&toWatch=" +
item.incidentid +
"_" +
item.pinswg_appealcasetype,
}
);
}}
title={t(
"case:watch-this-case-link"
)}
>
<span className="eye"></span>
</button>
</dd>
)}
</div>
);
})
+2 -2
View File
@@ -331,8 +331,8 @@ const SearchResults = (props) => {
resultsArr.map((item, key) => {
let detailsObj = jsonpath({
path:
'$..value[?(@ && @.pinswg_name=="' +
item.title +
'$..value[?(@ && @.ticketnumber=="' +
item.ticketnumber +
'")]',
json: searchDetailsObj,
eval: true,
+5 -1
View File
@@ -18,7 +18,11 @@ export default function ServiceBanner(props) {
<div className="servicebanner">
<h1>
<img
className="govuk-!-margin-top-4"
className={
router.locale == "cy"
? "govuk-!-margin-top-4 serviceTitle cy"
: "govuk-!-margin-top-4 serviceTitle"
}
src={
router.locale == "cy"
? "/assets/images/planning-casework-cy.svg"
+9
View File
@@ -34,6 +34,15 @@ export const getFormCollectionByID = (appealTypeID) => {
return collectionName[0];
};
export const getNavigationPropertyByPrimaryAttribute = (primaryAttribute) => {
const collectionName = jsonpath({
path: "$..[?(@ && @.PrimaryIdAttribute =='" + primaryAttribute + "')]",
json: data,
eval: true,
});
return collectionName[0];
};
export const getFormIDByLogicalName = (appealTypeLogicalName) => {
const collectionName = jsonpath({
path: "$..[?(@ && @.LogicalName =='" + appealTypeLogicalName + "')]",