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
88508f5d
Commit
88508f5d
authored
Dec 24, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#129
реализовал проекты в модалке для недельного календаря
parent
d38e42bc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
WeekCalendarBody.js
...lendars/WeekCalendar/WeekCalendarBody/WeekCalendarBody.js
+3
-2
MonthCalendar.js
planner-front/src/containers/MonthCalendar/MonthCalendar.js
+3
-3
WeekCalendar.js
planner-front/src/containers/WeekCalendar/WeekCalendar.js
+8
-3
No files found.
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarBody/WeekCalendarBody.js
View file @
88508f5d
...
@@ -2,7 +2,7 @@ import { Grid } from "@mui/material";
...
@@ -2,7 +2,7 @@ import { Grid } from "@mui/material";
import
{
Box
}
from
"@mui/system"
;
import
{
Box
}
from
"@mui/system"
;
import
{
useCallback
,
useState
}
from
"react"
;
import
{
useCallback
,
useState
}
from
"react"
;
import
ModalTask
from
"../../ModalTask/ModalTask"
;
import
ModalTask
from
"../../ModalTask/ModalTask"
;
import
MonthCalendarModal
Content
from
"../../CalendarModalTaskContent/CalendarModalTaskContent"
;
import
CalendarModalTask
Content
from
"../../CalendarModalTaskContent/CalendarModalTaskContent"
;
import
CalendarRow
from
"../../CalendarRow/CalendarRow"
;
import
CalendarRow
from
"../../CalendarRow/CalendarRow"
;
import
CalendarSmallCell
from
"../../CalendarSmallCell/CalendarSmallCell"
;
import
CalendarSmallCell
from
"../../CalendarSmallCell/CalendarSmallCell"
;
import
CalendarStandartCell
from
"../../CalendarStandartCell/CalendarStandartCell"
;
import
CalendarStandartCell
from
"../../CalendarStandartCell/CalendarStandartCell"
;
...
@@ -98,13 +98,14 @@ function WeekCalendarBody({ week, hoursInDay, hourFormat, setHourFormat, date, t
...
@@ -98,13 +98,14 @@ function WeekCalendarBody({ week, hoursInDay, hourFormat, setHourFormat, date, t
handleClose
=
{()
=>
{
handleClose
()
}}
handleClose
=
{()
=>
{
handleClose
()
}}
week
=
{
true
}
week
=
{
true
}
>
>
<
MonthCalendarModal
Content
<
CalendarModalTask
Content
title
=
{
currentTask
.
title
}
title
=
{
currentTask
.
title
}
description
=
{
currentTask
.
description
}
description
=
{
currentTask
.
description
}
priority
=
{
currentTask
.
priority
}
priority
=
{
currentTask
.
priority
}
id
=
{
currentTask
.
id
}
id
=
{
currentTask
.
id
}
startHour
=
{
currentTask
.
infoForCell
?.
startHour
}
startHour
=
{
currentTask
.
infoForCell
?.
startHour
}
endHour
=
{
currentTask
.
infoForCell
?.
endHour
}
endHour
=
{
currentTask
.
infoForCell
?.
endHour
}
project
=
{
currentTask
.
project
}
onChangeCurrentTaskHandler
=
{(
e
)
=>
{
onChangeCurrentTaskHandler
(
e
)
}}
onChangeCurrentTaskHandler
=
{(
e
)
=>
{
onChangeCurrentTaskHandler
(
e
)
}}
sendNewTaskHandler
=
{()
=>
{
sendNewTaskHandler
();
handleClose
()
}}
sendNewTaskHandler
=
{()
=>
{
sendNewTaskHandler
();
handleClose
()
}}
deleteTaskHandler
=
{()
=>
{
deleteTaskHandler
(
currentTask
.
id
);
handleClose
()
}}
deleteTaskHandler
=
{()
=>
{
deleteTaskHandler
(
currentTask
.
id
);
handleClose
()
}}
...
...
planner-front/src/containers/MonthCalendar/MonthCalendar.js
View file @
88508f5d
...
@@ -25,7 +25,7 @@ function MonthCalendar() {
...
@@ -25,7 +25,7 @@ function MonthCalendar() {
const
[
userId
,
setUserId
]
=
useState
(
''
)
const
[
userId
,
setUserId
]
=
useState
(
''
)
const
[
userCalendarId
,
setUserCalendarId
]
=
useState
(
null
)
const
[
userCalendarId
,
setUserCalendarId
]
=
useState
(
null
)
const
[
modal
,
setModal
]
=
useState
(
false
)
const
[
modal
,
setModal
]
=
useState
(
false
)
console
.
log
(
currentTask
)
useEffect
(()
=>
{
useEffect
(()
=>
{
setDateNow
({
setDateNow
({
month
:
new
Date
().
getMonth
(),
month
:
new
Date
().
getMonth
(),
...
@@ -148,10 +148,10 @@ function MonthCalendar() {
...
@@ -148,10 +148,10 @@ function MonthCalendar() {
endHour
:
hourDue
,
endHour
:
hourDue
,
startDay
:
dayNumber
startDay
:
dayNumber
},
},
project
:
allUserProjects
[
0
]
?
.
id
project
:
allUserProjects
[
0
].
id
}
}
setCurrentTask
((
newTask
))
setCurrentTask
((
newTask
))
},
[
dateNow
.
month
,
dateNow
.
year
,
hourFormat
])
},
[
dateNow
.
month
,
dateNow
.
year
,
hourFormat
,
allUserProjects
])
const
dragTaskHandler
=
useCallback
(
async
(
dayNumber
,
hour
)
=>
{
const
dragTaskHandler
=
useCallback
(
async
(
dayNumber
,
hour
)
=>
{
const
hourDiff
=
currentTask
.
infoForCell
.
endHour
-
currentTask
.
infoForCell
.
startHour
const
hourDiff
=
currentTask
.
infoForCell
.
endHour
-
currentTask
.
infoForCell
.
startHour
...
...
planner-front/src/containers/WeekCalendar/WeekCalendar.js
View file @
88508f5d
...
@@ -4,14 +4,17 @@ import { useDispatch, useSelector } from 'react-redux';
...
@@ -4,14 +4,17 @@ import { useDispatch, useSelector } from 'react-redux';
import
WeekCalendarBody
from
'../../components/Calendars/WeekCalendar/WeekCalendarBody/WeekCalendarBody'
;
import
WeekCalendarBody
from
'../../components/Calendars/WeekCalendar/WeekCalendarBody/WeekCalendarBody'
;
import
WeekCalendarHeader
from
'../../components/Calendars/WeekCalendar/WeekCalendarHeader/WeekCalendarHeader'
;
import
WeekCalendarHeader
from
'../../components/Calendars/WeekCalendar/WeekCalendarHeader/WeekCalendarHeader'
;
import
{
getWeekInfoString
,
getWeekFromCurrentDate
,
dateToISOLikeButLocal
}
from
'../../helpers/CalendarHelpers'
;
import
{
getWeekInfoString
,
getWeekFromCurrentDate
,
dateToISOLikeButLocal
}
from
'../../helpers/CalendarHelpers'
;
import
{
fetchAllUserProjects
}
from
'../../store/actions/projectsActions'
;
import
{
addCalendarTask
,
addCopyCalendarTask
,
deleteCalendarTask
,
editCalendarTask
,
fetchCalendarTasks
}
from
'../../store/actions/tasksActions'
;
import
{
addCalendarTask
,
addCopyCalendarTask
,
deleteCalendarTask
,
editCalendarTask
,
fetchCalendarTasks
}
from
'../../store/actions/tasksActions'
;
function
WeekCalendar
()
{
function
WeekCalendar
()
{
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
{
calendarTasks
}
=
useSelector
(
state
=>
state
.
tasks
);
const
{
calendarTasks
}
=
useSelector
(
state
=>
state
.
tasks
);
const
[
copyTask
,
setCopyTask
]
=
useState
(
null
)
const
{
allUserProjects
}
=
useSelector
(
state
=>
state
.
projects
)
const
user
=
useSelector
(
state
=>
state
.
users
?.
user
);
const
user
=
useSelector
(
state
=>
state
.
users
?.
user
);
const
[
copyTask
,
setCopyTask
]
=
useState
(
null
)
const
[
weekGoal
,
setWeekGoal
]
=
useState
(
'Наладить режим сна'
)
const
[
weekGoal
,
setWeekGoal
]
=
useState
(
'Наладить режим сна'
)
const
[
weekPriorities
,
setWeekPriorities
]
=
useState
({
priorityOne
:
'Один'
,
priorityTwo
:
'Два'
,
priorityThree
:
'Три'
})
const
[
weekPriorities
,
setWeekPriorities
]
=
useState
({
priorityOne
:
'Один'
,
priorityTwo
:
'Два'
,
priorityThree
:
'Три'
})
const
[
dateNow
,
setDateNow
]
=
useState
({
year
:
''
,
month
:
''
,
currentDay
:
''
})
const
[
dateNow
,
setDateNow
]
=
useState
({
year
:
''
,
month
:
''
,
currentDay
:
''
})
...
@@ -25,6 +28,7 @@ function WeekCalendar() {
...
@@ -25,6 +28,7 @@ function WeekCalendar() {
const
currentDay
=
moment
().
date
()
const
currentDay
=
moment
().
date
()
setDateNow
({
year
:
year
,
month
:
month
,
currentDay
:
currentDay
})
setDateNow
({
year
:
year
,
month
:
month
,
currentDay
:
currentDay
})
dispatch
(
fetchCalendarTasks
(
user
.
id
))
dispatch
(
fetchCalendarTasks
(
user
.
id
))
dispatch
(
fetchAllUserProjects
())
setUserId
(
user
.
id
)
setUserId
(
user
.
id
)
},
[
dispatch
,
user
.
id
])
},
[
dispatch
,
user
.
id
])
...
@@ -122,10 +126,11 @@ function WeekCalendar() {
...
@@ -122,10 +126,11 @@ function WeekCalendar() {
endHour
:
hourDue
,
endHour
:
hourDue
,
startDay
:
dayNumber
,
startDay
:
dayNumber
,
month
:
month
month
:
month
}
},
project
:
allUserProjects
[
0
]?.
id
}
}
setCurrentTask
((
newTask
))
setCurrentTask
((
newTask
))
},
[
dateNow
.
year
,
hourFormat
])
},
[
dateNow
.
year
,
hourFormat
,
allUserProjects
])
const
sendNewTaskHandler
=
useCallback
(
async
()
=>
{
const
sendNewTaskHandler
=
useCallback
(
async
()
=>
{
const
timeEndHour
=
currentTask
.
infoForCell
.
endHour
const
timeEndHour
=
currentTask
.
infoForCell
.
endHour
...
...
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