-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Add new fields ingested in background with valid mappings #172329
[UnifiedFieldList] Add new fields ingested in background with valid mappings #172329
Conversation
packages/kbn-unified-field-list/src/hooks/use_grouped_fields.ts
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
@elasticmachine merge upstream |
…s' into unified-field-list-add-new-fields
/ci |
@elasticmachine merge upstream |
/ci |
@@ -245,6 +230,27 @@ export const UnifiedFieldListSidebarComponent: React.FC<UnifiedFieldListSidebarP | |||
onOverrideFieldGroupDetails: stateService.creationOptions.onOverrideFieldGroupDetails, | |||
}); | |||
|
|||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note, this code was just moved to have access to the new modified list of allFields
…/kibana into unified-field-list-add-new-fields
/ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed and tested the PR again today. I found some issues and addressed them via kertal#16 @davismcphee Would be great if you could review it too. |
…s-updated [Discover] Small fixes for types and memo deps. Add tests.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good, and it worked great in testing in both Discover and Lens! I even tried to fool it a bit by deleting and recreating the index, adding different fields, etc., but the behaviour seemed good in each case (old fields after deleting the index got moved to empty fields, etc.).
It's a valuable enhancement with or without caching, but especially useful considering the upcoming changes. I left a couple of minor code suggestions, but nothing I'd consider blocking. Thanks and LGTM!
packages/kbn-unified-field-list/src/hooks/use_existing_fields.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/datasources/form_based/datapanel.tsx
Outdated
Show resolved
Hide resolved
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @kertal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another quick review after the latest round of changes, and everything is still working as intended. LGTM, thanks!
Code looks good, everything seems to be working well. Nice work! |
…appings (elastic#172329) Improves UnifiedFieldList by adding a newly ingested field to the list with the right type. On top of that, it triggers a refresh of the selected DataView fields, so the new field be available by consumers of the DataView. Co-authored-by: Julia Rechkunova <[email protected]>
…appings (elastic#172329) Improves UnifiedFieldList by adding a newly ingested field to the list with the right type. On top of that, it triggers a refresh of the selected DataView fields, so the new field be available by consumers of the DataView. Co-authored-by: Julia Rechkunova <[email protected]>
Summary
This PR improves UnifiedFieldList adding a newly ingested field to be added to the list with already the right type in Discover. On top of that, it triggers a refresh of the selected DataView fields, so the new field will be available by consumers of the DataView, no reload is necessary, and also when we introduce caching, the cache will be refreshed. One more benefit, when switching data views, the field refreshing was removed. It's no longer necessary, making data view switching snappy, while the UnifiedFieldList makes sure, new fields are showing up, and the data view field cache is refreshed behind the scenes, if necessary.
How to test
In Console ingest a new record
Go to Discover and create a DataView for
field-refresh-test
Open Kibana / Console in a second tab/window and ingest
Refresh the search in the first window. Then you should be able to see the new field with the correct mapping in the field list.
Before this change the new field was available, but unmapped. It also works in Lens, when new fields caps are requested due to change of query / filters / time range
Resolves #172342
Resolves #169360
Resolves #170874
Limitation: A type change won't be detected (this could be a follow up task)
Checklist