diff --git a/src/components/IOC/IOCDetailFetcher.js b/src/components/IOC/IOCDetailFetcher.js index a4c7be63730f353aa7c0cbe7a19c12a21f4b23fe..67a305cdc2528f109fa7da0e39b02f0fd13edd15 100644 --- a/src/components/IOC/IOCDetailFetcher.js +++ b/src/components/IOC/IOCDetailFetcher.js @@ -1,9 +1,5 @@ import { useEffect } from "react"; -import { - useTagsAndCommitIds, - useCSentryHost, - useIocStatus -} from "../../api/SwaggerApi"; +import { useTagsAndCommitIds, useIocStatus } from "../../api/SwaggerApi"; function onError(message) { console.warn(message); @@ -11,18 +7,15 @@ function onError(message) { export function IOCDetailFetcher({ ioc, index, setIocs }) { const [tagOrCommitId, getTagOrCommitId] = useTagsAndCommitIds(onError); - const [host, getHost] = useCSentryHost(onError); const [iocStatus, getIocStatus] = useIocStatus(); useEffect(() => { if (ioc.sourceVersion) { getTagOrCommitId(ioc.gitProjectId, ioc.sourceVersion); } - if (ioc.activeDeployment) { - getHost(ioc.activeDeployment.host.externalHostId); - } + getIocStatus(ioc.id); - }, [ioc, getTagOrCommitId, getHost, getIocStatus]); + }, [ioc, getTagOrCommitId, getIocStatus]); useEffect(() => { setIocs((iocs) => { @@ -30,12 +23,12 @@ export function IOCDetailFetcher({ ioc, index, setIocs }) { tagOrCommitId?.length === 1 ? tagOrCommitId[0].shortReference : iocs[index].sourceVersionShort; - iocs[index].host = host ?? iocs[index].host; + iocs[index].host = iocs[index].activeDeployment?.host; iocs[index].alert = iocStatus?.alertSeverity ?? iocs[index].alert; iocs[index].active = iocStatus?.active ?? iocs[index].active; return [...iocs]; }); - }, [index, setIocs, tagOrCommitId, host, iocStatus]); + }, [index, setIocs, tagOrCommitId, iocStatus]); return null; } diff --git a/src/components/Job/JobAsyncList.js b/src/components/Job/JobAsyncList.js index 64fd34b3779fb38fe0dd260102b21a61228761e7..ea48e862223140adc47718e22a5ef2eab8d213b6 100644 --- a/src/components/Job/JobAsyncList.js +++ b/src/components/Job/JobAsyncList.js @@ -1,5 +1,5 @@ import React, { useEffect } from "react"; -import { useTagsAndCommitIds, useCSentryHost } from "../../api/SwaggerApi"; +import { useTagsAndCommitIds } from "../../api/SwaggerApi"; import { JobTable } from "./JobTable"; export function JobAsyncList({ @@ -45,7 +45,6 @@ function onError(message) { export function JobDetailFetcher({ deployment, index, setDeployments }) { const [tagOrCommitId, getTagOrCommitId] = useTagsAndCommitIds(onError); - const [host, getHost] = useCSentryHost(onError); useEffect(() => { getTagOrCommitId( @@ -54,8 +53,7 @@ export function JobDetailFetcher({ deployment, index, setDeployments }) { false, "EQUALS" ); - getHost(deployment.host.externalHostId); - }, [deployment, getTagOrCommitId, getHost]); + }, [deployment, getTagOrCommitId]); useEffect(() => { setDeployments((deployments) => { @@ -63,11 +61,10 @@ export function JobDetailFetcher({ deployment, index, setDeployments }) { tagOrCommitId?.length === 1 ? tagOrCommitId[0].shortReference : deployments[index].gitReference; - deployments[index].host = host ?? deployments[index].host; - deployments[index].host.hostInfoFromCache = !host; + deployments[index].host.hostInfoFromCache = false; return [...deployments]; }); - }, [index, setDeployments, tagOrCommitId, host]); + }, [index, setDeployments, tagOrCommitId]); return null; }