-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(insights): Refactor chart widgets to pass down prop overrides #89455
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
feat(insights): Refactor chart widgets to pass down prop overrides #89455
Conversation
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.
See how it will be used in the Releases Drawer
); | ||
|
||
return ( | ||
<InsightsLineChartWidget | ||
id="httpDomainSummaryResponseCodesWidget" | ||
{...props} | ||
id="httpDomainSummaryResponseCodesChartWidget" |
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.
Gj cursor on autofixing this I guess
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.
Makes sense, but I think that sub
prefix is a little strange.
IMO, for hooks like useDiscoverSeries
, calling the prop pageFilters
is pretty natural, those hooks are generic, and they probably should accept pageFilters
as a prop. Same for InsightsTimeSeriesWidget
. That props is passed to BaseChart
anyway, so it makes sense to override it with something called just pageFilters
. I'm less sure about InsightsTimeSeriesWidget
, but even there it seems okay to omit the prefix
// TODO(billy): This should be required when all chart widgets are converted | ||
/** | ||
* Unique ID for the widget | ||
*/ |
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.
That makes sense, but if that's the case, TimeSeriesWidgetVisualization
should use Partial<LoadableChartWidgetProps>
. ID shouldn't be required there, just for the Insights chart
Inside of the Releases Drawers, we are only viewing a smaller slice of time than the main PageFilters. The chart widgets and their hooks need to support a pageFilters override. I think env/projects should be the same, but I think it will be more consistent to pass around the full pageFilters object. `showReleaseAs` is also needed since we currently show lines inside of the drawer, and bubbles outside of it.
b3d7b19
to
770da7b
Compare
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.
Missed this bc i had inclusion list with only *.tsx
:/
❌ 13 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Inside of the Releases Drawers, we are only viewing a smaller slice of
time than the main PageFilters. The chart widgets and their hooks need
to support a pageFilters override. I think env/projects should be the
same, but I think it will be more consistent to pass around the full
pageFilters object.
showReleaseAs
is also needed since we currentlyshow lines inside of the drawer, and bubbles outside of it.
Need as part of #88560