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

add default value for percentileValue #95

Merged
merged 5 commits into from
Jul 25, 2024

Conversation

MGJamJam
Copy link
Contributor

@MGJamJam MGJamJam commented Jul 24, 2024

Work:

  • adds default percentileValue when percentile is selected so that first query that gets triggered when percentile metric is selected does not fail
  • deletes percentileValue once percentile is deselected to not pollute the dashboard.json file.

Comment on lines 78 to 82
} else {
if (percentileValue != null) {
setPercentileValue(undefined);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

why not simple else , why is there another if ?

Suggested change
} else {
if (percentileValue != null) {
setPercentileValue(undefined);
}
}
} else {
setPercentileValue(undefined);
}

Copy link
Contributor Author

@MGJamJam MGJamJam Jul 25, 2024

Choose a reason for hiding this comment

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

My thinking was that if the percentileValue is already null we do not need to update the state because it already would be null/undefined. 🤔 But I guess it would make the code more readable to delete the if as it is really not necessary.

@MGJamJam MGJamJam merged commit 18b3cc1 into main Jul 25, 2024
3 checks passed
@MGJamJam MGJamJam deleted the feat/add-default-percentile-value branch July 25, 2024 14:01
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