Skip to content

Commit

Permalink
Module Duplication: list chunks from both Jobs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
danielbeardsley committed Feb 16, 2024
1 parent f56a8bc commit ca56d32
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions packages/ui/src/components/module-info/module-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -73,26 +72,30 @@ export const ModuleInfo = (props: ModuleInfoProps & React.ComponentProps<'div'>)
return (
<EntryInfo item={item} labels={labels} tags={tags} onClose={onClose} className={rootClassName}>
<Stack space="xxxsmall">
{!isEmpty(currentRun?.chunkIds) && (
<EntryInfo.Meta label="Chunks" className={css.chunks}>
{currentRun.chunkIds.map((chunkId) => {
const chunk = chunks?.find(({ id }) => id === chunkId);
{item.runs?.map(
(currentRun, index) =>
!isEmpty(currentRun?.chunkIds) && (
<EntryInfo.Meta label="Chunks" className={css.chunks}>
Job #{index + 1}:
{currentRun.chunkIds.map((chunkId) => {
const chunk = chunks?.find(({ id }) => id === chunkId);

if (!chunk) {
return null;
}
if (!chunk) {
return null;
}

return (
<EntryInfoMetaLink
as={CustomComponentLink}
{...getBundleModulesByChunk(chunkIds, chunkId)}
className={css.chunksItem}
>
{chunk.name}
</EntryInfoMetaLink>
);
})}
</EntryInfo.Meta>
return (
<EntryInfoMetaLink
as={CustomComponentLink}
{...getBundleModulesByChunk(chunkIds, chunkId)}
className={css.chunksItem}
>
{chunk.name}
</EntryInfoMetaLink>
);
})}
</EntryInfo.Meta>
),
)}

{item?.fileType && (
Expand Down

0 comments on commit ca56d32

Please sign in to comment.