15088: Fix to use new login function
authorEric Biagiotti <ebiagiotti@veritasgenetics.com>
Wed, 15 May 2019 15:29:53 +0000 (11:29 -0400)
committerEric Biagiotti <ebiagiotti@veritasgenetics.com>
Wed, 15 May 2019 15:29:53 +0000 (11:29 -0400)
Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti@veritasgenetics.com>

src/store/link-account-panel/link-account-panel-actions.ts
src/store/workbench/workbench-actions.ts
src/views-components/api-token/api-token.tsx

index 5552882449b0d376aa3c502ca74d4c66a650c87d..e63da1a42ac838f8d089771391ceb80dd94f8dac 100644 (file)
@@ -172,7 +172,7 @@ export const startLinking = (t: LinkAccountType) =>
         services.linkAccountService.saveAccountToLink(accountToLink);
         const auth = getState().auth;
         dispatch(logout());
-        dispatch(login(auth.localCluster, auth.remoteHosts[auth.homeCluster]));
+        dispatch(login(auth.localCluster, auth.homeCluster, auth.remoteHosts));
     };
 
 export const getAccountLinkData = () =>
index 27ac76f335198e75bc37bcbc30df330d39226cbd..9917782ab45baa8b98c34db97efe91256ddd35d2 100644 (file)
@@ -94,7 +94,6 @@ import { groupDetailsPanelColumns } from '~/views/group-details-panel/group-deta
 import { DataTableFetchMode } from "~/components/data-table/data-table";
 import { loadPublicFavoritePanel, publicFavoritePanelActions } from '~/store/public-favorites-panel/public-favorites-action';
 import { publicFavoritePanelColumns } from '~/views/public-favorites-panel/public-favorites-panel';
-import { USER_LINK_ACCOUNT_KEY } from '~/services/link-account-service/link-account-service';
 import { loadCollectionsContentAddressPanel, collectionsContentAddressActions } from '~/store/collections-content-address-panel/collections-content-address-panel-actions';
 import { collectionContentAddressPanelColumns } from '~/views/collection-content-address-panel/collection-content-address-panel';
 
@@ -117,7 +116,7 @@ const handleFirstTimeLoad = (action: any) =>
     };
 
 export const loadWorkbench = () =>
-    async (dispatch: Dispatch, getState: () => RootState) => {
+    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
         dispatch(progressIndicatorActions.START_WORKING(WORKBENCH_LOADING_SCREEN));
         const { auth, router } = getState();
         const { user } = auth;
@@ -138,7 +137,7 @@ export const loadWorkbench = () =>
             dispatch(apiClientAuthorizationsActions.SET_COLUMNS({ columns: apiClientAuthorizationPanelColumns }));
             dispatch(collectionsContentAddressActions.SET_COLUMNS({ columns: collectionContentAddressPanelColumns }));
 
-            if (sessionStorage.getItem(USER_LINK_ACCOUNT_KEY)) {
+            if (services.linkAccountService.getAccountToLink()) {
                 dispatch(linkAccountPanelActions.HAS_SESSION_DATA());
             }
 
index 2f8d87e1ede0d1b95fe688738583605136254904..fae099d5717b3f12bde13763746d26e3f4c9a944 100644 (file)
@@ -31,12 +31,12 @@ export const ApiToken = connect()(
                 this.props.dispatch(initSessions(this.props.authService, this.props.config, user));
             }).finally(() => {
                 if (loadMainApp) {
-                if (this.props.dispatch(getAccountLinkData())) {
-                    this.props.dispatch(navigateToLinkAccount);
-                }
-                else {
-                    this.props.dispatch(navigateToRootProject);
-                }
+                    if (this.props.dispatch(getAccountLinkData())) {
+                        this.props.dispatch(navigateToLinkAccount);
+                    }
+                    else {
+                        this.props.dispatch(navigateToRootProject);
+                    }
                 }
             });
         }