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
e61c5e29
Commit
e61c5e29
authored
Dec 25, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#131
Пофиксил отображение задачи пустышки
parent
5b44f9ae
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
30 deletions
+36
-30
CalendarTask.js
...thCalendar/MonthCalendarBody/CalendarTask/CalendarTask.js
+1
-1
CalendarStandartCell.js
...Calendars/UI/CalendarStandartCell/CalendarStandartCell.js
+15
-13
DefaultTask.js
...nt/src/components/Calendars/UI/DefaultTask/DefaultTask.js
+20
-16
No files found.
planner-front/src/components/Calendars/MonthCalendar/MonthCalendarBody/CalendarTask/CalendarTask.js
View file @
e61c5e29
...
...
@@ -17,7 +17,7 @@ const CalendarTask = ({ setCurrentTask, handleOpen, task, line, setCopyTask, wid
const
styles
=
{
boxSizing
:
'border-box'
,
backgroundColor
:
color
,
height
:
`
${
35
}
px`
,
height
:
`
35
px`
,
width
:
`
${
width
-
10
}
px`
,
position
:
'absolute'
,
display
:
'flex'
,
...
...
planner-front/src/components/Calendars/UI/CalendarStandartCell/CalendarStandartCell.js
View file @
e61c5e29
...
...
@@ -2,20 +2,18 @@ import { Grid } from "@mui/material";
import
{
memo
,
useEffect
,
useState
}
from
"react"
;
import
DefaultTask
from
"../DefaultTask/DefaultTask"
;
const
CalendarStandartCell
=
({
children
,
xs
,
hours
,
dayNumber
,
createTaskInCellHandler
,
handleOpen
,
modal
,
dragTaskHandler
,
linesInDay
,
week
,
copyTask
,
createCopyTask
,
month
,
year
})
=>
{
const
heightCell
=
45
const
CalendarStandartCell
=
({
children
,
xs
,
hours
,
dayNumber
,
createTaskInCellHandler
,
handleOpen
,
modal
,
dragTaskHandler
,
linesInDay
,
week
,
copyTask
,
createCopyTask
,
month
,
year
})
=>
{
const
[
isThisCell
,
setIsThisCell
]
=
useState
(
false
)
const
[
top
,
setTop
]
=
useState
(
0
)
const
cellClass
=
{
position
:
'relative'
,
height
:
linesInDay
?.
length
?
`
${
45
*
linesInDay
.
length
}
px`
:
`
${
40
}
px`
,
height
:
linesInDay
?.
length
?
`
${
heightCell
*
linesInDay
.
length
}
px`
:
`
${
40
}
px`
,
borderRight
:
'1px solid black'
,
borderBottom
:
week
?
'1px solid black'
:
null
,
'&:hover'
:
{
cursor
:
children
?
null
:
'#d6d2d2'
,
background
:
children
?
null
:
'#d6d2d2'
cursor
:
children
?
null
:
'#d6d2d2'
,
background
:
children
?
null
:
'#d6d2d2'
},
}
...
...
@@ -27,7 +25,7 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
const
dragOverHandler
=
(
e
)
=>
{
e
.
preventDefault
();
e
.
target
.
style
.
background
=
children
?
null
:
'#d6d2d2'
e
.
target
.
style
.
background
=
children
?
null
:
'#d6d2d2'
}
const
dragLeaveHandler
=
(
e
)
=>
{
e
.
preventDefault
();
...
...
@@ -42,6 +40,10 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
}
const
onClickHandler
=
(
e
)
=>
{
if
(
!
week
)
{
console
.
log
(
e
.
nativeEvent
.
offsetY
)
setTop
(
40
*
Math
.
ceil
((
e
.
nativeEvent
.
offsetY
-
5
*
linesInDay
.
length
)
/
40
-
1
))
}
if
(
copyTask
)
{
createCopyTask
(
dayNumber
,
parseInt
(
hours
.
split
(
':'
)[
0
]),
month
,
year
)
}
else
{
...
...
@@ -57,12 +59,12 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
sx
=
{
cellClass
}
onClick
=
{(
e
)
=>
{
onClickHandler
(
e
)
}}
onDragOver
=
{(
e
)
=>
{
dragOverHandler
(
e
)
}}
onDragLeave
=
{(
e
)
=>
{
dragLeaveHandler
(
e
)
}}
onDragLeave
=
{(
e
)
=>
{
dragLeaveHandler
(
e
)
}}
onDrop
=
{(
e
)
=>
{
dropHandler
(
e
)
}}
>
{
children
}
{
isThisCell
?
<
DefaultTask
week
=
{
week
}
/> : null
}
<
DefaultTask
week
=
{
week
}
top
=
{
top
}
/> : null
}
<
/Grid
>
<
/
>
...
...
planner-front/src/components/Calendars/UI/DefaultTask/DefaultTask.js
View file @
e61c5e29
import
{
Box
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
const
MonthDefaultTaskStyles
=
{
position
:
'relative'
,
height
:
'30px'
,
backgroundColor
:
'lightgreen'
,
whiteSpace
:
'nowrap'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
borderRadius
:
'10px'
,
margin
:
'5px 10px'
,
display
:
'flex'
,
justifyContent
:
'flex-start'
,
alignItems
:
'center'
,
paddingLeft
:
'5px'
,
zIndex
:
'5'
}
const
WeekDefaultTaskStyles
=
{
boxSizing
:
'border-box'
,
padding
:
'0 5px'
,
...
...
@@ -31,7 +17,25 @@ const WeekDefaultTaskStyles = {
}
const
DefaultTask
=
({
week
})
=>
{
const
DefaultTask
=
({
week
,
top
})
=>
{
const
MonthDefaultTaskStyles
=
{
boxSizing
:
'border-box'
,
position
:
'relative'
,
height
:
'35px'
,
backgroundColor
:
'lightgreen'
,
whiteSpace
:
'nowrap'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
borderRadius
:
'10px'
,
margin
:
'5px 3px 0 6px'
,
padding
:
'5px'
,
top
:
top
,
display
:
'flex'
,
justifyContent
:
'flex-start'
,
alignItems
:
'center'
,
zIndex
:
'5'
}
return
(
<>
<
Box
...
...
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