Skip to content

Commit

Permalink
[Discover] Integrate unified field list filters into Discover (elasti…
Browse files Browse the repository at this point in the history
…c#148547)

Closes elastic#145081
Part 1 of this integration was done in
elastic#147255

<img width="640" alt="Screenshot 2023-01-16 at 16 58 59"
src="https://user-images.githubusercontent.com/1415710/212720438-8f37eb69-635a-4611-89bb-34b095d79b8c.png">


## Summary

This PR integrates the unified field list filters and search into
Discover.
- [x] Integrate into Discover
- [x] Clean up deprecated code ("searchable"/"aggregatable" filters were
removed too)
- [x] Refactor field icons, labels, desc to use the unified ones
- [x] Field list in SQL view needs refactoring to use the received field
types rather than data view field types
- [x] Update tests

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Stratoula Kalafateli <[email protected]>
  • Loading branch information
3 people authored and kqualters-elastic committed Feb 6, 2023
1 parent 765d290 commit f7a7663
Show file tree
Hide file tree
Showing 52 changed files with 591 additions and 1,558 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ discover-app {
overflow: hidden;
}

.dscPageBody__sidebar {
position: relative;
}

.dscPageContent__wrapper {
padding: $euiSizeS $euiSizeS $euiSizeS 0;
overflow: hidden; // Ensures horizontal scroll of table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export function DiscoverLayout({
history={history}
/>
<EuiFlexGroup className="dscPageBody__contents" gutterSize="s">
<EuiFlexItem grow={false} className="dscPageBody__sidebar">
<EuiFlexItem grow={false}>
<SidebarMemoized
documents$={stateContainer.dataState.data$.documents$}
onAddField={onAddColumn}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ import {
import { i18n } from '@kbn/i18n';
import { UiCounterMetricType } from '@kbn/analytics';
import classNames from 'classnames';
import { FieldButton, FieldIcon } from '@kbn/react-field';
import { FieldButton } from '@kbn/react-field';
import type { DataViewField, DataView } from '@kbn/data-views-plugin/public';
import {
FieldIcon,
FieldPopover,
FieldPopoverHeader,
FieldPopoverHeaderProps,
FieldPopoverVisualize,
getFieldIconProps,
wrapFieldNameOnDot,
} from '@kbn/unified-field-list-plugin/public';
import { DiscoverFieldStats } from './discover_field_stats';
import { getTypeForFieldIcon } from '../../../../utils/get_type_for_field_icon';
import { DiscoverFieldDetails } from './deprecated_stats/discover_field_details';
import { getFieldTypeName } from '../../../../utils/get_field_type_name';
import { useDiscoverServices } from '../../../../hooks/use_discover_services';
import { SHOW_LEGACY_FIELD_TOP_VALUES, PLUGIN_ID } from '../../../../../common';
import { getUiActions } from '../../../../kibana_services';
Expand All @@ -59,10 +59,7 @@ const FieldInfoIcon: React.FC = memo(() => (
));

const DiscoverFieldTypeIcon: React.FC<{ field: DataViewField }> = memo(({ field }) => {
const typeForIcon = getTypeForFieldIcon(field);
return (
<FieldIcon type={typeForIcon} label={getFieldTypeName(typeForIcon)} scripted={field.scripted} />
);
return <FieldIcon {...getFieldIconProps(field)} />;
});

const FieldName: React.FC<{ field: DataViewField; highlight?: string }> = memo(
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit f7a7663

Please sign in to comment.