Skip to content

Commit

Permalink
🐛 Fix tabs visibility on formula fullscreen (elastic#113268)
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 authored Sep 29, 2021
1 parent 682a1c1 commit 04497da
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div id={columnId}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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(
<IndexPatternDimensionEditorComponent
{...defaultProps}
state={stateWithFormulaColumn}
supportStaticValue
isFullscreen
/>
);

expect(wrapper.find('[data-test-subj="lens-dimensionTabs"]').exists()).toBeFalsy();
});
});

0 comments on commit 04497da

Please sign in to comment.