Skip to content

Commit

Permalink
Josh feedback: Move the “partition” tag to the target area
Browse files Browse the repository at this point in the history
[INTERNAL_BRANCH=bengotow-2024-12/FE-715]
  • Loading branch information
bengotow committed Jan 4, 2025
1 parent e5cca01 commit 2ede778
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ interface AssetKeyTagCollectionProps {
assetKeys: AssetKey[] | null;
dialogTitle?: string;
useTags?: boolean;
extraTags?: React.ReactNode[];
maxRows?: number;
}

Expand Down Expand Up @@ -156,7 +157,7 @@ export function useAdjustChildVisibilityToFill(moreLabelFn: (count: number) => s
}

export const AssetKeyTagCollection = React.memo((props: AssetKeyTagCollectionProps) => {
const {assetKeys, useTags, maxRows, dialogTitle = 'Assets in run'} = props;
const {assetKeys, useTags, extraTags, maxRows, dialogTitle = 'Assets in run'} = props;

const count = assetKeys?.length ?? 0;
const rendered = maxRows ? 10 : count === 1 ? 1 : 0;
Expand Down Expand Up @@ -198,6 +199,7 @@ export const AssetKeyTagCollection = React.memo((props: AssetKeyTagCollectionPro
overflow: 'hidden',
}}
>
{extraTags}
{slicedSortedAssetKeys.map((assetKey) => (
// Outer span ensures the popover target is in the right place if the
// parent is a flexbox.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ export const RunRowTags = ({
isHovered,
isJob,
hideTags,
hidePartition,
}: {
run: Pick<RunTableRunFragment, 'tags' | 'assetSelection' | 'mode'>;
onAddTag?: (token: RunFilterToken) => void;
isHovered: boolean;
isJob: boolean;
hideTags?: string[];
hidePartition?: boolean;
}) => {
const {isTagPinned, onToggleTagPin} = useTagPinning();
const [showRunTags, setShowRunTags] = React.useState(false);
Expand Down Expand Up @@ -66,12 +68,15 @@ export const RunRowTags = ({
if (hideTags?.includes(tag.key)) {
return;
}
if (hidePartition && tag.key === DagsterTag.Partition) {
return;
}
if (tag.pinned) {
tags.push(tag);
}
});
return tags;
}, [allTagsWithPinned, hideTags, run.assetSelection?.length]);
}, [allTagsWithPinned, hideTags, hidePartition, run.assetSelection?.length]);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const RunTargetLink = ({
isJob,
repoAddress,
useTags,
extraTags,
}: {
isJob: boolean;
run: Pick<
Expand All @@ -21,6 +22,7 @@ export const RunTargetLink = ({
>;
repoAddress: RepoAddress | null;
useTags: boolean;
extraTags?: React.ReactNode[];
}) => {
const assetKeys = React.useMemo(() => {
return isHiddenAssetGroupJob(run.pipelineName) ? assetKeysForRun(run) : null;
Expand All @@ -32,6 +34,7 @@ export const RunTargetLink = ({
<AssetKeyTagCollection
assetKeys={assetKeys}
useTags={useTags}
extraTags={extraTags}
maxRows={run.assetCheckSelection?.length ? 1 : 2}
/>
<AssetCheckTagCollection
Expand Down
10 changes: 10 additions & 0 deletions js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {RunActionsMenu} from './RunActionsMenu';
import {RunRowTags} from './RunRowTags';
import {RunStatusTag, RunStatusTagWithStats} from './RunStatusTag';
import {DagsterTag} from './RunTag';
import {RunTags} from './RunTags';
import {RunTargetLink} from './RunTargetLink';
import {RunStateSummary, RunTime, titleForRun} from './RunUtils';
import {getBackfillPath} from './RunsFeedUtils';
Expand Down Expand Up @@ -86,6 +87,9 @@ export const RunsFeedRow = ({
__typename: 'Run',
};

const partitionTag =
entry.__typename === 'Run' ? entry.tags.find((t) => t.key === DagsterTag.Partition) : null;

return (
<RowGrid
border="bottom"
Expand Down Expand Up @@ -124,6 +128,7 @@ export const RunsFeedRow = ({
isHovered={isHovered}
onAddTag={onAddTag}
hideTags={hideTags}
hidePartition
/>

{entry.runStatus === RunStatus.QUEUED ? (
Expand All @@ -148,6 +153,11 @@ export const RunsFeedRow = ({
run={{...entry, pipelineName: entry.jobName!, stepKeysToExecute: []}}
repoAddress={repoAddress}
useTags={true}
extraTags={
partitionTag
? [<RunTags key="partition" tags={[partitionTag]} onAddTag={onAddTag} />]
: []
}
/>
) : (
<BackfillTarget
Expand Down

0 comments on commit 2ede778

Please sign in to comment.