Merged PR 2357: dashboards in admin for appeals and lpa
dashboards in admin for appeals and lpa Related work items: #23527
This commit is contained in:
+51
-4
@@ -11,9 +11,16 @@ import StorageTab from "../../components/admin/tabs/storage";
|
||||
import AccountsTab from "../../components/admin/tabs/accounts";
|
||||
import AppealsTab from "../../components/admin/tabs/appeals";
|
||||
import DocumentsTab from "../../components/admin/tabs/documents";
|
||||
import AppealsWithStatusTab from "../../components/admin/tabs/appealsWithStatus";
|
||||
import AppealStatusDashboard from "../../components/admin/tabs/appealsDashboard";
|
||||
import AppealLpaStatusDashboard from "../../components/admin/tabs/appealsDashboardLPA";
|
||||
|
||||
import { fetchAdminStorageData } from "../../components/admin/utils/serverside";
|
||||
import { getNewAppeals } from "../../actions/services/adminService";
|
||||
import {
|
||||
getNewAppeals,
|
||||
getStatusByAppeal,
|
||||
getStatusByAppealLPA
|
||||
} from "../../actions/services/adminService";
|
||||
|
||||
import { getSearchDetails } from "../../components/utils";
|
||||
|
||||
@@ -30,9 +37,11 @@ const StoragePage = (props) => {
|
||||
repCompleteCount,
|
||||
searchResultsObj,
|
||||
docsOffline,
|
||||
showFilteredDocs
|
||||
showFilteredDocs,
|
||||
statusObj,
|
||||
statusLPAObj
|
||||
} = props;
|
||||
const [whichTab, setWhichTab] = useState("documents");
|
||||
const [whichTab, setWhichTab] = useState("appealDashboard");
|
||||
|
||||
return (
|
||||
<div>
|
||||
@@ -54,6 +63,8 @@ const StoragePage = (props) => {
|
||||
{/* Tabs */}
|
||||
<ul className="govuk-tabs__list">
|
||||
{[
|
||||
"appealDashboard",
|
||||
"appealDashboardLPA",
|
||||
"documents",
|
||||
"appeals",
|
||||
"storage",
|
||||
@@ -85,6 +96,10 @@ const StoragePage = (props) => {
|
||||
"Storage Account"}
|
||||
{tab === "accounts" &&
|
||||
"User Accounts"}
|
||||
{tab === "appealDashboard" &&
|
||||
"Appeals Dashboard"}
|
||||
{tab === "appealDashboardLPA" &&
|
||||
"Appeals LPA Dashboard"}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
@@ -92,6 +107,26 @@ const StoragePage = (props) => {
|
||||
|
||||
{/* Panels */}
|
||||
|
||||
<div
|
||||
className={
|
||||
whichTab === "appealDashboard"
|
||||
? "govuk-tabs__panel"
|
||||
: "govuk-tabs__panel govuk-tabs__panel--hidden"
|
||||
}
|
||||
>
|
||||
<AppealStatusDashboard statusObj={statusObj} />
|
||||
</div>
|
||||
<div
|
||||
className={
|
||||
whichTab === "appealDashboardLPA"
|
||||
? "govuk-tabs__panel"
|
||||
: "govuk-tabs__panel govuk-tabs__panel--hidden"
|
||||
}
|
||||
>
|
||||
<AppealLpaStatusDashboard
|
||||
statusObj={statusLPAObj}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className={
|
||||
whichTab === "documents"
|
||||
@@ -119,6 +154,15 @@ const StoragePage = (props) => {
|
||||
searchResultsObj={searchResultsObj}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className={
|
||||
whichTab === "appealsWithStatus"
|
||||
? "govuk-tabs__panel"
|
||||
: "govuk-tabs__panel govuk-tabs__panel--hidden"
|
||||
}
|
||||
>
|
||||
<AppealsWithStatusTab statusObj={statusObj} />
|
||||
</div>
|
||||
|
||||
<div
|
||||
className={
|
||||
@@ -177,7 +221,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
await fetchAdminStorageData();
|
||||
|
||||
const newAppeals = await getNewAppeals();
|
||||
|
||||
const statusObj = await getStatusByAppeal();
|
||||
const statusLPAObj = await getStatusByAppealLPA();
|
||||
const searchDetailsObj = await getSearchDetails(newAppeals);
|
||||
|
||||
store.dispatch(setSearchResults(newAppeals));
|
||||
@@ -188,6 +233,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
|
||||
return {
|
||||
props: {
|
||||
statusObj,
|
||||
statusLPAObj,
|
||||
data,
|
||||
userData,
|
||||
repCompleteCount,
|
||||
|
||||
Reference in New Issue
Block a user