From f935a6579f9e30c05f4f5b3d8087297d5ff41670 Mon Sep 17 00:00:00 2001 From: Kristina Durivage Date: Sun, 30 Nov 2025 10:32:34 -0600 Subject: [PATCH] properly split logic --- .../correlations/CorrelationsPageWrapper.tsx | 78 ++++++++++--------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/public/app/features/correlations/CorrelationsPageWrapper.tsx b/public/app/features/correlations/CorrelationsPageWrapper.tsx index 079dcd8554f..60095110f58 100644 --- a/public/app/features/correlations/CorrelationsPageWrapper.tsx +++ b/public/app/features/correlations/CorrelationsPageWrapper.tsx @@ -6,46 +6,52 @@ import { GetCorrelationsParams } from './types'; import { useCorrelations } from './useCorrelations'; import { toEnrichedCorrelationDataK8s } from './useCorrelationsK8s'; -export default function CorrelationsPageWrapper() { - // I cannot use these conditionally, is this okay? +function CorrelationsPageLegacy() { const { remove, get } = useCorrelations(); + return ( + + ); +} + +function CorrelationsPageAppPlatform() { + // todo remove fake limit const { currentData, isLoading, error } = useListCorrelationQuery({ limit: 10 }); - if (config.featureToggles.kubernetesCorrelations) { - const enrichedCorrelations = (correlations?: CorrelationList) => { - return correlations !== undefined - ? correlations.items.map((item) => toEnrichedCorrelationDataK8s(item)).filter((i) => i !== undefined) - : []; - }; + const enrichedCorrelations = (correlations?: CorrelationList) => { + return correlations !== undefined + ? correlations.items.map((item) => toEnrichedCorrelationDataK8s(item)).filter((i) => i !== undefined) + : []; + }; - console.log(currentData?.metadata.remainingItemCount); + // we cant do a straight refetch, we have to pass in new pages if necessary + const enhRefetch = (params: GetCorrelationsParams): Promise => { + return new Promise(() => enrichedCorrelations(currentData)); + }; - // we cant do a straight refetch, we have to pass in new pages if necessary - const enhRefetch = (params: GetCorrelationsParams): Promise => { - return new Promise(() => enrichedCorrelations(currentData)); - }; + return ( + + ); +} - return ( - - ); - } else { - return ( - - ); +export default function CorrelationsPageWrapper() { + if (config.featureToggles.kubernetesCorrelations) { + return ; } + + return ; }