Commit 95a5903f authored by Ermolaev Timur's avatar Ermolaev Timur

#148 Исправил ошибку с селектом и кей пропом

parent d0dc6458
......@@ -40,8 +40,7 @@ const CalendarRowDay = ({ xs, hoursInDay, createTaskInCellHandler, currentTask,
>
{linesInDay?.map((line, i) => {
const tasks = getTasksWithInfoForPosition(line, hoursInDay, sortedTasks, i, rowDaySize.width)
return (<>
{tasks.map((task) => {
return (tasks.map((task) => {
const step = rowDaySize.width / hoursInDay.length
return (
<CalendarTask
......@@ -61,8 +60,8 @@ const CalendarRowDay = ({ xs, hoursInDay, createTaskInCellHandler, currentTask,
>
</CalendarTask>
)
})}
</>)
})
)
})}
{hoursInDay.map((hour, i) => {
......
......@@ -34,7 +34,7 @@ function CalendarModalTaskContent({ title, onChangeCurrentTaskHandler, descripti
/>
<div style={{ display: 'flex', gap: '20px', margin: '20px 0' }}>
<CustomSelect
defaultValue={null}
defaultValue={priorities[0]?.value}
value={priority}
name={'priority'}
variant={'outlined'}
......
......@@ -22,7 +22,6 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
}
},[copyTask, copyModeTask, year, month, dayNumber, hours])
// console.log(copyTask)
const cellClass = useMemo(() => {
const backgroundColor = isDeadLine ? '#fa9b9be3' : 'null'
return ({
......
import { useMemo } from "react";
import React, { useMemo } from "react";
import { getHoursInDayNumbers, getAvailableTasks, getLinesInDay, getSortedTasks } from "../../../../../helpers/CalendarHelpers";
import CalendarStandartCell from "../../../UI/CalendarStandartCell/CalendarStandartCell";
import { useEffect, useRef, useState } from "react";
......@@ -8,7 +8,7 @@ import { getTasksWithInfoForPosition, getWidthLeftZIndex } from "./Helpers";
function CalendarColumnDayWeek({ hoursInDay, tasks, month, year, day, hourFormat, handleOpen, setCurrentTask, copyTask, setCopyTask, createCopyTask, createTaskInCellHandler, modal, dragTaskHandler, copyMode, deleteTaskHandler }) {
function CalendarColumnDayWeek({ hoursInDay, tasks, month, year, day, hourFormat, handleOpen, setCurrentTask, copyTask, setCopyTask, createCopyTask, createTaskInCellHandler, modal, dragTaskHandler, copyMode, deleteTaskHandler}) {
const [columnDaySize, setColumnDaySize] = useState({ width: 0, height: 0 })
......@@ -39,8 +39,7 @@ function CalendarColumnDayWeek({ hoursInDay, tasks, month, year, day, hourFormat
<Grid item xs={12 / 7} ref={dayColumnRef} sx={{ position: 'relative' }}>
{linesInDay?.map((line, i) => {
const boxes = getTasksWithInfoForPosition(line, sortedTasks, linesInDay, columnDaySize.height, hours)
return (<>
{boxes.map((task) => {
return boxes.map((task) => {
const { width, left, zIndex } = getWidthLeftZIndex(task, columnDaySize.width, i)
const step = columnDaySize.height / hours.length
const tasksLength = task.tasksInHour
......@@ -64,11 +63,9 @@ function CalendarColumnDayWeek({ hoursInDay, tasks, month, year, day, hourFormat
hourFormat={hourFormat}
copyModeTask={copyMode.task}
deleteTaskHandler={deleteTaskHandler}
>
</CalendarWeekTask>
/>
)
})}
</>)
})
})}
{hoursInDay?.map((hour, i) => {
......
......@@ -15,7 +15,7 @@ export const anonymoysMenuButtons = [
]
export const priorities = [
{ value: null, text: '--Приоритет--' },
{ value: '', text: '--Приоритет--' },
{ value: 'A', text: 'A' },
{ value: 'B', text: 'B' },
{ value: 'C', text: 'C' }
......
......@@ -20,7 +20,7 @@ function MonthCalendar() {
const [hourFormat, setHourFormat] = useState(false);
const [dateNow, setDateNow] = useState({ month: '', year: '' })
const [workerInfo, setWorkerInfo] = useState({ project: '', worker: '' });
const [currentTask, setCurrentTask] = useState({ title: '', description: '', priority: null, infoForCell: { startHour: null, endHour: null } })
const [currentTask, setCurrentTask] = useState({ title: '', description: '', priority: '', infoForCell: { startHour: null, endHour: null } })
const [copyTask, setCopyTask] = useState(null)
const [cellSizes, setCellSizes] = useState({})
const [userId, setUserId] = useState('')
......@@ -141,7 +141,7 @@ function MonthCalendar() {
const newTask = {
title: "Задача",
description: "описание",
priority: null,
priority: '',
dateTimeStart: dateToISOLikeButLocal(new Date(dateNow.year, dateNow.month, dayNumber, hour, 0)),
dateTimeDue: dateToISOLikeButLocal(new Date(dateNow.year, dateNow.month, dayNumber, hourDue, 59)),
infoForCell: {
......
......@@ -23,7 +23,7 @@ function WeekCalendar() {
const [workerInfo, setWorkerInfo] = useState({ project: '', worker: '' });
const [dateNow, setDateNow] = useState({ year: '', month: '', currentDay: '' })
const [currentTask, setCurrentTask] = useState({ title: '', description: '', priority: null, infoForCell: { startHour: null, endHour: null } })
const [currentTask, setCurrentTask] = useState({ title: '', description: '', priority: '', infoForCell: { startHour: null, endHour: null } })
const [hourFormat, setHourFormat] = useState(false);
const [copyTask, setCopyTask] = useState(null)
const [userCalendarId, setUserCalendarId] = useState(null)
......@@ -138,7 +138,7 @@ function WeekCalendar() {
const newTask = {
title: "Задача",
description: "описание",
priority: null,
priority: '',
dateTimeStart: dateToISOLikeButLocal(new Date(year, month, dayNumber, hour, 0)),
dateTimeDue: dateToISOLikeButLocal(new Date(year, month, dayNumber, hourDue, 59)),
infoForCell: {
......
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