-
Notifications
You must be signed in to change notification settings - Fork 5
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(LabelsView): update main time series when a "group by" label is selected #341
Conversation
This reverts commit 46b9147.
# Conflicts: # src/pages/ProfilesExplorerView/components/SceneExploreServiceLabels/components/SceneGroupByLabels/components/SceneLabelValuesGrid/SceneLabelValuesGrid.tsx
# Conflicts: # src/pages/ProfilesExplorerView/domain/actions/SelectAction.tsx
# Conflicts: # docker-compose.e2e.yaml # docker-compose.local.yaml # docker-compose.remote.yaml # docker-compose.yaml # package.json # src/pages/ProfilesExplorerView/components/SceneLabelValuesTimeseries/SceneLabelValuesTimeseries.tsx # src/plugin.json # src/shared/infrastructure/tracking/faro/__tests__/faro.spec.ts # yarn.lock
# Conflicts: # package.json # yarn.lock
…rrentOption" method
@@ -66,6 +74,32 @@ export class GroupByVariable extends QueryVariable { | |||
this.changeValueTo(newValue); | |||
}; | |||
|
|||
findCurrentOption(): OptionWithIndex { |
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.
Added this new method to DRY in SceneGroupByLabels
and SceneMainServiceTimeseries
.map(({ value, text }, index) => { | ||
return { | ||
// TODO: check if there's a better way | ||
value: JSON.stringify({ ...value, index }), |
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.
Adding the index (after sorting) is the reason behind this change
LabelsDataSource.MAX_TIMESERIES_LABEL_VALUES | ||
).state; | ||
|
||
const queryRunner = body.state.$data?.state.$data as SceneQueryRunner; |
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.
Do we need to drill down to children props? Could we have the runner at SceneLabelValuesTimeseries/SceneLabelValuesTimeseries
. The viz should to pull it as the closest anyway.
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's a good idea. We'd also have to change some code in SceneComparePanel
but it will simplify the access to the query runner. Let's do this in a future refactoring PR.
✨ Description
Related issue(s): resolves #197, is blocked by #219
This PR makes the main time series in the Labels view responsive to "group by" changes, for example:
And after interacting with the "Include"/"Exclude" buttons (including 3 out of the 52 nodes available):
📖 Summary of the changes
General overview:
SceneExploreServiceLabels
SceneMainServiceTimeseries
reacts to thegroupBy
variable changes by updating the item stored inSceneLabelValuesTimeseries
's stateSceneLabelValuesTimeseries
run new queries whenever the item'squeryRunnerParams.groupBy
value changesSee diff tab for specific comments.
🧪 How to test?