Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
planner-team-one
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
21
Issues
21
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Евгений Положенцев
planner-team-one
Commits
261266f1
Commit
261266f1
authored
Dec 29, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#135
Добавил инактивные клетки, которые дальше дедлайна
parent
54ec2d57
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
35 deletions
+90
-35
CalendarRowDay.js
...lendar/MonthCalendarBody/CalendarRowDay/CalendarRowDay.js
+1
-0
CalendarStandartCell.js
...Calendars/UI/CalendarStandartCell/CalendarStandartCell.js
+87
-35
CalendarColumnDayWeek.js
...lendarBody/CalendarColumnDayWeek/CalendarColumnDayWeek.js
+1
-0
tasksReducer.js
planner-front/src/store/reducers/tasksReducer.js
+1
-0
No files found.
planner-front/src/components/Calendars/MonthCalendar/MonthCalendarBody/CalendarRowDay/CalendarRowDay.js
View file @
261266f1
...
@@ -81,6 +81,7 @@ const CalendarRowDay = ({ xs, hoursInDay, createTaskInCellHandler, currentTask,
...
@@ -81,6 +81,7 @@ const CalendarRowDay = ({ xs, hoursInDay, createTaskInCellHandler, currentTask,
copyTask
=
{
copyTask
}
copyTask
=
{
copyTask
}
createCopyTask
=
{
createCopyTask
}
createCopyTask
=
{
createCopyTask
}
month
=
{
month
}
month
=
{
month
}
year
=
{
year
}
>
>
<
/CalendarStandartCell
>
<
/CalendarStandartCell
>
)
)
...
...
planner-front/src/components/Calendars/UI/CalendarStandartCell/CalendarStandartCell.js
View file @
261266f1
import
{
Grid
}
from
"@mui/material"
;
import
{
Grid
}
from
"@mui/material"
;
import
{
memo
,
use
Effect
,
useState
}
from
"react"
;
import
{
memo
,
use
Callback
,
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
DefaultTask
from
"../DefaultTask/DefaultTask"
;
import
DefaultTask
from
"../DefaultTask/DefaultTask"
;
const
heightCell
=
40
const
heightCell
=
40
const
CalendarStandartCell
=
({
children
,
xs
,
hours
,
dayNumber
,
createTaskInCellHandler
,
handleOpen
,
modal
,
dragTaskHandler
,
linesInDay
,
week
,
copyTask
,
createCopyTask
,
month
,
year
,
copyMode
})
=>
{
const
CalendarStandartCell
=
({
children
,
xs
,
hours
,
dayNumber
,
createTaskInCellHandler
,
handleOpen
,
modal
,
dragTaskHandler
,
linesInDay
,
week
,
copyTask
,
createCopyTask
,
month
,
year
,
copyMode
,
copyModeTask
})
=>
{
const
[
isThisCell
,
setIsThisCell
]
=
useState
(
false
)
const
[
isThisCell
,
setIsThisCell
]
=
useState
(
false
)
const
[
top
,
setTop
]
=
useState
(
0
)
const
[
top
,
setTop
]
=
useState
(
0
)
const
cellClass
=
{
const
isDeadLine
=
useMemo
(()
=>
{
if
(
copyTask
?.
dateTimeDeadLine
)
{
if
(
new
Date
(
copyTask
?.
dateTimeDeadLine
).
getTime
()
-
new
Date
(
year
,
month
,
dayNumber
,
parseInt
(
hours
?.
split
(
':'
)[
0
])).
getTime
()
<
0
)
{
return
true
}
}
else
{
if
(
copyModeTask
?.
dateTimeDeadLine
)
{
if
(
new
Date
(
copyModeTask
?.
dateTimeDeadLine
).
getTime
()
-
new
Date
(
year
,
month
,
dayNumber
,
parseInt
(
hours
?.
split
(
':'
)[
0
])).
getTime
()
<
0
)
{
return
true
}
}
else
{
return
false
}
}
},[
copyTask
,
copyModeTask
,
year
,
month
,
dayNumber
,
hours
])
console
.
log
(
copyTask
)
const
cellClass
=
useMemo
(()
=>
{
const
backgroundColor
=
isDeadLine
?
'#fa9b9be3'
:
'null'
return
({
position
:
'relative'
,
position
:
'relative'
,
height
:
linesInDay
?.
length
?
`
${
heightCell
*
linesInDay
.
length
+
5
}
px`
:
`
${
45
}
px`
,
height
:
linesInDay
?.
length
?
`
${
heightCell
*
linesInDay
.
length
+
5
}
px`
:
`
${
45
}
px`
,
borderRight
:
'1px solid black'
,
borderRight
:
'1px solid black'
,
borderBottom
:
week
?
'1px solid black'
:
null
,
borderBottom
:
week
?
'1px solid black'
:
null
,
padding
:
week
?
'2px'
:
null
,
transition
:
week
?
'0.3s'
:
null
,
transition
:
week
?
'0.3s'
:
null
,
backgroundColor
:
backgroundColor
,
'&:hover'
:
{
'&:hover'
:
{
transition
:
'0.3s'
,
transition
:
'0.3s'
,
cursor
:
children
?
null
:
'#d6d2d2'
,
cursor
:
children
?
null
:
'#d6d2d2'
,
background
:
children
?
null
:
'#d6d2d2'
background
:
children
?
null
:
'#d6d2d2'
},
}
}
})
},
[
children
,
linesInDay
?.
length
,
week
,
isDeadLine
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
modal
)
{
if
(
!
modal
)
{
...
@@ -25,23 +48,23 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
...
@@ -25,23 +48,23 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
}
}
},
[
modal
])
},
[
modal
])
const
dragOverHandler
=
(
e
)
=>
{
const
dragOverHandler
=
useCallback
(
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
e
.
target
.
style
.
background
=
children
?
null
:
'#d6d2d2'
e
.
target
.
style
.
background
=
children
?
null
:
'#d6d2d2'
}
}
,
[
children
])
const
dragLeaveHandler
=
(
e
)
=>
{
const
dragLeaveHandler
=
useCallback
(
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
e
.
target
.
style
.
background
=
null
e
.
target
.
style
.
background
=
null
}
}
,
[])
const
dropHandler
=
(
e
)
=>
{
const
dropHandler
=
useCallback
(
(
e
)
=>
{
e
.
stopPropagation
()
e
.
stopPropagation
()
e
.
preventDefault
();
e
.
preventDefault
();
e
.
target
.
style
.
background
=
null
e
.
target
.
style
.
background
=
null
dragTaskHandler
(
dayNumber
,
parseInt
(
hours
.
split
(
':'
)[
0
]),
month
,
year
)
dragTaskHandler
(
dayNumber
,
parseInt
(
hours
.
split
(
':'
)[
0
]),
month
,
year
)
}
}
,
[
dayNumber
,
hours
,
month
,
year
,
dragTaskHandler
])
const
onClickHandler
=
(
e
)
=>
{
const
onClickHandler
=
useCallback
(
(
e
)
=>
{
if
(
!
week
)
{
if
(
!
week
)
{
if
(
e
.
nativeEvent
.
offsetY
<=
5
)
{
if
(
e
.
nativeEvent
.
offsetY
<=
5
)
{
setTop
(
40
*
Math
.
ceil
((
e
.
nativeEvent
.
offsetY
)
/
40
-
1
))
setTop
(
40
*
Math
.
ceil
((
e
.
nativeEvent
.
offsetY
)
/
40
-
1
))
...
@@ -56,9 +79,32 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
...
@@ -56,9 +79,32 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
setIsThisCell
(
true
);
setIsThisCell
(
true
);
handleOpen
(
e
)
handleOpen
(
e
)
}
}
}
}
,
[
week
,
copyTask
,
copyMode
,
dayNumber
,
hours
,
month
,
year
,
createTaskInCellHandler
,
createCopyTask
,
handleOpen
])
return
<>
const
returnCells
=
useMemo
(()
=>
{
if
(
copyTask
||
copyMode
)
{
if
(
isDeadLine
)
{
return
(
<
Grid
item
xs
=
{
xs
}
sx
=
{
cellClass
}
>
<
/Grid>
)
}
else
{
return
(
<
Grid
item
xs
=
{
xs
}
sx
=
{
cellClass
}
onClick
=
{(
e
)
=>
{
onClickHandler
(
e
)
}}
onDragOver
=
{(
e
)
=>
{
dragOverHandler
(
e
)
}}
onDragLeave
=
{(
e
)
=>
{
dragLeaveHandler
(
e
)
}}
onDrop
=
{(
e
)
=>
{
dropHandler
(
e
)
}}
>
{
children
}
{
isThisCell
?
<
DefaultTask
week
=
{
week
}
top
=
{
top
}
/> : null
}
<
/Grid>
)
}
}
return
(
<>
<
Grid
<
Grid
item
xs
=
{
xs
}
item
xs
=
{
xs
}
sx
=
{
cellClass
}
sx
=
{
cellClass
}
...
@@ -72,6 +118,12 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
...
@@ -72,6 +118,12 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
<
DefaultTask
week
=
{
week
}
top
=
{
top
}
/> : null
}
<
DefaultTask
week
=
{
week
}
top
=
{
top
}
/> : null
}
<
/Grid
>
<
/Grid
>
<
/>
)
},
[
cellClass
,
children
,
copyMode
,
copyTask
,
dragOverHandler
,
dropHandler
,
isThisCell
,
onClickHandler
,
top
,
week
,
xs
,
dragLeaveHandler
,
isDeadLine
])
return
<>
{
returnCells
}
<
/
>
<
/
>
};
};
...
...
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarBody/CalendarColumnDayWeek/CalendarColumnDayWeek.js
View file @
261266f1
...
@@ -87,6 +87,7 @@ function CalendarColumnDayWeek({ hoursInDay, tasks, month, year, day, hourFormat
...
@@ -87,6 +87,7 @@ function CalendarColumnDayWeek({ hoursInDay, tasks, month, year, day, hourFormat
year
=
{
year
}
year
=
{
year
}
dragTaskHandler
=
{
dragTaskHandler
}
dragTaskHandler
=
{
dragTaskHandler
}
copyMode
=
{
copyMode
.
working
}
copyMode
=
{
copyMode
.
working
}
copyModeTask
=
{
copyMode
.
task
}
>
>
<
/CalendarStandartCell
>
<
/CalendarStandartCell
>
)
)
...
...
planner-front/src/store/reducers/tasksReducer.js
View file @
261266f1
...
@@ -49,6 +49,7 @@ const tasksReduсer = (state = initialState, action) => {
...
@@ -49,6 +49,7 @@ const tasksReduсer = (state = initialState, action) => {
mainTaskId
:
task
.
id
,
mainTaskId
:
task
.
id
,
executor
:
task
.
executor
,
executor
:
task
.
executor
,
author
:
task
.
author
,
author
:
task
.
author
,
dateTimeDeadLine
:
task
.
dateTimeDeadLine
,
priority
:
task
.
priority
,
priority
:
task
.
priority
,
title
:
task
.
title
,
title
:
task
.
title
,
description
:
task
.
description
description
:
task
.
description
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment