refactor phase 3a myportal search results imports
This commit is contained in:
@@ -2,14 +2,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 {
|
import {
|
||||||
getAdvancedSearch,
|
|
||||||
getIP,
|
|
||||||
getPersonalAccount,
|
getPersonalAccount,
|
||||||
getPortalLogin,
|
getPortalLogin
|
||||||
getPortalModuleDetails,
|
} from "../../actions/services/accountService";
|
||||||
getWatchedCases,
|
import { getPortalModuleDetails } from "../../actions/services/caseService";
|
||||||
} from "../../actions";
|
import { getAdvancedSearch } from "../../actions/services/searchService";
|
||||||
|
import { getWatchedCases } from "../../actions/services/portalService";
|
||||||
import Breadcrumbs from "../../components/breadcrumbs";
|
import Breadcrumbs from "../../components/breadcrumbs";
|
||||||
import CookieBanner from "../../components/cookieBanner";
|
import CookieBanner from "../../components/cookieBanner";
|
||||||
import Footer from "../../components/footer";
|
import Footer from "../../components/footer";
|
||||||
@@ -17,17 +17,17 @@ import Header from "../../components/header";
|
|||||||
import SearchResults from "../../components/searchresults";
|
import SearchResults from "../../components/searchresults";
|
||||||
import {
|
import {
|
||||||
getFormCollectionByID,
|
getFormCollectionByID,
|
||||||
getSearchDetails,
|
getSearchDetails
|
||||||
} from "../../components/utils";
|
} from "../../components/utils";
|
||||||
import {
|
import {
|
||||||
setSearchDetails,
|
setSearchDetails,
|
||||||
setSearchResults,
|
setSearchResults
|
||||||
} from "../../store/searchOutput/action";
|
} from "../../store/searchOutput/action";
|
||||||
|
|
||||||
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";
|
||||||
@@ -37,7 +37,7 @@ import TimeOut from "../../components/timeout";
|
|||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import {
|
import {
|
||||||
setWatchedCases,
|
setWatchedCases,
|
||||||
setWatchedCasesDetails,
|
setWatchedCasesDetails
|
||||||
} from "../../store/watchedCases/action";
|
} from "../../store/watchedCases/action";
|
||||||
import ServiceBanner from "../../components/myportal/servicebanner";
|
import ServiceBanner from "../../components/myportal/servicebanner";
|
||||||
|
|
||||||
@@ -96,8 +96,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 &&
|
||||||
@@ -109,13 +109,13 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
|
|
||||||
const [accountDetails, watchedCases] = await Promise.all([
|
const [accountDetails, watchedCases] = await Promise.all([
|
||||||
await getPersonalAccount(loggedInUser),
|
await getPersonalAccount(loggedInUser),
|
||||||
await getWatchedCases(loggedInUser),
|
await getWatchedCases(loggedInUser)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
console.log(accountDetails);
|
console.log(accountDetails);
|
||||||
|
|
||||||
const [watchedCasesDetails] = await Promise.all([
|
const [watchedCasesDetails] = await Promise.all([
|
||||||
await getDetails(watchedCases, "myWatchedCases"),
|
await getDetails(watchedCases, "myWatchedCases")
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const showLoginCheck = process.env.SHOWLOGIN || false;
|
const showLoginCheck = process.env.SHOWLOGIN || false;
|
||||||
@@ -130,8 +130,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
showLoginCheck: showLoginCheck,
|
showLoginCheck: showLoginCheck
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -177,7 +177,7 @@ const mapStateToProps = (state) => {
|
|||||||
myCases: state.myCases,
|
myCases: state.myCases,
|
||||||
watchedCases: state.watchedCases,
|
watchedCases: state.watchedCases,
|
||||||
myRepresentations: state.myRepresentations,
|
myRepresentations: state.myRepresentations,
|
||||||
awaitingSubmission: state.awaitingSubmission,
|
awaitingSubmission: state.awaitingSubmission
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,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 {
|
import {
|
||||||
getBasicSearch,
|
|
||||||
getIP,
|
|
||||||
getPersonalAccount,
|
getPersonalAccount,
|
||||||
getPortalLogin,
|
getPortalLogin
|
||||||
getPortalModuleDetails,
|
} from "../../actions/services/accountService";
|
||||||
getWatchedCases,
|
import { getPortalModuleDetails } from "../../actions/services/caseService";
|
||||||
} from "../../actions";
|
import { getBasicSearch } from "../../actions/services/searchService";
|
||||||
|
import { getWatchedCases } from "../../actions/services/portalService";
|
||||||
import Breadcrumbs from "../../components/breadcrumbs";
|
import Breadcrumbs from "../../components/breadcrumbs";
|
||||||
import CookieBanner from "../../components/cookieBanner";
|
import CookieBanner from "../../components/cookieBanner";
|
||||||
import Footer from "../../components/footer";
|
import Footer from "../../components/footer";
|
||||||
@@ -17,18 +17,18 @@ import Header from "../../components/header";
|
|||||||
import SearchResults from "../../components/searchresults";
|
import SearchResults from "../../components/searchresults";
|
||||||
import {
|
import {
|
||||||
getFormCollectionByID,
|
getFormCollectionByID,
|
||||||
getSearchDetails,
|
getSearchDetails
|
||||||
} from "../../components/utils";
|
} from "../../components/utils";
|
||||||
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 { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import {
|
import {
|
||||||
setWatchedCases,
|
setWatchedCases,
|
||||||
setWatchedCasesDetails,
|
setWatchedCasesDetails
|
||||||
} from "../../store/watchedCases/action";
|
} from "../../store/watchedCases/action";
|
||||||
|
|
||||||
import { getSession } from "next-auth/react";
|
import { getSession } from "next-auth/react";
|
||||||
@@ -36,7 +36,7 @@ import TimeOut from "../../components/timeout";
|
|||||||
import {
|
import {
|
||||||
setAccountDetails,
|
setAccountDetails,
|
||||||
setContainerID,
|
setContainerID,
|
||||||
setLoggedInUserId,
|
setLoggedInUserId
|
||||||
} from "../../store/accountDetails/action";
|
} from "../../store/accountDetails/action";
|
||||||
import ServiceBanner from "../../components/myportal/servicebanner";
|
import ServiceBanner from "../../components/myportal/servicebanner";
|
||||||
|
|
||||||
@@ -96,12 +96,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
destination: "/auth/signin",
|
destination: "/auth/signin",
|
||||||
permanent: false,
|
permanent: false
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
let [loggedInUser] = await Promise.all([
|
let [loggedInUser] = await Promise.all([
|
||||||
await getPortalLogin(thisSession.user.email),
|
await getPortalLogin(thisSession.user.email)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//console.log("sssss", searchResultsObj);
|
//console.log("sssss", searchResultsObj);
|
||||||
@@ -114,7 +114,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
|
|
||||||
const [accountDetails, watchedCasesDetails] = await Promise.all([
|
const [accountDetails, watchedCasesDetails] = await Promise.all([
|
||||||
await getPersonalAccount(loggedInUser),
|
await getPersonalAccount(loggedInUser),
|
||||||
await getDetails(watchedCases, "myWatchedCases"),
|
await getDetails(watchedCases, "myWatchedCases")
|
||||||
]);
|
]);
|
||||||
store.dispatch(setAccountDetails(accountDetails));
|
store.dispatch(setAccountDetails(accountDetails));
|
||||||
store.dispatch(setSearch(query.q));
|
store.dispatch(setSearch(query.q));
|
||||||
@@ -127,8 +127,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
showLoginCheck: showLoginCheck,
|
showLoginCheck: showLoginCheck
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -174,7 +174,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
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user