diff --git a/ui/components/FluxRuntime.tsx b/ui/components/FluxRuntime.tsx index 131b2b2206..5fe85cd013 100644 --- a/ui/components/FluxRuntime.tsx +++ b/ui/components/FluxRuntime.tsx @@ -53,18 +53,18 @@ function FluxRuntime({ className, deployments, crds }: Props) { ]; const fluxVersions: { [key: string]: FluxVersion } = {}; deployments - .filter((d) => d.labels[partOfLabel] == fluxLabel) - .forEach((d) => { - const fv = d.labels[fluxVersionLabel]; - const k = `${fv}${d.clusterName}${d.namespace}`; - if (!fluxVersions[k]) { - fluxVersions[k] = { - version: fv, - clusterName: d.clusterName, - namespace: d.namespace, - }; - } - }); + .filter((d) => d.labels[partOfLabel] == fluxLabel) + .forEach((d) => { + const fv = d.labels[fluxVersionLabel]; + const k = `${fv}${d.clusterName}${d.namespace}`; + if (!fluxVersions[k]) { + fluxVersions[k] = { + version: fv, + clusterName: d.clusterName, + namespace: d.namespace, + }; + } + }); const supportMultipleFlux = true; diff --git a/ui/hooks/flux.ts b/ui/hooks/flux.ts index 3788f8def2..96604dde23 100644 --- a/ui/hooks/flux.ts +++ b/ui/hooks/flux.ts @@ -2,11 +2,11 @@ import { useContext } from "react"; import { useMutation, useQuery, useQueryClient } from "react-query"; import { CoreClientContext } from "../contexts/CoreClientContext"; import { - ListFluxCrdsResponse, - ListFluxRuntimeObjectsResponse, - ListRuntimeObjectsResponse, - ToggleSuspendResourceRequest, - ToggleSuspendResourceResponse, + ListFluxCrdsResponse, + ListFluxRuntimeObjectsResponse, + ListRuntimeObjectsResponse, + ToggleSuspendResourceRequest, + ToggleSuspendResourceResponse, } from "../lib/api/core/core.pb"; import { GroupVersionKind, Kind } from "../lib/api/core/types.pb"; import { getChildren } from "../lib/graph"; @@ -46,30 +46,30 @@ export function useListFluxCrds(clusterName = DefaultCluster) { } export function useListRuntimeObjects( - clusterName = DefaultCluster, - namespace = NoNamespace, - opts: ReactQueryOptions = { - retry: false, - refetchInterval: 5000, - } + clusterName = DefaultCluster, + namespace = NoNamespace, + opts: ReactQueryOptions = { + retry: false, + refetchInterval: 5000, + } ) { - const {api} = useContext(CoreClientContext); + const { api } = useContext(CoreClientContext); - return useQuery( - "runtime_objects", - () => api.ListRuntimeObjects({namespace, clusterName}), - opts - ); + return useQuery( + "runtime_objects", + () => api.ListRuntimeObjects({ namespace, clusterName }), + opts + ); } export function useListRuntimeCrds(clusterName = DefaultCluster) { - const {api} = useContext(CoreClientContext); + const { api } = useContext(CoreClientContext); - return useQuery( - "runtime_crds", - () => api.ListRuntimeCrds({clusterName}), - {retry: false, refetchInterval: 5000} - ); + return useQuery( + "runtime_crds", + () => api.ListRuntimeCrds({ clusterName }), + { retry: false, refetchInterval: 5000 } + ); } export function flattenChildren(children: FluxObject[]) { diff --git a/ui/pages/v2/FluxRuntime.tsx b/ui/pages/v2/FluxRuntime.tsx index db100735ce..039f52cc97 100644 --- a/ui/pages/v2/FluxRuntime.tsx +++ b/ui/pages/v2/FluxRuntime.tsx @@ -16,7 +16,7 @@ function FluxRuntime({ className }: Props) { error: crdsError, } = useListFluxCrds(); return ( -