X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/3e56db626688ee6225d40b7e4c511e3217e84847..ec121e0e865fe99c5df5453ed5fa819594b1cdd6:/src/views-components/project-properties-dialog/project-properties-dialog.tsx diff --git a/src/views-components/project-properties-dialog/project-properties-dialog.tsx b/src/views-components/project-properties-dialog/project-properties-dialog.tsx index 7a4cfba6..c2982b3d 100644 --- a/src/views-components/project-properties-dialog/project-properties-dialog.tsx +++ b/src/views-components/project-properties-dialog/project-properties-dialog.tsx @@ -13,7 +13,7 @@ import { Dialog, DialogTitle, DialogContent, DialogActions, Button, withStyles, import { ArvadosTheme } from '~/common/custom-theme'; import { ProjectPropertiesForm } from '~/views-components/project-properties-dialog/project-properties-form'; import { getResource } from '~/store/resources/resources'; -import { PropertyChipComponent } from "../resource-properties-form/property-chip"; +import { getPropertyChip } from "../resource-properties-form/property-chip"; type CssRules = 'tag'; @@ -29,7 +29,7 @@ interface ProjectPropertiesDialogDataProps { } interface ProjectPropertiesDialogActionProps { - handleDelete: (key: string) => void; + handleDelete: (key: string, value: string) => void; } const mapStateToProps = ({ detailsPanel, resources, properties }: RootState): ProjectPropertiesDialogDataProps => ({ @@ -37,38 +37,45 @@ const mapStateToProps = ({ detailsPanel, resources, properties }: RootState): Pr }); const mapDispatchToProps = (dispatch: Dispatch): ProjectPropertiesDialogActionProps => ({ - handleDelete: (key: string) => dispatch(deleteProjectProperty(key)), + handleDelete: (key: string, value: string) => () => dispatch(deleteProjectProperty(key, value)), }); -type ProjectPropertiesDialogProps = ProjectPropertiesDialogDataProps & ProjectPropertiesDialogActionProps & WithDialogProps<{}> & WithStyles; +type ProjectPropertiesDialogProps = ProjectPropertiesDialogDataProps & ProjectPropertiesDialogActionProps & WithDialogProps<{}> & WithStyles; export const ProjectPropertiesDialog = connect(mapStateToProps, mapDispatchToProps)( withStyles(styles)( - withDialog(PROJECT_PROPERTIES_DIALOG_NAME)( - ({ classes, open, closeDialog, handleDelete, project }: ProjectPropertiesDialogProps) => - - Properties - - - {project && project.properties && - Object.keys(project.properties).map(k => - handleDelete(k)} - key={k} className={classes.tag} - propKey={k} propValue={project.properties[k]} />) - } - - - - - - ) -)); \ No newline at end of file + + + ) + ));