From 4784db5aea2e40e541a510524b685af3fea34de1 Mon Sep 17 00:00:00 2001 From: Daniel Beardsley Date: Mon, 4 Dec 2023 10:55:17 -0800 Subject: [PATCH] Module Duplication: list chunks from both Jobs In the module info dialog we list the chunks that a module is in. Previously, we only showed the list of chunks that it's in from *one* of the jobs. Listing all chunks allows you to see if a module is duplicated and how that duplication is different across jobs. --- .../components/module-info/module-info.tsx | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/packages/ui/src/components/module-info/module-info.tsx b/packages/ui/src/components/module-info/module-info.tsx index 2f914cd313..190d008cd3 100644 --- a/packages/ui/src/components/module-info/module-info.tsx +++ b/packages/ui/src/components/module-info/module-info.tsx @@ -48,7 +48,6 @@ export const ModuleInfo = (props: ModuleInfoProps & React.ComponentProps<'div'>) } = props; const rootClassName = cx(css.root, className); - const currentRun = item.runs?.[0]; const tags = useMemo(() => { if (!item.duplicated) { @@ -73,26 +72,30 @@ export const ModuleInfo = (props: ModuleInfoProps & React.ComponentProps<'div'>) return ( - {!isEmpty(currentRun?.chunkIds) && ( - - {currentRun.chunkIds.map((chunkId) => { - const chunk = chunks?.find(({ id }) => id === chunkId); + {item.runs?.map( + (currentRun, index) => + !isEmpty(currentRun?.chunkIds) && ( + + Job #{index + 1}: + {currentRun.chunkIds.map((chunkId) => { + const chunk = chunks?.find(({ id }) => id === chunkId); - if (!chunk) { - return null; - } + if (!chunk) { + return null; + } - return ( - - {chunk.name} - - ); - })} - + return ( + + {chunk.name} + + ); + })} + + ), )} {item?.fileType && (