@@ -2,14 +2,12 @@ import {Box, Colors, FontFamily, Icon, Tooltip} from '@dagster-io/ui-components'
22import isEqual from 'lodash/isEqual' ;
33import * as React from 'react' ;
44import { Link } from 'react-router-dom' ;
5- import { observeEnabled } from 'shared/app/observeEnabled.oss' ;
65import styled , { CSSObject } from 'styled-components' ;
76
87import { ASSET_NODE_HOVER_EXPAND_HEIGHT } from './AssetNode2025' ;
98import { AssetNodeFacet } from './AssetNodeFacetsUtil' ;
109import { AssetNodeHealthRow } from './AssetNodeHealthRow' ;
1110import { AssetNodeMenuProps , useAssetNodeMenu } from './AssetNodeMenu' ;
12- import { buildAssetNodeStatusContent } from './AssetNodeStatusContent' ;
1311import { ContextMenuWrapper } from './ContextMenuWrapper' ;
1412import { LiveDataForNode } from './Utils' ;
1513import {
@@ -71,11 +69,8 @@ export const AssetNode = React.memo(({definition, selected, onChangeAssetSelecti
7169 < PartitionCountTags definition = { definition } liveData = { liveData } />
7270 ) }
7371 </ Box >
74- { observeEnabled ( ) ? (
75- < AssetNodeHealthRow definition = { definition } liveData = { liveData } />
76- ) : (
77- < AssetNodeStatusRow definition = { definition } liveData = { liveData } />
78- ) }
72+ < AssetNodeHealthRow definition = { definition } liveData = { liveData } />
73+
7974 { hasChecks && < AssetNodeChecksRow definition = { definition } liveData = { liveData } /> }
8075 </ AssetNodeBox >
8176 < Box
@@ -132,28 +127,6 @@ export const AssetNodeRowBox = styled(Box)`
132127 }
133128` ;
134129
135- interface StatusRowProps {
136- definition : AssetNodeFragment ;
137- liveData : LiveDataForNode | undefined ;
138- }
139-
140- const AssetNodeStatusRow = ( { definition, liveData} : StatusRowProps ) => {
141- const { content, background} = buildAssetNodeStatusContent ( {
142- assetKey : definition . assetKey ,
143- definition,
144- liveData,
145- } ) ;
146- return (
147- < AssetNodeRowBox
148- background = { background }
149- padding = { { horizontal : 8 } }
150- flex = { { justifyContent : 'space-between' , alignItems : 'center' , gap : 6 } }
151- >
152- { content }
153- </ AssetNodeRowBox >
154- ) ;
155- } ;
156-
157130export const AssetNodeContextMenuWrapper = React . memo (
158131 ( { children, ...menuProps } : AssetNodeMenuProps & { children : React . ReactNode } ) => {
159132 const { dialog, menu} = useAssetNodeMenu ( menuProps ) ;
@@ -208,20 +181,7 @@ type AssetNodeMinimalProps = {
208181 height : number ;
209182} ;
210183
211- export const AssetNodeMinimal = ( props : AssetNodeMinimalProps ) => {
212- return observeEnabled ( ) ? (
213- < AssetNodeMinimalWithHealth { ...props } />
214- ) : (
215- < AssetNodeMinimalOld { ...props } />
216- ) ;
217- } ;
218-
219- export const AssetNodeMinimalWithHealth = ( {
220- definition,
221- facets,
222- height,
223- selected,
224- } : AssetNodeMinimalProps ) => {
184+ export const AssetNodeMinimal = ( { definition, facets, height, selected} : AssetNodeMinimalProps ) => {
225185 const { isMaterializable, assetKey} = definition ;
226186 const { liveData} = useAssetLiveData ( assetKey ) ;
227187 const { liveData : healthData } = useAssetHealthData ( assetKey ) ;
@@ -294,75 +254,6 @@ export const AssetNodeMinimalWithHealth = ({
294254 ) ;
295255} ;
296256
297- export const AssetNodeMinimalOld = ( {
298- definition,
299- facets,
300- height,
301- selected,
302- } : AssetNodeMinimalProps ) => {
303- const { isMaterializable, assetKey} = definition ;
304- const { liveData} = useAssetLiveData ( assetKey ) ;
305-
306- const { border, background} = buildAssetNodeStatusContent ( { assetKey, definition, liveData} ) ;
307- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
308- const displayName = assetKey . path [ assetKey . path . length - 1 ] ! ;
309-
310- const isChanged = definition . changedReasons . length ;
311- const isStale = isAssetStale ( liveData ) ;
312-
313- const queuedRuns = liveData ?. unstartedRunIds . length ;
314- const inProgressRuns = liveData ?. inProgressRunIds . length ;
315-
316- // old design
317- let paddingTop = height / 2 - 52 ;
318- let nodeHeight = 86 ;
319-
320- if ( facets !== null ) {
321- const topTagsPresent = facets . has ( AssetNodeFacet . UnsyncedTag ) ;
322- const bottomTagsPresent = facets . has ( AssetNodeFacet . KindTag ) ;
323- paddingTop = ASSET_NODE_VERTICAL_MARGIN + ( topTagsPresent ? ASSET_NODE_TAGS_HEIGHT : 0 ) ;
324- nodeHeight =
325- height -
326- ASSET_NODE_VERTICAL_MARGIN * 2 -
327- ( topTagsPresent ? ASSET_NODE_TAGS_HEIGHT : ASSET_NODE_HOVER_EXPAND_HEIGHT ) -
328- ( bottomTagsPresent ? ASSET_NODE_TAGS_HEIGHT : 0 ) ;
329-
330- // Ensure that we have room for the label, even if it makes the minimal format larger.
331- if ( nodeHeight < 38 ) {
332- nodeHeight = 38 ;
333- }
334- }
335-
336- return (
337- < MinimalAssetNodeContainer $selected = { selected } style = { { paddingTop} } >
338- < TooltipStyled
339- content = { displayName }
340- canShow = { displayName . length > 14 }
341- targetTagName = "div"
342- position = "top"
343- >
344- < MinimalAssetNodeBox
345- $selected = { selected }
346- $isMaterializable = { isMaterializable }
347- $background = { background }
348- $border = { border }
349- $inProgress = { ! ! inProgressRuns }
350- $isQueued = { ! ! queuedRuns }
351- $height = { nodeHeight }
352- >
353- { isChanged ? (
354- < MinimalNodeChangedDot changedReasons = { definition . changedReasons } assetKey = { assetKey } />
355- ) : null }
356- { isStale ? < MinimalNodeStaleDot assetKey = { assetKey } liveData = { liveData } /> : null }
357- < MinimalName style = { { fontSize : 24 } } $isMaterializable = { isMaterializable } >
358- { withMiddleTruncation ( displayName , { maxLength : 18 } ) }
359- </ MinimalName >
360- </ MinimalAssetNodeBox >
361- </ TooltipStyled >
362- </ MinimalAssetNodeContainer >
363- ) ;
364- } ;
365-
366257// Note: This fragment should only contain fields that are needed for
367258// useAssetGraphData and the Asset DAG. Some pages of Dagster UI request this
368259// fragment for every AssetNode on the instance. Add fields with care!
0 commit comments