Skip to content

Commit 4bb9641

Browse files
committed
[dagster-airlift][jobs 6/n] jobs UI
1 parent 84e01c1 commit 4bb9641

35 files changed

+338
-127
lines changed

Diff for: js_modules/dagster-ui/packages/ui-components/src/components/Icon.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import add_circle from '../icon-svgs/add_circle.svg';
1010
import agent from '../icon-svgs/agent.svg';
1111
import alert from '../icon-svgs/alert.svg';
1212
import alternate_email from '../icon-svgs/alternate_email.svg';
13+
import airflow from '../icon-svgs/airflow.svg';
1314
import and from '../icon-svgs/and.svg';
1415
import approved from '../icon-svgs/approved.svg';
1516
import arrow_back from '../icon-svgs/arrow_back.svg';
@@ -428,6 +429,7 @@ export const Icons = {
428429
agent,
429430
alert,
430431
alternate_email,
432+
airflow,
431433
and,
432434
approved,
433435
arrow_back,
Loading

Diff for: js_modules/dagster-ui/packages/ui-core/client.json

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: js_modules/dagster-ui/packages/ui-core/src/asset-graph/types/AssetGraphJobSidebar.types.ts

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: js_modules/dagster-ui/packages/ui-core/src/graph/OpGraph.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ interface OpGraphProps {
3737
onEnterSubgraph?: (arg: OpNameOrPath) => void;
3838
onLeaveSubgraph?: () => void;
3939
onClickBackground?: () => void;
40+
isExternal?: boolean;
4041
}
4142

4243
interface OpGraphContentsProps extends OpGraphProps {
@@ -122,6 +123,7 @@ const OpGraphContents = React.memo((props: OpGraphContentsProps) => {
122123
isOpHighlighted(highlighted, op.name) ? highlighted : EmptyHighlightedArray
123124
}
124125
dim={highlightedOps.length > 0 && highlightedOps.indexOf(op) === -1}
126+
isExternal={props.isExternal}
125127
/>
126128
))}
127129
</foreignObject>

Diff for: js_modules/dagster-ui/packages/ui-core/src/graph/OpNode.tsx

+31-25
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ interface IOpNodeProps {
2727
onDoubleClick: () => void;
2828
onEnterComposite: () => void;
2929
onHighlightEdges: (edges: Edge[]) => void;
30+
isExternal?: boolean;
3031
}
3132

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

8990
public render() {
90-
const {definition, invocation, layout, dim, focused, selected, minified} = this.props;
91+
const {definition, invocation, layout, dim, focused, selected, minified, isExternal} =
92+
this.props;
9193
const {metadata} = definition;
9294
if (!layout) {
9395
throw new Error(`Layout is missing for ${definition.name}`);
@@ -137,18 +139,20 @@ export class OpNode extends React.Component<IOpNodeProps> {
137139
{minified ? 'C' : 'Config'}
138140
</div>
139141
)}
140-
<div>
141-
{definition.inputDefinitions.map((item, idx) => (
142-
<OpIOBox
143-
{...this.props}
144-
{...metadataForIO(item, invocation)}
145-
key={idx}
146-
item={item}
147-
layoutInfo={layout.inputs[item.name]}
148-
colorKey="input"
149-
/>
150-
))}
151-
</div>
142+
{!isExternal && (
143+
<div>
144+
{definition.inputDefinitions.map((item, idx) => (
145+
<OpIOBox
146+
{...this.props}
147+
{...metadataForIO(item, invocation)}
148+
key={idx}
149+
item={item}
150+
layoutInfo={layout.inputs[item.name]}
151+
colorKey="input"
152+
/>
153+
))}
154+
</div>
155+
)}
152156
<div className="node-box" style={{...position(layout.op)}}>
153157
<div className="name">
154158
{!minified && <Icon name="op" size={16} />}
@@ -174,18 +178,20 @@ export class OpNode extends React.Component<IOpNodeProps> {
174178
}}
175179
/>
176180
)}
177-
<div>
178-
{definition.outputDefinitions.map((item, idx) => (
179-
<OpIOBox
180-
{...this.props}
181-
{...metadataForIO(item, invocation)}
182-
key={idx}
183-
item={item}
184-
layoutInfo={layout.outputs[item.name]}
185-
colorKey="output"
186-
/>
187-
))}
188-
</div>
181+
{!isExternal && (
182+
<div>
183+
{definition.outputDefinitions.map((item, idx) => (
184+
<OpIOBox
185+
{...this.props}
186+
{...metadataForIO(item, invocation)}
187+
key={idx}
188+
item={item}
189+
layoutInfo={layout.outputs[item.name]}
190+
colorKey="output"
191+
/>
192+
))}
193+
</div>
194+
)}
189195
</NodeContainer>
190196
);
191197
}

Diff for: js_modules/dagster-ui/packages/ui-core/src/graphql/schema.graphql

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: js_modules/dagster-ui/packages/ui-core/src/graphql/types.ts

+24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: js_modules/dagster-ui/packages/ui-core/src/nav/LeftNavItem.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
InstigationStatesQuery,
1414
InstigationStatesQueryVariables,
1515
} from './types/InstigationStatesQuery.types';
16+
import {TagIcon} from '../graph/OpTags';
1617
import {InstigationStatus} from '../graphql/types';
1718
import {INSTIGATION_STATE_BASE_FRAGMENT} from '../instigation/InstigationStateBaseFragment';
1819
import {InstigationStateFragment} from '../instigation/types/InstigationUtils.types';
@@ -29,7 +30,6 @@ export const LeftNavItem = React.forwardRef(
2930
(props: LeftNavItemProps, ref: React.ForwardedRef<HTMLDivElement>) => {
3031
const {active, item} = props;
3132
const {label, leftIcon, path, repoAddress, schedules, sensors} = item;
32-
3333
const [showDialog, setShowDialog] = React.useState(false);
3434
const repositoryId = useRepository(repoAddress)?.repository.id;
3535

@@ -187,7 +187,11 @@ export const LeftNavItem = React.forwardRef(
187187
{sensorFragmentSubscriptions}
188188
{scheduleFragmentSubscriptions}
189189
<Item $active={active} to={path}>
190-
<Icon name={leftIcon} color={active ? Colors.accentBlue() : Colors.textDefault()} />
190+
{leftIcon === 'airflow' ? (
191+
<TagIcon label="airflow" />
192+
) : (
193+
<Icon name={leftIcon} color={active ? Colors.accentBlue() : Colors.textDefault()} />
194+
)}
191195
{label}
192196
</Item>
193197
{rightIcon}

Diff for: js_modules/dagster-ui/packages/ui-core/src/nav/LeftNavItemType.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {RepoAddress} from '../workspace/types';
99
export type LeftNavItemType = {
1010
name: string;
1111
isJob: boolean;
12-
leftIcon: IconName;
12+
leftIcon: IconName | 'airflow';
1313
label: React.ReactNode;
1414
path: string;
1515
repoAddress: RepoAddress;

Diff for: js_modules/dagster-ui/packages/ui-core/src/nav/PipelineNav.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const PipelineNav = (props: Props) => {
3737
// If using pipeline:mode tuple (crag flag), check for partition sets that are for this specific
3838
// pipeline:mode tuple. Otherwise, just check for a pipeline name match.
3939
const partitionSets = repo?.repository.partitionSets || [];
40-
const hasLaunchpad = !isAssetJob;
40+
const hasLaunchpad = !isAssetJob && !repoJobEntry?.externalJobSource;
4141
const hasPartitionSet = partitionSets.some(
4242
(partitionSet) => partitionSet.pipelineName === pipelineName,
4343
);

Diff for: js_modules/dagster-ui/packages/ui-core/src/nav/getLeftNavItemsForOption.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import styled from 'styled-components';
44

55
import {LeftNavItemType} from './LeftNavItemType';
66
import {isHiddenAssetGroupJob} from '../asset-graph/Utils';
7+
import {ExternalJobSource} from '../graphql/types';
78
import {LegacyPipelineTag} from '../pipelines/LegacyPipelineTag';
89
import {DagsterRepoOption} from '../workspace/WorkspaceContext/util';
910
import {buildRepoAddress} from '../workspace/buildRepoAddress';
@@ -79,16 +80,17 @@ export const getJobItemsForOption = (option: DagsterRepoOption) => {
7980
continue;
8081
}
8182

82-
const {isJob, name} = pipeline;
83+
const {isJob, name, externalJobSource} = pipeline;
8384
const schedulesForJob = schedules.filter((schedule) => schedule.pipelineName === name);
8485
const sensorsForJob = sensors.filter((sensor) =>
8586
sensor.targets?.map((target) => target.pipelineName).includes(name),
8687
);
88+
const isAirflowJob = externalJobSource === ExternalJobSource.AIRFLOW;
8789

8890
items.push({
8991
name,
9092
isJob,
91-
leftIcon: 'job',
93+
leftIcon: isAirflowJob ? 'airflow' : 'job',
9294
label: (
9395
<Label $hasIcon={someInRepoHasIcon}>
9496
<TruncatedTextWithFullTextOnHover text={name} />

0 commit comments

Comments
 (0)