Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UnifiedFieldList] Migrate field list components from Lens to UnifiedFieldList #142758

Merged
merged 79 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
7b33d6b
[UnifiedFieldList] Extract FieldsAccordion component from Lens
jughosta Oct 5, 2022
61975d8
[UnifiedFieldList] Extract FieldList component from Lens
jughosta Oct 5, 2022
8a5c3ab
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine Oct 5, 2022
21ba7b4
[UnifiedFieldList] Rename component
jughosta Oct 6, 2022
8cb999d
[UnifiedFieldList] Start extracting logic for fetching fields existen…
jughosta Oct 6, 2022
ae1b988
[UnifiedFieldList] Start extracting logic for fetching fields existen…
jughosta Oct 6, 2022
87f8c1b
[UnifiedFieldList] Fix special and runtime fields
jughosta Oct 6, 2022
8d9a819
[UnifiedFieldList] Start extracting logic for fetching fields existen…
jughosta Oct 6, 2022
ff199ea
Merge remote-tracking branch 'upstream/main' into 135678-unified-fiel…
jughosta Oct 10, 2022
b972d67
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Oct 10, 2022
a84a26a
[UnifiedFieldList] Make API stricter
jughosta Oct 10, 2022
46bd6e6
[UnifiedFieldList] Make sure that key is specified for items
jughosta Oct 10, 2022
a755602
[UnifiedFieldList] Fetch data for all active data views
jughosta Oct 10, 2022
f0ce67d
[UnifiedFieldList] Refactor some other occurances
jughosta Oct 10, 2022
6035e90
[UnifiedFieldList] Update more tests
jughosta Oct 10, 2022
2db2300
[UnifiedFieldList] Fix some checks
jughosta Oct 10, 2022
78f40c8
[UnifiedFieldList] Some progress on updating tests
jughosta Oct 11, 2022
5135262
[UnifiedFieldList] Update more tests
jughosta Oct 11, 2022
94f7cd3
[UnifiedFieldList] Skip redundant request's results
jughosta Oct 12, 2022
63775a3
[UnifiedFieldList] Update more tests
jughosta Oct 12, 2022
b5759d7
[UnifiedFieldList] Improve tests
jughosta Oct 12, 2022
4d6df85
[UnifiedFieldList] Improve tests
jughosta Oct 12, 2022
76f3138
[UnifiedFieldList] Improve tests
jughosta Oct 12, 2022
5a004d5
[UnifiedFieldList] Move grouping into a customizable hook
jughosta Oct 12, 2022
b46d63d
Merge remote-tracking branch 'upstream/main' into 135678-unified-fiel…
jughosta Oct 12, 2022
500db7e
[UnifiedFieldList] Fix after the merge
jughosta Oct 13, 2022
f798f7e
[UnifiedFieldList] Fix checks
jughosta Oct 13, 2022
b152e4a
Revert "[UnifiedFieldList] Fix after the merge"
jughosta Oct 13, 2022
bf971e5
[UnifiedFieldList] Handle merge better
jughosta Oct 13, 2022
52dfcd7
[UnifiedFieldList] Update the naming
jughosta Oct 13, 2022
26acca0
Merge remote-tracking branch 'upstream/main' into 135678-unified-fiel…
jughosta Oct 13, 2022
7d900a5
[UnifiedFieldList] Support Selected fields
jughosta Oct 13, 2022
bb9223f
[UnifiedFieldList] Update tests
jughosta Oct 13, 2022
272613b
[UnifiedFieldList] Fix grouping
jughosta Oct 13, 2022
d1ee686
[UnifiedFieldList] Update more tests
jughosta Oct 13, 2022
df3745b
Merge branch 'main' into 135678-unified-field-list-sections
jughosta Oct 14, 2022
a78ffa3
[UnifiedFieldList] Fix refetch after adding a field
jughosta Oct 14, 2022
2314f5f
[UnifiedFieldList] Load es query builder in async way
jughosta Oct 14, 2022
5a6bdd5
[UnifiedFieldList] Fix a bug in case of renaming a field
jughosta Oct 14, 2022
acf9b3e
Merge branch 'main' into 135678-unified-field-list-sections
jughosta Oct 14, 2022
f3082bf
Merge remote-tracking branch 'upstream/main' into 135678-unified-fiel…
jughosta Oct 17, 2022
30b5729
[UnifiedFieldList] Small refactoring
jughosta Oct 17, 2022
6b054ed
[UnifiedFieldList] Refactor text based view
jughosta Oct 17, 2022
1bb4dd9
[UnifiedFieldList] Better types support
jughosta Oct 17, 2022
0935693
[UnifiedFieldList] Simplify props
jughosta Oct 17, 2022
6501fc6
[UnifiedFieldList] Fix types
jughosta Oct 17, 2022
3c1c64e
Merge remote-tracking branch 'upstream/main' into 135678-unified-fiel…
jughosta Oct 17, 2022
0b1218c
[UnifiedFieldList] Async loading for FieldListGrouped code
jughosta Oct 17, 2022
7f045b6
Merge remote-tracking branch 'upstream/main' into 135678-unified-fiel…
jughosta Oct 18, 2022
92439fd
[UnifiedFieldList] Add more tests
jughosta Oct 19, 2022
f8f7109
[UnifiedFieldList] Add more tests
jughosta Oct 19, 2022
d85b7aa
[UnifiedFieldList] Add more tests
jughosta Oct 19, 2022
c21ad0d
[UnifiedFieldList] Add more tests
jughosta Oct 19, 2022
6688938
[UnifiedFieldList] Add more tests
jughosta Oct 19, 2022
2dc8527
Merge remote-tracking branch 'upstream/main' into 135678-unified-fiel…
jughosta Oct 19, 2022
2fcbe48
[UnifiedFieldList] Add more tests
jughosta Oct 20, 2022
660e83a
[UnifiedFieldList] Add more tests
jughosta Oct 20, 2022
bc18fa0
Merge remote-tracking branch 'upstream/main' into 135678-unified-fiel…
jughosta Oct 20, 2022
ea94729
Merge branch 'main' into 135678-unified-field-list-sections
jughosta Oct 24, 2022
bced293
[UnifiedFieldList] Add docs
jughosta Oct 24, 2022
530b595
Merge branch 'main' into 135678-unified-field-list-sections
jughosta Oct 24, 2022
eb49eb5
[UnifiedFieldList] Clean up
jughosta Oct 24, 2022
2b08e8d
Merge branch 'main' into 135678-unified-field-list-sections
jughosta Oct 24, 2022
8ad800f
[UnifiedFieldList] Fix onNoData callback
jughosta Oct 24, 2022
ee302c1
Merge branch 'main' into 135678-unified-field-list-sections
jughosta Oct 24, 2022
643e567
Merge branch 'main' into 135678-unified-field-list-sections
jughosta Oct 25, 2022
1acc00d
[UnifiedFieldList] Address PR comments
jughosta Oct 25, 2022
27f99f9
Merge branch 'main' into 135678-unified-field-list-sections
jughosta Oct 26, 2022
a27f79c
Merge branch 'main' into 135678-unified-field-list-sections
jughosta Oct 27, 2022
cdbceeb
[UnifiedFieldList] Address PR comments
jughosta Oct 27, 2022
0de6254
Merge remote-tracking branch 'upstream/main' into 135678-unified-fiel…
jughosta Oct 28, 2022
3b5aaea
Merge branch 'main' into 135678-unified-field-list-sections
kibanamachine Oct 28, 2022
a66e7b5
[UnifiedFieldList] Support a custom data-test-subj
jughosta Oct 28, 2022
8e1892f
[UnifiedFieldList] Fix concurrency handling logic
jughosta Oct 28, 2022
8c75546
Merge branch 'main' into 135678-unified-field-list-sections
jughosta Oct 28, 2022
59a3590
Merge branch 'main' into 135678-unified-field-list-sections
jughosta Oct 31, 2022
124c82b
[UnifiedFieldList] Remove a generic tooltip message. Lens and Discove…
jughosta Oct 31, 2022
3ec55d9
Merge branch 'main' into 135678-unified-field-list-sections
jughosta Nov 1, 2022
871d361
Merge branch 'main' into 135678-unified-field-list-sections
stratoula Nov 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion src/plugins/unified_field_list/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ This Kibana plugin contains components and services for field list UI (as in fie

## Components

* `<FieldListGrouped .../>` - renders a fields list which is split in sections (Selected, Special, Available, Empty, Meta fields). It accepts already grouped fields, please use `useGroupedFields` hook for it.

* `<FieldStats .../>` - loads and renders stats (Top values, Distribution) for a data view field.

* `<FieldVisualizeButton .../>` - renders a button to open this field in Lens.

* `<FieldPopover .../>` - a popover container component for a field.

* `<FieldPopoverHeader .../>` - this header component included a field name and common actions.
*

* `<FieldPopoverVisualize .../>` - renders Visualize action in the popover footer.

These components can be combined and customized as the following:
Expand Down Expand Up @@ -59,6 +61,47 @@ These components can be combined and customized as the following:

* `loadFieldExisting(...)` - returns the loaded existing fields (can also work with Ad-hoc data views)

## Hooks
davismcphee marked this conversation as resolved.
Show resolved Hide resolved

* `useExistingFieldsFetcher(...)` - this hook is responsible for fetching fields existence info for specified data views. It can be used higher in components tree than `useExistingFieldsReader` hook.

* `useExistingFieldsReader(...)` - you can call this hook to read fields existence info which was fetched by `useExistingFieldsFetcher` hook. Using multiple "reader" hooks from different children components is supported. So you would need only one "fetcher" and as many "reader" hooks as necessary.

* `useGroupedFields(...)` - this hook groups fields list into sections of Selected, Special, Available, Empty, Meta fields.

An example of using hooks together with `<FieldListGrouped .../>`:

```
const { refetchFieldsExistenceInfo, isProcessing } = useExistingFieldsFetcher({
dataViews,
query,
filters,
fromDate,
toDate,
...
});
const fieldsExistenceReader = useExistingFieldsReader()
const { fieldGroups } = useGroupedFields({
dataViewId: currentDataViewId,
allFields,
fieldsExistenceReader,
...
});

// and now we can render a field list
<FieldListGrouped
fieldGroups={fieldGroups}
fieldsExistenceStatus={fieldsExistenceReader.getFieldsExistenceStatus(currentDataViewId)}
fieldsExistInIndex={!!allFields.length}
renderFieldItem={renderFieldItem}
screenReaderDescriptionForSearchInputId={fieldSearchDescriptionId}
/>

// or check whether a field contains data
const { hasFieldData } = useExistingFieldsReader();
const hasData = hasFieldData(currentDataViewId, fieldName) // return a boolean
```

## Server APIs

* `/api/unified_field_list/field_stats` - returns the loaded field stats (except for Ad-hoc data views)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* 1. Don't cut off the shadow of the field items
*/

.lnsIndexPatternFieldList {
.unifiedFieldList__fieldListGrouped {
@include euiOverflowShadow;
@include euiScrollBar;
margin-left: -$euiSize; /* 1 */
Expand All @@ -11,7 +11,7 @@
overflow: auto;
}

.lnsIndexPatternFieldList__accordionContainer {
.unifiedFieldList__fieldListGrouped__container {
padding-top: $euiSizeS;
position: absolute;
top: 0;
Expand Down
Loading