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
c90e117a
Commit
c90e117a
authored
Nov 18, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#56
Пофиксил разные баги с драг энд дроп и модальным окном
parent
bc35da21
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
CalendarRowDay.js
...onents/MonthCalendarBody/CalendarRowDay/CalendarRowDay.js
+4
-6
MonthCalendarBody.js
...ont/src/components/MonthCalendarBody/MonthCalendarBody.js
+4
-2
No files found.
planner-front/src/components/MonthCalendarBody/CalendarRowDay/CalendarRowDay.js
View file @
c90e117a
...
...
@@ -25,8 +25,8 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
const
sortedTasks
=
useMemo
(()
=>
{
if
(
availableTasks
.
length
)
{
const
newSortedArr
=
[...
availableTasks
].
sort
(
function
(
a
,
b
){
const
durattionFirstDate
=
new
Date
(
a
.
dateTimeDue
).
getTime
()
-
new
Date
(
a
.
dateTimeStart
).
getTime
()
const
durattionSecondDate
=
new
Date
(
b
.
dateTimeDue
).
getTime
()
-
new
Date
(
b
.
dateTimeStart
).
getTime
()
const
durattionFirstDate
=
a
.
infoForCell
.
endHour
-
a
.
infoForCell
.
startHour
const
durattionSecondDate
=
b
.
infoForCell
.
endHour
-
b
.
infoForCell
.
startHour
return
durattionSecondDate
-
durattionFirstDate
;
})
return
newSortedArr
...
...
@@ -104,7 +104,7 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
// if (boxes[boxes.length -1]?.task === null) {
// boxes[boxes.length -1].xs += xs
// } else {
boxes
.
push
({
xs
:
xs
,
task
:
null
})
boxes
.
push
({
xs
:
xs
,
task
:
null
,
hour
:
line
[
i
]
})
// }
}
else
{
const
task
=
sortedTasks
[
line
[
i
].
split
(
'-'
)[
1
]]
...
...
@@ -131,8 +131,6 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
e
.
preventDefault
();
dragTaskHandler
(
day
.
dayNumber
,
currentHour
)
}
console
.
log
(
sortedTasks
)
console
.
log
(
linesInDay
)
return
<>
<
Grid
...
...
@@ -187,7 +185,7 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
}
else
{
return
(
<
Grid
onDragOver
=
{(
e
)
=>
{
dragOverHandler
(
e
)}}
onDrop
=
{(
e
)
=>
{
dropHandler
(
e
,
parseInt
(
hours
[
index
])
)}}
onDrop
=
{(
e
)
=>
{
dropHandler
(
e
,
box
.
hour
)}}
item
xs
=
{
box
.
xs
}
sx
=
{{
height
:
'35px'
,
backgroundColor
:
'rgb(0,0,0,0)'
}}
>
<
/Grid>
)
...
...
planner-front/src/components/MonthCalendarBody/MonthCalendarBody.js
View file @
c90e117a
...
...
@@ -13,10 +13,11 @@ function MonthCalendarBody({month, year, tasks, createTaskInCellHandler, current
const
[
currentLine
,
setCurrentLine
]
=
useState
(
''
)
const
[
modal
,
setModal
]
=
useState
({
open
:
false
,
y
:
0
,
x
:
0
,});
const
handleOpen
=
(
e
)
=>
{
console
.
log
(
e
)
setModal
(
{
open
:
true
,
yPage
:
e
.
page
Y
,
xPage
:
e
.
page
X
,
yPage
:
e
.
client
Y
,
xPage
:
e
.
client
X
,
yDivClick
:
e
.
nativeEvent
.
offsetY
,
xDivClick
:
e
.
nativeEvent
.
offsetX
,
yDiv
:
e
.
target
.
offsetHeight
,
...
...
@@ -39,6 +40,7 @@ function MonthCalendarBody({month, year, tasks, createTaskInCellHandler, current
})
}
},
[
divRef
.
current
?.
offsetHeight
,
hourFormat
,
month
,
tasks
]);
return
(
<
div
ref
=
{
divRef
}
style
=
{{
marginBottom
:
'30px'
}}
>
...
...
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