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
84b37444
Commit
84b37444
authored
Nov 11, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#30
Реализовал создание задачи
parent
ff131581
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
48 deletions
+62
-48
CalendarTask.js
...components/MonthCalendarBody/CalendarTask/CalendarTask.js
+3
-6
MonthCalendarBody.js
...ont/src/components/MonthCalendarBody/MonthCalendarBody.js
+9
-41
MonthCalendarModalContent.js
...ts/MonthCalendarModalContent/MonthCalendarModalContent.js
+49
-0
MonthCalendar.js
planner-front/src/containers/MonthCalendar/MonthCalendar.js
+1
-1
No files found.
planner-front/src/components/MonthCalendarBody/CalendarTask/CalendarTask.js
View file @
84b37444
import
{
Grid
,
TextField
}
from
"@mui/material"
;
import
{
Grid
,
TextField
,
Typography
}
from
"@mui/material"
;
import
React
,
{
useEffect
,
useState
}
from
"react"
;
const
CalendarTask
=
({
year
,
month
,
tasks
,
day
,
hours
,
setCurrentTask
,
hourFormat
,
handleOpen
})
=>
{
...
...
@@ -26,19 +26,16 @@ const CalendarTask = ({year, month, tasks, day, hours, setCurrentTask, hourForma
return
tasksCell
}
const
tasksCell
=
getTaskInDayCell
(
tasks
,
day
,
hours
)
const
returnText
=
(
text
)
=>
{
return
(
<
span
>
{
text
}
<
/span>
)
}
return
(
<>
{
tasksCell
.
length
?
tasksCell
.
map
((
task
,
i
)
=>
{
return
(
<
Grid
key
=
{
task
.
id
}
sx
=
{{
backgroundColor
:
'lightgreen'
,
}}
sx
=
{{
backgroundColor
:
'lightgreen'
,
whiteSpace
:
'nowrap'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
padding
:
'10px'
,
borderBottom
:
'1px solid rgb(29, 161, 51);;'
}}
onClick
=
{(
e
)
=>
{
e
.
stopPropagation
();
setCurrentTask
(
task
);
handleOpen
(
e
)}}
>
{
returnText
(
task
.
title
)
}
{
task
.
title
}
<
/Grid
>
)}
)
...
...
planner-front/src/components/MonthCalendarBody/MonthCalendarBody.js
View file @
84b37444
import
{
Button
,
FormControl
,
FormControlLabel
,
InputLabel
,
MenuItem
,
Select
,
Switch
,
TextField
}
from
"@mui/material"
;
import
{
FormControlLabel
,
Switch
}
from
"@mui/material"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
CalendarRow
from
"./CalendarRow/CalendarRow"
;
import
CalendarSmallCell
from
"./CalendarSmallCell/CalendarSmallCell"
;
import
CalendarStandartCell
from
"./CalendarStandartCell.js/CalendarStandartCell"
;
import
CalendarTask
from
"./CalendarTask/CalendarTask"
;
import
ModalTask
from
"../UI/ModalTask/ModalTask"
;
import
MonthCalendarModalContent
from
"../MonthCalendarModalContent/MonthCalendarModalContent"
;
function
MonthCalendarBody
({
month
,
year
,
tasks
,
createTaskInCellHandler
,
currentTask
,
setCurrentTask
,
hourFormat
,
setHourFormat
,
onChangeCurrentTaskHandler
,
sendNewTask
})
{
...
...
@@ -25,6 +26,7 @@ function MonthCalendarBody({month, year, tasks, createTaskInCellHandler, current
};
const
handleClose
=
()
=>
{
setModal
({...
modal
,
open
:
false
})
setCurrentTask
({})
};
...
...
@@ -139,47 +141,13 @@ function MonthCalendarBody({month, year, tasks, createTaskInCellHandler, current
modal
=
{
modal
}
handleClose
=
{()
=>
{
handleClose
()}}
>
<
TextField
id
=
"task-description-title"
value
=
{
currentTask
.
title
}
label
=
"Название"
variant
=
"outlined"
sx
=
{{
marginBottom
:
'30px'
}}
name
=
'title'
onChange
=
{(
e
)
=>
{
onChangeCurrentTaskHandler
(
e
)}}
<
MonthCalendarModalContent
title
=
{
currentTask
.
title
}
description
=
{
currentTask
.
description
}
priority
=
{
currentTask
.
priority
}
onChangeCurrentTaskHandler
=
{(
e
)
=>
{
onChangeCurrentTaskHandler
(
e
)}}
sendNewTask
=
{()
=>
{
sendNewTask
();
handleClose
()}}
/
>
<
TextField
id
=
"task-description"
multiline
rows
=
{
4
}
value
=
{
currentTask
.
description
}
label
=
"Описание"
variant
=
"outlined"
sx
=
{{
marginBottom
:
'30px'
}}
name
=
'description'
onChange
=
{(
e
)
=>
{
onChangeCurrentTaskHandler
(
e
)}}
/
>
<
FormControl
variant
=
"outlined"
sx
=
{{
width
:
'160px'
,
marginBottom
:
'30px'
}}
>
<
InputLabel
id
=
"priority-type-label"
>
Приоритет
<
/InputLabel
>
<
Select
labelId
=
"priority-type-label"
id
=
"priority-type"
label
=
"Приоритет"
sx
=
{{
width
:
'160px'
}}
value
=
{
currentTask
.
priority
}
name
=
'priority'
onChange
=
{(
e
)
=>
{
onChangeCurrentTaskHandler
(
e
)}}
>
<
MenuItem
value
=
""
>
<
em
>--
Выберите
Приоритет
--<
/em
>
<
/MenuItem
>
<
MenuItem
value
=
{
"A"
}
>
A
<
/MenuItem
>
<
MenuItem
value
=
{
"B"
}
>
B
<
/MenuItem
>
<
MenuItem
value
=
{
"C"
}
>
C
<
/MenuItem
>
<
/Select
>
<
/FormControl
>
<
Button
sx
=
{{
marginRight
:
'40px'
}}
onClick
=
{()
=>
{
sendNewTask
()}}
>
Сохранить
<
/Button
>
<
Button
>
Удалить
<
/Button
>
<
/ModalTask
>
<
/
>
);
...
...
planner-front/src/components/MonthCalendarModalContent/MonthCalendarModalContent.js
0 → 100644
View file @
84b37444
import
{
Button
,
FormControl
,
InputLabel
,
MenuItem
,
Select
,
TextField
}
from
"@mui/material"
;
function
MonthCalendarModalContent
({
title
,
onChangeCurrentTaskHandler
,
description
,
priority
,
sendNewTask
})
{
return
(
<>
<
TextField
id
=
"task-description-title"
value
=
{
title
}
label
=
"Название"
variant
=
"outlined"
sx
=
{{
marginBottom
:
'30px'
}}
name
=
'title'
onChange
=
{(
e
)
=>
{
onChangeCurrentTaskHandler
(
e
)}}
/
>
<
TextField
id
=
"task-description"
multiline
rows
=
{
4
}
value
=
{
description
}
label
=
"Описание"
variant
=
"outlined"
sx
=
{{
marginBottom
:
'30px'
}}
name
=
'description'
onChange
=
{(
e
)
=>
{
onChangeCurrentTaskHandler
(
e
)}}
/
>
<
FormControl
variant
=
"outlined"
sx
=
{{
width
:
'160px'
,
marginBottom
:
'30px'
}}
>
<
InputLabel
id
=
"priority-type-label"
>
Приоритет
<
/InputLabel
>
<
Select
labelId
=
"priority-type-label"
id
=
"priority-type"
label
=
"Приоритет"
sx
=
{{
width
:
'160px'
}}
value
=
{
priority
}
name
=
'priority'
onChange
=
{
onChangeCurrentTaskHandler
}
>
<
MenuItem
value
=
""
>
<
em
>--
Выберите
Приоритет
--<
/em
>
<
/MenuItem
>
<
MenuItem
value
=
{
"A"
}
>
A
<
/MenuItem
>
<
MenuItem
value
=
{
"B"
}
>
B
<
/MenuItem
>
<
MenuItem
value
=
{
"C"
}
>
C
<
/MenuItem
>
<
/Select
>
<
/FormControl
>
<
Button
sx
=
{{
marginRight
:
'40px'
}}
onClick
=
{
sendNewTask
}
>
Сохранить
<
/Button
>
<
Button
>
Удалить
<
/Button
>
<
/>
)
;
}
export
default
MonthCalendarModalContent
;
\ No newline at end of file
planner-front/src/containers/MonthCalendar/MonthCalendar.js
View file @
84b37444
...
...
@@ -15,7 +15,7 @@ function MonthCalendar() {
const
[
worker
,
setWorker
]
=
useState
(
''
);
const
[
calendarType
,
setCalendarType
]
=
useState
(
'Месяц'
);
const
[
currentTask
,
setCurrentTask
]
=
useState
({
title
:
''
,
description
:
''
,
priority
:
''
,
dateTimeStart
:
''
,
dateTimeDue
:
''
})
console
.
log
(
currentTask
)
useEffect
(()
=>
{
setMonth
(
new
Date
().
getMonth
())
setYear
(
new
Date
().
getFullYear
())
...
...
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