-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 v2] Add FlowRunActivityBarGraph
component
#16284
base: main
Are you sure you want to change the base?
Conversation
FlowRunActivityBarGraph
component
initialValue: boolean | undefined = undefined, | ||
leaveDelay = 500, | ||
) => { | ||
const [internalValue, setInternalValue] = useState<boolean | undefined>( |
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.
q: Is there a differentiation between an undefined
state and false
state?
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.
Yes, false
will cause the tooltip never to appear, and undefined
allows recharts
to control whether or not to display the tooltip. This implementation selectively takes over the state of the tooltip so that users can mouse over the tooltip to click on links to the flow, flow run, or deployment.
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.
🚀 🚀 💹
class ResizeObserverMock { | ||
observe() {} | ||
unobserve() {} | ||
disconnect() {} | ||
} | ||
|
||
global.ResizeObserver = ResizeObserverMock; |
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.
Is there a way to move this to tests/setup?
I'm also hitting a problem this problem with dialogs and needed to copy/paste the same logic
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.
Yeah, I think if you move the entire beforeAll
hook into ui-v2/tests/setup.ts
, then all tests should get this mock by default. If specific tests need a different mock then they should be able to override it.
Summary
This PR ports the flow run activity bar graph to the v2 UI. The bucketing algorithm from the existing UI was ported with minimal modifications (mostly to remove Vue references). The component isn't used anywhere in the app yet and this PR only adds a Storybook entry for development. The fist place this component will be used is in the deployments table.
The following customizations were made to the stock
recharts
bar graph:active
state is semi-controlled to apply an asymmetric debounce to the tooltip display. The tooltip appears instantly but disappears after a 500ms delay. The delay time can be modified, but I added this to make mousing to the tooltip easier.This PR also adds
@faker-js/faker
to enable generating randomized test data when developing with Storybook.Video
Screen.Recording.2024-12-09.at.10.39.37.AM.mov