Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ui] Resolve AMP state before handling Overview AMP route (#25496)
## Summary & Motivation Fix the `'unknown'` state for AMP flags, when navigating directly to `/overview/automation`. This route currently redirects to `/automation` if the user is not using the legacy nav and if the AMP sensor flag state is not `'has-global-amp'`. Unfortunately, on initial pageload we may not yet have received the response from the GraphQL request that asks for the flag state, so this is likely to be `'unknown'`, and the page redirects. Fix this by waiting until the query resolves before redirecting or rendering anything other than a `div`. ## How I Tested These Changes Test permutations of legacy nav and AMP sensor flag state. - Verify that redirect to `/overview/automation` occurs when the flag is `'has-global-amp'`, on navigation and full pageload. - Verify that when the flag is set to `'has-sensor-amp'`, the page redirects to `/overview/sensors` for legacy nav and `/automation` for new nav. ## Changelog [ui] Fix redirect behavior on full pageloads of auto-materialize overview page.
- Loading branch information
e813170
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.
Deploy preview for dagit-core-storybook ready!
✅ Preview
https://dagit-core-storybook-mgayiepmq-elementl.vercel.app
Built with commit e813170.
This pull request is being automatically deployed with vercel-action