Skip to content

[dagster-airlift][jobs 6/n] jobs UI #29278

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

Open
wants to merge 1 commit into
base: dpeng817/dpeng817/monitoring_job_real
Choose a base branch
from
Open
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 @@ -10,6 +10,7 @@ import add_circle from '../icon-svgs/add_circle.svg';
import agent from '../icon-svgs/agent.svg';
import alert from '../icon-svgs/alert.svg';
import alternate_email from '../icon-svgs/alternate_email.svg';
import airflow from '../icon-svgs/airflow.svg';
import and from '../icon-svgs/and.svg';
import approved from '../icon-svgs/approved.svg';
import arrow_back from '../icon-svgs/arrow_back.svg';
Expand Down Expand Up @@ -428,6 +429,7 @@ export const Icons = {
agent,
alert,
alternate_email,
airflow,
and,
approved,
arrow_back,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions js_modules/dagster-ui/packages/ui-core/client.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions js_modules/dagster-ui/packages/ui-core/src/graph/OpGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ interface OpGraphProps {
onEnterSubgraph?: (arg: OpNameOrPath) => void;
onLeaveSubgraph?: () => void;
onClickBackground?: () => void;
isExternal?: boolean;
}

interface OpGraphContentsProps extends OpGraphProps {
Expand Down Expand Up @@ -122,6 +123,7 @@ const OpGraphContents = React.memo((props: OpGraphContentsProps) => {
isOpHighlighted(highlighted, op.name) ? highlighted : EmptyHighlightedArray
}
dim={highlightedOps.length > 0 && highlightedOps.indexOf(op) === -1}
isExternal={props.isExternal}
/>
))}
</foreignObject>
Expand Down
56 changes: 31 additions & 25 deletions js_modules/dagster-ui/packages/ui-core/src/graph/OpNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface IOpNodeProps {
onDoubleClick: () => void;
onEnterComposite: () => void;
onHighlightEdges: (edges: Edge[]) => void;
isExternal?: boolean;
}

const TOOLTIP_STYLE = JSON.stringify({
Expand Down Expand Up @@ -87,7 +88,8 @@ export class OpNode extends React.Component<IOpNodeProps> {
};

public render() {
const {definition, invocation, layout, dim, focused, selected, minified} = this.props;
const {definition, invocation, layout, dim, focused, selected, minified, isExternal} =
this.props;
const {metadata} = definition;
if (!layout) {
throw new Error(`Layout is missing for ${definition.name}`);
Expand Down Expand Up @@ -137,18 +139,20 @@ export class OpNode extends React.Component<IOpNodeProps> {
{minified ? 'C' : 'Config'}
</div>
)}
<div>
{definition.inputDefinitions.map((item, idx) => (
<OpIOBox
{...this.props}
{...metadataForIO(item, invocation)}
key={idx}
item={item}
layoutInfo={layout.inputs[item.name]}
colorKey="input"
/>
))}
</div>
{!isExternal && (
<div>
{definition.inputDefinitions.map((item, idx) => (
<OpIOBox
{...this.props}
{...metadataForIO(item, invocation)}
key={idx}
item={item}
layoutInfo={layout.inputs[item.name]}
colorKey="input"
/>
))}
</div>
)}
<div className="node-box" style={{...position(layout.op)}}>
<div className="name">
{!minified && <Icon name="op" size={16} />}
Expand All @@ -174,18 +178,20 @@ export class OpNode extends React.Component<IOpNodeProps> {
}}
/>
)}
<div>
{definition.outputDefinitions.map((item, idx) => (
<OpIOBox
{...this.props}
{...metadataForIO(item, invocation)}
key={idx}
item={item}
layoutInfo={layout.outputs[item.name]}
colorKey="output"
/>
))}
</div>
{!isExternal && (
<div>
{definition.outputDefinitions.map((item, idx) => (
<OpIOBox
{...this.props}
{...metadataForIO(item, invocation)}
key={idx}
item={item}
layoutInfo={layout.outputs[item.name]}
colorKey="output"
/>
))}
</div>
)}
</NodeContainer>
);
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions js_modules/dagster-ui/packages/ui-core/src/graphql/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
InstigationStatesQuery,
InstigationStatesQueryVariables,
} from './types/InstigationStatesQuery.types';
import {TagIcon} from '../graph/OpTags';
import {InstigationStatus} from '../graphql/types';
import {INSTIGATION_STATE_BASE_FRAGMENT} from '../instigation/InstigationStateBaseFragment';
import {InstigationStateFragment} from '../instigation/types/InstigationUtils.types';
Expand All @@ -29,7 +30,6 @@ export const LeftNavItem = React.forwardRef(
(props: LeftNavItemProps, ref: React.ForwardedRef<HTMLDivElement>) => {
const {active, item} = props;
const {label, leftIcon, path, repoAddress, schedules, sensors} = item;

const [showDialog, setShowDialog] = React.useState(false);
const repositoryId = useRepository(repoAddress)?.repository.id;

Expand Down Expand Up @@ -187,7 +187,11 @@ export const LeftNavItem = React.forwardRef(
{sensorFragmentSubscriptions}
{scheduleFragmentSubscriptions}
<Item $active={active} to={path}>
<Icon name={leftIcon} color={active ? Colors.accentBlue() : Colors.textDefault()} />
{leftIcon === 'airflow' ? (
<TagIcon label="airflow" />
) : (
<Icon name={leftIcon} color={active ? Colors.accentBlue() : Colors.textDefault()} />
)}
{label}
</Item>
{rightIcon}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {RepoAddress} from '../workspace/types';
export type LeftNavItemType = {
name: string;
isJob: boolean;
leftIcon: IconName;
leftIcon: IconName | 'airflow';
label: React.ReactNode;
path: string;
repoAddress: RepoAddress;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const PipelineNav = (props: Props) => {
// If using pipeline:mode tuple (crag flag), check for partition sets that are for this specific
// pipeline:mode tuple. Otherwise, just check for a pipeline name match.
const partitionSets = repo?.repository.partitionSets || [];
const hasLaunchpad = !isAssetJob;
const hasLaunchpad = !isAssetJob && !repoJobEntry?.externalJobSource;
const hasPartitionSet = partitionSets.some(
(partitionSet) => partitionSet.pipelineName === pipelineName,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import styled from 'styled-components';

import {LeftNavItemType} from './LeftNavItemType';
import {isHiddenAssetGroupJob} from '../asset-graph/Utils';
import {ExternalJobSource} from '../graphql/types';
import {LegacyPipelineTag} from '../pipelines/LegacyPipelineTag';
import {DagsterRepoOption} from '../workspace/WorkspaceContext/util';
import {buildRepoAddress} from '../workspace/buildRepoAddress';
Expand Down Expand Up @@ -79,16 +80,17 @@ export const getJobItemsForOption = (option: DagsterRepoOption) => {
continue;
}

const {isJob, name} = pipeline;
const {isJob, name, externalJobSource} = pipeline;
const schedulesForJob = schedules.filter((schedule) => schedule.pipelineName === name);
const sensorsForJob = sensors.filter((sensor) =>
sensor.targets?.map((target) => target.pipelineName).includes(name),
);
const isAirflowJob = externalJobSource === ExternalJobSource.AIRFLOW;

items.push({
name,
isJob,
leftIcon: 'job',
leftIcon: isAirflowJob ? 'airflow' : 'job',
label: (
<Label $hasIcon={someInRepoHasIcon}>
<TruncatedTextWithFullTextOnHover text={name} />
Expand Down
Loading