-
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
[Enterprise Search] Convert IndexingStatus to use logic for fetching #84710
[Enterprise Search] Convert IndexingStatus to use logic for fetching #84710
Conversation
onComplete is not optional so these if blocks can be consolidated
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.
Mostly super minor comments, feel free to push back on anything that's too annoying or might take too long to do
Also great catch on the recent conditional refactor! ✨
...lugins/enterprise_search/public/applications/shared/indexing_status/indexing_status_logic.ts
Show resolved
Hide resolved
...lugins/enterprise_search/public/applications/shared/indexing_status/indexing_status_logic.ts
Outdated
Show resolved
Hide resolved
...lugins/enterprise_search/public/applications/shared/indexing_status/indexing_status_logic.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/public/applications/shared/indexing_status/indexing_status.tsx
Outdated
Show resolved
Hide resolved
expect(wrapper.find(EuiPanel)).toHaveLength(1); | ||
expect(wrapper.find(IndexingStatusContent)).toHaveLength(1); | ||
expect(fetchIndexingStatus).toHaveBeenCalled(); |
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.
Love how much easier this is to test w/o the render prop!! 🎉
...s/enterprise_search/public/applications/shared/indexing_status/indexing_status_logic.test.ts
Outdated
Show resolved
Hide resolved
...s/enterprise_search/public/applications/shared/indexing_status/indexing_status_logic.test.ts
Outdated
Show resolved
Hide resolved
...s/enterprise_search/public/applications/shared/indexing_status/indexing_status_logic.test.ts
Show resolved
Hide resolved
Co-authored-by: Constance <[email protected]>
Co-authored-by: Constance <[email protected]>
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.
Refactor looks great!! Thanks so much for always improving our code Scotty! ✨
In ent-search, we use Rails helpers to generate paths. These were in the form of routes.whateverPath(). We passed these method to the IndexingStatus component to generate the app-specific rotues in the shared component. In Kibana, we will not have these generators and should instead pass the path strings directly
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.
New commit LGTM 👍
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
…lastic#84710) * Add IndexingStatusLogic * Replace IndexingStatusFetcher with logic * Refactor out unnecessary conditional onComplete is not optional so these if blocks can be consolidated * Misc styling - destructuring and typing Co-authored-by: Constance <[email protected]> * Misc styling - imports Co-authored-by: Constance <[email protected]> * Remove div * Refactor test * Replace method with string for statusPath In ent-search, we use Rails helpers to generate paths. These were in the form of routes.whateverPath(). We passed these method to the IndexingStatus component to generate the app-specific rotues in the shared component. In Kibana, we will not have these generators and should instead pass the path strings directly Co-authored-by: Constance <[email protected]>
…84710) (#84825) * Add IndexingStatusLogic * Replace IndexingStatusFetcher with logic * Refactor out unnecessary conditional onComplete is not optional so these if blocks can be consolidated * Misc styling - destructuring and typing Co-authored-by: Constance <[email protected]> * Misc styling - imports Co-authored-by: Constance <[email protected]> * Remove div * Refactor test * Replace method with string for statusPath In ent-search, we use Rails helpers to generate paths. These were in the form of routes.whateverPath(). We passed these method to the IndexingStatus component to generate the app-specific rotues in the shared component. In Kibana, we will not have these generators and should instead pass the path strings directly Co-authored-by: Constance <[email protected]> Co-authored-by: Constance <[email protected]>
Summary
This PR converts the
IndexingStatus
component to use a newly added logic file instead of the legacyIndexingStatusFetcher
component. Because this is the egg and we have no chicken yet, I have pushed a POC of this toent-search
in case QA is desired before merging.Checklist