// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import React from 'react'; import { CustomStyleRulesCallback } from 'common/custom-theme'; import { Grid, Divider, IconButton, Typography, Tooltip } from '@mui/material'; import { Field, WrappedFieldProps, WrappedFieldArrayProps, FieldArray, FieldArrayFieldsProps, InjectedFormProps } from 'redux-form'; import { PermissionSelect, formatPermissionLevel, parsePermissionLevel } from './permission-select'; import { WithStyles } from '@mui/styles'; import withStyles from '@mui/styles/withStyles'; import { CloseIcon } from 'components/icon/icon'; import { ArvadosTheme } from 'common/custom-theme'; export interface SaveProps { onSave: () => void; } const headerStyles: CustomStyleRulesCallback<'heading'> = (theme: ArvadosTheme) => ({ heading: { fontSize: '1.25rem', } }); export const SharingManagementFormComponent = withStyles(headerStyles)( ({ classes, onSave }: WithStyles<'heading'> & SaveProps & InjectedFormProps<{}, SaveProps>) => <> People with access void }> name='permissions' component={SharingManagementFieldArray as any} props={{ onSave }} /> ); export default SharingManagementFormComponent; const SharingManagementFieldArray = ({ fields, onSave }: { onSave: () => void } & WrappedFieldArrayProps<{ email: string }>) =>
{fields.map((field, index, fields) => )}
; const permissionManagementRowStyles: CustomStyleRulesCallback<'root'> = theme => ({ root: { padding: `${theme.spacing(1)} 0`, } }); const PermissionManagementRow = withStyles(permissionManagementRowStyles)( ({ field, index, fields, classes, onSave }: { field: string, index: number, fields: FieldArrayFieldsProps<{ email: string }>, onSave: () => void; } & WithStyles<'root'>) => <> {fields.get(index).email} { fields.remove(index); onSave(); }} size="large"> ); const PermissionSelectComponent = ({ input }: WrappedFieldProps) => ;