Skip to content

Commit

Permalink
ran make fix
Browse files Browse the repository at this point in the history
  • Loading branch information
al-rosenthal committed Aug 28, 2023
1 parent 81b4fd3 commit e72411f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 38 deletions.
6 changes: 5 additions & 1 deletion app/src/components/fields/SearchAutocompleteField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ const SearchAutocompleteField = <T,>(props: ISearchAutocompleteFieldProps<T>) =>
fullWidth
InputProps={{
...params.InputProps,
startAdornment: <Box mx={1} mt={"6px"}><Icon path={mdiMagnify} size={1} /></Box>,
startAdornment: (
<Box mx={1} mt={'6px'}>
<Icon path={mdiMagnify} size={1} />
</Box>
),
endAdornment: (
<>
{isSearching ? <CircularProgress color="inherit" size={20} /> : null}
Expand Down
7 changes: 2 additions & 5 deletions app/src/components/user/UserRoleSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ const UserRoleSelector: React.FC<IUserRoleSelectorProps> = (props) => {
const { index, selectedRole, user, roles, error, handleAdd, handleRemove } = props;

return (

<Box mt={1}
className="userRoleItemContainer">
<Box mt={1} className="userRoleItemContainer">
<Paper
variant="outlined"
className={ error ? 'userRoleItemError' : 'userRoleItem'}
className={error ? 'userRoleItemError' : 'userRoleItem'}
sx={{
'&.userRoleItem': {
borderColor: 'grey.400'
Expand Down Expand Up @@ -82,7 +80,6 @@ const UserRoleSelector: React.FC<IUserRoleSelectorProps> = (props) => {
</Paper>
{error}
</Box>

);
};

Expand Down
61 changes: 29 additions & 32 deletions app/src/features/projects/components/ProjectUserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Icon from '@mdi/react';
import Autocomplete from '@mui/material/Autocomplete';
import Box from '@mui/material/Box';
import CircularProgress from '@mui/material/CircularProgress';
import Collapse from '@mui/material/Collapse';
import TextField from '@mui/material/TextField';
import Typography from '@mui/material/Typography';
import AlertBar from 'components/alert/AlertBar';
Expand All @@ -16,10 +17,9 @@ import { ICode } from 'interfaces/useCodesApi.interface';
import { ICreateProjectRequest, IGetProjectParticipant } from 'interfaces/useProjectApi.interface';
import { ISystemUser } from 'interfaces/useUserApi.interface';
import { useEffect, useState } from 'react';
import { TransitionGroup } from 'react-transition-group';
import { alphabetizeObjects } from 'utils/Utils';
import yup from 'utils/YupSchema';
import { TransitionGroup } from 'react-transition-group';
import Collapse from '@mui/material/Collapse';

export const ProjectUserRoleYupSchema = yup.object().shape({
participants: yup
Expand Down Expand Up @@ -234,37 +234,34 @@ const ProjectUserForm: React.FC<IProjectUser> = (props) => {
}}
/>
</Box>
{/* {selectedUsers.length > 0 && ( */}

<Box>
<Box
sx={{
'& .userRoleItemContainer + .userRoleItemContainer': {
mt: 1
}
}}>
<TransitionGroup>
{selectedUsers.map((user: ISystemUser | IGetProjectParticipant, index: number) => {
const error = rowItemError(index);
return (
<Collapse key={user.system_user_id}>
<UserRoleSelector
index={index}
user={user}
roles={props.roles}
error={error}
selectedRole={getSelectedRole(index)}
handleAdd={handleAddUserRole}
handleRemove={handleRemoveUser}
key={user.system_user_id}
/>
</Collapse>
);
})}
</TransitionGroup>
</Box>
<Box>
<Box
sx={{
'& .userRoleItemContainer + .userRoleItemContainer': {
mt: 1
}
}}>
<TransitionGroup>
{selectedUsers.map((user: ISystemUser | IGetProjectParticipant, index: number) => {
const error = rowItemError(index);
return (
<Collapse key={user.system_user_id}>
<UserRoleSelector
index={index}
user={user}
roles={props.roles}
error={error}
selectedRole={getSelectedRole(index)}
handleAdd={handleAddUserRole}
handleRemove={handleRemoveUser}
key={user.system_user_id}
/>
</Collapse>
);
})}
</TransitionGroup>
</Box>
{/* )} */}
</Box>
</Box>
</form>
);
Expand Down

0 comments on commit e72411f

Please sign in to comment.