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
d6bb42d4
Commit
d6bb42d4
authored
Dec 14, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#74
switch user current projects display fix
parent
d6073f38
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
18 deletions
+8
-18
ProfileBlock.js
...r-front/src/components/Menus/ProfileBlock/ProfileBlock.js
+0
-1
SwitchUserForm.js
...mponents/SwitchUserModal/SwitchUserForm/SwitchUserForm.js
+5
-14
SwitchUserTable.js
...onents/SwitchUserModal/SwitchUserTable/SwitchUserTable.js
+3
-3
No files found.
planner-front/src/components/Menus/ProfileBlock/ProfileBlock.js
View file @
d6bb42d4
...
...
@@ -30,7 +30,6 @@ const ProfileBlock = () => {
}
const
switchUser
=
()
=>
{
dispatch
(
fetchUsersAllFields
());
// dispatch(fetchUsers())
handleClose
()
handleOpenSwitchUser
()
}
...
...
planner-front/src/components/SwitchUserModal/SwitchUserForm/SwitchUserForm.js
View file @
d6bb42d4
...
...
@@ -13,24 +13,24 @@ const SwitchUserForm=({submitFormHandler, users})=> {
setCurrentUser
(
user
)
setProjectsRole
([])
}
console
.
log
(
'projectsRoles '
,
projectsRoles
)
useEffect
(()
=>
{
if
(
currentUser
?.
members
.
length
>
0
)
{
let
dataArray
=
[]
for
(
let
member
of
currentUser
.
members
)
{
le
t
newProjectRole
=
{
cons
t
newProjectRole
=
{
"projectName"
:
member
.
project
.
title
,
"roleName"
:
member
.
roleProject
}
setProjectsRole
([...
projectsRoles
,
newProjectRole
]
)
dataArray
.
push
(
newProjectRole
)
}
setProjectsRole
(
dataArray
)
}
},[
currentUser
])
return
(
<>
{
/* <Box sx={style}> */
}
{
users
?
<
form
onSubmit
=
{(
e
)
=>
submitFormHandler
(
e
,
currentUser
)}
>
<
Grid
container
direction
=
"column"
spacing
=
{
2
}
>
...
...
@@ -67,15 +67,7 @@ const SwitchUserForm=({submitFormHandler, users})=> {
<
/Button
>
<
/Grid
>
{
/* <Grid item>
<Button
onClick={()=>console.log('cancel form')}
color="primary"
variant="contained"
>
Отмена
</Button>
</Grid> */
}
<
/Grid
>
<
/Grid
>
...
...
@@ -83,7 +75,6 @@ const SwitchUserForm=({submitFormHandler, users})=> {
:
<><
/>
}
{
/* </Box> */
}
<
/
>
)
}
...
...
planner-front/src/components/SwitchUserModal/SwitchUserTable/SwitchUserTable.js
View file @
d6bb42d4
...
...
@@ -9,7 +9,6 @@ import Paper from '@mui/material/Paper';
const
SwitchUserTable
=
({
projectsRoles
})
=>
{
return
(
<
TableContainer
component
=
{
Paper
}
>
...
...
@@ -31,7 +30,8 @@ const SwitchUserTable=({projectsRoles})=>{
<
/TableRow
>
<
/TableHead
>
<
TableBody
>
{
projectsRoles
.
map
((
projectRole
,
index
)
=>
(
{
projectsRoles
.
map
((
projectRole
,
index
)
=>
{
return
(
<
TableRow
key
=
{
index
}
sx
=
{{
'&:last-child td, &:last-child th'
:
{
border
:
0
}
}}
...
...
@@ -41,7 +41,7 @@ const SwitchUserTable=({projectsRoles})=>{
<
/TableCell
>
<
TableCell
align
=
"right"
>
{
projectRole
.
roleName
}
<
/TableCell
>
<
/TableRow
>
))}
)
}
)}
<
/TableBody
>
<
/Table
>
<
/TableContainer
>
...
...
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