[SharedUX] Add loading indicator to NoDataPage#132272
Merged
majagrubic merged 6 commits intoelastic:mainfrom May 18, 2022
Merged
[SharedUX] Add loading indicator to NoDataPage#132272majagrubic merged 6 commits intoelastic:mainfrom
majagrubic merged 6 commits intoelastic:mainfrom
Conversation
sebelga
reviewed
May 17, 2022
|
|
||
| export const KibanaNoDataPage = ({ onDataViewCreated, noDataConfig }: Props) => { | ||
| const { hasESData, hasUserDataView } = useData(); | ||
| const [hasFinishedLoading, setHasFinishedLoading] = useState(false); |
Contributor
There was a problem hiding this comment.
I usually use the isLoading flag for this. Then on L38 you don't need a negation. Seems more direct to me.
4 tasks
Contributor
Author
|
@elasticmachine merge upstream |
cchaos
reviewed
May 17, 2022
packages/kbn-shared-ux-components/src/empty_state/kibana_no_data_page.tsx
Outdated
Show resolved
Hide resolved
3 tasks
Contributor
Author
|
@elasticmachine merge upstream |
cchaos
reviewed
May 18, 2022
packages/kbn-shared-ux-components/src/empty_state/kibana_no_data_page.tsx
Outdated
Show resolved
Hide resolved
…ta_page.tsx Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
cchaos
approved these changes
May 18, 2022
Contributor
cchaos
left a comment
There was a problem hiding this comment.
Woot! Nice and centered, now if we can just do the same for withSuspense() 😼
Contributor
Author
|
Thanx for looking into it! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
When we started adding the

NoDataPagein Kibana, it became obvious we were missing the loading state of the component. The component fires two requests:hasEsDataandhasUserDataView. If the second one finishes before the first, there will be an ugly transition between the two states, as shown in the GIF below (notice how the no data component is shown first. Then it disappears and "no data views" appears, which should be the end state):This PR adds a simple loading indicator that should be shown until both requests have finished. This way the component will render immediately the state it needs. Observe how the loading indicator is shown first and then "no data views" components shows immediately:
I've just added a simple
EuiLoadingSpinnerto be shown while the requests are running. I don't think we need a more sophisticated way of showing a loading state here @cchaos?Checklist
Delete any items that are not applicable to this PR.
- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorials- [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker listFor maintainers