🐛 Fix tabs visibility on formula fullscreen (#113268)

This commit is contained in:
Marco Liberati 2021-09-29 14:47:36 +02:00 committed by GitHub
parent 682a1c1126
commit 04497daed3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 2 deletions

View file

@ -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}>

View file

@ -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(
<IndexPatternDimensionEditorComponent
{...defaultProps}
state={stateWithFormulaColumn}
supportStaticValue
isFullscreen
/>
);
expect(wrapper.find('[data-test-subj="lens-dimensionTabs"]').exists()).toBeFalsy();
});
});