From 04497daed31358f03eae497fde0a0063265c977e Mon Sep 17 00:00:00 2001 From: Marco Liberati Date: Wed, 29 Sep 2021 14:47:36 +0200 Subject: [PATCH] :bug: Fix tabs visibility on formula fullscreen (#113268) --- .../dimension_panel/dimension_editor.tsx | 2 +- .../dimension_panel/dimension_panel.test.tsx | 26 ++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx index d25e6754fe03f..333e76f5a4f57 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx @@ -680,7 +680,7 @@ export function DimensionEditor(props: DimensionEditorProps) { const hasFormula = !isFullscreen && operationSupportMatrix.operationWithoutField.has(formulaOperationName); - const hasTabs = hasFormula || supportStaticValue; + const hasTabs = !isFullscreen && (hasFormula || supportStaticValue); return (
diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx index 656174fcb8708..6df4360aeac4c 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx @@ -2263,7 +2263,7 @@ describe('IndexPatternDimensionEditorPanel', () => { ).toBeTruthy(); }); - it('should now show the static_value tab when not supported', () => { + it('should not show the static_value tab when not supported', () => { const stateWithFormulaColumn: IndexPatternPrivateState = getStateWithColumns({ col1: { label: 'Formula', @@ -2337,4 +2337,28 @@ describe('IndexPatternDimensionEditorPanel', () => { wrapper.find('[data-test-subj="lens-dimensionTabs-static_value"]').first().prop('isSelected') ).toBeTruthy(); }); + + it('should not show any tab when formula is in full screen mode', () => { + const stateWithFormulaColumn: IndexPatternPrivateState = getStateWithColumns({ + col1: { + label: 'Formula', + dataType: 'number', + isBucketed: false, + operationType: 'formula', + references: ['ref1'], + params: {}, + }, + }); + + wrapper = mount( + + ); + + expect(wrapper.find('[data-test-subj="lens-dimensionTabs"]').exists()).toBeFalsy(); + }); });