18559: Fix user profile form initialization & cleanup
[arvados.git] / src / views / user-panel / user-panel.tsx
index 5fb979a2194c62af81a0de64b37cdc509096ead0..9f4d4ce4f692bde552e88bf7f44aaeb70e89efe3 100644 (file)
@@ -20,7 +20,7 @@ import {
     ResourceIsAdmin,
     ResourceUsername
 } from "views-components/data-explorer/renderers";
-import { navigateTo } from "store/navigation/navigation-action";
+import { navigateToUserProfile } from "store/navigation/navigation-action";
 import { ContextMenuKind } from "views-components/context-menu/context-menu";
 import { DataTableDefaultView } from 'components/data-table-default-view/data-table-default-view';
 import { createTree } from 'models/tree';
@@ -124,7 +124,7 @@ interface UserPanelDataProps {
 
 interface UserPanelActionProps {
     openUserCreateDialog: () => void;
-    handleRowDoubleClick: (uuid: string) => void;
+    handleRowClick: (uuid: string) => void;
     onContextMenu: (event: React.MouseEvent<HTMLElement>, item: any) => void;
 }
 
@@ -136,7 +136,7 @@ const mapStateToProps = (state: RootState) => {
 
 const mapDispatchToProps = (dispatch: Dispatch) => ({
     openUserCreateDialog: () => dispatch<any>(openUserCreateDialog()),
-    handleRowDoubleClick: (uuid: string) => dispatch<any>(navigateTo(uuid)),
+    handleRowClick: (uuid: string) => dispatch<any>(navigateToUserProfile(uuid)),
     onContextMenu: (event: React.MouseEvent<HTMLElement>, item: any) => dispatch<any>(openContextMenu(event, item))
 });
 
@@ -157,7 +157,7 @@ export const UserPanel = compose(
             render() {
                 const { value } = this.state;
                 return <Paper className={this.props.classes.root}>
-                    <Tabs value={value} onChange={this.handleChange} fullWidth>
+                    <Tabs value={value} onChange={this.handleChange} variant={"fullWidth"}>
                         <Tab label="USERS" />
                         <Tab label="ACTIVITY" disabled />
                     </Tabs>
@@ -165,7 +165,7 @@ export const UserPanel = compose(
                         <div className={this.props.classes.content}>
                             <DataExplorer
                                 id={USERS_PANEL_ID}
-                                onRowClick={noop}
+                                onRowClick={this.props.handleRowClick}
                                 onRowDoubleClick={noop}
                                 onContextMenu={this.handleContextMenu}
                                 contextMenuColumn={true}
@@ -194,6 +194,7 @@ export const UserPanel = compose(
             }
 
             handleContextMenu = (event: React.MouseEvent<HTMLElement>, resourceUuid: string) => {
+                event.stopPropagation();
                 const resource = getResource<UserResource>(resourceUuid)(this.props.resources);
                 if (resource) {
                     this.props.onContextMenu(event, {