X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/486b76baf259d3b83bc551cd0f7dd0c9d4395961..61c27319e0c16b865ae381c086b61f738bb57354:/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 91c5e027ba..1be04b00ee 100644 --- a/src/views-components/details-panel/project-details.tsx +++ b/src/views-components/details-panel/project-details.tsx @@ -3,7 +3,6 @@ // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; -import { compose } from 'redux'; import { connect } from 'react-redux'; import { openProjectPropertiesDialog } from '~/store/details-panel/details-panel-action'; import { ProjectIcon, RenameIcon } from '~/components/icon/icon'; @@ -14,8 +13,10 @@ 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 { 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'; export class ProjectDetails extends DetailsData { getIcon(className?: string) { @@ -40,7 +41,6 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ } }); - interface ProjectDetailsComponentDataProps { project: ProjectResource; } @@ -49,7 +49,9 @@ interface ProjectDetailsComponentActionProps { onClick: () => void; } -const mapDispatchToProps = ({ onClick: openProjectPropertiesDialog }); +const mapDispatchToProps = (dispatch: Dispatch) => ({ + onClick: () => dispatch(openProjectPropertiesDialog()), +}); type ProjectDetailsComponentProps = ProjectDetailsComponentDataProps & ProjectDetailsComponentActionProps & WithStyles; @@ -57,31 +59,35 @@ const ProjectDetailsComponent = connect(null, mapDispatchToProps)( withStyles(styles)( ({ classes, project, onClick }: ProjectDetailsComponentProps) =>
- {/* Missing attr */} - - - - - {/* Missing attr */} - {/**/} - - {project.description ? - - : '---' - } - - -
- -
-
- { - Object.keys(project.properties).map(k => { - return ; - }) + {/* Missing attr */} + + + + + + {/* Missing attr */} + {/**/} + + {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) + ) + }
-)); \ No newline at end of file + ));