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

[Discover] Migrate expandedDoc to internalStateContainer #153369

Merged
merged 3 commits into from
Mar 22, 2023

Conversation

kertal
Copy link
Member

@kertal kertal commented Mar 21, 2023

Summary

This PR migrates the stateful expandedDoc property (It determines which ES document should be displayed in the flyout showing he doc viewer, and needs to be closed when e.g. the inspector is displayed) to the internalStateContainer, one less useState based prop left that needs to be passed down the component tree.

Additionally AppState is renamed to DiscoverAppState, DataStateContainer to DiscoverDataStateContainer and InternalStateContainer to DiscoverInternalStateContainer for better consistency of naming and easier autocompletion when developing

Checklist

@kertal kertal self-assigned this Mar 21, 2023
@kertal kertal added the Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. label Mar 21, 2023
@kertal kertal added Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes labels Mar 21, 2023
@@ -37,7 +36,6 @@ export function DiscoverMainApp(props: DiscoverMainProps) {
const services = useDiscoverServices();
const { chrome, docLinks, data, spaces, history } = services;
const usedHistory = useHistory();
const [expandedDoc, setExpandedDoc] = useState<DataTableRecord | undefined>(undefined);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the main change, removal of expandedDoc high up in the component tree

To DiscoverAppState / DiscoverDataStateContainer
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #31 / detection engine api security and spaces enabled - rule execution logic Threat match type rules terms and match should have the same alerts with pagination

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 395.6KB 395.6KB -15.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 433 436 +3

Total ESLint disabled count

id before after diff
securitySolution 513 516 +3

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @kertal

@kertal kertal marked this pull request as ready for review March 21, 2023 16:20
@kertal kertal requested a review from a team as a code owner March 21, 2023 16:20
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great! Thanks, Matthias! 👍

@kertal kertal merged commit fba936c into elastic:main Mar 22, 2023
@kibanamachine kibanamachine added v8.8.0 backport:skip This commit does not require backporting labels Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants