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
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
57 additions
and
52 deletions
+57
-52
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
+6
-6
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
{
NavLink
}
from
"react-router-dom"
;
import
{
Button
}
from
"@mui/material"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
superuserMenuButtons
}
from
"../../../constants"
;
import
ProfileBlock
from
"../ProfileBlock/ProfileBlock"
;
const
AdminMenu
=
()
=>
{
return
<>
{
superuserMenuButtons
.
map
((
button
,
i
)
=>
{
return
(
{
superuserMenuButtons
.
map
((
button
,
i
)
=>
{
return
(
<
Button
key
=
{
i
}
component
=
{
NavLink
}
...
...
@@ -19,7 +19,7 @@ const AdminMenu = () => {
<
/Button
>
)
})}
<
ProfileBlock
/>
<
ProfileBlock
/>
<
/
>
};
...
...
planner-front/src/components/Menus/AnonymousMenu/AnonymousMenu.js
View file @
ef153cfe
import
{
Button
}
from
"@mui/material"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
Button
}
from
"@mui/material"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
anonymoysMenuButtons
}
from
"../../../constants"
;
const
AnonymousMenu
=
()
=>
{
return
<>
{
anonymoysMenuButtons
.
map
((
button
,
i
)
=>
{
return
(
{
anonymoysMenuButtons
.
map
((
button
,
i
)
=>
{
return
(
<
Button
key
=
{
i
}
component
=
{
NavLink
}
...
...
planner-front/src/components/Menus/WorkerMenu/WorkerMenu.js
View file @
ef153cfe
import
{
Button
}
from
"@mui/material"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
Button
}
from
"@mui/material"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
workerMenuButtons
}
from
"../../../constants"
;
import
ProfileBlock
from
"../ProfileBlock/ProfileBlock"
;
const
WorkerMenu
=
()
=>
{
return
<>
{
workerMenuButtons
.
map
((
button
,
i
)
=>
{
return
(
{
workerMenuButtons
.
map
((
button
,
i
)
=>
{
return
(
<
Button
key
=
{
i
}
component
=
{
NavLink
}
...
...
@@ -20,7 +20,7 @@ const WorkerMenu = () => {
)
})}
<
ProfileBlock
/>
<
ProfileBlock
/>
<
/
>
};
...
...
planner-front/src/components/MonthCalendar/MonthCalendarModalContent/MonthCalendarModalContent.js
View file @
ef153cfe
import
{
Button
,
TextField
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
import
{
priorities
}
from
"../../../constants"
;
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
})
{
return
(
<>
...
...
planner-front/src/components/UI/AppToolBar/AppToolBar.js
View file @
ef153cfe
import
{
AppBar
,
Box
,
Toolbar
,
Typography
}
from
"@mui/material"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
useSelector
}
from
"react-redux"
;
import
{
AppBar
,
Box
,
Toolbar
,
Typography
}
from
"@mui/material"
;
import
{
NavLink
}
from
"react-router-dom"
;
import
{
useSelector
}
from
"react-redux"
;
import
HasAccess
from
"../HasAccess/HasAccess"
;
import
AnonymousMenu
from
"../../Menus/AnonymousMenu/AnonymousMenu"
;
import
WorkerMenu
from
"../../Menus/WorkerMenu/WorkerMenu"
;
...
...
@@ -17,17 +17,17 @@ const AppToolbar = () => {
component
=
"div"
sx
=
{{
flexGrow
:
1
}}
>
<
NavLink
to
=
'/'
style
=
{{
textDecoration
:
'none'
,
color
:
'inherit'
}}
>
Task
Manager
<
/NavLink
>
<
NavLink
to
=
'/'
style
=
{{
textDecoration
:
'none'
,
color
:
'inherit'
}}
>
Task
Manager
<
/NavLink
>
<
/Typography
>
<
HasAccess
allowed
=
{
!
user
}
>
<
AnonymousMenu
/>
<
AnonymousMenu
/>
<
/HasAccess
>
<
HasAccess
roles
=
{[
'user'
]}
>
<
WorkerMenu
/>
<
WorkerMenu
/>
<
/HasAccess
>
<
HasAccess
roles
=
{[
'superuser'
]}
>
<
AdminMenu
/>
<
AdminMenu
/>
<
/HasAccess
>
<
/Toolbar
>
<
/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'
;
function
С
ustomSelect
({
value
,
onChange
,
label
,
variant
=
'standard'
,
items
,
id
,
defaultValue
,
name
})
{
function
С
ustomSelect
({
value
,
onChange
,
label
,
variant
=
'standard'
,
items
,
id
,
defaultValue
,
name
})
{
return
(
<>
...
...
@@ -16,7 +16,7 @@ function СustomSelect({value, onChange, label, variant='standard', items, id,
name
=
{
name
}
defaultValue
=
{
defaultValue
}
>
{
items
.
map
((
item
,
i
)
=>
{
{
items
.
map
((
item
,
i
)
=>
{
return
(
<
MenuItem
key
=
{
i
}
...
...
@@ -26,11 +26,11 @@ function СustomSelect({value, onChange, label, variant='standard', items, id,
})}
<
/Select
>
<
/FormControl
>
<
/>
)
;
<
/>
)
;
}
export
default
memo
(
С
ustomSelect
,
(
prevProps
,
nextProps
)
=>
{
if
(
prevProps
.
value
!==
nextProps
.
value
)
{
export
default
memo
(
С
ustomSelect
,
(
prevProps
,
nextProps
)
=>
{
if
(
prevProps
.
value
!==
nextProps
.
value
)
{
return
false
}
else
{
return
true
...
...
planner-front/src/components/WeekCalendar/WeekCalendarBody/CalendarRowDayWeek/CalendarRowDayWeek.js
View file @
ef153cfe
...
...
@@ -2,8 +2,8 @@ import { useMemo } from "react";
import
{
getHoursInDayNumbers
,
getAvailableTasks
,
getLinesInDay
,
getSortedTasks
}
from
"../../../../helpers/CalendarHelpers"
;
import
CalendarStandartCell
from
"../../../MonthCalendar/MonthCalendarBody/CalendarStandartCell.js/CalendarStandartCell"
;
function
CalendarRowDayWeek
({
hoursInDay
,
tasks
,
month
,
year
,
day
,
hourFormat
})
{
const
hours
=
useMemo
(()
=>
{
function
CalendarRowDayWeek
({
hoursInDay
,
tasks
,
month
,
year
,
day
,
hourFormat
})
{
const
hours
=
useMemo
(()
=>
{
return
getHoursInDayNumbers
(
hoursInDay
)
},
[
hoursInDay
])
...
...
@@ -18,7 +18,7 @@ function CalendarRowDayWeek({hoursInDay, tasks, month, year, day, hourFormat}) {
const
linesInDay
=
useMemo
(()
=>
{
return
getLinesInDay
(
availableTasks
,
sortedTasks
,
hoursInDay
,
hours
,
hourFormat
)
},
[
availableTasks
,
hourFormat
,
hours
,
hoursInDay
,
sortedTasks
])
console
.
log
(
linesInDay
)
return
(
<>
{
hoursInDay
?.
map
((
hour
,
i
)
=>
{
return
(
...
...
planner-front/src/constants.js
View file @
ef153cfe
...
...
@@ -3,21 +3,28 @@ export const uploadsUrl = `${apiUrl}/uploads`;
export
const
workerMenuButtons
=
[
{
text
:
'Проекты'
,
path
:
'/projects'
},
{
text
:
'Неделя'
,
path
:
'/week'
},
{
text
:
'Месяц'
,
path
:
'/month'
},
{
text
:
'Мои задачи'
,
path
:
'/my-tasks'
}
{
text
:
'Проекты'
,
path
:
'/projects'
},
{
text
:
'Неделя'
,
path
:
'/week'
},
{
text
:
'Месяц'
,
path
:
'/month'
},
{
text
:
'Мои задачи'
,
path
:
'/my-tasks'
}
]
export
const
superuserMenuButtons
=
[
{
text
:
'Проекты'
,
path
:
'/projects'
},
{
text
:
'Неделя'
,
path
:
'/week'
},
{
text
:
'Месяц'
,
path
:
'/month'
},
{
text
:
'Мои задачи'
,
path
:
'/my-tasks'
},
{
text
:
'Задачи Сотрудников'
,
path
:
'/workers-tasks'
},
{
text
:
'Создать Сотрудника'
,
path
:
'/sign-up'
}
{
text
:
'Проекты'
,
path
:
'/projects'
},
{
text
:
'Неделя'
,
path
:
'/week'
},
{
text
:
'Месяц'
,
path
:
'/month'
},
{
text
:
'Мои задачи'
,
path
:
'/my-tasks'
},
{
text
:
'Задачи Сотрудников'
,
path
:
'/workers-tasks'
},
{
text
:
'Создать Сотрудника'
,
path
:
'/sign-up'
}
]
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
{
getAvailableTasks
,
getSortedTasks
}
from
'../components/MonthCalendar/MonthCalendarBody/CalendarRowDay/Helpers'
import
{
getDaysInMonth
,
getCurrentMonthString
,
dateToISOLikeButLocal
,
getAvailableTasks
,
getSortedTasks
}
from
'../helpers/CalendarHelpers'
;
describe
(
'Получение дней в феврале 2022'
,
()
=>
{
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