-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dagit] Show assets on run pages in more scenarios (#7874)
* [dagit] Do not display the dagster/partition_set tag on asset group runs * Update to reflect Claire’s new changes Co-authored-by: bengotow <bgotow@elementl.com>
- Loading branch information
Showing
11 changed files
with
242 additions
and
101 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
js_modules/dagit/packages/core/src/instance/types/RunReExecutionQuery.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
105 changes: 105 additions & 0 deletions
105
js_modules/dagit/packages/core/src/runs/RunAssetKeyTags.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import { | ||
Box, | ||
Button, | ||
ButtonLink, | ||
Colors, | ||
Dialog, | ||
DialogFooter, | ||
Icon, | ||
Table, | ||
Tag, | ||
} from '@dagster-io/ui'; | ||
import * as React from 'react'; | ||
import {Link} from 'react-router-dom'; | ||
|
||
import {displayNameForAssetKey, tokenForAssetKey} from '../asset-graph/Utils'; | ||
import {AssetKey} from '../assets/types'; | ||
|
||
export const RunAssetKeyTags: React.FC<{ | ||
assetKeys: AssetKey[] | null; | ||
clickableTags?: boolean; | ||
}> = React.memo(({assetKeys, clickableTags}) => { | ||
const [showMore, setShowMore] = React.useState(false); | ||
|
||
if (!assetKeys || !assetKeys.length) { | ||
return null; | ||
} | ||
|
||
const displayed = assetKeys.slice(0, 3); | ||
const hidden = assetKeys.length - displayed.length; | ||
|
||
if (clickableTags) { | ||
return ( | ||
<> | ||
{displayed.map((assetKey) => ( | ||
<Link | ||
to={`/instance/assets/${assetKey.path.map(encodeURIComponent).join('/')}`} | ||
key={tokenForAssetKey(assetKey)} | ||
> | ||
<Tag intent="none" interactive icon="asset"> | ||
{displayNameForAssetKey(assetKey)} | ||
</Tag> | ||
</Link> | ||
))} | ||
{hidden > 0 && ( | ||
<ButtonLink onClick={() => setShowMore(true)}> | ||
<Tag intent="none" icon="asset"> | ||
{` + ${hidden} more`} | ||
</Tag> | ||
</ButtonLink> | ||
)} | ||
<Dialog | ||
title="Assets in Run" | ||
onClose={() => setShowMore(false)} | ||
style={{minWidth: '400px', maxWidth: '80vw', maxHeight: '70vh'}} | ||
isOpen={showMore} | ||
> | ||
{showMore ? ( | ||
<Box | ||
padding={{bottom: 12}} | ||
border={{side: 'bottom', color: Colors.KeylineGray, width: 1}} | ||
style={{overflowY: 'auto'}} | ||
background={Colors.White} | ||
> | ||
<Table> | ||
<thead> | ||
<tr> | ||
<th>Asset Key</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{assetKeys.map((assetKey) => ( | ||
<tr key={tokenForAssetKey(assetKey)}> | ||
<td> | ||
<Link | ||
to={`/instance/assets/${assetKey.path.map(encodeURIComponent).join('/')}`} | ||
key={tokenForAssetKey(assetKey)} | ||
> | ||
{displayNameForAssetKey(assetKey)} | ||
</Link> | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</Table> | ||
</Box> | ||
) : null} | ||
<DialogFooter> | ||
<Button intent="primary" autoFocus={true} onClick={() => setShowMore(false)}> | ||
OK | ||
</Button> | ||
</DialogFooter> | ||
</Dialog> | ||
</> | ||
); | ||
} | ||
|
||
return ( | ||
<Box flex={{direction: 'row', gap: 8, wrap: 'wrap', alignItems: 'center'}}> | ||
<Icon color={Colors.Gray400} name="asset" size={16} /> | ||
{`${displayed.map(displayNameForAssetKey).join(', ')}${ | ||
hidden > 0 ? ` + ${hidden} more` : '' | ||
}`} | ||
</Box> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
js_modules/dagit/packages/core/src/runs/RunStepKeysAssetList.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
cbd7da9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
dagit-storybook – ./js_modules/dagit/packages/ui
dagit-storybook-elementl.vercel.app
dagit-storybook.vercel.app
dagit-storybook-git-master-elementl.vercel.app