From b64c1709e2caf9c3b44925127b9558d5515f29e5 Mon Sep 17 00:00:00 2001 From: zachlite Date: Wed, 26 Apr 2023 13:42:17 -0400 Subject: [PATCH] ui: enable initial data fetch in insecure mode Previously, `alertDataSync`, the function that populates missing cluster info, did not consider insecure mode when assessing a user's login state. Because the 23.1 test cluster is running in insecure mode, the UI is noticeably missing it's cluster ID. Resolves #102350 Epic: none Release note: None --- pkg/ui/workspaces/db-console/src/redux/alerts.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkg/ui/workspaces/db-console/src/redux/alerts.ts b/pkg/ui/workspaces/db-console/src/redux/alerts.ts index 9a8102d64f1f..44e8a5558dad 100644 --- a/pkg/ui/workspaces/db-console/src/redux/alerts.ts +++ b/pkg/ui/workspaces/db-console/src/redux/alerts.ts @@ -653,15 +653,19 @@ export function alertDataSync(store: Store) { // Always refresh health. dispatch(refreshHealth()); + const { Insecure } = getDataFromServer(); // We should not send out requests to the endpoints below if // the user has not successfully logged in since the requests // will always return with a 401 error. - if ( - !state.login || - !state.login.loggedInUser || - state.login.loggedInUser == `` - ) { - return; + // Insecure mode is an exception, where login state is irrelevant. + if (!Insecure) { + if ( + !state.login || + !state.login.loggedInUser || + state.login.loggedInUser == `` + ) { + return; + } } // Load persistent settings which have not yet been loaded.