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

fix: never render HeaderBar without runtime provider #587

Merged
merged 5 commits into from
Jul 8, 2021

Conversation

amcgee
Copy link
Member

@amcgee amcgee commented Jul 8, 2021

This cleans up the logic for displaying LoginModal (when baseUrl is undefined or user is unauthenticated) vs displaying the headerbar and app (when API requests can proceed). Previously, the runtime provider only wrapped the HeaderBar and app once login was successful, otherwise they would be rendered (along with the LoginModal) without a wrapping provider. This changes the behavior so that all provider-required components (Headerbar, locale provider, app) are exclusively rendered beneath a valid runtime <Provider> component. The LoginModal is now rendered independently outside the provider tree.

Note that this has a small visual change when displaying the login modal - the headerbar skeleton no longer appears. This is OK as the login modal is only expected for development, but should be improved if we start using it for session reinitialization or for production login workflows.

A happy side-effect of this change is that there should be no more misleading /system/info 404 errors or "Runtime provider is not initialized" warnings in the console when showing the login dialog

mediremi
mediremi previously approved these changes Jul 8, 2021
@amcgee amcgee requested a review from mediremi July 8, 2021 12:12
ismay
ismay previously approved these changes Jul 8, 2021
@amcgee amcgee requested a review from ismay July 8, 2021 12:28
@amcgee amcgee dismissed stale reviews from ismay and mediremi July 8, 2021 12:28

Changes

@amcgee amcgee changed the base branch from master to alpha July 8, 2021 12:41
@amcgee amcgee changed the base branch from alpha to master July 8, 2021 12:41
@amcgee amcgee merged commit 65c7766 into master Jul 8, 2021
@amcgee amcgee deleted the fix/show-login-modal-outside-provider branch July 8, 2021 13:11
dhis2-bot added a commit that referenced this pull request Jul 8, 2021
## [7.1.1](v7.1.0...v7.1.1) (2021-07-08)

### Bug Fixes

* never render HeaderBar without runtime provider ([#587](#587)) ([65c7766](65c7766))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 7.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

5 participants