изменила названия колонок, вывела данные в колонку дедлайн, вывела кнопку перехода в календарь

parent d19dd8ff
......@@ -5,6 +5,7 @@ import Input from "@mui/material/Input";
const CustomTableCell = ({task,
name,
value,
value2,
onChange,
onModalOpen,
placeholder,
......@@ -36,6 +37,35 @@ const CustomTableCell = ({task,
</>
);
}
if (task && name=="dateTimeStart") {
return (
<>
<TableCell
onClick={(e) => (onModalOpen ? onModalOpen(e, task) : null)}
align="left"
style={styles}
>
{task.isEditMode && onChange && name==!"author" && task.author.id==user.id ? (
<Input
placeholder={placeholder}
value={value}
name={name}
onChange={(e) => onChange(e, task)}
style={styles}
/>
) : (
<>
<span>{value}</span>
<div>{"valuehjlhlh"}</div>
<span>{value2}</span>
</>
)}
</TableCell>
</>
);
}
};
export default CustomTableCell;
......@@ -25,7 +25,7 @@ import MaterialUIPickers from "../../components/MyTasksCompoments/DateTimePicker
import BasicSelect from "../../components/UI/Select/Select";
import { fetchAllTasks, deleteTask,editTask} from "../../store/actions/tasksActions";
import NewTaskForm from "../../components/MyTasksCompoments/NewTaskForm";
import CalendarMonthIcon from '@mui/icons-material/CalendarMonth';
export default function EnhancedTable() {
......@@ -221,7 +221,7 @@ useEffect(() => {
return results;
}, []);
console.log(tasks)
if (
tasks &&
tasks?.length > 0 &&
......@@ -353,26 +353,89 @@ useEffect(() => {
user:user
}}
/>
<TableCell>
<MaterialUIPickers
{task.isEditMode && task.author.id===user.id ? (
<TableCell>
{/* <MaterialUIPickers
task={task}
name="dateTimeStart"
onChange={onDateChange}
user={user}
/>
/> */}
<TableCell>
<Tooltip title="Перейти в календарь">
<IconButton
onClick={(id) => { deleteHandle(task.id);}}
>
<CalendarMonthIcon />
</IconButton>
</Tooltip>
</TableCell>
</TableCell>
) : (<>
<CustomTableCell
{...{
task,
name: "dateTimeStart",
value: moment(task.dateTimeStart)
.utc()
.format("DD-MM-YYYY hh:mm A"),
value2:moment(task.dateTimeStart)
.utc()
.format("hh:mm A")+
"-"+
moment(task.dateTimeDue)
.utc()
.format("hh:mm A"),
user:user
}}>
<span>"время заершения", {moment(task.dateTimeDue)
.utc()
.format("hh:mm A")}</span>
</CustomTableCell>
{/* <CustomTableCell
{...{
task,
name: "dateTimeStart",
value: moment(task.dateTimeDue)
.utc()
.format("DD-MM-YYYY hh:mm A"),
user:user
}}
/> */}
</>
)}
<TableCell>
{/* <TableCell>
<MaterialUIPickers
task={task}
name="dateTimeStart"
onChange={onDateChange}
user={user}
/>
</TableCell> */}
{task.isEditMode && task.author.id===user.id ? (
<TableCell>
<MaterialUIPickers
task={task}
name="dateTimeDue"
onChange={onDateChange}
user={user}
/>
</TableCell>
</TableCell>
) : (
<CustomTableCell
{...{
task,
name: "dateTimeDue",
value: moment(task.dateTimeDue)
.utc()
.format("DD-MM-YYYY hh:mm A"),
user:user
}}
/>
)}
{task.isEditMode ? (
<TableCell>
<BasicSelect
......
......@@ -49,13 +49,13 @@ const headCells = [
id: "dateTimeStart",
numeric: true,
disablePadding: false,
label: "Дата начала",
label: "Дата и время выполнения",
},
{
id: "dateTimeDue",
numeric: true,
disablePadding: false,
label: ата завершения",
label: едлайн",
},
{
id: "accomplish",
......
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