Skip to content

Commit

Permalink
ui: fix alignment on custom scale
Browse files Browse the repository at this point in the history
The check for valid options with the
removal of some options on cockroachdb#83229 didn't took
the custom values into consideration.
This commit add the option back, allowing the alignment
on custom values.

Release note (bug fix): Custom time period selection is now aligning
between Metrics and SQL Activity page.
  • Loading branch information
maryliag committed Jul 8, 2022
1 parent 672f201 commit 10b3672
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ export const getValidOption = (
currentScale: TimeScale,
options: TimeScaleOptions,
): TimeScale => {
if (currentScale.key === "Custom") {
return currentScale;
}
if (!(currentScale.key in options)) {
const firstValidKey = Object.keys(options)[0];
return {
Expand Down

0 comments on commit 10b3672

Please sign in to comment.