X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/525e81bdbe18ea369f5a61a713e743608bab2e42..823127bc1a6583888b11d659d84ad9e7e0e53caa:/services/workbench2/src/views/project-panel/project-panel.tsx diff --git a/services/workbench2/src/views/project-panel/project-panel.tsx b/services/workbench2/src/views/project-panel/project-panel.tsx index 4c94ab8d2d..3d64f6517a 100644 --- a/services/workbench2/src/views/project-panel/project-panel.tsx +++ b/services/workbench2/src/views/project-panel/project-panel.tsx @@ -51,16 +51,28 @@ import { GroupClass, GroupResource } from 'models/group'; import { CollectionResource } from 'models/collection'; import { resourceIsFrozen } from 'common/frozen-resources'; import { ProjectResource } from 'models/project'; +import { deselectAllOthers, toggleOne } from 'store/multiselect/multiselect-actions'; +import { DetailsCardRoot } from 'views-components/details-card/details-card-root'; +import { MPVContainer, MPVPanelContent, MPVPanelState } from 'components/multi-panel-view/multi-panel-view'; +import { PROJECT_PANEL_ID } from 'store/project-panel/project-panel-action-bind'; -type CssRules = 'root' | 'button'; +type CssRules = 'root' | 'button' | 'mpvRoot' | 'dataExplorer'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { width: '100%', + display: 'flex', + flexDirection: 'column', }, button: { marginLeft: theme.spacing.unit, }, + mpvRoot: { + flexGrow: 1, + }, + dataExplorer: { + height: "100%", + }, }); export enum ProjectPanelColumnNames { @@ -231,43 +243,68 @@ export const projectPanelColumns: DataColumns = [ }, ]; -export const PROJECT_PANEL_ID = 'projectPanel'; - const DEFAULT_VIEW_MESSAGES = ['Your project is empty.', 'Please create a project or create a collection and upload a data.']; +const panelsData: MPVPanelState[] = [ + { name: "Subprojects", visible: true }, +]; + interface ProjectPanelDataProps { currentItemId: string; resources: ResourcesState; + project: GroupResource; isAdmin: boolean; userUuid: string; dataExplorerItems: any; + working: boolean; } type ProjectPanelProps = ProjectPanelDataProps & DispatchProp & WithStyles & RouteComponentProps<{ id: string }>; -export const ProjectPanel = withStyles(styles)( - connect((state: RootState) => ({ - currentItemId: getProperty(PROJECT_PANEL_CURRENT_UUID)(state.properties), +const mapStateToProps = (state: RootState) => { + const currentItemId = getProperty(PROJECT_PANEL_CURRENT_UUID)(state.properties); + const project = getResource(currentItemId || "")(state.resources); + return { + currentItemId, + project, resources: state.resources, userUuid: state.auth.user!.uuid, - }))( + }; +} + +export const ProjectPanel = withStyles(styles)( + connect(mapStateToProps)( class extends React.Component { + render() { const { classes } = this.props; - - return ( -
- -
- ); + return
+ + + + + + +
} isCurrentItemChild = (resource: Resource) => { @@ -310,6 +347,8 @@ export const ProjectPanel = withStyles(styles)( }; handleRowClick = (uuid: string) => { + this.props.dispatch(toggleOne(uuid)) + this.props.dispatch(deselectAllOthers(uuid)) this.props.dispatch(loadDetailsPanel(uuid)); }; }