-
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
[Discover] [Embeddable] Fix Discover session embeddable drilldown #211678
Merged
davismcphee
merged 10 commits into
elastic:main
from
davismcphee:fix-discover-drilldown
Feb 21, 2025
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f521e28
Fixing Discover session embeddable drilldown
davismcphee 626b3c2
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine d7c2a3f
Fix types
davismcphee 9813f29
Fix issue with deserialization
davismcphee 93d625f
Drop filter trigger for drilldowns
davismcphee 578c913
Add Discover session URL drilldown test
davismcphee e73035d
Fix test
davismcphee 850c851
Merge branch 'main' into fix-discover-drilldown
davismcphee 962abe6
Merge branch 'main' into fix-discover-drilldown
davismcphee aacae82
Merge branch 'main' into fix-discover-drilldown
kertal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,13 @@ export const getSearchEmbeddableFactory = ({ | |
/** Build API */ | ||
const titleManager = initializeTitleManager(initialState); | ||
const timeRange = initializeTimeRange(initialState); | ||
const dynamicActionsApi = | ||
discoverServices.embeddableEnhanced?.initializeReactEmbeddableDynamicActions( | ||
uuid, | ||
() => titleManager.api.title$.getValue(), | ||
initialState | ||
); | ||
const maybeStopDynamicActions = dynamicActionsApi?.startDynamicActions(); | ||
const searchEmbeddable = await initializeSearchEmbeddableApi(initialState, { | ||
discoverServices, | ||
}); | ||
|
@@ -126,6 +133,7 @@ export const getSearchEmbeddableFactory = ({ | |
savedSearch: searchEmbeddable.api.savedSearch$.getValue(), | ||
serializeTitles: titleManager.serialize, | ||
serializeTimeRange: timeRange.serialize, | ||
serializeDynamicActions: dynamicActionsApi?.serializeDynamicActions, | ||
savedObjectId, | ||
}); | ||
|
||
|
@@ -134,6 +142,7 @@ export const getSearchEmbeddableFactory = ({ | |
...titleManager.api, | ||
...searchEmbeddable.api, | ||
...timeRange.api, | ||
...dynamicActionsApi?.dynamicActionsApi, | ||
...initializeEditApi({ | ||
uuid, | ||
parentApi, | ||
|
@@ -178,10 +187,18 @@ export const getSearchEmbeddableFactory = ({ | |
getSerializedStateByReference: (newId: string) => serialize(newId), | ||
serializeState: () => serialize(savedObjectId$.getValue()), | ||
getInspectorAdapters: () => searchEmbeddable.stateManager.inspectorAdapters.getValue(), | ||
supportedTriggers: () => { | ||
// No triggers are supported, but this is still required to pass the drilldown | ||
// compatibilty check and ensure top-level drilldowns (e.g. URL) work as expected | ||
return []; | ||
}, | ||
Comment on lines
+190
to
+194
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another candidate that would benefit from #202054 🙈 |
||
}, | ||
{ | ||
...titleManager.comparators, | ||
...timeRange.comparators, | ||
...(dynamicActionsApi?.dynamicActionsComparator ?? { | ||
enhancements: getUnchangingComparator(), | ||
}), | ||
...searchEmbeddable.comparators, | ||
rawSavedObjectAttributes: getUnchangingComparator(), | ||
savedObjectId: [savedObjectId$, (value) => savedObjectId$.next(value)], | ||
|
@@ -206,6 +223,7 @@ export const getSearchEmbeddableFactory = ({ | |
return () => { | ||
searchEmbeddable.cleanup(); | ||
unsubscribeFromFetch(); | ||
maybeStopDynamicActions?.stopDynamicActions(); | ||
}; | ||
}, []); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.