X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/bc9df86de8ce648f14193315f037ca4a2b119773..952bcc8f3ef686a2463931bc3f88457398163df7:/src/views/link-account-panel/link-account-panel.tsx

diff --git a/src/views/link-account-panel/link-account-panel.tsx b/src/views/link-account-panel/link-account-panel.tsx
index 44b4bb54..65a82170 100644
--- a/src/views/link-account-panel/link-account-panel.tsx
+++ b/src/views/link-account-panel/link-account-panel.tsx
@@ -2,27 +2,37 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { RootState } from '~/store/store';
+import { RootState } from 'store/store';
 import { Dispatch } from 'redux';
 import { connect } from 'react-redux';
-import { saveAccountLinkData, removeAccountLinkData } from '~/store/link-account-panel/link-account-panel-actions';
-import { LinkAccountType } from '~/models/link-account';
+import { startLinking, linkAccount, linkAccountPanelActions, cancelLinking } from 'store/link-account-panel/link-account-panel-actions';
+import { LinkAccountType } from 'models/link-account';
 import {
     LinkAccountPanelRoot,
     LinkAccountPanelRootDataProps,
     LinkAccountPanelRootActionProps
-} from '~/views/link-account-panel/link-account-panel-root';
+} from 'views/link-account-panel/link-account-panel-root';
 
 const mapStateToProps = (state: RootState): LinkAccountPanelRootDataProps => {
     return {
-        user: state.auth.user,
-        accountToLink: state.linkAccountPanel.accountToLink
+        remoteHostsConfig: state.auth.remoteHostsConfig,
+        hasRemoteHosts: Object.keys(state.auth.remoteHosts).length > 1 && state.auth.loginCluster === "",
+        selectedCluster: state.linkAccountPanel.selectedCluster,
+        localCluster: state.auth.localCluster,
+        loginCluster: state.auth.loginCluster,
+        targetUser: state.linkAccountPanel.targetUser,
+        userToLink: state.linkAccountPanel.userToLink,
+        status: state.linkAccountPanel.status,
+        error: state.linkAccountPanel.error,
+        isProcessing: state.linkAccountPanel.isProcessing
     };
 };
 
 const mapDispatchToProps = (dispatch: Dispatch): LinkAccountPanelRootActionProps => ({
-    saveAccountLinkData: (type: LinkAccountType) => dispatch<any>(saveAccountLinkData(type)),
-    removeAccountLinkData: () => dispatch<any>(removeAccountLinkData())
+    startLinking: (type: LinkAccountType) => dispatch<any>(startLinking(type)),
+    cancelLinking: () => dispatch<any>(cancelLinking(true)),
+    linkAccount: () => dispatch<any>(linkAccount()),
+    setSelectedCluster: (selectedCluster: string) => dispatch<any>(linkAccountPanelActions.SET_SELECTED_CLUSTER({ selectedCluster }))
 });
 
 export const LinkAccountPanel = connect(mapStateToProps, mapDispatchToProps)(LinkAccountPanelRoot);
