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';
import { USERS_PANEL_ID, openUserCreateDialog } from 'store/users/users-actions';
import { noop } from 'lodash';
-type UserPanelRules = "button";
+type UserPanelRules = "button" | 'root' | 'content';
const styles = withStyles<UserPanelRules>(theme => ({
button: {
textAlign: 'right',
alignSelf: 'center'
},
+ root: {
+ width: '100%',
+ },
+ content: {
+ // reserve space for the tab bar
+ height: `calc(100% - ${theme.spacing.unit * 7}px)`,
+ }
}));
export enum UserPanelColumnNames {
interface UserPanelActionProps {
openUserCreateDialog: () => void;
- handleRowDoubleClick: (uuid: string) => void;
+ handleRowClick: (uuid: string) => void;
onContextMenu: (event: React.MouseEvent<HTMLElement>, item: any) => void;
}
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))
});
render() {
const { value } = this.state;
- return <Paper>
- <Tabs value={value} onChange={this.handleChange} fullWidth>
+ return <Paper className={this.props.classes.root}>
+ <Tabs value={value} onChange={this.handleChange} variant={"fullWidth"}>
<Tab label="USERS" />
<Tab label="ACTIVITY" disabled />
</Tabs>
{value === 0 &&
- <span>
+ <div className={this.props.classes.content}>
<DataExplorer
id={USERS_PANEL_ID}
- onRowClick={noop}
+ onRowClick={this.props.handleRowClick}
onRowDoubleClick={noop}
onContextMenu={this.handleContextMenu}
contextMenuColumn={true}
icon={ShareMeIcon}
messages={['Your user list is empty.']} />
} />
- </span>}
+ </div>}
</Paper>;
}
}
handleContextMenu = (event: React.MouseEvent<HTMLElement>, resourceUuid: string) => {
+ event.stopPropagation();
const resource = getResource<UserResource>(resourceUuid)(this.props.resources);
if (resource) {
this.props.onContextMenu(event, {