Commit f156467b authored by Ermolaev Timur's avatar Ermolaev Timur

#154 починил все селекты

parent 604159dd
import { TableCell, TextField, Tooltip } from "@mui/material";
import moment from "moment";
import { memo } from "react";
import { memo, useEffect } from "react";
import { accomplishStatuses, priorities } from "../../../../../../constants";
import CustomSelect from "../../../../../UI/СustomSelect/СustomSelect"
import { styled } from '@mui/material/styles';
......@@ -15,7 +15,7 @@ const StyledTooltip = styled(({ className, ...props }) => (
`;
function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTask, allUserProjectsForModalTask, onDateChangeEditHandler, user }) {
return (
<>
<TableCell sx={{ width: '4%' }}>
......@@ -70,6 +70,7 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
variant={'outlined'}
onChange={onChangeCurrentTaskHandler}
id={'project'}
renderValue={(project)=>project.title}
items={allUserProjectsForModalTask}
sx={{ width: '100%' }}
/>
......
import { FormControl, InputLabel, MenuItem, Select } from '@mui/material';
import { memo } from 'react';
function СustomSelect({ value, onChange, label, variant = 'standard', items, id, defaultValue, name, sx}) {
function СustomSelect({ value, onChange, label, variant = 'standard', items, id, defaultValue, name, sx, renderValue}) {
return (
<>
<FormControl variant={variant} sx={ sx?.width ? sx : { m: 0, minWidth: 125}}>
......@@ -10,6 +10,7 @@ function СustomSelect({ value, onChange, label, variant = 'standard', items, id
labelId={`${id}-select-label`}
id={`${id}-select`}
value={value}
renderValue={renderValue ? renderValue : null}
onChange={onChange}
label={label}
name={name}
......
......@@ -92,6 +92,7 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
name={'executor'}
variant={'outlined'}
onChange={onChangeCurrentTaskHandler}
renderValue={(executor)=>executor?.displayName}
id={'executor'}
items={workers}
sx={{ width: '100%' }}
......
......@@ -138,7 +138,7 @@ export default function MyTasks() {
setAddFormStatus((prevState) => { return !prevState })
}, [dispatch, newTask, user])
console.log(currentTask)
const deleteTaskHandler = useCallback((id) => {
dispatch(deleteTask(id))
}, [dispatch])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment