-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[WIP][TSVB] Fix field value when switching aggregation type #101160
Conversation
💚 Build SucceededMetrics [docs]Module Count
Async chunks
To update your PR or re-run it, just comment with: cc @alexwizp |
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.
LGTM. Tested locally, works as expected.
model.stacked === STACKED_OPTIONS.PERCENT && | ||
isPercentDisabled(seriesQuantity[model.id]) | ||
) { | ||
if (seriesQuantity && model.stacked === STACKED_OPTIONS.PERCENT && seriesQuantity[model.id] < 2) { |
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.
Nit: Don't you want to move the condition seriesQuantity[model.id] < 2
to a separate function in case, if this condition will become more complex, and describe a check by function name? It occurs two times in the code.
@@ -74,7 +73,7 @@ export const TimeseriesConfig = injectI18n(function (props) { | |||
defaultMessage: 'Percent', | |||
}), | |||
value: STACKED_OPTIONS.PERCENT, | |||
disabled: isPercentDisabled(props.seriesQuantity[model.id]), | |||
disabled: props.seriesQuantity[model.id] < 2, |
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.
Nit: This is the second time this condition with magic number occures.
Summary
When switching between aggregations, the following UI issue sometimes occurs
Steps to reproduce:
Open
TSVB
and configure some pipeline aggregation. I used the following one:Switch
Pipeline Aggreagation
->Base Aggregation
e.g.Average
Actual behavior:
User see an error message on UI
Expected behavior:
Field should be empty
Also this PR addressed some parts of #63593: