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
ef153cfe
Commit
ef153cfe
authored
Dec 12, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#100
небольшие изменения
parent
98c5286f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
61 additions
and
56 deletions
+61
-56
AdminMenu.js
planner-front/src/components/Menus/AdminMenu/AdminMenu.js
+5
-5
AnonymousMenu.js
...front/src/components/Menus/AnonymousMenu/AnonymousMenu.js
+4
-4
WorkerMenu.js
planner-front/src/components/Menus/WorkerMenu/WorkerMenu.js
+6
-6
MonthCalendarModalContent.js
...ar/MonthCalendarModalContent/MonthCalendarModalContent.js
+1
-2
AppToolBar.js
planner-front/src/components/UI/AppToolBar/AppToolBar.js
+12
-12
СustomSelect.js
planner-front/src/components/UI/СustomSelect/СustomSelect.js
+10
-10
CalendarRowDayWeek.js
...WeekCalendarBody/CalendarRowDayWeek/CalendarRowDayWeek.js
+4
-4
constants.js
planner-front/src/constants.js
+18
-11
MonthCalendar.test.js
planner-front/src/tests/MonthCalendar.test.js
+1
-2
No files found.
planner-front/src/components/Menus/AdminMenu/AdminMenu.js
View file @
ef153cfe
import
{
Button
}
from
"@mui/material"
;
import
{
Button
}
from
"@mui/material"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
superuserMenuButtons
}
from
"../../../constants"
;
import
{
superuserMenuButtons
}
from
"../../../constants"
;
import
ProfileBlock
from
"../ProfileBlock/ProfileBlock"
;
import
ProfileBlock
from
"../ProfileBlock/ProfileBlock"
;
const
AdminMenu
=
()
=>
{
const
AdminMenu
=
()
=>
{
return
<>
return
<>
{
superuserMenuButtons
.
map
((
button
,
i
)
=>
{
{
superuserMenuButtons
.
map
((
button
,
i
)
=>
{
return
(
return
(
<
Button
<
Button
key
=
{
i
}
key
=
{
i
}
component
=
{
NavLink
}
component
=
{
NavLink
}
...
@@ -19,7 +19,7 @@ const AdminMenu = () => {
...
@@ -19,7 +19,7 @@ const AdminMenu = () => {
<
/Button
>
<
/Button
>
)
)
})}
})}
<
ProfileBlock
/>
<
ProfileBlock
/>
<
/
>
<
/
>
};
};
...
...
planner-front/src/components/Menus/AnonymousMenu/AnonymousMenu.js
View file @
ef153cfe
import
{
Button
}
from
"@mui/material"
;
import
{
Button
}
from
"@mui/material"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
anonymoysMenuButtons
}
from
"../../../constants"
;
import
{
anonymoysMenuButtons
}
from
"../../../constants"
;
const
AnonymousMenu
=
()
=>
{
const
AnonymousMenu
=
()
=>
{
return
<>
return
<>
{
anonymoysMenuButtons
.
map
((
button
,
i
)
=>
{
{
anonymoysMenuButtons
.
map
((
button
,
i
)
=>
{
return
(
return
(
<
Button
<
Button
key
=
{
i
}
key
=
{
i
}
component
=
{
NavLink
}
component
=
{
NavLink
}
...
...
planner-front/src/components/Menus/WorkerMenu/WorkerMenu.js
View file @
ef153cfe
import
{
Button
}
from
"@mui/material"
;
import
{
Button
}
from
"@mui/material"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
workerMenuButtons
}
from
"../../../constants"
;
import
{
workerMenuButtons
}
from
"../../../constants"
;
import
ProfileBlock
from
"../ProfileBlock/ProfileBlock"
;
import
ProfileBlock
from
"../ProfileBlock/ProfileBlock"
;
const
WorkerMenu
=
()
=>
{
const
WorkerMenu
=
()
=>
{
return
<>
return
<>
{
workerMenuButtons
.
map
((
button
,
i
)
=>
{
{
workerMenuButtons
.
map
((
button
,
i
)
=>
{
return
(
return
(
<
Button
<
Button
key
=
{
i
}
key
=
{
i
}
component
=
{
NavLink
}
component
=
{
NavLink
}
...
@@ -19,8 +19,8 @@ const WorkerMenu = () => {
...
@@ -19,8 +19,8 @@ const WorkerMenu = () => {
<
/Button
>
<
/Button
>
)
)
})}
})}
<
ProfileBlock
/>
<
ProfileBlock
/>
<
/
>
<
/
>
};
};
...
...
planner-front/src/components/MonthCalendar/MonthCalendarModalContent/MonthCalendarModalContent.js
View file @
ef153cfe
import
{
Button
,
TextField
}
from
"@mui/material"
;
import
{
Button
,
TextField
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
import
{
memo
}
from
"react"
;
import
{
priorities
}
from
"../../../constants"
;
import
CustomSelect
from
'../../UI/СustomSelect/СustomSelect'
import
CustomSelect
from
'../../UI/СustomSelect/СustomSelect'
const
priorities
=
[{
value
:
null
,
text
:
'--Приоритет--'
},
{
value
:
'A'
,
text
:
'A'
},
{
value
:
'B'
,
text
:
'B'
},
{
value
:
'C'
,
text
:
'C'
}]
function
MonthCalendarModalContent
({
title
,
onChangeCurrentTaskHandler
,
description
,
priority
,
sendNewTaskHandler
,
deleteTaskHandler
,
startHour
,
endHour
})
{
function
MonthCalendarModalContent
({
title
,
onChangeCurrentTaskHandler
,
description
,
priority
,
sendNewTaskHandler
,
deleteTaskHandler
,
startHour
,
endHour
})
{
return
(
<>
return
(
<>
...
...
planner-front/src/components/UI/AppToolBar/AppToolBar.js
View file @
ef153cfe
import
{
AppBar
,
Box
,
Toolbar
,
Typography
}
from
"@mui/material"
;
import
{
AppBar
,
Box
,
Toolbar
,
Typography
}
from
"@mui/material"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
useSelector
}
from
"react-redux"
;
import
{
useSelector
}
from
"react-redux"
;
import
HasAccess
from
"../HasAccess/HasAccess"
;
import
HasAccess
from
"../HasAccess/HasAccess"
;
import
AnonymousMenu
from
"../../Menus/AnonymousMenu/AnonymousMenu"
;
import
AnonymousMenu
from
"../../Menus/AnonymousMenu/AnonymousMenu"
;
import
WorkerMenu
from
"../../Menus/WorkerMenu/WorkerMenu"
;
import
WorkerMenu
from
"../../Menus/WorkerMenu/WorkerMenu"
;
...
@@ -10,24 +10,24 @@ const AppToolbar = () => {
...
@@ -10,24 +10,24 @@ const AppToolbar = () => {
const
user
=
useSelector
(
state
=>
state
.
users
.
user
);
const
user
=
useSelector
(
state
=>
state
.
users
.
user
);
return
<
Box
sx
=
{{
flexGrow
:
1
,
mb
:
"40px"
}}
>
return
<
Box
sx
=
{{
flexGrow
:
1
,
mb
:
"40px"
}}
>
<
AppBar
position
=
"static"
>
<
AppBar
position
=
"static"
>
<
Toolbar
>
<
Toolbar
>
<
Typography
<
Typography
variant
=
"h4"
variant
=
"h4"
component
=
"div"
component
=
"div"
sx
=
{{
flexGrow
:
1
}}
>
sx
=
{{
flexGrow
:
1
}}
>
<
NavLink
to
=
'/'
style
=
{{
textDecoration
:
'none'
,
color
:
'inherit'
}}
>
Task
Manager
<
/NavLink
>
<
NavLink
to
=
'/'
style
=
{{
textDecoration
:
'none'
,
color
:
'inherit'
}}
>
Task
Manager
<
/NavLink
>
<
/Typography>
<
/Typography
>
<
HasAccess
allowed
=
{
!
user
}
>
<
HasAccess
allowed
=
{
!
user
}
>
<
AnonymousMenu
/>
<
AnonymousMenu
/>
<
/HasAccess
>
<
/HasAccess
>
<
HasAccess
roles
=
{[
'user'
]}
>
<
HasAccess
roles
=
{[
'user'
]}
>
<
WorkerMenu
/>
<
WorkerMenu
/>
<
/HasAccess
>
<
/HasAccess
>
<
HasAccess
roles
=
{[
'superuser'
]}
>
<
HasAccess
roles
=
{[
'superuser'
]}
>
<
AdminMenu
/>
<
AdminMenu
/>
<
/HasAccess
>
<
/HasAccess
>
<
/Toolbar
>
<
/Toolbar
>
<
/AppBar
>
<
/AppBar
>
...
...
planner-front/src/components/UI/СustomSelect/СustomSelect.js
View file @
ef153cfe
import
{
FormControl
,
InputLabel
,
MenuItem
,
Select
}
from
'@mui/material'
;
import
{
FormControl
,
InputLabel
,
MenuItem
,
Select
}
from
'@mui/material'
;
import
{
memo
}
from
'react'
;
import
{
memo
}
from
'react'
;
function
С
ustomSelect
({
value
,
onChange
,
label
,
variant
=
'standard'
,
items
,
id
,
defaultValue
,
name
})
{
function
С
ustomSelect
({
value
,
onChange
,
label
,
variant
=
'standard'
,
items
,
id
,
defaultValue
,
name
})
{
return
(
return
(
<>
<>
<
FormControl
variant
=
{
variant
}
sx
=
{{
m
:
0
,
minWidth
:
120
}}
>
<
FormControl
variant
=
{
variant
}
sx
=
{{
m
:
0
,
minWidth
:
120
}}
>
<
InputLabel
id
=
{
`
${
id
}
-select-label`
}
>
{
label
}
<
/InputLabel
>
<
InputLabel
id
=
{
`
${
id
}
-select-label`
}
>
{
label
}
<
/InputLabel
>
<
Select
<
Select
labelId
=
{
`
${
id
}
-select-label`
}
labelId
=
{
`
${
id
}
-select-label`
}
...
@@ -16,7 +16,7 @@ function СustomSelect({value, onChange, label, variant='standard', items, id,
...
@@ -16,7 +16,7 @@ function СustomSelect({value, onChange, label, variant='standard', items, id,
name
=
{
name
}
name
=
{
name
}
defaultValue
=
{
defaultValue
}
defaultValue
=
{
defaultValue
}
>
>
{
items
.
map
((
item
,
i
)
=>
{
{
items
.
map
((
item
,
i
)
=>
{
return
(
return
(
<
MenuItem
<
MenuItem
key
=
{
i
}
key
=
{
i
}
...
@@ -26,11 +26,11 @@ function СustomSelect({value, onChange, label, variant='standard', items, id,
...
@@ -26,11 +26,11 @@ function СustomSelect({value, onChange, label, variant='standard', items, id,
})}
})}
<
/Select
>
<
/Select
>
<
/FormControl
>
<
/FormControl
>
<
/>
)
;
<
/>
)
;
}
}
export
default
memo
(
С
ustomSelect
,
(
prevProps
,
nextProps
)
=>
{
export
default
memo
(
С
ustomSelect
,
(
prevProps
,
nextProps
)
=>
{
if
(
prevProps
.
value
!==
nextProps
.
value
)
{
if
(
prevProps
.
value
!==
nextProps
.
value
)
{
return
false
return
false
}
else
{
}
else
{
return
true
return
true
...
...
planner-front/src/components/WeekCalendar/WeekCalendarBody/CalendarRowDayWeek/CalendarRowDayWeek.js
View file @
ef153cfe
import
{
useMemo
}
from
"react"
;
import
{
useMemo
}
from
"react"
;
import
{
getHoursInDayNumbers
,
getAvailableTasks
,
getLinesInDay
,
getSortedTasks
}
from
"../../../../helpers/CalendarHelpers"
;
import
{
getHoursInDayNumbers
,
getAvailableTasks
,
getLinesInDay
,
getSortedTasks
}
from
"../../../../helpers/CalendarHelpers"
;
import
CalendarStandartCell
from
"../../../MonthCalendar/MonthCalendarBody/CalendarStandartCell.js/CalendarStandartCell"
;
import
CalendarStandartCell
from
"../../../MonthCalendar/MonthCalendarBody/CalendarStandartCell.js/CalendarStandartCell"
;
function
CalendarRowDayWeek
({
hoursInDay
,
tasks
,
month
,
year
,
day
,
hourFormat
})
{
function
CalendarRowDayWeek
({
hoursInDay
,
tasks
,
month
,
year
,
day
,
hourFormat
})
{
const
hours
=
useMemo
(()
=>
{
const
hours
=
useMemo
(()
=>
{
return
getHoursInDayNumbers
(
hoursInDay
)
return
getHoursInDayNumbers
(
hoursInDay
)
},
[
hoursInDay
])
},
[
hoursInDay
])
...
@@ -18,7 +18,7 @@ function CalendarRowDayWeek({hoursInDay, tasks, month, year, day, hourFormat}) {
...
@@ -18,7 +18,7 @@ function CalendarRowDayWeek({hoursInDay, tasks, month, year, day, hourFormat}) {
const
linesInDay
=
useMemo
(()
=>
{
const
linesInDay
=
useMemo
(()
=>
{
return
getLinesInDay
(
availableTasks
,
sortedTasks
,
hoursInDay
,
hours
,
hourFormat
)
return
getLinesInDay
(
availableTasks
,
sortedTasks
,
hoursInDay
,
hours
,
hourFormat
)
},
[
availableTasks
,
hourFormat
,
hours
,
hoursInDay
,
sortedTasks
])
},
[
availableTasks
,
hourFormat
,
hours
,
hoursInDay
,
sortedTasks
])
console
.
log
(
linesInDay
)
return
(
<>
return
(
<>
{
hoursInDay
?.
map
((
hour
,
i
)
=>
{
{
hoursInDay
?.
map
((
hour
,
i
)
=>
{
return
(
return
(
...
...
planner-front/src/constants.js
View file @
ef153cfe
...
@@ -3,21 +3,28 @@ export const uploadsUrl = `${apiUrl}/uploads`;
...
@@ -3,21 +3,28 @@ export const uploadsUrl = `${apiUrl}/uploads`;
export
const
workerMenuButtons
=
[
export
const
workerMenuButtons
=
[
{
text
:
'Проекты'
,
path
:
'/projects'
},
{
text
:
'Проекты'
,
path
:
'/projects'
},
{
text
:
'Неделя'
,
path
:
'/week'
},
{
text
:
'Неделя'
,
path
:
'/week'
},
{
text
:
'Месяц'
,
path
:
'/month'
},
{
text
:
'Месяц'
,
path
:
'/month'
},
{
text
:
'Мои задачи'
,
path
:
'/my-tasks'
}
{
text
:
'Мои задачи'
,
path
:
'/my-tasks'
}
]
]
export
const
superuserMenuButtons
=
[
export
const
superuserMenuButtons
=
[
{
text
:
'Проекты'
,
path
:
'/projects'
},
{
text
:
'Проекты'
,
path
:
'/projects'
},
{
text
:
'Неделя'
,
path
:
'/week'
},
{
text
:
'Неделя'
,
path
:
'/week'
},
{
text
:
'Месяц'
,
path
:
'/month'
},
{
text
:
'Месяц'
,
path
:
'/month'
},
{
text
:
'Мои задачи'
,
path
:
'/my-tasks'
},
{
text
:
'Мои задачи'
,
path
:
'/my-tasks'
},
{
text
:
'Задачи Сотрудников'
,
path
:
'/workers-tasks'
},
{
text
:
'Задачи Сотрудников'
,
path
:
'/workers-tasks'
},
{
text
:
'Создать Сотрудника'
,
path
:
'/sign-up'
}
{
text
:
'Создать Сотрудника'
,
path
:
'/sign-up'
}
]
]
export
const
anonymoysMenuButtons
=
[
export
const
anonymoysMenuButtons
=
[
{
text
:
'Вход'
,
path
:
'/sign-in'
},
{
text
:
'Вход'
,
path
:
'/sign-in'
},
]
export
const
priorities
=
[
{
value
:
null
,
text
:
'--Приоритет--'
},
{
value
:
'A'
,
text
:
'A'
},
{
value
:
'B'
,
text
:
'B'
},
{
value
:
'C'
,
text
:
'C'
}
]
]
\ No newline at end of file
planner-front/src/tests/MonthCalendar.test.js
View file @
ef153cfe
import
{
getDaysInMonth
,
getCurrentMonthString
,
dateToISOLikeButLocal
}
from
'../helpers/CalendarHelpers'
;
import
{
getDaysInMonth
,
getCurrentMonthString
,
dateToISOLikeButLocal
,
getAvailableTasks
,
getSortedTasks
}
from
'../helpers/CalendarHelpers'
;
import
{
getAvailableTasks
,
getSortedTasks
}
from
'../components/MonthCalendar/MonthCalendarBody/CalendarRowDay/Helpers'
describe
(
'Получение дней в феврале 2022'
,
()
=>
{
describe
(
'Получение дней в феврале 2022'
,
()
=>
{
test
(
'Всего дней'
,
()
=>
{
test
(
'Всего дней'
,
()
=>
{
...
...
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