diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/_datapanel.scss b/x-pack/plugins/lens/public/indexpattern_datasource/_datapanel.scss index 77d4b41a0413c1..e2341a1807bb13 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/_datapanel.scss +++ b/x-pack/plugins/lens/public/indexpattern_datasource/_datapanel.scss @@ -16,10 +16,6 @@ line-height: $euiSizeXXL; } -.lnsInnerIndexPatternDataPanel__filterWrapper { - flex-grow: 0; -} - /** * 1. Don't cut off the shadow of the field items */ @@ -39,13 +35,12 @@ top: 0; left: $euiSize; /* 1 */ right: $euiSizeXS; /* 1 */ -} -.lnsInnerIndexPatternDataPanel__filterButton { - width: 100%; - color: $euiColorPrimary; - padding-left: $euiSizeS; - padding-right: $euiSizeS; + /* EUI-TODO: Allow passing a classname to this component */ + .euiAccordion__childWrapper { + // Quick fix for making sure the shadow and focus rings are visible outside the accordion bounds + padding: $euiSizeXS; + } } .lnsInnerIndexPatternDataPanel__textField { @@ -54,7 +49,9 @@ } .lnsInnerIndexPatternDataPanel__filterType { + font-size: $euiFontSizeS; padding: $euiSizeS; + border-bottom: 1px solid $euiColorLightestShade; } .lnsInnerIndexPatternDataPanel__filterTypeInner { diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx index 98758aa441f1c0..3466f61e4371ec 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx @@ -7,26 +7,23 @@ import { uniq, indexBy } from 'lodash'; import React, { useState, useEffect, memo, useCallback } from 'react'; import { - // @ts-ignore - EuiHighlight, EuiFlexGroup, EuiFlexItem, EuiContextMenuPanel, EuiContextMenuItem, EuiContextMenuPanelProps, EuiPopover, - EuiPopoverTitle, - EuiButton, + EuiText, EuiCallOut, EuiFormControlLayout, EuiNotificationBadge, EuiSpacer, - EuiFormLabel, EuiAccordion, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { DataPublicPluginStart } from 'src/plugins/data/public'; +import { EuiFilterGroup, EuiFilterButton } from '@elastic/eui'; import { DatasourceDataPanelProps, DataType, StateSetter } from '../types'; import { ChildDragDropProvider, DragContextState } from '../drag_drop'; import { FieldItem } from './field_item'; @@ -293,7 +290,7 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({ direction="column" responsive={false} > - +
- -
+ + { + trackUiEvent('indexpattern_filters_cleared'); + clearLocalState(); + }, + }} + > + { + setLocalState({ ...localState, nameFilter: e.target.value }); + }} + aria-label={i18n.translate('xpack.lens.indexPatterns.filterByNameAriaLabel', { + defaultMessage: 'Search fields', + })} + /> + + + + + setLocalState(() => ({ ...localState, isTypeFilterOpen: false }))} button={ - - { - setLocalState((s) => ({ - ...s, - isTypeFilterOpen: !localState.isTypeFilterOpen, - })); - }} - > - {localState.typeFilter.length ? ( - <> - {fieldFiltersLabel}{' '} - - {localState.typeFilter.length} - - - ) : ( - fieldFiltersLabel - )} - - - + { + setLocalState((s) => ({ + ...s, + isTypeFilterOpen: !localState.isTypeFilterOpen, + })); + }} + > + {fieldFiltersLabel} + } > - {fieldFiltersLabel} -
- -
- { - trackUiEvent('indexpattern_filters_cleared'); - clearLocalState(); - }, - }} - > - { - setLocalState({ ...localState, nameFilter: e.target.value }); - }} - aria-label={i18n.translate('xpack.lens.indexPatterns.filterByNameAriaLabel', { - defaultMessage: 'Search fields', - })} - /> - -
+ +
+
{ @@ -445,11 +434,13 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({ initialIsOpen={true} id="availableFieldsLabel" buttonContent={ - - {i18n.translate('xpack.lens.indexPattern.availableFieldsLabel', { - defaultMessage: 'Available fields', - })} - + + + {i18n.translate('xpack.lens.indexPattern.availableFieldsLabel', { + defaultMessage: 'Available fields', + })} + + } extraAction={ @@ -556,11 +547,13 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({ initialIsOpen={false} id="emptyFieldsLabel" buttonContent={ - - {i18n.translate('xpack.lens.indexPattern.emptyFieldsLabel', { - defaultMessage: 'Empty fields', - })} - + + + {i18n.translate('xpack.lens.indexPattern.emptyFieldsLabel', { + defaultMessage: 'Empty fields', + })} + + } extraAction={ - -