Merged PR 1499: SIPS Sprint 3 14760 tabs ui
Related work items: #14758, #15079
This commit is contained in:
@@ -75,7 +75,7 @@ export const getSelectQuery = (appealTypeName) => {
|
||||
break;
|
||||
case "pinswg_sipses":
|
||||
// return "&$select=pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
|
||||
return "&$select=pinswg_anticipatedgridrefeasting,pinswg_anticipatedgridrefnorthing,_pinswg_appellant_value,pinswg_name,_pinswg_associatedlpa_value,pinswg_choiceofprocedure,pinswg_decision,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,statuscode,pinswg_casestage,_pinswg_sipscase_value,pinswg_writtenacceptanceofnotification,pinswg_validnoticeofintentiontosubmit,pinswg_deadlineforsubmissionofapplication,pinswg_screeningstartdate,pinswg_eiatargetdate,pinswg_targetextended,pinswg_directionissueddate,pinswg_eiarequired,pinswg_scopingstartdate,pinswg_scopingtargetdate,pinswg_scopingtargetextended,pinswg_scopingoutcomeissueddate";
|
||||
return "&$select=pinswg_eiarequired,pinswg_anticipatedgridrefeasting,pinswg_anticipatedgridrefnorthing,_pinswg_appellant_value,pinswg_name,_pinswg_associatedlpa_value,pinswg_choiceofprocedure,pinswg_decision,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,statuscode,pinswg_casestage,_pinswg_sipscase_value,pinswg_writtenacceptanceofnotification,pinswg_validnoticeofintentiontosubmit,pinswg_deadlineforsubmissionofapplication,pinswg_screeningstartdate,pinswg_eiatargetdate,pinswg_targetextended,pinswg_directionissueddate,pinswg_eiarequired,pinswg_scopingstartdate,pinswg_scopingtargetdate,pinswg_scopingtargetextended,pinswg_scopingoutcomeissueddate";
|
||||
break;
|
||||
default:
|
||||
return "";
|
||||
|
||||
@@ -33,8 +33,7 @@ const EventsDetails = (props) => {
|
||||
<h2 className="govuk-heading-m ">Events</h2>
|
||||
{eventsArr.map(
|
||||
(item, key) =>
|
||||
item.pinswg_eventpublishingflag ==
|
||||
846040001 && (
|
||||
item.pinswg_eventpublishflag && (
|
||||
<>
|
||||
{" "}
|
||||
<div className="eventContainer">
|
||||
|
||||
+510
-49
@@ -61,6 +61,9 @@ import Pinswg_wayleaveid from "./summaryTypes/pinswg_wayleaveid";
|
||||
import CaseNoticeBanner from "./caseNoticeBanner";
|
||||
import WatchModal from "./watchmodal";
|
||||
|
||||
import GoogleMapComponent from "../mapping";
|
||||
import OSPoint from "ospoint";
|
||||
|
||||
const CaseSummary = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
@@ -94,6 +97,7 @@ const CaseSummary = (props) => {
|
||||
const { data: session, status } = useSession();
|
||||
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
const [whichTab, setWhichTab] = useState("case-details");
|
||||
|
||||
const handleOpenModal = () => {
|
||||
setIsModalOpen(true);
|
||||
@@ -229,9 +233,51 @@ const CaseSummary = (props) => {
|
||||
|
||||
let hasEndDate = typeof d != "undefined";
|
||||
|
||||
let point = {};
|
||||
let siteCoords = {};
|
||||
let center = {};
|
||||
|
||||
point = new OSPoint(
|
||||
detailsObj.pinswg_anticipatedgridreferencenorthingtext ||
|
||||
detailsObj.pinswg_anticipatedgridrefnorthing,
|
||||
detailsObj.pinswg_anticipatedgridreferenceeastingtext ||
|
||||
detailsObj.pinswg_anticipatedgridrefeasting
|
||||
);
|
||||
siteCoords = point.toOSGB36();
|
||||
//console.log(siteCoords);
|
||||
center = {
|
||||
id: "",
|
||||
lat: isNaN(parseFloat(siteCoords.latitude))
|
||||
? 52.412272
|
||||
: parseFloat(siteCoords.latitude),
|
||||
lng: isNaN(parseFloat(siteCoords.longitude))
|
||||
? -3.437989
|
||||
: parseFloat(siteCoords.longitude),
|
||||
};
|
||||
|
||||
const zoom = isNaN(parseFloat(siteCoords.latitude)) ? 7 : 12;
|
||||
|
||||
function hasValidKey(obj, key) {
|
||||
return (
|
||||
obj.hasOwnProperty(key) &&
|
||||
obj[key] !== null &&
|
||||
obj[key] !== undefined &&
|
||||
obj[key] !== ""
|
||||
);
|
||||
}
|
||||
|
||||
function hasOwnPropertyAndNotNull(obj, property) {
|
||||
return obj.hasOwnProperty(property) && obj[property] !== null;
|
||||
}
|
||||
|
||||
function isObjectNotEmpty(obj, key) {
|
||||
return obj.hasOwnProperty(key) && Object.keys(obj[key]).length > 0;
|
||||
}
|
||||
|
||||
let showDetailsBlock =
|
||||
showDetails == true ? (
|
||||
<>
|
||||
<div className="govuk-frontend-supported">
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||
@@ -244,23 +290,156 @@ const CaseSummary = (props) => {
|
||||
? casesObj.pinswg_title
|
||||
: casesObj.reference}
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-tabs" data-module="govuk-tabs">
|
||||
<h2 className="govuk-tabs__title">Contents</h2>
|
||||
<ul className="govuk-tabs__list">
|
||||
<li
|
||||
className={
|
||||
whichTab == "case-details"
|
||||
? "govuk-tabs__list-item govuk-tabs__list-item--selected"
|
||||
: "govuk-tabs__list-item "
|
||||
}
|
||||
>
|
||||
<a
|
||||
className="govuk-tabs__tab"
|
||||
href="#case-details"
|
||||
onClick={() => setWhichTab("case-details")}
|
||||
>
|
||||
{" "}
|
||||
Details{" "}
|
||||
</a>
|
||||
</li>
|
||||
<li
|
||||
className={
|
||||
whichTab == "case-summary"
|
||||
? "govuk-tabs__list-item govuk-tabs__list-item--selected"
|
||||
: "govuk-tabs__list-item "
|
||||
}
|
||||
>
|
||||
<a
|
||||
className="govuk-tabs__tab"
|
||||
href="#case-summary"
|
||||
onClick={() => setWhichTab("case-summary")}
|
||||
>
|
||||
{" "}
|
||||
Summary{" "}
|
||||
</a>
|
||||
</li>
|
||||
{((hasValidKey(
|
||||
detailsObj,
|
||||
"pinswg_anticipatedgridreferencenorthingtext"
|
||||
) &&
|
||||
hasValidKey(
|
||||
detailsObj,
|
||||
"pinswg_anticipatedgridreferenceeastingtext"
|
||||
)) ||
|
||||
(hasValidKey(
|
||||
detailsObj,
|
||||
"pinswg_anticipatedgridrefeasting"
|
||||
) &&
|
||||
hasValidKey(
|
||||
detailsObj,
|
||||
"pinswg_anticipatedgridrefnorthing"
|
||||
))) && (
|
||||
<li
|
||||
className={
|
||||
whichTab == "case-map"
|
||||
? "govuk-tabs__list-item govuk-tabs__list-item--selected"
|
||||
: "govuk-tabs__list-item "
|
||||
}
|
||||
>
|
||||
<a
|
||||
className="govuk-tabs__tab"
|
||||
href="#case-map"
|
||||
onClick={() => setWhichTab("case-map")}
|
||||
>
|
||||
{" "}
|
||||
Map{" "}
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
{isObjectNotEmpty(props, "eventsObj") && (
|
||||
<li
|
||||
className={
|
||||
whichTab == "case-events"
|
||||
? "govuk-tabs__list-item govuk-tabs__list-item--selected"
|
||||
: "govuk-tabs__list-item "
|
||||
}
|
||||
>
|
||||
<a
|
||||
className="govuk-tabs__tab"
|
||||
href="#case-events"
|
||||
onClick={() =>
|
||||
setWhichTab("case-events")
|
||||
}
|
||||
>
|
||||
{" "}
|
||||
Events{" "}
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
<li
|
||||
className={
|
||||
whichTab == "case-documents"
|
||||
? "govuk-tabs__list-item govuk-tabs__list-item--selected"
|
||||
: "govuk-tabs__list-item "
|
||||
}
|
||||
>
|
||||
<a
|
||||
className="govuk-tabs__tab"
|
||||
href="#case-documents"
|
||||
onClick={() =>
|
||||
setWhichTab("case-documents")
|
||||
}
|
||||
>
|
||||
{" "}
|
||||
Documents{" "}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div
|
||||
className={
|
||||
whichTab == "case-details"
|
||||
? "govuk-tabs__panel "
|
||||
: "govuk-tabs__panel govuk-tabs__panel--hidden"
|
||||
}
|
||||
id="case-details"
|
||||
>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
{/* <h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||
</h1> */}
|
||||
{props.messagesObj["@odata.count"] > 0 && (
|
||||
<CaseNoticeBanner messagesObj={props.messagesObj} />
|
||||
<CaseNoticeBanner
|
||||
messagesObj={props.messagesObj}
|
||||
/>
|
||||
)}
|
||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9">
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{getFormCollectionByID(appealTypeID)
|
||||
.PrimaryIdAttribute == "pinswg_dnsid"
|
||||
? t("case:summary-applicantonly-label")
|
||||
: getFormCollectionByID(appealTypeID)
|
||||
.PrimaryIdAttribute ==
|
||||
{getFormCollectionByID(
|
||||
appealTypeID
|
||||
).PrimaryIdAttribute ==
|
||||
"pinswg_dnsid"
|
||||
? t(
|
||||
"case:summary-applicantonly-label"
|
||||
)
|
||||
: getFormCollectionByID(
|
||||
appealTypeID
|
||||
).PrimaryIdAttribute ==
|
||||
"pinswg_nonvalidationid"
|
||||
? t("case:summary-appellantonly-label")
|
||||
: t("case:summary-applicant-label")}
|
||||
? t(
|
||||
"case:summary-appellantonly-label"
|
||||
)
|
||||
: t(
|
||||
"case:summary-applicant-label"
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{casesObj.pinswg_appellantagent == 846040001
|
||||
{casesObj.pinswg_appellantagent ==
|
||||
846040001
|
||||
? casesObj.pinswg_appellantfirstname +
|
||||
" " +
|
||||
casesObj.pinswg_appellantlastname
|
||||
@@ -269,14 +448,17 @@ const CaseSummary = (props) => {
|
||||
] || "not entered"}
|
||||
</dd>
|
||||
</div>
|
||||
{detailsObj.pinswg_agentcontactname != null &&
|
||||
{detailsObj.pinswg_agentcontactname !=
|
||||
null &&
|
||||
(_.has(
|
||||
detailsObj,
|
||||
"pinswg_agentcontactname"
|
||||
) ? (
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:summary-agent-label")}
|
||||
{t(
|
||||
"case:summary-agent-label"
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{_.has(
|
||||
@@ -292,20 +474,27 @@ const CaseSummary = (props) => {
|
||||
))}
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:summary-site-address-label")}
|
||||
{t(
|
||||
"case:summary-site-address-label"
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{getFormCollectionByID(appealTypeID)
|
||||
.PrimaryIdAttribute == "pinswg_dnsid" ||
|
||||
getFormCollectionByID(appealTypeID)
|
||||
.PrimaryIdAttribute == "pinswg_sipscase"
|
||||
{getFormCollectionByID(
|
||||
appealTypeID
|
||||
).PrimaryIdAttribute ==
|
||||
"pinswg_dnsid" ||
|
||||
getFormCollectionByID(
|
||||
appealTypeID
|
||||
).PrimaryIdAttribute ==
|
||||
"pinswg_sipscase"
|
||||
? detailsObj.pinswg_projectlocation !=
|
||||
null
|
||||
? detailsObj.pinswg_projectlocation.indexOf(
|
||||
";"
|
||||
) < 0
|
||||
? detailsObj.pinswg_projectlocation
|
||||
: router.locale == "cy"
|
||||
: router.locale ==
|
||||
"cy"
|
||||
? detailsObj.pinswg_projectlocation.split(
|
||||
";"
|
||||
)[1]
|
||||
@@ -320,7 +509,10 @@ const CaseSummary = (props) => {
|
||||
)
|
||||
? detailsObj.pinswg_siteaddressline1
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_addressline1")
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addressline1"
|
||||
)
|
||||
? detailsObj.pinswg_addressline1
|
||||
: ""}
|
||||
{_.has(
|
||||
@@ -329,7 +521,10 @@ const CaseSummary = (props) => {
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddressline1 !=
|
||||
null && <br />}
|
||||
{_.has(detailsObj, "pinswg_addressline1") &&
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addressline1"
|
||||
) &&
|
||||
detailsObj.pinswg_addressline1 !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
@@ -338,16 +533,28 @@ const CaseSummary = (props) => {
|
||||
)
|
||||
? detailsObj.pinswg_siteaddressline2
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_addressline2")
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addressline2"
|
||||
)
|
||||
? detailsObj.pinswg_addressline2
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_addressline2") &&
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addressline2"
|
||||
) &&
|
||||
detailsObj.pinswg_addressline2 !=
|
||||
null && <br />}
|
||||
{_.has(detailsObj, "pinswg_siteaddresstown")
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresstown"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddresstown
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_addresstown")
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addresstown"
|
||||
)
|
||||
? detailsObj.pinswg_addresstown
|
||||
: ""}
|
||||
{_.has(
|
||||
@@ -356,7 +563,10 @@ const CaseSummary = (props) => {
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddresstown !=
|
||||
null && <br />}
|
||||
{_.has(detailsObj, "pinswg_addresstown") &&
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addresstown"
|
||||
) &&
|
||||
detailsObj.pinswg_addresstown !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
@@ -365,7 +575,10 @@ const CaseSummary = (props) => {
|
||||
)
|
||||
? detailsObj.pinswg_siteaddresscounty
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_addresscounty")
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addresscounty"
|
||||
)
|
||||
? detailsObj.pinswg_addresscounty
|
||||
: ""}
|
||||
{_.has(
|
||||
@@ -386,7 +599,10 @@ const CaseSummary = (props) => {
|
||||
)
|
||||
? detailsObj.pinswg_siteaddresspostcode
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_postcode")
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_postcode"
|
||||
)
|
||||
? detailsObj.pinswg_postcode
|
||||
: ""}
|
||||
</dd>
|
||||
@@ -394,23 +610,32 @@ const CaseSummary = (props) => {
|
||||
{casesObj.description != null && (
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:summary-description-label")}
|
||||
{t(
|
||||
"case:summary-description-label"
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{casesObj.description.indexOf(";") < 0
|
||||
{casesObj.description.indexOf(
|
||||
";"
|
||||
) < 0
|
||||
? casesObj.description
|
||||
: router.locale == "cy"
|
||||
? casesObj.description.split(";")[1]
|
||||
? casesObj.description.split(
|
||||
";"
|
||||
)[1]
|
||||
: casesObj.description.split(
|
||||
";"
|
||||
)[0]}
|
||||
</dd>
|
||||
</div>
|
||||
)}
|
||||
{detailsObj.pinswg_casestage != null && (
|
||||
{detailsObj.pinswg_casestage !=
|
||||
null && (
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:summary-case-stage-label")}
|
||||
{t(
|
||||
"case:summary-case-stage-label"
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
@@ -433,12 +658,19 @@ const CaseSummary = (props) => {
|
||||
)}
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:summary-last-modified-label")}
|
||||
{t(
|
||||
"case:summary-last-modified-label"
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{detailsObj.modifiedon > casesObj.modifiedon
|
||||
? formatDates(detailsObj.modifiedon)
|
||||
: formatDates(casesObj.modifiedon)}
|
||||
{detailsObj.modifiedon >
|
||||
casesObj.modifiedon
|
||||
? formatDates(
|
||||
detailsObj.modifiedon
|
||||
)
|
||||
: formatDates(
|
||||
casesObj.modifiedon
|
||||
)}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
@@ -450,7 +682,10 @@ const CaseSummary = (props) => {
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="govuk-button-group">
|
||||
{(_.has(detailsObj, "pinswg_startdate") ||
|
||||
{(_.has(
|
||||
detailsObj,
|
||||
"pinswg_startdate"
|
||||
) ||
|
||||
_.has(
|
||||
detailsObj,
|
||||
"pinswg_applicationacceptedasvalid"
|
||||
@@ -468,7 +703,8 @@ const CaseSummary = (props) => {
|
||||
) && (
|
||||
<>
|
||||
{showRepButton(
|
||||
props.currentView
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.appealType
|
||||
) ? (
|
||||
@@ -568,7 +804,8 @@ const CaseSummary = (props) => {
|
||||
<div className="govuk-body">
|
||||
{session &&
|
||||
(isWatchedCase(
|
||||
props.currentView.caseReference
|
||||
props.currentView
|
||||
.caseReference
|
||||
.incidentid
|
||||
).length >
|
||||
0 ==
|
||||
@@ -597,13 +834,16 @@ const CaseSummary = (props) => {
|
||||
|
||||
"watchedCases"
|
||||
),
|
||||
setCurrentView({
|
||||
setCurrentView(
|
||||
{
|
||||
"viewName":
|
||||
"Watched Cases",
|
||||
"viewKey":
|
||||
"watchedCases",
|
||||
});
|
||||
setCurrentReference({
|
||||
}
|
||||
);
|
||||
setCurrentReference(
|
||||
{
|
||||
"ticketnumber":
|
||||
props
|
||||
.currentView
|
||||
@@ -626,8 +866,10 @@ const CaseSummary = (props) => {
|
||||
.currentView
|
||||
.caseReference
|
||||
.appealType,
|
||||
"showMap": showMap,
|
||||
});
|
||||
"showMap":
|
||||
showMap,
|
||||
}
|
||||
);
|
||||
}}
|
||||
title={t(
|
||||
"case:stop-watching-case-link"
|
||||
@@ -743,8 +985,12 @@ const CaseSummary = (props) => {
|
||||
</div>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
{_.has(detailsObj, "pinswg_startdate") &&
|
||||
(detailsObj.pinswg_startdate != null ||
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_startdate"
|
||||
) &&
|
||||
(detailsObj.pinswg_startdate !=
|
||||
null ||
|
||||
detailsObj.pinswg_finalcommentsduedate !=
|
||||
null) &&
|
||||
showRepsEnded(
|
||||
@@ -755,8 +1001,10 @@ const CaseSummary = (props) => {
|
||||
{t(
|
||||
"case:representation-period-ended-on-label"
|
||||
)}
|
||||
{props.currentView.caseReference
|
||||
.appealType == 846040019
|
||||
{props.currentView
|
||||
.caseReference
|
||||
.appealType ==
|
||||
846040019
|
||||
? formatDates(
|
||||
detailsObj.pinswg_statementduedate
|
||||
)
|
||||
@@ -769,10 +1017,220 @@ const CaseSummary = (props) => {
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
</div>
|
||||
<div
|
||||
className={
|
||||
whichTab == "case-summary"
|
||||
? "govuk-tabs__panel "
|
||||
: "govuk-tabs__panel govuk-tabs__panel--hidden"
|
||||
}
|
||||
id="case-summary"
|
||||
>
|
||||
{showSummary(casesObj, detailsObj)}
|
||||
<EventsDetails eventsObj={props.eventsObj} />
|
||||
</div>
|
||||
|
||||
{((hasValidKey(
|
||||
detailsObj,
|
||||
"pinswg_anticipatedgridreferencenorthingtext"
|
||||
) &&
|
||||
hasValidKey(
|
||||
detailsObj,
|
||||
"pinswg_anticipatedgridreferenceeastingtext"
|
||||
)) ||
|
||||
(hasValidKey(
|
||||
detailsObj,
|
||||
"pinswg_anticipatedgridrefeasting"
|
||||
) &&
|
||||
hasValidKey(
|
||||
detailsObj,
|
||||
"pinswg_anticipatedgridrefnorthing"
|
||||
))) && (
|
||||
<div
|
||||
className={
|
||||
whichTab == "case-map"
|
||||
? "govuk-tabs__panel "
|
||||
: "govuk-tabs__panel govuk-tabs__panel--hidden"
|
||||
}
|
||||
id="case-map"
|
||||
>
|
||||
<div className="govuk-grid-row">
|
||||
<div
|
||||
style={{
|
||||
height: "40vh",
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<GoogleMapComponent
|
||||
center={center}
|
||||
zoom={zoom}
|
||||
/>
|
||||
{/* <OSMapComponent center={center} zoom={zoom} /> */}
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9">
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t(
|
||||
"case:summary-site-address-label"
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{getFormCollectionByID(
|
||||
appealTypeID
|
||||
).PrimaryIdAttribute ==
|
||||
"pinswg_dnsid" ||
|
||||
getFormCollectionByID(
|
||||
appealTypeID
|
||||
).PrimaryIdAttribute ==
|
||||
"pinswg_sipscase"
|
||||
? detailsObj.pinswg_projectlocation !=
|
||||
null
|
||||
? detailsObj.pinswg_projectlocation.indexOf(
|
||||
";"
|
||||
) < 0
|
||||
? detailsObj.pinswg_projectlocation
|
||||
: router.locale ==
|
||||
"cy"
|
||||
? detailsObj.pinswg_projectlocation.split(
|
||||
";"
|
||||
)[1]
|
||||
: detailsObj.pinswg_projectlocation.split(
|
||||
";"
|
||||
)[0]
|
||||
: ""
|
||||
: ""}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline1"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddressline1
|
||||
: ""}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addressline1"
|
||||
)
|
||||
? detailsObj.pinswg_addressline1
|
||||
: ""}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline1"
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddressline1 !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addressline1"
|
||||
) &&
|
||||
detailsObj.pinswg_addressline1 !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddressline2"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddressline2
|
||||
: ""}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addressline2"
|
||||
)
|
||||
? detailsObj.pinswg_addressline2
|
||||
: ""}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addressline2"
|
||||
) &&
|
||||
detailsObj.pinswg_addressline2 !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresstown"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddresstown
|
||||
: ""}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addresstown"
|
||||
)
|
||||
? detailsObj.pinswg_addresstown
|
||||
: ""}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresstown"
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddresstown !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addresstown"
|
||||
) &&
|
||||
detailsObj.pinswg_addresstown !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresscounty"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddresscounty
|
||||
: ""}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addresscounty"
|
||||
)
|
||||
? detailsObj.pinswg_addresscounty
|
||||
: ""}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresscounty"
|
||||
) &&
|
||||
detailsObj.pinswg_siteaddresscounty !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_addresscounty"
|
||||
) &&
|
||||
detailsObj.pinswg_addresscounty !=
|
||||
null && <br />}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_siteaddresspostcode"
|
||||
)
|
||||
? detailsObj.pinswg_siteaddresspostcode
|
||||
: ""}
|
||||
{_.has(
|
||||
detailsObj,
|
||||
"pinswg_postcode"
|
||||
)
|
||||
? detailsObj.pinswg_postcode
|
||||
: ""}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{isObjectNotEmpty(props, "eventsObj") && (
|
||||
<div
|
||||
className={
|
||||
whichTab == "case-events"
|
||||
? "govuk-tabs__panel "
|
||||
: "govuk-tabs__panel govuk-tabs__panel--hidden"
|
||||
}
|
||||
id="case-events"
|
||||
>
|
||||
<EventsDetails eventsObj={props.eventsObj} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div
|
||||
className={
|
||||
whichTab == "case-documents"
|
||||
? "govuk-tabs__panel "
|
||||
: "govuk-tabs__panel govuk-tabs__panel--hidden"
|
||||
}
|
||||
id="case-documents"
|
||||
>
|
||||
<Documents
|
||||
incidentid={props.incidentid}
|
||||
caseReference={props.caseReference}
|
||||
@@ -782,6 +1240,7 @@ const CaseSummary = (props) => {
|
||||
docsOffline={docsOffline}
|
||||
showFilteredDocs={props.showFilteredDocs}
|
||||
/>
|
||||
</div>
|
||||
{/* <WatchModal
|
||||
isOpen={isModalOpen}
|
||||
onClose={handleCloseModal}
|
||||
@@ -789,6 +1248,8 @@ const CaseSummary = (props) => {
|
||||
currentType={currentType}
|
||||
props={props}
|
||||
/> */}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
|
||||
@@ -10,32 +10,12 @@ import OSPoint from "ospoint";
|
||||
|
||||
const Pinswg_sipscase = (props) => {
|
||||
let { t } = useTranslation();
|
||||
const { casesObj, detailsObj, formatDates, linkedCasesList, showMap } =
|
||||
props;
|
||||
const { casesObj, detailsObj, formatDates, linkedCasesList } = props;
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
let point = {};
|
||||
let siteCoords = {};
|
||||
let center = {};
|
||||
|
||||
point = new OSPoint(
|
||||
detailsObj.pinswg_anticipatedgridrefnorthing,
|
||||
detailsObj.pinswg_anticipatedgridrefeasting
|
||||
);
|
||||
siteCoords = point.toOSGB36();
|
||||
//console.log(siteCoords);
|
||||
center = {
|
||||
id: "",
|
||||
lat: isNaN(parseFloat(siteCoords.latitude))
|
||||
? 52.412272
|
||||
: parseFloat(siteCoords.latitude),
|
||||
lng: isNaN(parseFloat(siteCoords.longitude))
|
||||
? -3.437989
|
||||
: parseFloat(siteCoords.longitude),
|
||||
};
|
||||
|
||||
const zoom = isNaN(parseFloat(siteCoords.latitude)) ? 7 : 12;
|
||||
|
||||
function hasValidKey(obj, key) {
|
||||
return (
|
||||
@@ -51,13 +31,7 @@ const Pinswg_sipscase = (props) => {
|
||||
{detailsObj.pinswg_projectdescription != null ? (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="flex-container grid-row govuk-body case">
|
||||
<div
|
||||
className={
|
||||
showMap == "true"
|
||||
? "govuk-grid-column-one-half"
|
||||
: "govuk-grid-column-full"
|
||||
}
|
||||
>
|
||||
<div className={"govuk-grid-column-full"}>
|
||||
<h2 className="govuk-heading-m govuk-!-margin-bottom-7">
|
||||
{t("case:summary-project-details-label")}
|
||||
</h2>
|
||||
@@ -93,22 +67,6 @@ const Pinswg_sipscase = (props) => {
|
||||
: ""}
|
||||
</p> */}
|
||||
</div>
|
||||
{showMap == "true" && (
|
||||
<div className="govuk-grid-column-one-half">
|
||||
<div
|
||||
style={{
|
||||
height: "40vh",
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<GoogleMapComponent
|
||||
center={center}
|
||||
zoom={zoom}
|
||||
/>
|
||||
{/* <OSMapComponent center={center} zoom={zoom} /> */}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
@@ -235,6 +193,30 @@ const Pinswg_sipscase = (props) => {
|
||||
)}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t(
|
||||
"case:summary-eia-required-label"
|
||||
)}
|
||||
</dt>
|
||||
<dd className="govuk-summary-list__value">
|
||||
{router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
detailsObj[
|
||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: detailsObj[
|
||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
t(
|
||||
"case:summary-to-be-confirmed-label"
|
||||
)}
|
||||
</dd>
|
||||
</div>
|
||||
{/* <div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:summary-status-label")}
|
||||
@@ -762,7 +744,6 @@ const Pinswg_sipscase = (props) => {
|
||||
"case:summary-awaiting-information-label"
|
||||
)}
|
||||
</dd>
|
||||
)
|
||||
</div>
|
||||
)}
|
||||
<div className="govuk-summary-list__row">
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
"summary-type-of-event-label": "Math o ddigwyddiad",
|
||||
"summary-status-label": "Statws",
|
||||
"summary-decision-label": "Penderfyniad",
|
||||
"summary-eia-required-label": "Angen AEA",
|
||||
"summary-case-link-status-label": "Statws Cysylltiad yr Achos",
|
||||
"summary-case-link-status-not-linked": "Heb ei gysylltu",
|
||||
"summary-case-link-status-linked": "Wedi'i gysylltu",
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
"summary-start-event-time-label": "Start time of event",
|
||||
"summary-event-date-label": "Event Date",
|
||||
"summary-decision-date-label": "Decision Date",
|
||||
"summary-eia-required-label": "EIA required",
|
||||
"summary-documents-button-label": "Documents",
|
||||
"documents-not-available-label": "Documents are not available for download at this time, please check later.",
|
||||
"documents-document-count-label": "Document(s)",
|
||||
|
||||
@@ -65,6 +65,11 @@ h5,
|
||||
height: 1.8rem;
|
||||
}
|
||||
|
||||
.govuk-tabs__panel .govuk-grid-row {
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background-color: #ffffff;
|
||||
|
||||
Reference in New Issue
Block a user