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
53fe8f38
Commit
53fe8f38
authored
Dec 29, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#135
Добавил мод редактирования
parent
d56c1f40
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
51 additions
and
23 deletions
+51
-23
MonthCalendarBody.js
...dars/MonthCalendar/MonthCalendarBody/MonthCalendarBody.js
+0
-1
MonthCalendarHeader.js
.../MonthCalendar/MonthCalendarHeader/MonthCalendarHeader.js
+1
-1
ModalTask.js
...-front/src/components/Calendars/UI/ModalTask/ModalTask.js
+2
-2
CalendarWeekTask.js
...alendarColumnDayWeek/CalendarWeekTask/CalendarWeekTask.js
+1
-1
TableRowTask.js
...components/MyTasksCompoments/TableRowTask/TableRowTask.js
+11
-7
MyTasks.js
planner-front/src/containers/MyTasks/MyTasks.js
+0
-1
WeekCalendar.js
planner-front/src/containers/WeekCalendar/WeekCalendar.js
+7
-6
tasksTypes.js
planner-front/src/store/actionTypes/tasksTypes.js
+4
-1
tasksActions.js
planner-front/src/store/actions/tasksActions.js
+13
-2
tasksReducer.js
planner-front/src/store/reducers/tasksReducer.js
+12
-1
No files found.
planner-front/src/components/Calendars/MonthCalendar/MonthCalendarBody/MonthCalendarBody.js
View file @
53fe8f38
...
...
@@ -6,7 +6,6 @@ import CalendarStandartCell from "../../UI/CalendarStandartCell/CalendarStandart
import
ModalTask
from
"../../UI/ModalTask/ModalTask"
import
MonthCalendarModalContent
from
"../../UI/CalendarModalTaskContent/CalendarModalTaskContent"
;
import
CalendarRowDay
from
"./CalendarRowDay/CalendarRowDay"
;
import
{
useSelector
}
from
"react-redux"
;
function
MonthCalendarBody
({
month
,
year
,
tasks
,
createTaskInCellHandler
,
currentTask
,
setCurrentTask
,
hourFormat
,
setHourFormat
,
onChangeCurrentTaskHandler
,
sendNewTaskHandler
,
deleteTaskHandler
,
cellSizes
,
hoursInDay
,
daysInMonth
,
dragTaskHandler
,
createCopyTask
,
setCopyTask
,
copyTask
})
{
...
...
planner-front/src/components/Calendars/MonthCalendar/MonthCalendarHeader/MonthCalendarHeader.js
View file @
53fe8f38
import
{
AppBar
,
Button
,
Toolbar
,
Typography
}
from
'@mui/material'
;
import
{
AppBar
,
Toolbar
,
}
from
'@mui/material'
;
import
{
Box
}
from
'@mui/system'
;
import
ButtonSwapCalendar
from
'../../UI/ButtonSwapCalendar/ButtonSwapCalendar'
;
import
CalendarUserDisplayName
from
'../../UI/CalendarUserDisplayName/CalendarUserDisplayName'
;
...
...
planner-front/src/components/Calendars/UI/ModalTask/ModalTask.js
View file @
53fe8f38
import
Box
from
'@mui/material/Box'
;
import
Modal
from
'@mui/material/Modal'
;
import
{
useCallback
,
useEffect
,
use
Memo
,
use
State
}
from
'react'
;
import
{
useCallback
,
useEffect
,
useState
}
from
'react'
;
export
default
function
ModalTask
({
modal
,
handleClose
,
children
,
week
})
{
...
...
@@ -38,7 +38,7 @@ export default function ModalTask({ modal, handleClose, children, week }) {
return
modal
.
yClick
С
ordinates
-
modal
.
yDiv
-
modal
.
yDivClick
-
((
modal
.
yClick
С
ordinates
+
470
)
-
windowDimenion
.
winHeight
)
-
30
}
}
},
[
windowDimenion
.
winHeight
,
modal
])
},
[
windowDimenion
.
winHeight
,
modal
,
week
])
const
getXCordinatesToModal
=
useCallback
(()
=>
{
if
(
windowDimenion
.
winWidth
>
modal
.
xClick
С
ordinates
+
270
+
modal
.
xDiv
)
{
...
...
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarBody/CalendarColumnDayWeek/CalendarWeekTask/CalendarWeekTask.js
View file @
53fe8f38
...
...
@@ -94,7 +94,7 @@ function CalendarWeekTask({ height, width, left, top, task, zIndex, handleOpen,
e
.
stopPropagation
();
setCopyTask
(
task
)
},
[
task
,
setCopyTask
])
console
.
log
(
tasksLength
)
return
(
<
Box
draggable
=
{
true
}
...
...
planner-front/src/components/MyTasksCompoments/TableRowTask/TableRowTask.js
View file @
53fe8f38
...
...
@@ -22,6 +22,9 @@ import BasicSelect from "../../UI/Select/Select";
import
CalendarMonthIcon
from
'@mui/icons-material/CalendarMonth'
;
import
KeyboardArrowDownIcon
from
'@mui/icons-material/KeyboardArrowDown'
;
import
KeyboardArrowUpIcon
from
'@mui/icons-material/KeyboardArrowUp'
;
import
{
useNavigate
}
from
"react-router-dom"
;
import
{
useDispatch
}
from
"react-redux"
;
import
{
activateCreateCopyTasksMode
}
from
"../../../store/actions/tasksActions"
;
const
weekDays
=
[
"Вс"
,
"Пн"
,
"Вт"
,
"Ср"
,
"Чт"
,
"Пт"
,
"Сб"
];
...
...
@@ -40,9 +43,10 @@ const TableRowTask= ({
onToggleEditMode
,
onToggleEditModeDone
,
})
=>
{
const
[
open
,
setOpen
]
=
React
.
useState
(
false
);
const
navigate
=
useNavigate
()
const
dispatch
=
useDispatch
()
const
roudHourUp
=
(
dateIso
)
=>
{
let
m
=
moment
(
dateIso
);
let
roundUp
=
m
.
minute
()
||
m
.
second
()
||
m
.
millisecond
()
?
m
.
add
(
1
,
'hour'
).
startOf
(
'hour'
)
:
m
.
startOf
(
'hour'
);
...
...
@@ -59,7 +63,7 @@ const TableRowTask= ({
return
weekDays
[
date
.
day
()];
}
const
calendarOpen
=
(
taskId
)
=>
{
console
.
log
(
'task Id in Calendar Open'
,
taskId
)
dispatch
(
activateCreateCopyTasksMode
(
task
,
navigate
)
)
}
return
(
...
...
@@ -159,11 +163,11 @@ const TableRowTask= ({
user
:
user
}}
/
>
{
task
.
isEditMode
&&
task
.
author
.
id
===
user
.
id
?
(
{
task
.
dateTimeTasks
.
length
===
0
&&
task
.
author
.
id
===
user
.
id
?
(
<
TableCell
>
<
Tooltip
title
=
"Перейти в календарь"
>
<
IconButton
onClick
=
{()
=>
{
calendarOpen
(
task
.
id
)}}
onClick
=
{()
=>
{
calendarOpen
(
task
)}}
>
<
CalendarMonthIcon
/>
<
/IconButton
>
...
...
@@ -172,7 +176,7 @@ const TableRowTask= ({
<
/TableCell
>
)
:
(
task
.
dateTimeTasks
.
length
>
1
?
task
.
dateTimeTasks
.
length
>=
1
?
<
TableCell
>
<
IconButton
aria
-
label
=
"expand row"
...
...
@@ -286,7 +290,7 @@ const TableRowTask= ({
<
/TableCell>
)
:null
}
<
/TableRow
>
{
task
.
dateTimeTasks
.
length
>
1
?
{
task
.
dateTimeTasks
.
length
>
=
1
?
<
TableRow
>
<
TableCell
style
=
{{
paddingBottom
:
0
,
paddingTop
:
0
}}
colSpan
=
{
11
}
>
<
Collapse
in
=
{
open
}
timeout
=
"auto"
unmountOnExit
>
...
...
planner-front/src/containers/MyTasks/MyTasks.js
View file @
53fe8f38
...
...
@@ -189,7 +189,6 @@ export default function EnhancedTable() {
setRecievedTasks
(
tasksFilteredByProject
)
setFilterProjectTumbler
(
true
)
}
// if (
// tasks &&
// tasks?.length > 0
...
...
planner-front/src/containers/WeekCalendar/WeekCalendar.js
View file @
53fe8f38
...
...
@@ -8,15 +8,15 @@ import DefaultModal from '../../components/UI/DefaultModal/DefaultModal';
import
{
AllHoursOneHourFormat
,
AllHoursTwoHourFormat
}
from
'../../constants'
;
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
,
de
activateCreateCopyTasksMode
,
de
leteCalendarTask
,
editCalendarTask
,
fetchCalendarTasks
}
from
'../../store/actions/tasksActions'
;
import
{
fetchCurrentCalendarDisplayName
}
from
'../../store/actions/usersActions'
;
function
WeekCalendar
()
{
const
dispatch
=
useDispatch
();
const
{
calendarTasks
}
=
useSelector
(
state
=>
state
.
tasks
);
const
{
calendarTasks
,
copyMode
}
=
useSelector
(
state
=>
state
.
tasks
);
const
{
user
,
currentCalendarDisplayName
}
=
useSelector
(
state
=>
state
.
users
);
const
{
allUserProjects
,
project
}
=
useSelector
(
state
=>
state
.
projects
)
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
:
''
});
...
...
@@ -33,8 +33,9 @@ function WeekCalendar() {
const
month
=
new
Date
().
getMonth
()
const
currentDay
=
moment
().
date
()
setDateNow
({
year
:
year
,
month
:
month
,
currentDay
:
currentDay
})
dispatch
(
fetchCalendarTasks
(
user
.
id
))
dispatch
(
fetchAllUserProjects
())
return
()
=>
{
dispatch
(
deactivateCreateCopyTasksMode
())
}
},
[
dispatch
,
user
.
id
])
useEffect
(()
=>
{
...
...
planner-front/src/store/actionTypes/tasksTypes.js
View file @
53fe8f38
...
...
@@ -28,4 +28,7 @@ export const DELETE_DATETIMETASK_FAILURE = "DELETE_TASK_FAILURE";
export
const
FETCH_ALL_TASKS_BY_MEMBERSHIP_REQUEST
=
"FETCH_ALL_TASKS_BY_MEMBERSHIP_REQUEST"
;
export
const
FETCH_ALL_TASKS_BY_MEMBERSHIP_SUCCESS
=
"FETCH_ALL_TASKS_BY_MEMBERSHIP_SUCCESS"
;
export
const
FETCH_ALL_TASKS_BY_MEMBERSHIP_FAILURE
=
"FETCH_ALL_TASKS_BY_MEMBERSHIP_FAILURE"
;
\ No newline at end of file
export
const
FETCH_ALL_TASKS_BY_MEMBERSHIP_FAILURE
=
"FETCH_ALL_TASKS_BY_MEMBERSHIP_FAILURE"
;
export
const
ACTIVATE_CREATE_COPY_TASKS_MODE
=
"ACTIVATE_CREATE_COPY_TASKS_MODE"
export
const
DEACTIVATE_CREATE_COPY_TASKS_MODE
=
"DEACTIVATE_CREATE_COPY_TASKS_MODE"
\ No newline at end of file
planner-front/src/store/actions/tasksActions.js
View file @
53fe8f38
...
...
@@ -18,7 +18,9 @@ import {
DELETE_DATETIMETASK_FAILURE
,
DELETE_DATETIMETASK_SUCCESS
,
DELETE_DATETIMETASK_REQUEST
,
FETCH_ALL_TASKS_BY_MEMBERSHIP_SUCCESS
FETCH_ALL_TASKS_BY_MEMBERSHIP_SUCCESS
,
DEACTIVATE_CREATE_COPY_TASKS_MODE
,
ACTIVATE_CREATE_COPY_TASKS_MODE
}
from
"../actionTypes/tasksTypes"
;
import
axios
from
'../../axiosPlanner'
...
...
@@ -294,4 +296,13 @@ export const addTaskToUserTasksTable = (task) => {
}
}
/** end */
\ No newline at end of file
/** end */
export
const
activateCreateCopyTasksMode
=
(
task
,
navigate
)
=>
{
navigate
(
'/'
)
return
{
type
:
ACTIVATE_CREATE_COPY_TASKS_MODE
,
task
}
}
export
const
deactivateCreateCopyTasksMode
=
()
=>
{
return
{
type
:
DEACTIVATE_CREATE_COPY_TASKS_MODE
}
}
\ No newline at end of file
planner-front/src/store/reducers/tasksReducer.js
View file @
53fe8f38
...
...
@@ -18,10 +18,17 @@ import {
DELETE_DATETIMETASK_FAILURE
,
DELETE_DATETIMETASK_SUCCESS
,
DELETE_DATETIMETASK_REQUEST
,
FETCH_ALL_TASKS_BY_MEMBERSHIP_SUCCESS
FETCH_ALL_TASKS_BY_MEMBERSHIP_SUCCESS
,
ACTIVATE_CREATE_COPY_TASKS_MODE
,
DEACTIVATE_CREATE_COPY_TASKS_MODE
}
from
"../actionTypes/tasksTypes"
;
const
initialState
=
{
copyMode
:
{
working
:
false
,
task
:
null
,
},
tasks
:
[],
calendarTasks
:
[],
loading
:
false
,
error
:
null
,
...
...
@@ -114,6 +121,10 @@ const tasksReduсer = (state = initialState, action) => {
return
{...
state
,
loading
:
true
};
case
DELETE_DATETIMETASK_FAILURE
:
return
{...
state
,
loading
:
false
,
error
:
action
.
error
};
case
ACTIVATE_CREATE_COPY_TASKS_MODE
:
return
{...
state
,
copyMode
:
{
working
:
true
,
task
:
action
.
task
}}
case
DEACTIVATE_CREATE_COPY_TASKS_MODE
:
return
{...
state
,
copyMode
:
{
working
:
false
,
task
:
null
}}
default
:
return
state
;
}
...
...
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