X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/670d92f78e9af2390b93e5d984f5fabf59a16071..8489fb1669592f46853a3c793ad211fa919c30b7:/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 c3c3d68e33..7dc6709da5 100644 --- a/src/views-components/details-panel/project-details.tsx +++ b/src/views-components/details-panel/project-details.tsx @@ -16,9 +16,12 @@ import { withStyles, StyleRulesCallback, WithStyles, Button } from '@material-ui 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 { ResourceWithName } from '../data-explorer/renderers'; import { GroupClass } from "models/group"; import { openProjectUpdateDialog, ProjectUpdateFormDialogData } from 'store/projects/project-update-actions'; +import { RootState } from 'store/store'; +import { ResourcesState } from 'store/resources/resources'; +import { resourceIsFrozen } from 'common/frozen-resources'; export class ProjectDetails extends DetailsData { getIcon(className?: string) { @@ -33,17 +36,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, + paddingRight: theme.spacing.unit / 2, fontSize: '1.125rem', - } + }, + editButton: { + boxShadow: 'none', + padding: '2px 10px 2px 5px', + fontSize: '0.75rem' + }, }); interface ProjectDetailsComponentDataProps { @@ -54,6 +62,12 @@ interface ProjectDetailsComponentActionProps { onClick: (prj: ProjectUpdateFormDialogData) => () => void; } +const mapStateToProps = (state: RootState): { resources: ResourcesState } => { + return { + resources: state.resources + }; +}; + const mapDispatchToProps = (dispatch: Dispatch) => ({ onClick: (prj: ProjectUpdateFormDialogData) => () => dispatch(openProjectUpdateDialog(prj)), @@ -61,23 +75,26 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({ type ProjectDetailsComponentProps = ProjectDetailsComponentDataProps & ProjectDetailsComponentActionProps & WithStyles; -const ProjectDetailsComponent = connect(null, mapDispatchToProps)( +const ProjectDetailsComponent = connect(mapStateToProps, mapDispatchToProps)( withStyles(styles)( - ({ classes, project, onClick }: ProjectDetailsComponentProps) =>
+ ({ classes, project, resources, onClick }: ProjectDetailsComponentProps & { resources: ResourcesState }) =>
{project.groupClass !== GroupClass.FILTER ? - - : '' - } + + : '' + } } /> + uuidEnhancer={(uuid: string) => } /> @@ -94,9 +111,9 @@ const ProjectDetailsComponent = connect(null, mapDispatchToProps)( { 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) + ? project.properties[k].map((v: string) => + getPropertyChip(k, v, undefined, classes.tag)) + : getPropertyChip(k, project.properties[k], undefined, classes.tag) ) }