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
height
:
linesInDay
?.
length
?
`
${
heightCell
*
linesInDay
.
length
+
5
}
px`
:
`
${
45
}
px`
,
borderRight
:
'1px solid black'
,
borderBottom
:
week
?
'1px solid black'
:
null
,
transition
:
'0.3s'
,
transition
:
week
?
'0.3s'
:
null
,
'&:hover'
:
{
transition
:
'0.3s'
,
cursor
:
children
?
null
:
'#d6d2d2'
,
...
...
planner-front/src/components/Calendars/UI/CopyIcon/CopyIcon.js
View file @
f9ec068f
...
...
@@ -2,9 +2,8 @@
import
React
,
{
memo
}
from
"react"
;
import
ContentCopyIcon
from
'@mui/icons-material/ContentCopy'
;
const
styles
=
{
width
:
'20px'
,
cursor
:
'pointer'
,
marginLeft
:
'auto'
}
const
CopyIcon
=
({
onClick
})
=>
{
const
CopyIcon
=
({
onClick
,
tasksLength
})
=>
{
const
styles
=
{
width
:
'20px'
,
cursor
:
'pointer'
,
marginLeft
:
tasksLength
>
2
?
'5px'
:
'auto'
,
marginTop
:
tasksLength
?
'5px'
:
0
}
return
(
<
ContentCopyIcon
sx
=
{
styles
}
onClick
=
{
onClick
}
>
<
/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
{
boxes
.
map
((
task
)
=>
{
const
{
width
,
left
,
zIndex
}
=
getWidthLeftZIndex
(
task
,
columnDaySize
.
width
,
i
)
const
step
=
columnDaySize
.
height
/
hours
.
length
const
tasksLength
=
task
.
tasksInHour
return
(
<
CalendarWeekTask
key
=
{
task
.
task
.
id
}
...
...
@@ -59,6 +60,7 @@ function CalendarColumnDayWeek({ hoursInDay, tasks, month, year, day, hourFormat
setCopyTask
=
{
setCopyTask
}
dragTaskHandler
=
{
dragTaskHandler
}
step
=
{
step
}
tasksLength
=
{
tasksLength
}
hourFormat
=
{
hourFormat
}
>
<
/CalendarWeekTask
>
...
...
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarBody/CalendarColumnDayWeek/CalendarWeekTask/CalendarWeekTask.js
View file @
f9ec068f
...
...
@@ -4,7 +4,7 @@ import { getColorTaskByPriority } from "../../../../../../helpers/CalendarHelper
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
color
=
useMemo
(()
=>
{
return
getColorTaskByPriority
(
task
.
priority
)
...
...
@@ -79,9 +79,9 @@ function CalendarWeekTask({ height, width, left, top, task, zIndex, handleOpen,
e
.
preventDefault
();
let
hour
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
{
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
)
}
...
...
@@ -90,28 +90,38 @@ function CalendarWeekTask({ height, width, left, top, task, zIndex, handleOpen,
e
.
preventDefault
();
}
const
onClickCopyIconHandler
=
useCallback
((
e
)
=>
{
const
onClickCopyIconHandler
=
useCallback
((
e
)
=>
{
e
.
stopPropagation
();
setCopyTask
(
task
)
},[
task
,
setCopyTask
])
},
[
task
,
setCopyTask
])
console
.
log
(
tasksLength
)
return
(
<
Box
draggable
=
{
true
}
onDragStart
=
{(
e
)
=>
{
dragStartHandler
(
e
,
task
)
}}
onDragEnd
=
{(
e
)
=>
{
dragEndHandler
(
e
)
}}
onDrop
=
{(
e
)
=>
{
dropHandler
(
e
,
task
)
}}
onDragOver
=
{(
e
)
=>
{
dragOverHandler
(
e
)
}}
onDragOver
=
{(
e
)
=>
{
dragOverHandler
(
e
)
}}
onDragLeave
=
{(
e
)
=>
{
dragLeaveHandler
(
e
)
}}
onClick
=
{(
e
)
=>
{
onClickTaskHandler
(
e
,
task
)
}}
className
=
'calendar_task_block'
sx
=
{
styles
}
>
<
span
style
=
{{
textOverflow
:
'ellipsis'
,
padding
:
'5px 0 0 5px'
}}
>
{
task
.
title
}
<
/span
>
<
CopyIcon
onClick
=
{(
e
)
=>
{
onClickCopyIconHandler
(
e
)}}
/
>
{
tasksLength
>
2
?
<>
<
CopyIcon
tasksLength
=
{
tasksLength
}
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>
)
;
}
...
...
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