-import { RootState } from '../../store/store';
-
-export const PROJECT_PANEL_ID = "projectPanel";
-
-type ProjectPanelProps = {
- currentItemId: string,
- onItemClick: (item: ProjectPanelItem) => void,
- onItemRouteChange: (itemId: string) => void
-}
- & DispatchProp
- & WithStyles<CssRules>
- & RouteComponentProps<{ id: string }>;
-class ProjectPanel extends React.Component<ProjectPanelProps> {
- state = {
- open: false,
- };
-
- handleClickOpen = () => {
- this.setState({ open: true });
- }
-
- handleClose = () => {
- this.setState({ open: false });
- }
-
- render() {
- return <div>
- <div className={this.props.classes.toolbar}>
- <Button color="primary" variant="raised" className={this.props.classes.button}>
- Create a collection
- </Button>
- <Button color="primary" variant="raised" className={this.props.classes.button}>
- Run a process
- </Button>
- <Button color="primary" onClick={this.handleClickOpen} variant="raised" className={this.props.classes.button}>
- Create a project
- </Button>
- <Dialog
- open={this.state.open}
- onClose={this.handleClose}>
- <div className={this.props.classes.dialog}>
- <DialogTitle id="form-dialog-title">Create a project</DialogTitle>
- <DialogContent className={this.props.classes.dialogContent}>
- <TextField
- margin="dense"
- className={this.props.classes.textField}
- id="name"
- label="Project name"
- fullWidth />
- <TextField
- margin="dense"
- id="description"
- label="Description - optional"
- fullWidth />
- </DialogContent>
- <DialogActions>
- <Button onClick={this.handleClose} className={this.props.classes.button} color="primary">CANCEL</Button>
- <Button onClick={this.handleClose} className={this.props.classes.lastButton} color="primary" variant="raised">CREATE A PROJECT</Button>
- </DialogActions>
- </div>
- </Dialog>
- </div>
- <DataExplorer
- id={PROJECT_PANEL_ID}
- contextActions={contextMenuActions}
- onColumnToggle={this.toggleColumn}
- onFiltersChange={this.changeFilters}
- onRowClick={this.props.onItemClick}
- onSortToggle={this.toggleSort}
- onSearch={this.search}
- onContextAction={this.executeAction}
- onChangePage={this.changePage}
- onChangeRowsPerPage={this.changeRowsPerPage} />;
- </div>;
- }
-
- componentDidMount() {
- this.props.dispatch(actions.SET_COLUMNS({ id: PROJECT_PANEL_ID, columns }));
- }
-
- componentWillReceiveProps({ match, currentItemId }: ProjectPanelProps) {
- if (match.params.id !== currentItemId) {
- this.props.onItemRouteChange(match.params.id);
- }
- }
-
- toggleColumn = (toggledColumn: DataColumn<ProjectPanelItem>) => {
- this.props.dispatch(actions.TOGGLE_COLUMN({ id: PROJECT_PANEL_ID, columnName: toggledColumn.name }));
- }
-
- toggleSort = (column: DataColumn<ProjectPanelItem>) => {
- this.props.dispatch(actions.TOGGLE_SORT({ id: PROJECT_PANEL_ID, columnName: column.name }));
- }
-
- changeFilters = (filters: DataTableFilterItem[], column: DataColumn<ProjectPanelItem>) => {
- this.props.dispatch(actions.SET_FILTERS({ id: PROJECT_PANEL_ID, columnName: column.name, filters }));
- }
-
- executeAction = (action: ContextMenuAction, item: ProjectPanelItem) => {
- alert(`Executing ${action.name} on ${item.name}`);
- }
-
- search = (searchValue: string) => {
- this.props.dispatch(actions.SET_SEARCH_VALUE({ id: PROJECT_PANEL_ID, searchValue }));
- }
-
- changePage = (page: number) => {
- this.props.dispatch(actions.SET_PAGE({ id: PROJECT_PANEL_ID, page }));
- }
-
- changeRowsPerPage = (rowsPerPage: number) => {
- this.props.dispatch(actions.SET_ROWS_PER_PAGE({ id: PROJECT_PANEL_ID, rowsPerPage }));
- }
-
-}
-
-type CssRules = "toolbar" | "button" | "lastButton" | "dialogContent" | "textField" | "dialog";
-
-const styles: StyleRulesCallback<CssRules> = theme => ({
+import { RootState } from '~/store/store';
+import { DataTableFilterItem } from '~/components/data-table-filters/data-table-filters';
+import { ContainerRequestState } from '~/models/container-request';
+import { SortDirection } from '~/components/data-table/data-column';
+import { ResourceKind } from '~/models/resource';
+import { resourceLabel } from '~/common/labels';
+import { ArvadosTheme } from '~/common/custom-theme';
+import { ResourceFileSize, ResourceLastModifiedDate, ProcessStatus, ResourceType, ResourceOwner } from '~/views-components/data-explorer/renderers';
+import { ProjectIcon } from '~/components/icon/icon';
+import { ResourceName } from '~/views-components/data-explorer/renderers';
+import { ResourcesState, getResource } from '~/store/resources/resources';
+import { loadDetailsPanel } from '~/store/details-panel/details-panel-action';
+import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
+import { contextMenuActions, resourceKindToContextMenuKind, openContextMenu } from '~/store/context-menu/context-menu-actions';
+import { CollectionResource } from '~/models/collection';
+import { ProjectResource } from '~/models/project';
+import { navigateTo } from '~/store/navigation/navigation-action';
+import { getProperty } from '~/store/properties/properties';
+import { PROJECT_PANEL_CURRENT_UUID } from '~/store/project-panel/project-panel-action';
+import { openCollectionCreateDialog } from '../../store/collections/collection-create-actions';
+import { openProjectCreateDialog } from '~/store/projects/project-create-actions';
+
+type CssRules = 'root' | "toolbar" | "button";
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+ root: {
+ position: 'relative',
+ width: '100%',
+ height: '100%'
+ },