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] Refactoring to support asset health overview #21081

Merged
merged 8 commits into from
Apr 22, 2024

Conversation

bengotow
Copy link
Collaborator

@bengotow bengotow commented Apr 8, 2024

Summary & Motivation

This PR extracts the fetching and filtering portions of the asset catalog into a high-level hook so that it's easier to build UI that re-uses the asset catalog's index caching and filtering. I also exported a few pieces of the left asset sidebar and updated asset context menus to allow them to appear in more places.

How I Tested These Changes

Tested this as part of the new asset health feature in cloud

@bengotow bengotow requested review from salazarm and hellendag April 8, 2024 15:03
const [menuPosition, setMenuPosition] = React.useState<{top: number; left: number}>({
top: 0,
left: 0,
const [menuPosition, setMenuPosition] = React.useState<{
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fix for right-clicking on an asset on the far right edge of the screen - the menu needs to be anchored from the other side so it's onscreen

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooo I figured blueprint would have logic to make sure it's always visible regardless of setting, that's a bummer that it doesn't

Copy link

github-actions bot commented Apr 8, 2024

Deploy preview for dagit-storybook ready!

✅ Preview
https://dagit-storybook-i8yu3i5l1-elementl.vercel.app
https://bengotow-2024-04-asset-health-overview.components-storybook.dagster-docs.io

Built with commit 3019fcc.
This pull request is being automatically deployed with vercel-action

Copy link

github-actions bot commented Apr 8, 2024

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-ei0kl74oh-elementl.vercel.app
https://bengotow-2024-04-asset-health-overview.core-storybook.dagster-docs.io

Built with commit 3019fcc.
This pull request is being automatically deployed with vercel-action

});

const showMenu = (e: React.MouseEvent) => {
const anchor = window.innerWidth - e.pageX < 240 ? 'right' : 'left';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of hardcoding 240 here should we take it as a prop with maybe 240 as the default? We could also use useViewport to get the real width I think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm that's a good point, we probably should calculate this at runtime rather than hardcoding to 240 -- we'll need to do the first render invisibly I think to avoid it appearing left anchored and then jumping to the right anchor but I think we can do that 👀

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edit hrm, it looks like we have to render hidden, size, render visible to do this with the correct breakpoint, going to come back to it in a follow-up!

@bengotow bengotow force-pushed the bengotow-2024-04/asset-health-overview branch from ef270bc to e8ac396 Compare April 8, 2024 16:18
Copy link
Contributor

@salazarm salazarm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I think the asset graph is still defining it's own filters after this right?

@bengotow bengotow force-pushed the bengotow-2024-04/asset-health-overview branch from 306b1ed to dd385af Compare April 17, 2024 22:23
bengotow added 4 commits April 19, 2024 08:09
…2024-04/asset-health-overview

# Conflicts:
#	js_modules/dagster-ui/packages/ui-core/src/asset-graph/sidebar/StatusDot.tsx
#	js_modules/dagster-ui/packages/ui-core/src/assets/AssetsCatalogTable.tsx
#	js_modules/dagster-ui/packages/ui-core/src/assets/asset-checks/AssetCheckStatusTag.tsx
#	js_modules/dagster-ui/packages/ui-core/src/insights/InsightsLineChart.tsx
#	js_modules/dagster-ui/packages/ui-core/src/overview/OverviewTabs.tsx
#	js_modules/dagster-ui/packages/ui-core/src/overview/OverviewTimelineRoot.tsx
@bengotow bengotow merged commit 530fae2 into master Apr 22, 2024
3 checks passed
@bengotow bengotow deleted the bengotow-2024-04/asset-health-overview branch April 22, 2024 20:51
nikomancy pushed a commit to nikomancy/dagster that referenced this pull request May 1, 2024
## Summary & Motivation

This PR extracts the fetching and filtering portions of the asset
catalog into a high-level hook so that it's easier to build UI that
re-uses the asset catalog's index caching and filtering. I also exported
a few pieces of the left asset sidebar and updated asset context menus
to allow them to appear in more places.

## How I Tested These Changes

Tested this as part of the new asset health feature in cloud

---------

Co-authored-by: bengotow <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants