Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Fix loading state on detector list #134

Merged

Conversation

ohltyler
Copy link
Contributor

Issue #, if available:

Description of changes:

This PR fixes the loading state on the detector list page. Before, if user refreshed or changed any filters (search bar, detector state, detector index, sorted column, sorted direction), the stale data would be displayed until the new data was retrieved and rendered. This fixes that problem by displaying an intermediate loading state while new data is being retrieved to display.

This PR also increases the performance of the page by only retrieving the detectors to display once during a page state change (logic now encapsulated in useEffect()).

After:

Screen Shot 2020-05-13 at 11 53 00 AM

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ohltyler ohltyler requested review from kaituo and ylwu-amzn May 13, 2020 20:48
Copy link
Contributor

@ylwu-amzn ylwu-amzn left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the change!

@ohltyler ohltyler merged commit 83c7391 into opendistro-for-elasticsearch:master May 15, 2020
@ohltyler ohltyler deleted the fixLoadingState branch May 18, 2020 18:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants