Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui] For runs targeting assets, show >1 asset in the Target column #26122

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const BackfillOpJobPartitionsTable = ({
<tr>
<td>
<Box flex={{direction: 'row', justifyContent: 'space-between', alignItems: 'baseline'}}>
<BackfillTarget backfill={backfill} repoAddress={repoAddress} />
<BackfillTarget backfill={backfill} repoAddress={repoAddress} useTags={false} />
<StatusBar
targeted={results.length}
inProgress={inProgress.length}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {FIFTEEN_SECONDS, useQueryRefreshAtInterval} from '../../app/QueryRefresh
import {isHiddenAssetGroupJob} from '../../asset-graph/Utils';
import {RunStatus} from '../../graphql/types';
import {PartitionStatus, PartitionStatusHealthSourceOps} from '../../partitions/PartitionStatus';
import {PipelineReference} from '../../pipelines/PipelineReference';
import {PipelineReference, PipelineTag} from '../../pipelines/PipelineReference';
import {AssetKeyTagCollection} from '../../runs/AssetTagCollections';
import {CreatedByTagCell} from '../../runs/CreatedByTag';
import {getBackfillPath} from '../../runs/RunsFeedUtils';
Expand Down Expand Up @@ -118,7 +118,7 @@ export const BackfillRowContent = ({
</td>
{showBackfillTarget ? (
<td style={{width: '20%'}}>
<BackfillTarget backfill={backfill} repoAddress={repoAddress} />
<BackfillTarget backfill={backfill} repoAddress={repoAddress} useTags={false} />
</td>
) : null}
<td style={{width: allPartitions ? 300 : 140}}>
Expand Down Expand Up @@ -146,9 +146,11 @@ export const BackfillRowContent = ({
export const BackfillTarget = ({
backfill,
repoAddress,
useTags,
}: {
backfill: Pick<BackfillTableFragment, 'assetSelection' | 'partitionSet' | 'partitionSetName'>;
repoAddress: RepoAddress | null;
useTags: boolean;
}) => {
const repo = useRepository(repoAddress);
const {assetSelection, partitionSet, partitionSetName} = backfill;
Expand All @@ -160,22 +162,30 @@ export const BackfillTarget = ({
return null;
}
if (partitionSet && repo) {
const link = workspacePipelinePath({
repoName: partitionSet.repositoryOrigin.repositoryName,
repoLocation: partitionSet.repositoryOrigin.repositoryLocationName,
pipelineName: partitionSet.pipelineName,
isJob: isThisThingAJob(repo, partitionSet.pipelineName),
path: `/partitions?partitionSet=${encodeURIComponent(partitionSet.name)}`,
});
if (useTags) {
return (
<Tag icon="partition_set">
<Link to={link}>{partitionSet.name}</Link>
</Tag>
);
}
return (
<Link
style={{fontWeight: 500}}
to={workspacePipelinePath({
repoName: partitionSet.repositoryOrigin.repositoryName,
repoLocation: partitionSet.repositoryOrigin.repositoryLocationName,
pipelineName: partitionSet.pipelineName,
isJob: isThisThingAJob(repo, partitionSet.pipelineName),
path: `/partitions?partitionSet=${encodeURIComponent(partitionSet.name)}`,
})}
>
<Link style={{fontWeight: 500}} to={link}>
{partitionSet.name}
</Link>
);
}
if (partitionSetName) {
if (useTags) {
return <Tag icon="partition_set">{partitionSetName}</Tag>;
}
return <span style={{fontWeight: 500}}>{partitionSetName}</span>;
}
return null;
Expand All @@ -193,10 +203,28 @@ export const BackfillTarget = ({

const buildPipelineOrAssets = () => {
if (assetSelection?.length) {
return <AssetKeyTagCollection assetKeys={assetSelection} dialogTitle="Assets in backfill" />;
return (
<AssetKeyTagCollection
assetKeys={assetSelection}
dialogTitle="Assets in backfill"
useTags={useTags}
maxRows={2}
/>
);
}
if (partitionSet && repo) {
return (
return useTags ? (
<PipelineTag
showIcon
size="small"
pipelineName={partitionSet.pipelineName}
pipelineHrefContext={{
name: partitionSet.repositoryOrigin.repositoryName,
location: partitionSet.repositoryOrigin.repositoryLocationName,
}}
isJob={isThisThingAJob(repo, partitionSet.pipelineName)}
/>
) : (
<PipelineReference
showIcon
size="small"
Expand All @@ -215,11 +243,11 @@ export const BackfillTarget = ({
const repoLink = buildRepoLink();
const pipelineOrAssets = buildPipelineOrAssets();
return (
<Box flex={{direction: 'column', gap: 8}}>
<Box flex={{direction: 'column', gap: 8, alignItems: 'start'}}>
{buildHeader()}
{(pipelineOrAssets || repoLink) && (
<Box flex={{direction: 'column', gap: 4}} style={{fontSize: '12px'}}>
{repoLink}
{repoLink && useTags ? <Tag>{repoLink}</Tag> : repoLink}
{pipelineOrAssets}
</Box>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {Box, Colors, Icon, Tag} from '@dagster-io/ui-components';
import {Link} from 'react-router-dom';
import styled from 'styled-components';

import {PipelineSnapshotLink} from './PipelinePathUtils';
import {RepoAddress} from '../workspace/types';
Expand Down Expand Up @@ -54,7 +53,7 @@ export const PipelineReference = ({
return (
<Box flex={{direction: 'row', alignItems: 'center', display: 'inline-flex'}}>
{showIcon && (
<Box margin={{right: 8}}>
<Box margin={{right: 4}}>
<Icon color={Colors.accentGray()} name="job" />
</Box>
)}
Expand All @@ -71,16 +70,8 @@ export const PipelineReference = ({

export const PipelineTag = (props: Props) => {
return (
<PipelineTagWrap>
<Tag tooltipText={props.pipelineName}>
<PipelineReference {...props} />
</Tag>
</PipelineTagWrap>
<Tag tooltipText={props.pipelineName} icon="job">
<PipelineReference {...props} showIcon={false} />
</Tag>
);
};

const PipelineTagWrap = styled.span`
span {
line-height: 0;
}
`;
Loading
Loading