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
ad2aeb04
Commit
ad2aeb04
authored
Dec 29, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#135
Реализовал снизу плашечку при включение состояния создания копий задач
parent
53fe8f38
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
26 deletions
+58
-26
CreateCopyTasksModeBlock.js
...dars/CreateCopyTasksModeBlock/CreateCopyTasksModeBlock.js
+36
-0
DateTimePicker.js
.../components/Calendars/UI/DateTimePicker/DateTimePicker.js
+0
-23
WeekCalendarBody.js
...lendars/WeekCalendar/WeekCalendarBody/WeekCalendarBody.js
+2
-2
NewTaskForm.js
...ner-front/src/components/MyTasksCompoments/NewTaskForm.js
+0
-1
WeekCalendar.js
planner-front/src/containers/WeekCalendar/WeekCalendar.js
+20
-0
No files found.
planner-front/src/components/Calendars/CreateCopyTasksModeBlock/CreateCopyTasksModeBlock.js
0 → 100644
View file @
ad2aeb04
import
{
Box
,
Button
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
const
style
=
{
position
:
'fixed'
,
left
:
'50%'
,
bottom
:
10
,
width
:
'30%'
,
height
:
'70px'
,
backgroundColor
:
'white'
,
border
:
'2px solid black'
,
borderRadius
:
'10px'
,
zIndex
:
'100'
,
transform
:
'translateX(-50%)'
,
boxShadow
:
'0px 5px 54px 27px rgba(34, 60, 80, 0.2)'
,
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'space-around'
}
const
CreateCopyTasksModeBlock
=
({
copyMode
,
copyModeReturn
,
copyModeStay
})
=>
{
return
(
<>
{
copyMode
?
<
Box
sx
=
{
style
}
>
<
Button
onClick
=
{
copyModeStay
}
>
Остаться
<
/Button
>
<
Button
onClick
=
{
copyModeReturn
}
>
Вернуться
<
/Button
>
<
/Box
>
:
null
}
<
/
>
);
};
export
default
memo
(
CreateCopyTasksModeBlock
);
planner-front/src/components/Calendars/UI/DateTimePicker/DateTimePicker.js
deleted
100644 → 0
View file @
53fe8f38
import
React
,
{
useState
}
from
'react'
;
import
DatePicker
from
"react-datepicker"
;
const
DateTimePicker
=
({
task
,
name
,
onChange
})
=>
{
const
[
startDate
,
setStartDate
]
=
useState
(
new
Date
());
return
(
<>
<
DatePicker
selected
=
{
startDate
}
onChange
=
{(
date
)
=>
setStartDate
(
date
)}
// locale="ru"
showTimeSelect
timeFormat
=
"p"
timeIntervals
=
{
60
}
dateFormat
=
"Pp"
/>
<
/
>
);
};
export
default
DateTimePicker
;
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarBody/WeekCalendarBody.js
View file @
ad2aeb04
...
@@ -10,7 +10,7 @@ import HourFormatSwitch from "../../UI/HourFormatSwitch/HourFormatSwitch";
...
@@ -10,7 +10,7 @@ import HourFormatSwitch from "../../UI/HourFormatSwitch/HourFormatSwitch";
import
CalendarColumnDayWeek
from
"./CalendarColumnDayWeek/CalendarColumnDayWeek"
;
import
CalendarColumnDayWeek
from
"./CalendarColumnDayWeek/CalendarColumnDayWeek"
;
import
{
getCurrentWeekDayString
,
getMonthAndYearToDayColumn
}
from
"./Helpers"
;
import
{
getCurrentWeekDayString
,
getMonthAndYearToDayColumn
}
from
"./Helpers"
;
function
WeekCalendarBody
({
week
,
hoursInDay
,
hourFormat
,
setHourFormat
,
date
,
tasks
,
currentTask
,
setCurrentTask
,
onChangeCurrentTaskHandler
,
deleteTaskHandler
,
sendNewTaskHandler
,
createTaskInCellHandler
,
copyTask
,
setCopyTask
,
createCopyTask
,
dragTaskHandler
})
{
function
WeekCalendarBody
({
week
,
hoursInDay
,
hourFormat
,
setHourFormat
,
date
,
tasks
,
currentTask
,
setCurrentTask
,
onChangeCurrentTaskHandler
,
deleteTaskHandler
,
sendNewTaskHandler
,
createTaskInCellHandler
,
copyTask
,
setCopyTask
,
createCopyTask
,
dragTaskHandler
,
copyMode
})
{
const
[
modal
,
setModal
]
=
useState
({
open
:
false
,
y
:
0
,
x
:
0
,
});
const
[
modal
,
setModal
]
=
useState
({
open
:
false
,
y
:
0
,
x
:
0
,
});
const
handleOpen
=
useCallback
((
e
)
=>
{
const
handleOpen
=
useCallback
((
e
)
=>
{
setModal
({
setModal
({
...
@@ -31,7 +31,7 @@ function WeekCalendarBody({ week, hoursInDay, hourFormat, setHourFormat, date, t
...
@@ -31,7 +31,7 @@ function WeekCalendarBody({ week, hoursInDay, hourFormat, setHourFormat, date, t
return
(
return
(
<>
<>
<
Box
style
=
{{
marginBottom
:
'30px'
}}
>
<
Box
style
=
{{
marginBottom
:
copyMode
?
'100px'
:
'30px'
}}
>
<
Box
style
=
{{
position
:
'sticky'
,
top
:
'0px'
,
zIndex
:
'10'
,
backgroundColor
:
'lightgrey'
}}
>
<
Box
style
=
{{
position
:
'sticky'
,
top
:
'0px'
,
zIndex
:
'10'
,
backgroundColor
:
'lightgrey'
}}
>
<
CalendarRow
<
CalendarRow
>
>
...
...
planner-front/src/components/MyTasksCompoments/NewTaskForm.js
View file @
ad2aeb04
...
@@ -21,7 +21,6 @@ import BasicSelect from "../UI/Select/Select";
...
@@ -21,7 +21,6 @@ import BasicSelect from "../UI/Select/Select";
import
{
addTask
}
from
"../../store/actions/tasksActions"
;
import
{
addTask
}
from
"../../store/actions/tasksActions"
;
import
TaskModal
from
"./TaskModal/TaskModal"
;
import
TaskModal
from
"./TaskModal/TaskModal"
;
import
{
dateToISOLikeButLocal
}
from
'../../helpers/CalendarHelpers'
;
import
{
dateToISOLikeButLocal
}
from
'../../helpers/CalendarHelpers'
;
import
DateTimePicker
from
"../Calendars/UI/DateTimePicker/DateTimePicker"
;
export
default
function
NewTaskForm
({
projects
,
setAddTaskForm
})
{
export
default
function
NewTaskForm
({
projects
,
setAddTaskForm
})
{
console
.
log
(
'new task form'
)
console
.
log
(
'new task form'
)
...
...
planner-front/src/containers/WeekCalendar/WeekCalendar.js
View file @
ad2aeb04
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
{
useEffect
,
useState
,
useMemo
,
useCallback
}
from
'react'
;
import
{
useEffect
,
useState
,
useMemo
,
useCallback
}
from
'react'
;
import
{
useDispatch
,
useSelector
}
from
'react-redux'
;
import
{
useDispatch
,
useSelector
}
from
'react-redux'
;
import
{
useNavigate
}
from
'react-router-dom'
;
import
CreateCopyTasksModeBlock
from
'../../components/Calendars/CreateCopyTasksModeBlock/CreateCopyTasksModeBlock'
;
import
CalendarModalWorkerContent
from
'../../components/Calendars/UI/CalendarModalWorkerContent/CalendarModalWorkerContent'
;
import
CalendarModalWorkerContent
from
'../../components/Calendars/UI/CalendarModalWorkerContent/CalendarModalWorkerContent'
;
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'
;
...
@@ -13,6 +16,7 @@ import { fetchCurrentCalendarDisplayName } from '../../store/actions/usersAction
...
@@ -13,6 +16,7 @@ import { fetchCurrentCalendarDisplayName } from '../../store/actions/usersAction
function
WeekCalendar
()
{
function
WeekCalendar
()
{
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
navigate
=
useNavigate
()
const
{
calendarTasks
,
copyMode
}
=
useSelector
(
state
=>
state
.
tasks
);
const
{
calendarTasks
,
copyMode
}
=
useSelector
(
state
=>
state
.
tasks
);
const
{
user
,
currentCalendarDisplayName
}
=
useSelector
(
state
=>
state
.
users
);
const
{
user
,
currentCalendarDisplayName
}
=
useSelector
(
state
=>
state
.
users
);
const
{
allUserProjects
}
=
useSelector
(
state
=>
state
.
projects
)
const
{
allUserProjects
}
=
useSelector
(
state
=>
state
.
projects
)
...
@@ -261,6 +265,15 @@ function WeekCalendar() {
...
@@ -261,6 +265,15 @@ function WeekCalendar() {
setUserCalendarId
(
null
)
setUserCalendarId
(
null
)
}
}
},
[
dispatch
,
user
.
id
,
userId
])
},
[
dispatch
,
user
.
id
,
userId
])
const
copyModeStay
=
useCallback
(
async
()
=>
{
dispatch
(
deactivateCreateCopyTasksMode
())
},
[
dispatch
])
const
copyModeReturn
=
useCallback
(
async
()
=>
{
navigate
(
'/my-tasks'
)
},
[
dispatch
])
return
(
return
(
<>
<>
<
DefaultModal
<
DefaultModal
...
@@ -308,6 +321,13 @@ function WeekCalendar() {
...
@@ -308,6 +321,13 @@ function WeekCalendar() {
copyTask
=
{
copyTask
}
copyTask
=
{
copyTask
}
setCopyTask
=
{
setCopyTask
}
setCopyTask
=
{
setCopyTask
}
dragTaskHandler
=
{
dragTaskHandler
}
dragTaskHandler
=
{
dragTaskHandler
}
copyMode
=
{
copyMode
.
working
}
/
>
<
CreateCopyTasksModeBlock
copyMode
=
{
copyMode
.
working
}
copyModeStay
=
{()
=>
{
copyModeStay
()}}
copyModeReturn
=
{()
=>
{
copyModeReturn
()}}
/
>
/
>
<
/
>
<
/
>
);
);
...
...
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