X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/49ad5cc761e56b7d2fb204e872ad956c6fc1c60c..1e1abe6a0146d3f31836334a7e5880e349afed24:/src/views-components/sharing-dialog/sharing-management-form-component.tsx

diff --git a/src/views-components/sharing-dialog/sharing-management-form-component.tsx b/src/views-components/sharing-dialog/sharing-management-form-component.tsx
index 688f416f..e4096ea5 100644
--- a/src/views-components/sharing-dialog/sharing-management-form-component.tsx
+++ b/src/views-components/sharing-dialog/sharing-management-form-component.tsx
@@ -3,11 +3,18 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from 'react';
-import { Grid, StyleRulesCallback, Divider } from '@material-ui/core';
-import { Field, WrappedFieldProps, WrappedFieldArrayProps, FieldArray, FieldsProps } from 'redux-form';
-import { PermissionSelect } from './permission-select';
+import { Grid, StyleRulesCallback, Divider, IconButton, Typography } from '@material-ui/core';
+import {
+    Field,
+    WrappedFieldProps,
+    WrappedFieldArrayProps,
+    FieldArray,
+    FieldArrayFieldsProps
+} from 'redux-form';
+import { PermissionSelect, formatPermissionLevel, parsePermissionLevel } from './permission-select';
 import { WithStyles } from '@material-ui/core/styles';
 import withStyles from '@material-ui/core/styles/withStyles';
+import { CloseIcon } from '~/components/icon/icon';
 
 
 export default () =>
@@ -28,15 +35,22 @@ const permissionManagementRowStyles: StyleRulesCallback<'root'> = theme => ({
     }
 });
 const PermissionManagementRow = withStyles(permissionManagementRowStyles)(
-    ({ field, index, fields, classes }: { field: string, index: number, fields: FieldsProps<{ email: string }> } & WithStyles<'root'>) =>
+    ({ field, index, fields, classes }: { field: string, index: number, fields: FieldArrayFieldsProps<{ email: string }> } & WithStyles<'root'>) =>
         <>
             <Divider />
-            <Grid container alignItems='center' spacing={8} className={classes.root}>
+            <Grid container alignItems='center' spacing={8} wrap='nowrap' className={classes.root}>
                 <Grid item xs={8}>
-                    {fields.get(index).email}
+                    <Typography noWrap variant='subtitle1'>{fields.get(index).email}</Typography>
                 </Grid>
-                <Grid item xs={4}>
-                    <Field name={`${field}.permissions`} component={PermissionSelectComponent} />
+                <Grid item xs={4} container wrap='nowrap'>
+                    <Field
+                        name={`${field}.permissions`}
+                        component={PermissionSelectComponent}
+                        format={formatPermissionLevel}
+                        parse={parsePermissionLevel} />
+                    <IconButton onClick={() => fields.remove(index)}>
+                        <CloseIcon />
+                    </IconButton>
                 </Grid>
             </Grid>
         </>
