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

adding loading spinner for watch visualization #35798

Merged
merged 2 commits into from
Apr 30, 2019

Conversation

bmcconaghy
Copy link
Contributor

This adds a loading spinner while the visualization loads. You can comment out the setIsLoading(false); line to see what it looks like.

@bmcconaghy bmcconaghy added Feature:Watcher Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels Apr 30, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui

Copy link
Contributor

@alisonelizabeth alisonelizabeth left a comment

Choose a reason for hiding this comment

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

@bmcconaghy thanks for adding this! Left a couple comments, the one might be obsolete if the suggestion I mentioned around use_request works.

Also, nit, but I noticed EUI has a loading component for charts, EuiLoadingChart: https://elastic.github.io/eui/#/display/loading. What do you think about swapping the spinner out with this?

timezone: getTimezone(),
});
setIsLoading(true);
const { visualizeData } = (await getWatchVisualizationData(watch, visualizeOptions)) as any;
Copy link
Contributor

Choose a reason for hiding this comment

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

could you update getWatchVisualizationData in api.ts to use the use_request helper CJ added? I think that returns an isLoading prop.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got an error when I tried to do this. Punting for now.

const WatchVisualizationUi = () => {
const { watch } = useContext(WatchContext);
const [watchVisualizationData, setWatchVisualizationData] = useState<any>({});

const [isLoading, setIsLoading] = useState(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the initial state be true? Otherwise, I noticed the callout message flashes briefly before the spinner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah makes sense, fixed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@bmcconaghy
Copy link
Contributor Author

@alisonelizabeth mind taking another look?

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@bmcconaghy bmcconaghy merged commit 02a0a38 into elastic:watcher-port Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Watcher Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants