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(admin): if were in EE mode wait for the EE routes to be loaded before rendering #20238

Merged
merged 1 commit into from
May 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/core/admin/admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@ export const App = ({ authLogo, menuLogo, showReleaseNotification, showTutorials
[uuid, telemetryPropertiesQuery.data]
);

if (initQuery.isLoading) {
/**
* `routes` will only be an array if EE mode is activated,
* therefore we need to ensure the lazy loading of EE routes
* has been complete otherwise the SSO repsonse URL will not be
* caught by the component and you won't be able to login with it.
*/
if (initQuery.isLoading || (Array.isArray(routes) && routes.length === 0)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

(Nevermind my previous comment...) But wondering if there's a more certain way to know for sure than checking the array?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could make useEnterprise better for sure e.g. adding "state" like isLoading etc.

I think if we wanted to do that we should revisit the hook entirely, the types aren't great etc. So it'd be another ticket 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

This also isn't an issue in V5 because of how the router works there.

return <LoadingIndicatorPage />;
}

Expand Down