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
39d8ad77
Commit
39d8ad77
authored
Dec 24, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#127
Пофиксил менюшки в хедере
parent
1ac76af3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
42 deletions
+12
-42
AdminMenu.js
planner-front/src/components/Menus/AdminMenu/AdminMenu.js
+0
-26
ProfileBlock.js
...r-front/src/components/Menus/ProfileBlock/ProfileBlock.js
+9
-0
AppToolBar.js
planner-front/src/components/UI/AppToolBar/AppToolBar.js
+1
-5
constants.js
planner-front/src/constants.js
+1
-10
MonthCalendar.js
planner-front/src/containers/MonthCalendar/MonthCalendar.js
+1
-1
No files found.
planner-front/src/components/Menus/AdminMenu/AdminMenu.js
deleted
100644 → 0
View file @
1ac76af3
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
(
<
Button
key
=
{
i
}
component
=
{
NavLink
}
to
=
{
button
.
path
}
color
=
"inherit"
size
=
"large"
>
{
button
.
text
}
<
/Button
>
)
})}
<
ProfileBlock
/>
<
/
>
};
export
default
AdminMenu
;
\ No newline at end of file
planner-front/src/components/Menus/ProfileBlock/ProfileBlock.js
View file @
39d8ad77
...
...
@@ -4,6 +4,7 @@ import { useDispatch, useSelector } from "react-redux";
import
{
NavLink
,
useNavigate
}
from
"react-router-dom"
;
import
{
fetchUsersAllFields
,
logoutUser
}
from
"../../../store/actions/usersActions"
;
import
SwitchUserModal
from
"../../SwitchUserModal/SwitchUserModal"
;
import
HasAccess
from
"../../UI/HasAccess/HasAccess"
;
const
ProfileBlock
=
()
=>
{
const
dispatch
=
useDispatch
();
...
...
@@ -33,6 +34,11 @@ const ProfileBlock = () => {
handleClose
()
handleOpenSwitchUser
()
}
const
navigateToRegisterUser
=
()
=>
{
navigate
(
'/sign-up'
)
handleClose
()
}
return
<>
...
...
@@ -51,6 +57,9 @@ const ProfileBlock = () => {
>
<
MenuItem
component
=
{
NavLink
}
to
=
"/profile/test"
color
=
"inherit"
onClick
=
{
handleClose
}
>
Профиль
<
/MenuItem
>
<
MenuItem
onClick
=
{()
=>
{
switchUser
()}}
>
Поменять
юзера
<
/MenuItem
>
<
HasAccess
roles
=
{[
'superuser'
]}
>
<
MenuItem
onClick
=
{()
=>
{
navigateToRegisterUser
()}}
>
Создать
сотрудника
<
/MenuItem
>
<
/HasAccess
>
<
MenuItem
onClick
=
{()
=>
{
logout
()}}
>
Выйти
<
/MenuItem
>
<
/Menu
>
<
SwitchUserModal
...
...
planner-front/src/components/UI/AppToolBar/AppToolBar.js
View file @
39d8ad77
...
...
@@ -4,7 +4,6 @@ import { useSelector } from "react-redux";
import
HasAccess
from
"../HasAccess/HasAccess"
;
import
AnonymousMenu
from
"../../Menus/AnonymousMenu/AnonymousMenu"
;
import
WorkerMenu
from
"../../Menus/WorkerMenu/WorkerMenu"
;
import
AdminMenu
from
"../../Menus/AdminMenu/AdminMenu"
;
const
AppToolbar
=
()
=>
{
const
user
=
useSelector
(
state
=>
state
.
users
.
user
);
...
...
@@ -23,12 +22,9 @@ const AppToolbar = () => {
<
HasAccess
allowed
=
{
!
user
}
>
<
AnonymousMenu
/>
<
/HasAccess
>
<
HasAccess
roles
=
{[
'user'
]
}
>
<
HasAccess
allowed
=
{
user
}
>
<
WorkerMenu
/>
<
/HasAccess
>
<
HasAccess
roles
=
{[
'superuser'
]}
>
<
AdminMenu
/>
<
/HasAccess
>
<
/Toolbar
>
<
/AppBar
>
<
/Box
>
...
...
planner-front/src/constants.js
View file @
39d8ad77
...
...
@@ -3,20 +3,11 @@ export const uploadsUrl = `${apiUrl}/uploads`;
export
const
workerMenuButtons
=
[
{
text
:
'
Проекты'
,
path
:
'/project
s'
},
{
text
:
'
Мои задачи'
,
path
:
'/my-task
s'
},
{
text
:
'Неделя'
,
path
:
'/week'
},
{
text
:
'Месяц'
,
path
:
'/month'
},
{
text
:
'Задачи Сотрудников'
,
path
:
'/workers-tasks'
},
{
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'
}
]
export
const
anonymoysMenuButtons
=
[
...
...
planner-front/src/containers/MonthCalendar/MonthCalendar.js
View file @
39d8ad77
...
...
@@ -238,7 +238,7 @@ function MonthCalendar() {
await
dispatch
(
fetchAllUserProjects
())
setModal
(
true
)
}
else
{
dispatch
(
setUserCalendarId
(
null
)
)
setUserCalendarId
(
null
)
}
},
[
dispatch
,
user
.
id
,
userId
])
...
...
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