From dcab8d69b5fb93c025c49fd85bf39d038c4fb3d0 Mon Sep 17 00:00:00 2001 From: Eric Biagiotti Date: Fri, 3 May 2019 11:27:12 -0400 Subject: [PATCH] 15088: Adds link accounts to drop down. Removes changes to my account Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti --- .../main-app-bar/account-menu.tsx | 4 ++- .../my-account-panel-root.tsx | 35 ++++--------------- .../my-account-panel/my-account-panel.tsx | 11 ++---- 3 files changed, 13 insertions(+), 37 deletions(-) diff --git a/src/views-components/main-app-bar/account-menu.tsx b/src/views-components/main-app-bar/account-menu.tsx index 87bfe0c6db..93aeadae80 100644 --- a/src/views-components/main-app-bar/account-menu.tsx +++ b/src/views-components/main-app-bar/account-menu.tsx @@ -17,7 +17,8 @@ import { openRepositoriesPanel } from "~/store/repositories/repositories-actions import { navigateToSiteManager, navigateToSshKeysUser, - navigateToMyAccount + navigateToMyAccount, + navigateToLinkAccount } from '~/store/navigation/navigation-action'; import { openUserVirtualMachines } from "~/store/virtual-machines/virtual-machines-actions"; @@ -75,6 +76,7 @@ export const AccountMenu = withStyles(styles)( dispatch(navigateToSshKeysUser)}>Ssh Keys dispatch(navigateToSiteManager)}>Site Manager dispatch(navigateToMyAccount)}>My account + dispatch(navigateToLinkAccount)}>Link account : null} = (theme: ArvadosTheme) => ({ root: { @@ -40,24 +39,13 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ marginBottom: theme.spacing.unit * 3, color: theme.palette.grey["600"] }, - link: { - lineHeight:'2.1', - whiteSpace: 'nowrap', - fontSize: '1rem', - color: theme.palette.primary.main, - '&:hover': { - cursor: 'pointer' - } - }, actions: { display: 'flex', justifyContent: 'flex-end' } }); -export interface MyAccountPanelRootActionProps { - openLinkAccount: () => void; - } +export interface MyAccountPanelRootActionProps { } export interface MyAccountPanelRootDataProps { isPristine: boolean; @@ -76,7 +64,7 @@ const RoleTypes = [ { key: 'Other', value: 'Other' } ]; -type MyAccountPanelRootProps = InjectedFormProps & MyAccountPanelRootActionProps & MyAccountPanelRootDataProps & WithStyles; +type MyAccountPanelRootProps = InjectedFormProps & MyAccountPanelRootDataProps & WithStyles; type LocalClusterProp = { localCluster: string }; const renderField: React.ComponentType = ({ input, localCluster }) => ( @@ -84,21 +72,12 @@ const renderField: React.ComponentType = ( ); export const MyAccountPanelRoot = withStyles(styles)( - ({ classes, isValid, handleSubmit, reset, isPristine, invalid, submitting, localCluster, openLinkAccount}: MyAccountPanelRootProps) => { + ({ classes, isValid, handleSubmit, reset, isPristine, invalid, submitting, localCluster }: MyAccountPanelRootProps) => { return - - - - Logged in as - - - - openLinkAccount()}> - - - - + + Logged in as +
diff --git a/src/views/my-account-panel/my-account-panel.tsx b/src/views/my-account-panel/my-account-panel.tsx index 85f285d60f..bd1f587457 100644 --- a/src/views/my-account-panel/my-account-panel.tsx +++ b/src/views/my-account-panel/my-account-panel.tsx @@ -3,12 +3,11 @@ // SPDX-License-Identifier: AGPL-3.0 import { RootState } from '~/store/store'; -import { Dispatch } from 'redux'; import { compose } from 'redux'; import { reduxForm, isPristine, isValid } from 'redux-form'; import { connect } from 'react-redux'; -import { saveEditedUser, openLinkAccount } from '~/store/my-account/my-account-panel-actions'; -import { MyAccountPanelRoot, MyAccountPanelRootDataProps, MyAccountPanelRootActionProps } from '~/views/my-account-panel/my-account-panel-root'; +import { saveEditedUser } from '~/store/my-account/my-account-panel-actions'; +import { MyAccountPanelRoot, MyAccountPanelRootDataProps } from '~/views/my-account-panel/my-account-panel-root'; import { MY_ACCOUNT_FORM } from "~/store/my-account/my-account-panel-actions"; const mapStateToProps = (state: RootState): MyAccountPanelRootDataProps => ({ @@ -18,12 +17,8 @@ const mapStateToProps = (state: RootState): MyAccountPanelRootDataProps => ({ localCluster: state.auth.localCluster }); -const mapDispatchToProps = (dispatch: Dispatch): MyAccountPanelRootActionProps => ({ - openLinkAccount: () => dispatch(openLinkAccount()) -}); - export const MyAccountPanel = compose( - connect(mapStateToProps, mapDispatchToProps), + connect(mapStateToProps), reduxForm({ form: MY_ACCOUNT_FORM, onSubmit: (data, dispatch) => { -- 2.30.2