refactor phase 3a myportal representation and case imports

This commit is contained in:
2026-03-12 09:26:34 +00:00
parent dacf2511f5
commit 72e4655188
2 changed files with 38 additions and 29 deletions
+13 -8
View File
@@ -2,19 +2,24 @@ import useTranslation from "next-translate/useTranslation";
import Head from "next/head";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { getIP } from "../../../actions/core/logger";
import {
getBasicSearch,
getCaseMessage,
getIP,
getMyCases,
getMyLPACases,
getPersonalAccount,
getPortalLogin,
getPortalLogin
} from "../../../actions/services/accountService";
import {
getCaseMessage,
getPortalModuleDetails,
getWatchedCases,
getSIPSEvents,
getSIPSMedia
} from "../../../actions";
} from "../../../actions/services/caseService";
import { getRepsFromBlob } from "../../../actions/services/documentService";
import {
getMyCases,
getMyLPACases,
getWatchedCases
} from "../../../actions/services/portalService";
import { getBasicSearch } from "../../../actions/services/searchService";
import { getFormCollectionByID } from "../../../components/utils";
import { getSession } from "next-auth/react";
+25 -21
View File
@@ -7,14 +7,18 @@ import { useRouter } from "next/router";
import { connect, useDispatch } from "react-redux";
import {
getPersonalAccount,
getPortalLoginProxy,
getPortalLogin,
getRepsFromBlob,
getPortalLoginProxy
} from "../../actions/services/accountService";
import {
getCase,
getPortalModuleDetails,
getBasicSearch,
getPortalModuleDetails
} from "../../actions/services/caseService";
import {
getFilesFromBlob,
} from "../../actions";
getRepsFromBlob
} from "../../actions/services/documentService";
import { getBasicSearch } from "../../actions/services/searchService";
import { getFormCollectionByID } from "../../components/utils";
import Breadcrumbs from "../../components/breadcrumbs";
import CookieBanner from "../../components/cookieBanner";
@@ -24,7 +28,7 @@ import Case from "../../components/representation";
import {
setAccountDetails,
setContainerID,
setLoggedInUserId,
setLoggedInUserId
} from "../../store/accountDetails/action";
import { wrapper } from "../../store/store";
import { getSearchDetails } from "../../components/utils";
@@ -33,11 +37,11 @@ import {
setCurrentReference,
setCurrentView,
setFilesForRepresentations,
setRepresentationCapacity,
setRepresentationCapacity
} from "../../store/currentView/action";
import {
setSearchDetails,
setSearchResults,
setSearchResults
} from "../../store/searchOutput/action";
import { setSearch } from "../../store/search/action";
@@ -49,7 +53,7 @@ import {
setMyRepresentations,
setMyRepresentationsDetails,
setMySubmittedReps,
setMySubmittedRepsDetails,
setMySubmittedRepsDetails
} from "../../store/myRepresentations/action";
import { getRepsFilesBlobs } from "../../actions/azurestorage";
@@ -236,12 +240,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
return {
redirect: {
destination: "/auth/signin",
permanent: false,
},
permanent: false
}
};
} else {
[loggedInUser] = await Promise.all([
await getPortalLogin(thisSession.user.email),
await getPortalLogin(thisSession.user.email)
]);
console.log(
@@ -255,7 +259,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
const [accountDetails, myRepresentations] = await Promise.all([
await getPersonalAccount(loggedInUser),
await getRepsFromBlob(thisSession.user.id),
await getRepsFromBlob(thisSession.user.id)
]);
const myRepresentationsDetails = await getDetails(
@@ -304,7 +308,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
"incidentid": result.incidentID,
"appealType": result.appealType,
"repDetails": result,
"filesList": result.filesList,
"filesList": result.filesList
})
);
@@ -329,8 +333,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
return {
props: {
containerID: thisSession.user.id,
docsOffline: process.env.DOCAPI_OFFLINE || false,
},
docsOffline: process.env.DOCAPI_OFFLINE || false
}
};
} else {
const searchResultsObj = await getBasicSearch(query.case);
@@ -343,7 +347,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(
setCurrentView({
"viewName": "My Representations",
"viewKey": "myRepresentations",
"viewKey": "myRepresentations"
})
);
@@ -376,7 +380,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
.pinswg_speacialistcaseprocess ||
searchDetailsObj[0].value[0]
.pinswg_specialistcaseprocess
: "",
: ""
})
);
@@ -385,8 +389,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
return {
props: {
containerID: thisSession.user.id,
docsOffline: process.env.DOCAPI_OFFLINE || false,
},
docsOffline: process.env.DOCAPI_OFFLINE || false
}
};
}
}
@@ -498,7 +502,7 @@ const mapStateToProps = (state) => {
myCases: state.myCases,
watchedCases: state.watchedCases,
myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission,
awaitingSubmission: state.awaitingSubmission
};
};