X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/b6ac7fe88d347582d39fffa002e300af222c578f..dec2560060035f165662cff34b3a8916927a7ee6:/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 41ba6f00..d4100767 100644 --- a/src/views-components/details-panel/project-details.tsx +++ b/src/views-components/details-panel/project-details.tsx @@ -4,7 +4,6 @@ import React from 'react'; import { connect } from 'react-redux'; -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'; @@ -13,12 +12,13 @@ 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, WithStyles } from '@material-ui/core'; +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) { @@ -33,17 +33,22 @@ export class ProjectDetails extends DetailsData { } } -type CssRules = 'tag' | 'editIcon'; +type CssRules = 'tag' | 'editIcon' | 'editButton'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ tag: { - marginRight: theme.spacing.unit, - marginBottom: theme.spacing.unit + marginRight: theme.spacing.unit / 2, + marginBottom: theme.spacing.unit / 2, }, editIcon: { + paddingRight: theme.spacing.unit/2, fontSize: '1.125rem', - cursor: 'pointer' - } + }, + editButton: { + boxShadow: 'none', + padding: '2px 10px 2px 5px', + fontSize: '0.75rem' + }, }); interface ProjectDetailsComponentDataProps { @@ -51,11 +56,12 @@ interface ProjectDetailsComponentDataProps { } interface ProjectDetailsComponentActionProps { - onClick: () => void; + onClick: (prj: ProjectUpdateFormDialogData) => () => void; } const mapDispatchToProps = (dispatch: Dispatch) => ({ - onClick: () => dispatch(openProjectPropertiesDialog()), + onClick: (prj: ProjectUpdateFormDialogData) => + () => dispatch(openProjectUpdateDialog(prj)), }); type ProjectDetailsComponentProps = ProjectDetailsComponentDataProps & ProjectDetailsComponentActionProps & WithStyles; @@ -63,6 +69,19 @@ type ProjectDetailsComponentProps = ProjectDetailsComponentDataProps & ProjectDe const ProjectDetailsComponent = connect(null, mapDispatchToProps)( withStyles(styles)( ({ classes, project, onClick }: ProjectDetailsComponentProps) =>
+ {project.groupClass !== GroupClass.FILTER ? + + : '' + } } /> @@ -78,14 +97,7 @@ const ProjectDetailsComponent = connect(null, mapDispatchToProps)( : '---' } - - {project.groupClass !== GroupClass.FILTER ? -
- -
- : '' - } -
+ { Object.keys(project.properties).map(k => Array.isArray(project.properties[k])