refactor phase 3a myportal advanced and address search imports

This commit is contained in:
2026-03-12 09:20:33 +00:00
parent cbcb9549be
commit 562cffdc59
2 changed files with 29 additions and 29 deletions
+18 -18
View File
@@ -3,14 +3,14 @@ import useTranslation from "next-translate/useTranslation";
import Head from "next/head"; import Head from "next/head";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { getIP } from "../../actions/core/logger";
import { getPersonalAccount } from "../../actions/services/accountService";
import { getPortalModuleDetails } from "../../actions/services/caseService";
import { import {
getAddressSearch, getAddressSearch,
getAdvancedSearch, getAdvancedSearch
getIP, } from "../../actions/services/searchService";
getPersonalAccount, import { getWatchedCases } from "../../actions/services/portalService";
getPortalModuleDetails,
getWatchedCases,
} from "../../actions";
import SearchResults from "../../components/addresssearchresults"; import SearchResults from "../../components/addresssearchresults";
import Breadcrumbs from "../../components/breadcrumbs"; import Breadcrumbs from "../../components/breadcrumbs";
import CookieBanner from "../../components/cookieBanner"; import CookieBanner from "../../components/cookieBanner";
@@ -18,22 +18,22 @@ import Footer from "../../components/footer";
import Header from "../../components/header"; import Header from "../../components/header";
import { import {
getFormCollectionByID, getFormCollectionByID,
getSearchDetails, getSearchDetails
} from "../../components/utils"; } from "../../components/utils";
import { import {
setAccountDetails, setAccountDetails,
setContainerID, setContainerID,
setLoggedInUserId, setLoggedInUserId
} from "../../store/accountDetails/action"; } from "../../store/accountDetails/action";
import { setShowReps } from "../../store/currentView/action"; import { setShowReps } from "../../store/currentView/action";
import { setSearch } from "../../store/search/action"; import { setSearch } from "../../store/search/action";
import { import {
setSearchDetails, setSearchDetails,
setSearchResults, setSearchResults
} from "../../store/searchOutput/action"; } from "../../store/searchOutput/action";
import { import {
setWatchedCases, setWatchedCases,
setWatchedCasesDetails, setWatchedCasesDetails
} from "../../store/watchedCases/action"; } from "../../store/watchedCases/action";
import { wrapper } from "../../store/store"; import { wrapper } from "../../store/store";
@@ -159,8 +159,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
return { return {
redirect: { redirect: {
destination: "/auth/signin", destination: "/auth/signin",
permanent: false, permanent: false
}, }
}; };
} else { } else {
thisSession != false && thisSession != false &&
@@ -170,12 +170,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
await Promise.all([ await Promise.all([
await getPersonalAccount(loggedInUser), await getPersonalAccount(loggedInUser),
await getAdvancedSearch(query), await getAdvancedSearch(query),
await getWatchedCases(loggedInUser), await getWatchedCases(loggedInUser)
]); ]);
const [searchDetailsObj, watchedCasesDetails] = await Promise.all([ const [searchDetailsObj, watchedCasesDetails] = await Promise.all([
await getSearchDetails(searchResultsObj), await getSearchDetails(searchResultsObj),
await getDetails(watchedCases, "myWatchedCases"), await getDetails(watchedCases, "myWatchedCases")
]); ]);
store.dispatch(setAccountDetails(accountDetails)); store.dispatch(setAccountDetails(accountDetails));
@@ -191,11 +191,11 @@ export const getServerSideProps = wrapper.getServerSideProps(
props: { props: {
searchResultsObj: { searchResultsObj: {
searchResultsObj: searchResultsObj, searchResultsObj: searchResultsObj,
searchDetailsObj: searchDetailsObj, searchDetailsObj: searchDetailsObj
}, },
currentType: "directResultsObj", currentType: "directResultsObj",
showLoginCheck: showLoginCheck, showLoginCheck: showLoginCheck
}, }
}; };
} }
); );
@@ -241,7 +241,7 @@ const mapStateToProps = (state) => {
watchedCases: state.watchedCases, watchedCases: state.watchedCases,
myRepresentations: state.myRepresentations, myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission, awaitingSubmission: state.awaitingSubmission,
accountDetails: state.accountDetails, accountDetails: state.accountDetails
}; };
}; };
+11 -11
View File
@@ -4,13 +4,13 @@ import useTranslation from "next-translate/useTranslation";
import Head from "next/head"; import Head from "next/head";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { getIP } from "../../actions/core/logger";
import { getPersonalAccount } from "../../actions/services/accountService";
import { import {
getAppealsTypes, getAppealsTypes,
getIP,
getLPA, getLPA,
getPersonalAccount, getProjectTypes
getProjectTypes, } from "../../actions/services/referenceDataService";
} from "../../actions";
import Breadcrumbs from "../../components/breadcrumbs"; import Breadcrumbs from "../../components/breadcrumbs";
import CookieBanner from "../../components/cookieBanner"; import CookieBanner from "../../components/cookieBanner";
import CRMError from "../../components/crmError"; import CRMError from "../../components/crmError";
@@ -21,7 +21,7 @@ import TimeOut from "../../components/timeout";
import { import {
setAccountDetails, setAccountDetails,
setContainerID, setContainerID,
setLoggedInUserId, setLoggedInUserId
} from "../../store/accountDetails/action"; } from "../../store/accountDetails/action";
import { setAppealType, setProjectType } from "../../store/appealType/action"; import { setAppealType, setProjectType } from "../../store/appealType/action";
import { setLPA } from "../../store/lpa/action"; import { setLPA } from "../../store/lpa/action";
@@ -91,8 +91,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
return { return {
redirect: { redirect: {
destination: "/auth/signin", destination: "/auth/signin",
permanent: false, permanent: false
}, }
}; };
} else { } else {
const [accountDetails, appealTypeData, lpaData, projectTypeData] = const [accountDetails, appealTypeData, lpaData, projectTypeData] =
@@ -100,7 +100,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
await getPersonalAccount(loggedInUser), await getPersonalAccount(loggedInUser),
await getAppealsTypes(), await getAppealsTypes(),
await getLPA(), await getLPA(),
await getProjectTypes(), await getProjectTypes()
]); ]);
//const lpaData = require("../../data/lpa.json"); //const lpaData = require("../../data/lpa.json");
@@ -117,8 +117,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
} }
return { return {
props: { props: {
showLoginCheck: showLoginCheck, showLoginCheck: showLoginCheck
}, }
}; };
} }
); );
@@ -132,7 +132,7 @@ const mapStateToProps = (state) => {
appealType: state.appealType, appealType: state.appealType,
LPAData: state.LPAData, LPAData: state.LPAData,
form: state.form, form: state.form,
accountDetails: state.accountDetails, accountDetails: state.accountDetails
}; };
}; };