From aa1b6450e0d02f32ecbcc60c3ec2f22905462a72 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Mon, 26 Jul 2021 10:39:36 +0300 Subject: [PATCH] Disable orientation if ticklabels are off --- .../public/xy_visualization/axis_settings_popover.test.tsx | 7 +++++++ .../lens/public/xy_visualization/axis_settings_popover.tsx | 1 + 2 files changed, 8 insertions(+) diff --git a/x-pack/plugins/lens/public/xy_visualization/axis_settings_popover.test.tsx b/x-pack/plugins/lens/public/xy_visualization/axis_settings_popover.test.tsx index 11dc6efad01e0..7609c534711d0 100644 --- a/x-pack/plugins/lens/public/xy_visualization/axis_settings_popover.test.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/axis_settings_popover.test.tsx @@ -99,6 +99,13 @@ describe('Axes Settings', () => { expect(props.setOrientation).toHaveBeenCalled(); }); + it('should disable the orientation group if the tickLabels are set to not visible', () => { + const component = shallow(); + expect( + component.find('[data-test-subj="lnsXY_axisOrientation_groups"]').prop('isDisabled') + ).toEqual(true); + }); + it('hides the endzone visibility flag if no setter is passed in', () => { const component = shallow(); expect(component.find('[data-test-subj="lnsshowEndzones"]').length).toBe(0); diff --git a/x-pack/plugins/lens/public/xy_visualization/axis_settings_popover.tsx b/x-pack/plugins/lens/public/xy_visualization/axis_settings_popover.tsx index a2d65e92ebcdc..3c1cecc3c5a44 100644 --- a/x-pack/plugins/lens/public/xy_visualization/axis_settings_popover.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/axis_settings_popover.tsx @@ -328,6 +328,7 @@ export const AxisSettingsPopover: React.FunctionComponent value === orientation)!.id}