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
f9ec068f
Commit
f9ec068f
authored
Dec 28, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#134
исправил кнопку копирования
parent
d5fb9f2c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
17 deletions
+28
-17
CalendarStandartCell.js
...Calendars/UI/CalendarStandartCell/CalendarStandartCell.js
+1
-1
CopyIcon.js
...er-front/src/components/Calendars/UI/CopyIcon/CopyIcon.js
+2
-3
CalendarColumnDayWeek.js
...lendarBody/CalendarColumnDayWeek/CalendarColumnDayWeek.js
+2
-0
CalendarWeekTask.js
...alendarColumnDayWeek/CalendarWeekTask/CalendarWeekTask.js
+23
-13
No files found.
planner-front/src/components/Calendars/UI/CalendarStandartCell/CalendarStandartCell.js
View file @
f9ec068f
...
@@ -11,7 +11,7 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
...
@@ -11,7 +11,7 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
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
,
transition
:
'0.3s'
,
transition
:
week
?
'0.3s'
:
null
,
'&:hover'
:
{
'&:hover'
:
{
transition
:
'0.3s'
,
transition
:
'0.3s'
,
cursor
:
children
?
null
:
'#d6d2d2'
,
cursor
:
children
?
null
:
'#d6d2d2'
,
...
...
planner-front/src/components/Calendars/UI/CopyIcon/CopyIcon.js
View file @
f9ec068f
...
@@ -2,9 +2,8 @@
...
@@ -2,9 +2,8 @@
import
React
,
{
memo
}
from
"react"
;
import
React
,
{
memo
}
from
"react"
;
import
ContentCopyIcon
from
'@mui/icons-material/ContentCopy'
;
import
ContentCopyIcon
from
'@mui/icons-material/ContentCopy'
;
const
styles
=
{
width
:
'20px'
,
cursor
:
'pointer'
,
marginLeft
:
'auto'
}
const
CopyIcon
=
({
onClick
,
tasksLength
})
=>
{
const
CopyIcon
=
({
onClick
})
=>
{
const
styles
=
{
width
:
'20px'
,
cursor
:
'pointer'
,
marginLeft
:
tasksLength
>
2
?
'5px'
:
'auto'
,
marginTop
:
tasksLength
?
'5px'
:
0
}
return
(
return
(
<
ContentCopyIcon
sx
=
{
styles
}
onClick
=
{
onClick
}
>
<
ContentCopyIcon
sx
=
{
styles
}
onClick
=
{
onClick
}
>
<
/ContentCopyIcon>
)
<
/ContentCopyIcon>
)
...
...
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarBody/CalendarColumnDayWeek/CalendarColumnDayWeek.js
View file @
f9ec068f
...
@@ -43,6 +43,7 @@ function CalendarColumnDayWeek({ hoursInDay, tasks, month, year, day, hourFormat
...
@@ -43,6 +43,7 @@ function CalendarColumnDayWeek({ hoursInDay, tasks, month, year, day, hourFormat
{
boxes
.
map
((
task
)
=>
{
{
boxes
.
map
((
task
)
=>
{
const
{
width
,
left
,
zIndex
}
=
getWidthLeftZIndex
(
task
,
columnDaySize
.
width
,
i
)
const
{
width
,
left
,
zIndex
}
=
getWidthLeftZIndex
(
task
,
columnDaySize
.
width
,
i
)
const
step
=
columnDaySize
.
height
/
hours
.
length
const
step
=
columnDaySize
.
height
/
hours
.
length
const
tasksLength
=
task
.
tasksInHour
return
(
return
(
<
CalendarWeekTask
<
CalendarWeekTask
key
=
{
task
.
task
.
id
}
key
=
{
task
.
task
.
id
}
...
@@ -59,6 +60,7 @@ function CalendarColumnDayWeek({ hoursInDay, tasks, month, year, day, hourFormat
...
@@ -59,6 +60,7 @@ function CalendarColumnDayWeek({ hoursInDay, tasks, month, year, day, hourFormat
setCopyTask
=
{
setCopyTask
}
setCopyTask
=
{
setCopyTask
}
dragTaskHandler
=
{
dragTaskHandler
}
dragTaskHandler
=
{
dragTaskHandler
}
step
=
{
step
}
step
=
{
step
}
tasksLength
=
{
tasksLength
}
hourFormat
=
{
hourFormat
}
hourFormat
=
{
hourFormat
}
>
>
<
/CalendarWeekTask
>
<
/CalendarWeekTask
>
...
...
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarBody/CalendarColumnDayWeek/CalendarWeekTask/CalendarWeekTask.js
View file @
f9ec068f
...
@@ -4,7 +4,7 @@ import { getColorTaskByPriority } from "../../../../../../helpers/CalendarHelper
...
@@ -4,7 +4,7 @@ import { getColorTaskByPriority } from "../../../../../../helpers/CalendarHelper
import
CopyIcon
from
"../../../../UI/CopyIcon/CopyIcon"
;
import
CopyIcon
from
"../../../../UI/CopyIcon/CopyIcon"
;
function
CalendarWeekTask
({
height
,
width
,
left
,
top
,
task
,
zIndex
,
handleOpen
,
setCurrentTask
,
modal
,
setCopyTask
,
month
,
dragTaskHandler
,
step
,
hourFormat
})
{
function
CalendarWeekTask
({
height
,
width
,
left
,
top
,
task
,
zIndex
,
handleOpen
,
setCurrentTask
,
modal
,
setCopyTask
,
month
,
dragTaskHandler
,
step
,
hourFormat
,
tasksLength
})
{
const
[
zIndexStyle
,
setZIndexStyle
]
=
useState
(
10
)
const
[
zIndexStyle
,
setZIndexStyle
]
=
useState
(
10
)
const
color
=
useMemo
(()
=>
{
const
color
=
useMemo
(()
=>
{
return
getColorTaskByPriority
(
task
.
priority
)
return
getColorTaskByPriority
(
task
.
priority
)
...
@@ -79,9 +79,9 @@ function CalendarWeekTask({ height, width, left, top, task, zIndex, handleOpen,
...
@@ -79,9 +79,9 @@ function CalendarWeekTask({ height, width, left, top, task, zIndex, handleOpen,
e
.
preventDefault
();
e
.
preventDefault
();
let
hour
let
hour
if
(
hourFormat
)
{
if
(
hourFormat
)
{
hour
=
task
.
infoForCell
.
startHour
+
(
Math
.
ceil
(
e
.
nativeEvent
.
offsetY
/
step
)
-
1
)
hour
=
task
.
infoForCell
.
startHour
+
(
Math
.
ceil
(
e
.
nativeEvent
.
offsetY
/
step
)
-
1
)
}
else
{
}
else
{
hour
=
task
.
infoForCell
.
startHour
+
(
Math
.
ceil
(
e
.
nativeEvent
.
offsetY
/
step
)
-
1
+
Math
.
ceil
(
e
.
nativeEvent
.
offsetY
/
step
)
-
1
)
hour
=
task
.
infoForCell
.
startHour
+
(
Math
.
ceil
(
e
.
nativeEvent
.
offsetY
/
step
)
-
1
+
Math
.
ceil
(
e
.
nativeEvent
.
offsetY
/
step
)
-
1
)
}
}
dragTaskHandler
(
task
.
infoForCell
.
startDay
,
hour
,
task
.
infoForCell
.
startMonth
-
1
,
task
.
infoForCell
.
startYear
)
dragTaskHandler
(
task
.
infoForCell
.
startDay
,
hour
,
task
.
infoForCell
.
startMonth
-
1
,
task
.
infoForCell
.
startYear
)
}
}
...
@@ -90,28 +90,38 @@ function CalendarWeekTask({ height, width, left, top, task, zIndex, handleOpen,
...
@@ -90,28 +90,38 @@ function CalendarWeekTask({ height, width, left, top, task, zIndex, handleOpen,
e
.
preventDefault
();
e
.
preventDefault
();
}
}
const
onClickCopyIconHandler
=
useCallback
((
e
)
=>
{
const
onClickCopyIconHandler
=
useCallback
((
e
)
=>
{
e
.
stopPropagation
();
e
.
stopPropagation
();
setCopyTask
(
task
)
setCopyTask
(
task
)
},[
task
,
setCopyTask
])
},
[
task
,
setCopyTask
])
console
.
log
(
tasksLength
)
return
(
return
(
<
Box
<
Box
draggable
=
{
true
}
draggable
=
{
true
}
onDragStart
=
{(
e
)
=>
{
dragStartHandler
(
e
,
task
)
}}
onDragStart
=
{(
e
)
=>
{
dragStartHandler
(
e
,
task
)
}}
onDragEnd
=
{(
e
)
=>
{
dragEndHandler
(
e
)
}}
onDragEnd
=
{(
e
)
=>
{
dragEndHandler
(
e
)
}}
onDrop
=
{(
e
)
=>
{
dropHandler
(
e
,
task
)
}}
onDrop
=
{(
e
)
=>
{
dropHandler
(
e
,
task
)
}}
onDragOver
=
{(
e
)
=>
{
dragOverHandler
(
e
)
}}
onDragOver
=
{(
e
)
=>
{
dragOverHandler
(
e
)
}}
onDragLeave
=
{(
e
)
=>
{
dragLeaveHandler
(
e
)
}}
onDragLeave
=
{(
e
)
=>
{
dragLeaveHandler
(
e
)
}}
onClick
=
{(
e
)
=>
{
onClickTaskHandler
(
e
,
task
)
}}
onClick
=
{(
e
)
=>
{
onClickTaskHandler
(
e
,
task
)
}}
className
=
'calendar_task_block'
className
=
'calendar_task_block'
sx
=
{
styles
}
>
sx
=
{
styles
}
>
<
span
style
=
{{
textOverflow
:
'ellipsis'
,
padding
:
'5px 0 0 5px'
}}
>
{
tasksLength
>
2
?
<>
{
task
.
title
}
<
CopyIcon
<
/span
>
tasksLength
=
{
tasksLength
}
<
CopyIcon
onClick
=
{(
e
)
=>
{
onClickCopyIconHandler
(
e
)
}}
onClick
=
{(
e
)
=>
{
onClickCopyIconHandler
(
e
)}}
/
>
/
>
<
span
style
=
{{
textOverflow
:
'ellipsis'
,
padding
:
'5px 0 0 5px'
}}
>
{
task
.
title
}
<
/span
>
<
/
>
:
<>
<
span
style
=
{{
textOverflow
:
'ellipsis'
,
padding
:
'5px 0 0 5px'
}}
>
{
task
.
title
}
<
/span
>
<
CopyIcon
onClick
=
{(
e
)
=>
{
onClickCopyIconHandler
(
e
)
}}
/> </
>
}
<
/Box>
)
;
<
/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