From 217899a787f1076806fa977d29491058da0caf5f Mon Sep 17 00:00:00 2001 From: tjuranek Date: Wed, 29 Mar 2023 08:16:09 -0600 Subject: [PATCH] fix(dashboard): hide y axis settings for status timeline component --- .../sections/axisSettingSection/index.tsx | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/packages/dashboard/src/components/sidePanel/sections/axisSettingSection/index.tsx b/packages/dashboard/src/components/sidePanel/sections/axisSettingSection/index.tsx index 3fa17f453..4726a67a0 100644 --- a/packages/dashboard/src/components/sidePanel/sections/axisSettingSection/index.tsx +++ b/packages/dashboard/src/components/sidePanel/sections/axisSettingSection/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { ExpandableSection, Input, SpaceBetween, Toggle } from '@cloudscape-design/components'; import ExpandableSectionHeader from '../../shared/expandableSectionHeader'; import { useWidgetLense } from '../../utils/useWidgetLense'; @@ -59,6 +59,9 @@ const AxisSetting: FC = (widget) => { }); }; + // The widget does not support the Y axis + const shouldHideYAxis = widget.type === 'status-timeline'; + return ( {defaultMessages.header}} @@ -69,24 +72,29 @@ const AxisSetting: FC = (widget) => { {defaultMessages.toggleXLabel} - - {defaultMessages.toggleYLabel} - + + {!shouldHideYAxis && ( + + {defaultMessages.toggleYLabel} + + )} -
- -
- + {!shouldHideYAxis && ( +
+ +
+ +
-
+ )} );