18315: Adds file upload test proving that the UI is correctly updated.
[arvados-workbench2.git] / src / views / link-account-panel / link-account-panel.tsx
index c49b511d65d94976f944269a9d6b54e6fbd6b0e0..65a8217076fb5554ad685015f3fac93efd713e04 100644 (file)
@@ -2,26 +2,37 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { RootState } from '~/store/store';
+import { RootState } from 'store/store';
 import { Dispatch } from 'redux';
-import { compose } from 'redux';
-import { reduxForm } from 'redux-form';
 import { connect } from 'react-redux';
-import { getResource, ResourcesState } from '~/store/resources/resources';
-import { Resource } from '~/models/resource';
-import { User, UserResource } from '~/models/user';
+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
+        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 => ({});
+const mapDispatchToProps = (dispatch: Dispatch): LinkAccountPanelRootActionProps => ({
+    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);