X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/02fe86a56f080ed1d5770ad6c6856a15f50ab508..394ebdfd13fe40a7096f484c46a353d2537f4c9a:/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 8f03cc5d..41ba6f00 100644 --- a/src/views-components/details-panel/project-details.tsx +++ b/src/views-components/details-panel/project-details.tsx @@ -2,22 +2,29 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from 'react'; +import React from 'react'; import { connect } from 'react-redux'; -import { openProjectPropertiesDialog } from '~/store/details-panel/details-panel-action'; -import { ProjectIcon, RenameIcon } 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 { openProjectPropertiesDialog } from 'store/details-panel/details-panel-action'; +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 { RichTextEditorLink } from '~/components/rich-text-editor-link/rich-text-editor-link'; -import { withStyles, StyleRulesCallback, Chip, WithStyles } from '@material-ui/core'; -import { ArvadosTheme } from '~/common/custom-theme'; +import { DetailsAttribute } from "components/details-attribute/details-attribute"; +import { RichTextEditorLink } from 'components/rich-text-editor-link/rich-text-editor-link'; +import { withStyles, StyleRulesCallback, WithStyles } 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"; export class ProjectDetails extends DetailsData { getIcon(className?: string) { + if (this.item.groupClass === GroupClass.FILTER) { + return ; + } return ; } @@ -39,7 +46,6 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ } }); - interface ProjectDetailsComponentDataProps { project: ProjectResource; } @@ -48,22 +54,21 @@ interface ProjectDetailsComponentActionProps { onClick: () => void; } -const mapDispatchToProps = ({ onClick: openProjectPropertiesDialog }); +const mapDispatchToProps = (dispatch: Dispatch) => ({ + onClick: () => dispatch(openProjectPropertiesDialog()), +}); type ProjectDetailsComponentProps = ProjectDetailsComponentDataProps & ProjectDetailsComponentActionProps & WithStyles; const ProjectDetailsComponent = connect(null, mapDispatchToProps)( withStyles(styles)( ({ classes, project, onClick }: ProjectDetailsComponentProps) =>
- - {/* Missing attr */} - - + + } /> - - {/* Missing attr */} - {/**/} + {project.description ? -
- -
+ {project.groupClass !== GroupClass.FILTER ? +
+ +
+ : '' + }
{ - Object.keys(project.properties).map(k => { - return ; - }) + 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) + ) }
));