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
adfe0432
Commit
adfe0432
authored
Jan 11, 2023
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'task-148-fix/fix_bugs_and_enhance' into 'development'
Task 148 fix/fix bugs and enhance See merge request
!115
parents
eb22fe70
95a5903f
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
50 additions
and
215 deletions
+50
-215
tasks.ts
planner-api/src/routers/tasks.ts
+2
-2
CalendarRowDay.js
...lendar/MonthCalendarBody/CalendarRowDay/CalendarRowDay.js
+3
-4
CalendarTask.js
...thCalendar/MonthCalendarBody/CalendarTask/CalendarTask.js
+2
-2
CalendarModalTaskContent.js
...s/UI/CalendarModalTaskContent/CalendarModalTaskContent.js
+1
-1
CalendarStandartCell.js
...Calendars/UI/CalendarStandartCell/CalendarStandartCell.js
+0
-1
CalendarColumnDayWeek.js
...lendarBody/CalendarColumnDayWeek/CalendarColumnDayWeek.js
+5
-8
WeekCalendarHeader.js
...ars/WeekCalendar/WeekCalendarHeader/WeekCalendarHeader.js
+1
-13
WeekCalendarHeaderInfo.js
...arHeader/WeekCalendarHeaderInfo/WeekCalendarHeaderInfo.js
+1
-1
WeekGoal.js
...dars/WeekCalendar/WeekCalendarHeader/WeekGoal/WeekGoal.js
+0
-43
WeekPriorities.js
...endar/WeekCalendarHeader/WeekPriorities/WeekPriorities.js
+0
-34
WeekPriority.js
...alendarHeader/WeekPriorities/WeekPriority/WeekPriority.js
+0
-40
ProjectInfo.js
...c/components/ProjectComponents/ProjectInfo/ProjectInfo.js
+1
-1
ProjectUserItem.js
...ents/ProjectComponents/ProjectUserItem/ProjectUserItem.js
+0
-26
UserItem.js
...Wrapper/ProjectUsersColumn/UsersList/UserItem/UserItem.js
+1
-1
ProjectItem.js
...s/ProjectsWrapper/ProjectsList/ProjectItem/ProjectItem.js
+11
-2
ProjectsWrapper.js
...nts/ProjectsComponents/ProjectsWrapper/ProjectsWrapper.js
+1
-1
constants.js
planner-front/src/constants.js
+1
-1
FullProject.js
planner-front/src/containers/FullProject/FullProject.js
+10
-2
MonthCalendar.js
planner-front/src/containers/MonthCalendar/MonthCalendar.js
+3
-3
WeekCalendar.js
planner-front/src/containers/WeekCalendar/WeekCalendar.js
+6
-28
projectsActions.js
planner-front/src/store/actions/projectsActions.js
+1
-1
No files found.
planner-api/src/routers/tasks.ts
View file @
adfe0432
...
...
@@ -27,7 +27,7 @@ router.get('/', async(req:Request, res:Response):Promise<Response> => {
/**create new task for table MyTask*/
router
.
post
(
'/'
,
auth
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
const
{
user
,
title
,
description
,
project
,
executor
,
dateTimeStart
,
dateTimeDue
,
dateTimeDeadLine
,
priority
}
=
req
.
body
;
const
{
user
,
title
,
description
,
project
,
executor
,
dateTimeStart
,
dateTimeDue
,
dateTimeDeadLine
,
priority
,
calendar
}
=
req
.
body
;
console
.
log
(
'dateTimeStart
\
n'
,
dateTimeStart
,
"dateTimeDue
\n
"
,
dateTimeDue
,
'dateTimeDeadLine
\
n '
,
dateTimeDeadLine
)
let
dateTimeDueFinal
=
dateTimeDue
let
dateTimeStartFinal
=
dateTimeStart
...
...
@@ -96,7 +96,7 @@ router.post('/', auth, async(req:Request, res:Response):Promise<Response>=>{
}
newTask
.
priority
=
priority
;
await
newTask
.
save
();
if
(
dateTimeDeadlineFinal
)
{
if
(
calendar
)
{
const
newDateTimeTask
=
new
DateTimeTask
();
newDateTimeTask
.
dateTimeStart
=
dateTimeStartFinal
newDateTimeTask
.
dateTimeDue
=
dateTimeDueFinal
...
...
planner-front/src/components/Calendars/MonthCalendar/MonthCalendarBody/CalendarRowDay/CalendarRowDay.js
View file @
adfe0432
...
...
@@ -40,8 +40,7 @@ const CalendarRowDay = ({ xs, hoursInDay, createTaskInCellHandler, currentTask,
>
{
linesInDay
?.
map
((
line
,
i
)
=>
{
const
tasks
=
getTasksWithInfoForPosition
(
line
,
hoursInDay
,
sortedTasks
,
i
,
rowDaySize
.
width
)
return
(
<>
{
tasks
.
map
((
task
)
=>
{
return
(
tasks
.
map
((
task
)
=>
{
const
step
=
rowDaySize
.
width
/
hoursInDay
.
length
return
(
<
CalendarTask
...
...
@@ -61,8 +60,8 @@ const CalendarRowDay = ({ xs, hoursInDay, createTaskInCellHandler, currentTask,
>
<
/CalendarTask
>
)
})
}
<
/>
)
})
)
})}
{
hoursInDay
.
map
((
hour
,
i
)
=>
{
...
...
planner-front/src/components/Calendars/MonthCalendar/MonthCalendarBody/CalendarTask/CalendarTask.js
View file @
adfe0432
...
...
@@ -57,12 +57,12 @@ const CalendarTask = ({ setCurrentTask, handleOpen, task, setCopyTask, width, le
const
dragStartHandler
=
useCallback
((
e
,
task
)
=>
{
setCurrentTask
(
task
);
setCopyTask
(
task
)
},[
setCurrentTask
])
},[
setCurrentTask
,
setCopyTask
])
const
dragEndHandler
=
useCallback
((
e
)
=>
{
e
.
target
.
style
.
boxShadow
=
'none'
setCopyTask
(
null
)
},[])
},[
setCopyTask
])
const
onClickCopyIconHandler
=
useCallback
((
e
)
=>
{
e
.
stopPropagation
();
...
...
planner-front/src/components/Calendars/UI/CalendarModalTaskContent/CalendarModalTaskContent.js
View file @
adfe0432
...
...
@@ -34,7 +34,7 @@ function CalendarModalTaskContent({ title, onChangeCurrentTaskHandler, descripti
/
>
<
div
style
=
{{
display
:
'flex'
,
gap
:
'20px'
,
margin
:
'20px 0'
}}
>
<
CustomSelect
defaultValue
=
{
null
}
defaultValue
=
{
priorities
[
0
]?.
value
}
value
=
{
priority
}
name
=
{
'priority'
}
variant
=
{
'outlined'
}
...
...
planner-front/src/components/Calendars/UI/CalendarStandartCell/CalendarStandartCell.js
View file @
adfe0432
...
...
@@ -22,7 +22,6 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
}
},[
copyTask
,
copyModeTask
,
year
,
month
,
dayNumber
,
hours
])
// console.log(copyTask)
const
cellClass
=
useMemo
(()
=>
{
const
backgroundColor
=
isDeadLine
?
'#fa9b9be3'
:
'null'
return
({
...
...
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarBody/CalendarColumnDayWeek/CalendarColumnDayWeek.js
View file @
adfe0432
import
{
useMemo
}
from
"react"
;
import
React
,
{
useMemo
}
from
"react"
;
import
{
getHoursInDayNumbers
,
getAvailableTasks
,
getLinesInDay
,
getSortedTasks
}
from
"../../../../../helpers/CalendarHelpers"
;
import
CalendarStandartCell
from
"../../../UI/CalendarStandartCell/CalendarStandartCell"
;
import
{
useEffect
,
useRef
,
useState
}
from
"react"
;
...
...
@@ -8,7 +8,7 @@ import { getTasksWithInfoForPosition, getWidthLeftZIndex } from "./Helpers";
function
CalendarColumnDayWeek
({
hoursInDay
,
tasks
,
month
,
year
,
day
,
hourFormat
,
handleOpen
,
setCurrentTask
,
copyTask
,
setCopyTask
,
createCopyTask
,
createTaskInCellHandler
,
modal
,
dragTaskHandler
,
copyMode
,
deleteTaskHandler
})
{
function
CalendarColumnDayWeek
({
hoursInDay
,
tasks
,
month
,
year
,
day
,
hourFormat
,
handleOpen
,
setCurrentTask
,
copyTask
,
setCopyTask
,
createCopyTask
,
createTaskInCellHandler
,
modal
,
dragTaskHandler
,
copyMode
,
deleteTaskHandler
})
{
const
[
columnDaySize
,
setColumnDaySize
]
=
useState
({
width
:
0
,
height
:
0
})
...
...
@@ -39,8 +39,7 @@ function CalendarColumnDayWeek({ hoursInDay, tasks, month, year, day, hourFormat
<
Grid
item
xs
=
{
12
/
7
}
ref
=
{
dayColumnRef
}
sx
=
{{
position
:
'relative'
}}
>
{
linesInDay
?.
map
((
line
,
i
)
=>
{
const
boxes
=
getTasksWithInfoForPosition
(
line
,
sortedTasks
,
linesInDay
,
columnDaySize
.
height
,
hours
)
return
(
<>
{
boxes
.
map
((
task
)
=>
{
return
boxes
.
map
((
task
)
=>
{
const
{
width
,
left
,
zIndex
}
=
getWidthLeftZIndex
(
task
,
columnDaySize
.
width
,
i
)
const
step
=
columnDaySize
.
height
/
hours
.
length
const
tasksLength
=
task
.
tasksInHour
...
...
@@ -64,11 +63,9 @@ function CalendarColumnDayWeek({ hoursInDay, tasks, month, year, day, hourFormat
hourFormat
=
{
hourFormat
}
copyModeTask
=
{
copyMode
.
task
}
deleteTaskHandler
=
{
deleteTaskHandler
}
>
<
/CalendarWeekTask
>
/
>
)
})}
<
/>
)
})
})}
{
hoursInDay
?.
map
((
hour
,
i
)
=>
{
...
...
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarHeader/WeekCalendarHeader.js
View file @
adfe0432
...
...
@@ -4,13 +4,11 @@ import { memo } from 'react';
import
ButtonSwapCalendar
from
'../../UI/ButtonSwapCalendar/ButtonSwapCalendar'
;
import
CalendarUserDisplayName
from
'../../UI/CalendarUserDisplayName/CalendarUserDisplayName'
;
import
WeekCalendarHeaderInfo
from
'./WeekCalendarHeaderInfo/WeekCalendarHeaderInfo'
;
import
WeekGoal
from
'./WeekGoal/WeekGoal'
;
import
WeekPriorities
from
'./WeekPriorities/WeekPriorities'
;
function
WeekCalendarHeader
({
decrementWeek
,
incrementWeek
,
weekInfo
,
weekGoal
,
onChangeWeekGoalHandler
,
weekPriorities
,
onChangeWeekPriorities
Handler
,
handleOpen
,
currentCalendarDisplayName
,
user
,
userId
})
{
function
WeekCalendarHeader
({
decrementWeek
,
incrementWeek
,
weekInfo
,
onChangeWeekGoal
Handler
,
handleOpen
,
currentCalendarDisplayName
,
user
,
userId
})
{
return
(
<>
...
...
@@ -22,21 +20,11 @@ function WeekCalendarHeader({ decrementWeek, incrementWeek, weekInfo, weekGoal,
<
CalendarUserDisplayName
currentCalendarDisplayName
=
{
currentCalendarDisplayName
}
/
>
<
WeekGoal
weekGoal
=
{
weekGoal
}
onChangeWeekGoalHandler
=
{
onChangeWeekGoalHandler
}
/
>
<
WeekPriorities
weekPriorities
=
{
weekPriorities
}
onChangeWeekPrioritiesHandler
=
{
onChangeWeekPrioritiesHandler
}
/
>
<
WeekCalendarHeaderInfo
decrementWeek
=
{
decrementWeek
}
incrementWeek
=
{
incrementWeek
}
weekInfo
=
{
weekInfo
}
weekGoal
=
{
weekGoal
}
onChangeWeekGoalHandler
=
{
onChangeWeekGoalHandler
}
/
>
...
...
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarHeader/WeekCalendarHeaderInfo/WeekCalendarHeaderInfo.js
View file @
adfe0432
...
...
@@ -9,7 +9,7 @@ import { memo, } from 'react';
function
WeekCalendarHeaderInfo
({
decrementWeek
,
incrementWeek
,
weekInfo
})
{
return
(
<>
<
Box
sx
=
{{
width
:
'
80%
'
,
marginBottom
:
'15px'
}}
>
<
Box
sx
=
{{
width
:
'
400px
'
,
marginBottom
:
'15px'
}}
>
<
Box
sx
=
{{
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
ArrowDecrementButton
...
...
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarHeader/WeekGoal/WeekGoal.js
deleted
100644 → 0
View file @
eb22fe70
import
{
Box
}
from
'@mui/system'
;
import
{
TextField
,
Typography
}
from
'@mui/material'
;
import
{
memo
,
useCallback
,
useState
}
from
'react'
;
function
WeekGoal
({
weekGoal
,
onChangeWeekGoalHandler
})
{
const
[
goalEditCheck
,
setGoalEditCheck
]
=
useState
(
false
)
const
onClickGoalHandler
=
useCallback
(()
=>
{
setGoalEditCheck
(
true
)
},
[])
return
(
<>
<
Box
sx
=
{{
display
:
'flex'
,
alignItems
:
'center'
,
gap
:
'10px'
}}
>
{
goalEditCheck
?
<>
<
Typography
variant
=
'h5'
sx
=
{{
marginTop
:
'20px'
}}
>
Цель
недели
:
<
/Typography
>
<
TextField
id
=
"week-gaol"
value
=
{
weekGoal
}
variant
=
"standard"
sx
=
{{
input
:
{
color
:
'white'
,
fontSize
:
'22px'
,
fontWeight
:
'400'
,
paddingTop
:
'25px'
}
}}
InputProps
=
{{
disableUnderline
:
true
,
}}
name
=
'weekGoal'
autoFocus
onBlur
=
{()
=>
{
setGoalEditCheck
(
false
)
}}
onChange
=
{(
e
)
=>
{
onChangeWeekGoalHandler
(
e
)
}}
/
>
<
/
>
:
<
Typography
variant
=
'h5'
onClick
=
{()
=>
{
onClickGoalHandler
()
}}
sx
=
{{
marginTop
:
'20px'
}}
>
Цель
недели
:
{
weekGoal
}
<
/Typography
>
}
<
/Box
>
<
/
>
);
}
export
default
memo
(
WeekGoal
);
\ No newline at end of file
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarHeader/WeekPriorities/WeekPriorities.js
deleted
100644 → 0
View file @
eb22fe70
import
{
Box
}
from
'@mui/system'
;
import
{
Typography
}
from
'@mui/material'
;
import
{
memo
}
from
'react'
;
import
WeekPriority
from
'./WeekPriority/WeekPriority'
;
function
WeekPriorities
({
weekPriorities
,
onChangeWeekPrioritiesHandler
})
{
return
(
<>
<
Box
>
<
Typography
variant
=
'h5'
sx
=
{{
display
:
'flex'
,
flexDirection
:
'column'
}}
>
Приоритеты
:
{
Object
.
values
(
weekPriorities
).
map
((
priority
,
i
)
=>
{
return
(
<
WeekPriority
key
=
{
i
}
onChangeWeekPrioritiesHandler
=
{(
e
)
=>
{
onChangeWeekPrioritiesHandler
(
e
)}}
priorityName
=
{
Object
.
keys
(
weekPriorities
)[
i
]}
priority
=
{
priority
}
number
=
{
i
+
1
}
/
>
)
})}
<
/Typography
>
<
/Box
>
<
/
>
);
}
export
default
memo
(
WeekPriorities
);
\ No newline at end of file
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarHeader/WeekPriorities/WeekPriority/WeekPriority.js
deleted
100644 → 0
View file @
eb22fe70
import
{
Box
}
from
'@mui/system'
;
import
{
TextField
,
Typography
}
from
'@mui/material'
;
import
{
memo
,
useCallback
,
useState
}
from
'react'
;
function
WeekPriority
({
number
,
priority
,
onChangeWeekPrioritiesHandler
,
priorityName
})
{
const
[
priorityEditCheck
,
setPriorityEditCheck
]
=
useState
(
false
)
const
onClickPriorityHandler
=
useCallback
(()
=>
{
setPriorityEditCheck
(
true
)
},
[])
return
(
<>
<
Box
sx
=
{{
display
:
'flex'
,
alignItems
:
'center'
,
gap
:
'10px'
}}
>
{
priorityEditCheck
?
<>
<
Typography
variant
=
'string'
>
{
number
}.
<
/Typography
>
<
TextField
id
=
{
priorityName
}
value
=
{
priority
}
variant
=
"standard"
sx
=
{{
input
:
{
color
:
'white'
,
fontSize
:
'22px'
,
fontWeight
:
'400'
}
}}
InputProps
=
{{
disableUnderline
:
true
,
}}
name
=
{
priorityName
}
autoFocus
onBlur
=
{()
=>
{
setPriorityEditCheck
(
false
)
}}
onChange
=
{(
e
)
=>
{
onChangeWeekPrioritiesHandler
(
e
)
}}
/
>
<
/
>
:
<
Typography
variant
=
'string'
onClick
=
{()
=>
{
onClickPriorityHandler
()
}}
>
{
number
}.
{
priority
}
<
/Typography
>
}
<
/Box
>
<
/
>
);
}
export
default
memo
(
WeekPriority
);
\ No newline at end of file
planner-front/src/components/ProjectComponents/ProjectInfo/ProjectInfo.js
View file @
adfe0432
...
...
@@ -36,7 +36,7 @@ const ProjectInfo = ({ project, handleOpen, currentRoleInProject,onClickTasksHan
<
Typography
variant
=
"body1"
sx
=
{
styleText
}
>
Задачи
:
<
ArrowIncrementButton
onClick
=
{()
=>
{
onClickTasksHandler
()}}
/
>
<
/Typography
>
{
currentRoleInProject
===
'
admin
'
?
{
currentRoleInProject
===
'
Админ
'
?
<
Typography
variant
=
"body1"
sx
=
{
styleText
}
>
Добавить
участника
:
<
PersonAddIcon
style
=
{{
cursor
:
'pointer'
}}
onClick
=
{()
=>
{
handleOpen
()
}}
/
>
<
/Typography
>
...
...
planner-front/src/components/ProjectComponents/ProjectUserItem/ProjectUserItem.js
deleted
100644 → 0
View file @
eb22fe70
import
{
Grid
}
from
"@mui/material"
;
import
DeleteIcon
from
"@mui/icons-material/Delete"
;
import
{
deleteMember
}
from
"../../../store/actions/projectsActions"
;
import
{
memo
}
from
"react"
;
const
ProjectMembersItem
=
({
user
})
=>
{
const
style
=
{
width
:
'90%'
,
border
:
'1px solid black'
,
borderRadius
:
'5px'
,
padding
:
'15px 15px'
,
display
:
'flex'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}
return
<>
<
Grid
sx
=
{
style
}
>
{
user
?.
displayName
}
<
DeleteIcon
/>
<
/Grid
>
<
/
>
};
export
default
memo
(
ProjectMembersItem
);
planner-front/src/components/ProjectComponents/ProjectUsersColumnsWrapper/ProjectUsersColumn/UsersList/UserItem/UserItem.js
View file @
adfe0432
...
...
@@ -48,7 +48,7 @@ const ProjectMembersItem = ({ user, deleteMemberHandler, currentRoleInProject, d
>
{
user
?.
displayName
}
{
currentRoleInProject
===
'
admin
'
&&
user
.
id
!==
userId
?
{
currentRoleInProject
===
'
Админ
'
&&
user
.
id
!==
userId
?
<
DeleteIcon
sx
=
{{
cursor
:
'pointer'
}}
onClick
=
{
deleteMemberHandler
}
...
...
planner-front/src/components/ProjectsComponents/ProjectsWrapper/ProjectsList/ProjectItem/ProjectItem.js
View file @
adfe0432
import
{
Box
,
Grid
,
Typography
}
from
"@mui/material"
;
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
{
useSelector
}
from
"react-redux"
;
import
{
memo
,
useMemo
}
from
"react"
;
import
DeleteButton
from
"../../../../UI/DeleteButton/DeleteButton"
;
...
...
@@ -23,7 +23,16 @@ const ProjectItem = ({ title, members, onClickProjectHandler, onClickGoToSpecifi
const
{
user
}
=
useSelector
(
state
=>
state
.
users
);
const
currentRoleInProject
=
useMemo
(()
=>
{
return
members
.
find
((
member
)
=>
member
.
user
.
id
===
user
.
id
)?.
roleProject
switch
(
members
.
find
((
member
)
=>
member
.
user
.
id
===
user
.
id
)?.
roleProject
)
{
case
'admin'
:
return
'Админ'
case
'user'
:
return
'Юзер'
case
'watcher'
:
return
'Наблюдатель'
default
:
return
''
}
},
[
members
,
user
.
id
])
return
<>
...
...
planner-front/src/components/ProjectsComponents/ProjectsWrapper/ProjectsWrapper.js
View file @
adfe0432
import
{
Grid
,
Typography
,
Button
,
Card
,
CardContent
}
from
"@mui/material"
;
import
{
Grid
,
Typography
,
Button
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
import
ProjectsList
from
"./ProjectsList/ProjectsList"
;
...
...
planner-front/src/constants.js
View file @
adfe0432
...
...
@@ -15,7 +15,7 @@ export const anonymoysMenuButtons = [
]
export
const
priorities
=
[
{
value
:
null
,
text
:
'--Приоритет--'
},
{
value
:
''
,
text
:
'--Приоритет--'
},
{
value
:
'A'
,
text
:
'A'
},
{
value
:
'B'
,
text
:
'B'
},
{
value
:
'C'
,
text
:
'C'
}
...
...
planner-front/src/containers/FullProject/FullProject.js
View file @
adfe0432
import
{
Grid
}
from
"@mui/material"
;
import
{
useNavigate
,
useParams
}
from
"react-router-dom"
;
import
{
useSelector
,
useDispatch
}
from
"react-redux"
;
import
{
useCallback
,
useEffect
,
useMemo
,
useState
}
from
"react"
;
...
...
@@ -39,7 +38,16 @@ const FullProject = ({ projectId }) => {
},
[
project
])
const
currentRoleInProject
=
useMemo
(()
=>
{
return
members
.
find
((
member
)
=>
member
.
user
.
id
===
user
.
id
)?.
roleProject
switch
(
members
.
find
((
member
)
=>
member
.
user
.
id
===
user
.
id
)?.
roleProject
)
{
case
'admin'
:
return
'Админ'
case
'user'
:
return
'Юзер'
case
'watcher'
:
return
'Наблюдатель'
default
:
return
''
}
},
[
members
,
user
.
id
])
const
onChangeRoleHandler
=
useCallback
((
e
,
value
)
=>
{
...
...
planner-front/src/containers/MonthCalendar/MonthCalendar.js
View file @
adfe0432
...
...
@@ -20,7 +20,7 @@ function MonthCalendar() {
const
[
hourFormat
,
setHourFormat
]
=
useState
(
false
);
const
[
dateNow
,
setDateNow
]
=
useState
({
month
:
''
,
year
:
''
})
const
[
workerInfo
,
setWorkerInfo
]
=
useState
({
project
:
''
,
worker
:
''
});
const
[
currentTask
,
setCurrentTask
]
=
useState
({
title
:
''
,
description
:
''
,
priority
:
null
,
infoForCell
:
{
startHour
:
null
,
endHour
:
null
}
})
const
[
currentTask
,
setCurrentTask
]
=
useState
({
title
:
''
,
description
:
''
,
priority
:
''
,
infoForCell
:
{
startHour
:
null
,
endHour
:
null
}
})
const
[
copyTask
,
setCopyTask
]
=
useState
(
null
)
const
[
cellSizes
,
setCellSizes
]
=
useState
({})
const
[
userId
,
setUserId
]
=
useState
(
''
)
...
...
@@ -141,7 +141,7 @@ function MonthCalendar() {
const
newTask
=
{
title
:
"Задача"
,
description
:
"описание"
,
priority
:
null
,
priority
:
''
,
dateTimeStart
:
dateToISOLikeButLocal
(
new
Date
(
dateNow
.
year
,
dateNow
.
month
,
dayNumber
,
hour
,
0
)),
dateTimeDue
:
dateToISOLikeButLocal
(
new
Date
(
dateNow
.
year
,
dateNow
.
month
,
dayNumber
,
hourDue
,
59
)),
infoForCell
:
{
...
...
@@ -198,7 +198,7 @@ function MonthCalendar() {
dateTimeDue
:
due
,
executor
:
userId
,
author
:
user
.
id
,
dateTimeDeadLine
:
d
ue
,
calendar
:
tr
ue
,
}
delete
newTask
.
infoForCell
delete
newTask
.
id
...
...
planner-front/src/containers/WeekCalendar/WeekCalendar.js
View file @
adfe0432
...
...
@@ -20,18 +20,16 @@ function WeekCalendar() {
const
{
calendarTasks
,
copyMode
}
=
useSelector
(
state
=>
state
.
tasks
);
const
{
user
,
currentCalendarDisplayName
}
=
useSelector
(
state
=>
state
.
users
);
const
{
allUserProjects
}
=
useSelector
(
state
=>
state
.
projects
)
console
.
log
(
copyMode
)
const
[
weekGoal
,
setWeekGoal
]
=
useState
(
'Наладить режим сна'
)
const
[
weekPriorities
,
setWeekPriorities
]
=
useState
({
priorityOne
:
'Один'
,
priorityTwo
:
'Два'
,
priorityThree
:
'Три'
})
const
[
workerInfo
,
setWorkerInfo
]
=
useState
({
project
:
''
,
worker
:
''
});
const
[
dateNow
,
setDateNow
]
=
useState
({
year
:
''
,
month
:
''
,
currentDay
:
''
})
const
[
currentTask
,
setCurrentTask
]
=
useState
({
title
:
''
,
description
:
''
,
priority
:
null
,
infoForCell
:
{
startHour
:
null
,
endHour
:
null
}
})
const
[
currentTask
,
setCurrentTask
]
=
useState
({
title
:
''
,
description
:
''
,
priority
:
''
,
infoForCell
:
{
startHour
:
null
,
endHour
:
null
}
})
const
[
hourFormat
,
setHourFormat
]
=
useState
(
false
);
const
[
copyTask
,
setCopyTask
]
=
useState
(
null
)
const
[
userCalendarId
,
setUserCalendarId
]
=
useState
(
null
)
const
[
modal
,
setModal
]
=
useState
(
false
)
const
[
userId
,
setUserId
]
=
useState
(
''
)
console
.
log
(
copyTask
)
useEffect
(()
=>
{
const
year
=
new
Date
().
getFullYear
()
const
month
=
new
Date
().
getMonth
()
...
...
@@ -96,23 +94,6 @@ function WeekCalendar() {
setWorkerInfo
((
prevState
)
=>
{
return
{
...
prevState
,
worker
:
value
}
});
},
[]);
const
onChangeWeekGoalHandler
=
useCallback
((
e
)
=>
{
setWeekGoal
((
prevState
)
=>
{
return
e
.
target
.
value
})
},
[])
const
onChangeWeekPrioritiesHandler
=
useCallback
((
e
)
=>
{
const
{
name
,
value
}
=
e
.
target
;
setWeekPriorities
((
prevState
)
=>
{
return
{
...
prevState
,
[
name
]:
value
}
})
},
[])
const
onChangeCurrentTaskHandler
=
useCallback
((
e
)
=>
{
const
{
name
,
value
}
=
e
.
target
;
if
(
name
===
'startHour'
||
name
===
'endHour'
)
{
...
...
@@ -157,7 +138,7 @@ function WeekCalendar() {
const
newTask
=
{
title
:
"Задача"
,
description
:
"описание"
,
priority
:
null
,
priority
:
''
,
dateTimeStart
:
dateToISOLikeButLocal
(
new
Date
(
year
,
month
,
dayNumber
,
hour
,
0
)),
dateTimeDue
:
dateToISOLikeButLocal
(
new
Date
(
year
,
month
,
dayNumber
,
hourDue
,
59
)),
infoForCell
:
{
...
...
@@ -196,7 +177,7 @@ function WeekCalendar() {
dateTimeDue
:
due
,
executor
:
userId
,
author
:
user
.
id
,
dateTimeDeadLine
:
d
ue
,
calendar
:
tr
ue
,
}
delete
newTask
.
infoForCell
delete
newTask
.
id
...
...
@@ -311,15 +292,12 @@ function WeekCalendar() {
incrementWeek
=
{
incrementWeek
}
decrementWeek
=
{
decrementWeek
}
weekInfo
=
{
weekInfo
}
weekGoal
=
{
weekGoal
}
onChangeWeekGoalHandler
=
{
onChangeWeekGoalHandler
}
weekPriorities
=
{
weekPriorities
}
onChangeWeekPrioritiesHandler
=
{
onChangeWeekPrioritiesHandler
}
handleOpen
=
{
handleOpen
}
currentCalendarDisplayName
=
{
currentCalendarDisplayName
}
user
=
{
user
}
userId
=
{
userId
}
/
>
<
WeekCalendarBody
deleteTaskHandler
=
{
deleteTaskHandler
}
sendNewTaskHandler
=
{
sendNewTaskHandler
}
...
...
planner-front/src/store/actions/projectsActions.js
View file @
adfe0432
...
...
@@ -64,7 +64,7 @@ export const deleteProject = (projectId) => {
return
async
(
dispatch
)
=>
{
dispatch
(
deleteProjectRequest
());
try
{
const
response
=
await
axios
.
delete
(
'/projects'
,
{
data
:
{
projectId
:
projectId
}
});
await
axios
.
delete
(
'/projects'
,
{
data
:
{
projectId
:
projectId
}
});
dispatch
(
deleteProjectSuccess
())
dispatch
(
fetchProjects
())
}
catch
(
error
)
{
...
...
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