Skip to content
Snippets Groups Projects
Commit a2980ee5 authored by Johanna Szepanski's avatar Johanna Szepanski
Browse files

removed registrered IOC list from profile page

parent 1a401e9b
No related branches found
No related tags found
2 merge requests!612Release 5.0.0,!556CE-3223: Removed registrered IOCs section from profile page
import { useContext } from "react";
import { Card, CardHeader } from "@mui/material";
import { useEffect } from "react";
import { initRequestParams } from "../Helper";
import IOCTable from "../../IOC/IOCTable";
import { apiContext } from "../../../api/DeployApi";
import { useAPIMethod, usePagination } from "@ess-ics/ce-ui-common";
export function UserIocList({ userName }) {
const client = useContext(apiContext);
const {
value: iocs,
wrapper: getIocs,
loading,
dataReady,
abort
} = useAPIMethod({
fcn: client.apis.IOCs.listIocs,
call: false
});
const rowsPerPage = [20, 50];
const { pagination, setPagination } = usePagination({
rowsPerPageOptions: rowsPerPage,
initLimit: rowsPerPage[0],
initPage: 0
});
// update pagination whenever search result total pages change
useEffect(() => {
setPagination({ totalCount: iocs?.totalCount ?? 0 });
}, [setPagination, iocs?.totalCount]);
// Request more results when pagination changes
useEffect(() => {
let requestParams = initRequestParams(pagination);
requestParams.created_by = userName;
getIocs(requestParams);
return () => {
abort();
};
}, [getIocs, pagination, userName, abort]);
// Invoked by Table on change to pagination
const onPage = (params) => {
setPagination(params);
abort();
};
return (
<Card variant="plain">
<CardHeader
title={"IOCs registered"}
titleTypographyProps={{
variant: "h2",
component: "h2"
}}
/>
<IOCTable
iocs={iocs?.iocList}
loading={loading || !dataReady}
rowType="explore"
pagination={pagination}
onPage={onPage}
/>
</Card>
);
}
import { UserIocList } from "./UserIOCList";
import { UserOperationList } from "./UserOperationList"; import { UserOperationList } from "./UserOperationList";
import { UserProfile } from "./UserProfile"; import { UserProfile } from "./UserProfile";
import { UserAvatar } from "./UserAvatar"; import { UserAvatar } from "./UserAvatar";
export { UserIocList, UserOperationList, UserProfile, UserAvatar }; export { UserOperationList, UserProfile, UserAvatar };
...@@ -3,7 +3,6 @@ import { Grid } from "@mui/material"; ...@@ -3,7 +3,6 @@ import { Grid } from "@mui/material";
import { GlobalAppBarContext } from "@ess-ics/ce-ui-common"; import { GlobalAppBarContext } from "@ess-ics/ce-ui-common";
import { applicationTitle } from "../../components/common/Helper"; import { applicationTitle } from "../../components/common/Helper";
import { UserProfile } from "../../components/common/User/UserProfile"; import { UserProfile } from "../../components/common/User/UserProfile";
import { UserIocList } from "../../components/common/User/UserIOCList";
import { UserOperationList } from "../../components/common/User/UserOperationList"; import { UserOperationList } from "../../components/common/User/UserOperationList";
export function UserPageView({ userName, userInfo }) { export function UserPageView({ userName, userInfo }) {
...@@ -21,12 +20,6 @@ export function UserPageView({ userName, userInfo }) { ...@@ -21,12 +20,6 @@ export function UserPageView({ userName, userInfo }) {
> >
<UserProfile userInfo={userInfo} /> <UserProfile userInfo={userInfo} />
</Grid> </Grid>
<Grid
item
xs={12}
>
<UserIocList userName={userName} />
</Grid>
<Grid <Grid
item item
xs={12} xs={12}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment