From fb3f4deaceade35ad36718ce814d6ff4d0cb996b Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Mon, 5 Oct 2020 13:07:51 -0400 Subject: [PATCH] 16941: Fix AxiosInstance import. Add apiClient accessor Also fix warning about Grid needing to be a container. Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- src/services/auth-service/auth-service.ts | 4 ++ src/store/auth/auth-action-session.ts | 4 +- .../main-content-bar/main-content-bar.tsx | 44 +++++++++---------- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/services/auth-service/auth-service.ts b/src/services/auth-service/auth-service.ts index 29442401..ce3564e0 100644 --- a/src/services/auth-service/auth-service.ts +++ b/src/services/auth-service/auth-service.ts @@ -69,6 +69,10 @@ export class AuthService { return this.getStorage().getItem(HOME_CLUSTER) || undefined; } + public getApiClient() { + return this.apiClient; + } + public removeUser() { this.getStorage().removeItem(USER_EMAIL_KEY); this.getStorage().removeItem(USER_FIRST_NAME_KEY); diff --git a/src/store/auth/auth-action-session.ts b/src/store/auth/auth-action-session.ts index f0093f9f..c871e147 100644 --- a/src/store/auth/auth-action-session.ts +++ b/src/store/auth/auth-action-session.ts @@ -6,7 +6,7 @@ import { Dispatch } from "redux"; import { setBreadcrumbs } from "~/store/breadcrumbs/breadcrumbs-actions"; import { RootState } from "~/store/store"; import { ServiceRepository, createServices, setAuthorizationHeader } from "~/services/services"; -import Axios from "axios"; +import Axios, { AxiosInstance } from "axios"; import { User, getUserDisplayName } from "~/models/user"; import { authActions } from "~/store/auth/auth-action"; import { @@ -313,7 +313,7 @@ export const initSessions = (authService: AuthService, config: Config, user: Use (dispatch: Dispatch) => { const sessions = authService.buildSessions(config, user); dispatch(authActions.SET_SESSIONS(sessions)); - dispatch(validateSessions(authService.apiClient)); + dispatch(validateSessions(authService.getApiClient())); }; export const loadSiteManagerPanel = () => diff --git a/src/views-components/main-content-bar/main-content-bar.tsx b/src/views-components/main-content-bar/main-content-bar.tsx index c8565d62..cad73a3a 100644 --- a/src/views-components/main-content-bar/main-content-bar.tsx +++ b/src/views-components/main-content-bar/main-content-bar.tsx @@ -43,26 +43,26 @@ export const MainContentBar = connect((state: RootState) => ({ buttonVisible: isButtonVisible(state) }), { - onDetailsPanelToggle: toggleDetailsPanel, - })( - withStyles(styles)( - (props: MainContentBarProps & WithStyles & any) => - - - - + onDetailsPanelToggle: toggleDetailsPanel, + })( + withStyles(styles)( + (props: MainContentBarProps & WithStyles & any) => + + + + + + + + + + {props.buttonVisible && + + + + } + - - - - - {props.buttonVisible && - - - - } - - - - ) - ); + + ) + ); -- 2.30.2