updated filelist obj to check else default to empty array
This commit is contained in:
+70
-34
@@ -3,7 +3,7 @@ import _ from "lodash";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { connect } from "react-redux";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import Documents from "./documents";
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
getLinkedCases,
|
||||
getPortalModuleDetailsProxy,
|
||||
getWatchedCasesProxy,
|
||||
setCaseInvolvment,
|
||||
} from "../../actions";
|
||||
import {
|
||||
setCurrentLinkedCases,
|
||||
@@ -56,6 +57,8 @@ import Pinswg_rowid from "./summaryTypes/pinswg_rowid";
|
||||
import Pinswg_transportandworkactid from "./summaryTypes/pinswg_transportandworkactid";
|
||||
import Pinswg_wayleaveid from "./summaryTypes/pinswg_wayleaveid";
|
||||
import CaseNoticeBanner from "./caseNoticeBanner";
|
||||
import WatchModal from "./watchmodal";
|
||||
|
||||
const CaseSummary = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
@@ -88,6 +91,16 @@ const CaseSummary = (props) => {
|
||||
currentType == "directResultsObj" ? "true" : currentView.showLogin;
|
||||
const { data: session, status } = useSession();
|
||||
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
|
||||
const handleOpenModal = () => {
|
||||
setIsModalOpen(true);
|
||||
};
|
||||
|
||||
const handleCloseModal = () => {
|
||||
setIsModalOpen(false);
|
||||
};
|
||||
|
||||
const cookies = parseCookies();
|
||||
|
||||
const isLPA =
|
||||
@@ -114,6 +127,8 @@ const CaseSummary = (props) => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
setCaseInvolvment(incidentid, loggedInUser);
|
||||
};
|
||||
|
||||
const isWatchedCase = (whichIncident) => {
|
||||
@@ -586,39 +601,48 @@ const CaseSummary = (props) => {
|
||||
)}{" "}
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
className="govuk-link watchCase"
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
"case:you-are-watching-label"
|
||||
) +
|
||||
" " +
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.currentReference +
|
||||
"?"
|
||||
) &&
|
||||
selectWatchedCase(
|
||||
props
|
||||
.accountDetails
|
||||
.loggedinUserId,
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.incidentid,
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.appealType
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
"case:watch-this-case-link"
|
||||
)}
|
||||
</button>
|
||||
<>
|
||||
<button
|
||||
className="govuk-link watchCase"
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
"case:you-are-watching-label"
|
||||
) +
|
||||
" " +
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.currentReference +
|
||||
"?"
|
||||
) &&
|
||||
selectWatchedCase(
|
||||
props
|
||||
.accountDetails
|
||||
.loggedinUserId,
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.incidentid,
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.appealType
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
"case:watch-this-case-link"
|
||||
)}
|
||||
</button>
|
||||
{/* <button
|
||||
onClick={
|
||||
handleOpenModal
|
||||
}
|
||||
>
|
||||
Open Modal
|
||||
</button> */}
|
||||
</>
|
||||
))}
|
||||
|
||||
{!session && (
|
||||
@@ -669,6 +693,11 @@ const CaseSummary = (props) => {
|
||||
"case:watch-this-case-link"
|
||||
)}
|
||||
</button>
|
||||
{/* <button
|
||||
onClick={handleOpenModal}
|
||||
>
|
||||
Open Modal
|
||||
</button> */}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
@@ -714,6 +743,13 @@ const CaseSummary = (props) => {
|
||||
docsOffline={docsOffline}
|
||||
showFilteredDocs={props.showFilteredDocs}
|
||||
/>
|
||||
{/* <WatchModal
|
||||
isOpen={isModalOpen}
|
||||
onClose={handleCloseModal}
|
||||
casesObj={casesObj}
|
||||
currentType={currentType}
|
||||
props={props}
|
||||
/> */}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user