From 87469f78f54b8c143a69d11e559d59f21360fbab Mon Sep 17 00:00:00 2001 From: Johanna Szepanski <johanna.szepanski@softhouse.se> Date: Thu, 5 Dec 2024 15:11:06 +0100 Subject: [PATCH] fixed bug operations list should only show this IOC jobs --- src/components/IOC/IOCManage/IOCManage.jsx | 2 +- src/components/IOC/IOCManage/JobSection.tsx | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/components/IOC/IOCManage/IOCManage.jsx b/src/components/IOC/IOCManage/IOCManage.jsx index c0557e3e..05186c80 100644 --- a/src/components/IOC/IOCManage/IOCManage.jsx +++ b/src/components/IOC/IOCManage/IOCManage.jsx @@ -154,7 +154,7 @@ export const IOCManage = ({ ioc }) => { allowedRoles={["DeploymentToolAdmin", "DeploymentToolIntegrator"]} renderNoAccess={() => <></>} > - <JobSection /> + <JobSection ioc={ioc} /> <DeployIOC open={deployDialogOpen} setOpen={setDeployDialogOpen} diff --git a/src/components/IOC/IOCManage/JobSection.tsx b/src/components/IOC/IOCManage/JobSection.tsx index 3deef686..df425ac6 100644 --- a/src/components/IOC/IOCManage/JobSection.tsx +++ b/src/components/IOC/IOCManage/JobSection.tsx @@ -1,12 +1,16 @@ import { useEffect } from "react"; import { Stack, Typography } from "@mui/material"; import { usePagination } from "@ess-ics/ce-ui-common"; -import { useListJobsQuery } from "../../../store/deployApi"; +import { useListJobsQuery, IocDetails } from "../../../store/deployApi"; import { initRequestParams } from "../../common/Helper"; import { ROWS_PER_PAGE } from "../../../constants"; import { JobTable } from "../../Job"; -export const JobSection = () => { +interface JobSectionProps { + ioc: IocDetails; +} + +export const JobSection = ({ ioc }: JobSectionProps) => { const { pagination, setPagination } = usePagination({ rowsPerPageOptions: ROWS_PER_PAGE, initLimit: ROWS_PER_PAGE[0], @@ -14,7 +18,10 @@ export const JobSection = () => { }); const { data: jobs, isLoading } = useListJobsQuery( - initRequestParams(pagination), + { + ...initRequestParams(pagination), + iocId: ioc.id + }, { pollingInterval: 5000 } ); -- GitLab