From 10b367253721cff70fbc7c2303b8a6b99ee828b1 Mon Sep 17 00:00:00 2001 From: Marylia Gutierrez Date: Fri, 8 Jul 2022 14:46:34 -0400 Subject: [PATCH] ui: fix alignment on custom scale The check for valid options with the removal of some options on #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. --- .../cluster-ui/src/timeScaleDropdown/timeScaleDropdown.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.tsx index a5c0adb74b3b..8db97d5f8c38 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.tsx @@ -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 {