X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/37e43f4e19ad2bd27b15fe7f0d857218dad39055..670d92f78e9af2390b93e5d984f5fabf59a16071:/src/views-components/details-panel/project-details.tsx diff --git a/src/views-components/details-panel/project-details.tsx b/src/views-components/details-panel/project-details.tsx index 154f0a2c..c3c3d68e 100644 --- a/src/views-components/details-panel/project-details.tsx +++ b/src/views-components/details-panel/project-details.tsx @@ -2,32 +2,102 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from 'react'; -import { ProjectIcon } from '~/components/icon/icon'; -import { ProjectResource } from '~/models/project'; -import { formatDate } from '~/common/formatters'; -import { ResourceKind } from '~/models/resource'; -import { resourceLabel } from '~/common/labels'; +import React from 'react'; +import { connect } from 'react-redux'; +import { ProjectIcon, RenameIcon, FilterGroupIcon } from 'components/icon/icon'; +import { ProjectResource } from 'models/project'; +import { formatDate } from 'common/formatters'; +import { ResourceKind } from 'models/resource'; +import { resourceLabel } from 'common/labels'; import { DetailsData } from "./details-data"; -import { DetailsAttribute } from "~/components/details-attribute/details-attribute"; +import { DetailsAttribute } from "components/details-attribute/details-attribute"; +import { RichTextEditorLink } from 'components/rich-text-editor-link/rich-text-editor-link'; +import { withStyles, StyleRulesCallback, WithStyles, Button } from '@material-ui/core'; +import { ArvadosTheme } from 'common/custom-theme'; +import { Dispatch } from 'redux'; +import { getPropertyChip } from '../resource-properties-form/property-chip'; +import { ResourceOwnerWithName } from '../data-explorer/renderers'; +import { GroupClass } from "models/group"; +import { openProjectUpdateDialog, ProjectUpdateFormDialogData } from 'store/projects/project-update-actions'; export class ProjectDetails extends DetailsData { - getIcon(className?: string) { + if (this.item.groupClass === GroupClass.FILTER) { + return ; + } return ; } getDetails() { - return
- - {/* Missing attr */} - - - - - {/* Missing attr */} - - -
; + return ; + } +} + +type CssRules = 'tag' | 'editIcon'; + +const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ + tag: { + marginRight: theme.spacing.unit, + marginBottom: theme.spacing.unit + }, + editIcon: { + paddingRight: theme.spacing.unit/2, + fontSize: '1.125rem', } +}); + +interface ProjectDetailsComponentDataProps { + project: ProjectResource; } + +interface ProjectDetailsComponentActionProps { + onClick: (prj: ProjectUpdateFormDialogData) => () => void; +} + +const mapDispatchToProps = (dispatch: Dispatch) => ({ + onClick: (prj: ProjectUpdateFormDialogData) => + () => dispatch(openProjectUpdateDialog(prj)), +}); + +type ProjectDetailsComponentProps = ProjectDetailsComponentDataProps & ProjectDetailsComponentActionProps & WithStyles; + +const ProjectDetailsComponent = connect(null, mapDispatchToProps)( + withStyles(styles)( + ({ classes, project, onClick }: ProjectDetailsComponentProps) =>
+ {project.groupClass !== GroupClass.FILTER ? + + : '' + } + + } /> + + + + + {project.description ? + + : '---' + } + + + { + Object.keys(project.properties).map(k => + Array.isArray(project.properties[k]) + ? project.properties[k].map((v: string) => + getPropertyChip(k, v, undefined, classes.tag)) + : getPropertyChip(k, project.properties[k], undefined, classes.tag) + ) + } +
+ ));