Merge branch '15530-wb2-logincluster' refs #15530
[arvados-workbench2.git] / src / views / link-account-panel / link-account-panel.tsx
index 45045a3b72632d0e40e918a058e1d2fc79d7d9c2..60166cda853d7b196b902ad62c34a88fe2f8d7c7 100644 (file)
@@ -5,7 +5,7 @@
 import { RootState } from '~/store/store';
 import { Dispatch } from 'redux';
 import { connect } from 'react-redux';
-import { saveAccountLinkData, cancelLinking, linkAccount } from '~/store/link-account-panel/link-account-panel-actions';
+import { startLinking, cancelLinking, linkAccount, linkAccountPanelActions } from '~/store/link-account-panel/link-account-panel-actions';
 import { LinkAccountType } from '~/models/link-account';
 import {
     LinkAccountPanelRoot,
@@ -15,17 +15,24 @@ import {
 
 const mapStateToProps = (state: RootState): LinkAccountPanelRootDataProps => {
     return {
+        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
+        error: state.linkAccountPanel.error,
+        isProcessing: state.linkAccountPanel.isProcessing
     };
 };
 
 const mapDispatchToProps = (dispatch: Dispatch): LinkAccountPanelRootActionProps => ({
-    saveAccountLinkData: (type: LinkAccountType) => dispatch<any>(saveAccountLinkData(type)),
-    cancelLinking: () => dispatch<any>(cancelLinking()),
-    linkAccount: () => dispatch<any>(linkAccount())
+    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);