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
Show 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 = () => {
...
@@ -30,7 +30,6 @@ const ProfileBlock = () => {
}
}
const
switchUser
=
()
=>
{
const
switchUser
=
()
=>
{
dispatch
(
fetchUsersAllFields
());
dispatch
(
fetchUsersAllFields
());
// dispatch(fetchUsers())
handleClose
()
handleClose
()
handleOpenSwitchUser
()
handleOpenSwitchUser
()
}
}
...
...
planner-front/src/components/SwitchUserModal/SwitchUserForm/SwitchUserForm.js
View file @
d6bb42d4
...
@@ -13,24 +13,24 @@ const SwitchUserForm=({submitFormHandler, users})=> {
...
@@ -13,24 +13,24 @@ const SwitchUserForm=({submitFormHandler, users})=> {
setCurrentUser
(
user
)
setCurrentUser
(
user
)
setProjectsRole
([])
setProjectsRole
([])
}
}
console
.
log
(
'projectsRoles '
,
projectsRoles
)
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
currentUser
?.
members
.
length
>
0
)
{
if
(
currentUser
?.
members
.
length
>
0
)
{
let
dataArray
=
[]
for
(
let
member
of
currentUser
.
members
)
{
for
(
let
member
of
currentUser
.
members
)
{
le
t
newProjectRole
=
{
cons
t
newProjectRole
=
{
"projectName"
:
member
.
project
.
title
,
"projectName"
:
member
.
project
.
title
,
"roleName"
:
member
.
roleProject
"roleName"
:
member
.
roleProject
}
}
setProjectsRole
([...
projectsRoles
,
newProjectRole
]
)
dataArray
.
push
(
newProjectRole
)
}
}
setProjectsRole
(
dataArray
)
}
}
},[
currentUser
])
},[
currentUser
])
return
(
return
(
<>
<>
{
/* <Box sx={style}> */
}
{
users
?
{
users
?
<
form
onSubmit
=
{(
e
)
=>
submitFormHandler
(
e
,
currentUser
)}
>
<
form
onSubmit
=
{(
e
)
=>
submitFormHandler
(
e
,
currentUser
)}
>
<
Grid
container
direction
=
"column"
spacing
=
{
2
}
>
<
Grid
container
direction
=
"column"
spacing
=
{
2
}
>
...
@@ -67,15 +67,7 @@ const SwitchUserForm=({submitFormHandler, users})=> {
...
@@ -67,15 +67,7 @@ const SwitchUserForm=({submitFormHandler, users})=> {
<
/Button
>
<
/Button
>
<
/Grid
>
<
/Grid
>
{
/* <Grid item>
<Button
onClick={()=>console.log('cancel form')}
color="primary"
variant="contained"
>
Отмена
</Button>
</Grid> */
}
<
/Grid
>
<
/Grid
>
<
/Grid
>
<
/Grid
>
...
@@ -83,7 +75,6 @@ const SwitchUserForm=({submitFormHandler, users})=> {
...
@@ -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';
...
@@ -9,7 +9,6 @@ import Paper from '@mui/material/Paper';
const
SwitchUserTable
=
({
projectsRoles
})
=>
{
const
SwitchUserTable
=
({
projectsRoles
})
=>
{
return
(
return
(
<
TableContainer
component
=
{
Paper
}
>
<
TableContainer
component
=
{
Paper
}
>
...
@@ -31,7 +30,8 @@ const SwitchUserTable=({projectsRoles})=>{
...
@@ -31,7 +30,8 @@ const SwitchUserTable=({projectsRoles})=>{
<
/TableRow
>
<
/TableRow
>
<
/TableHead
>
<
/TableHead
>
<
TableBody
>
<
TableBody
>
{
projectsRoles
.
map
((
projectRole
,
index
)
=>
(
{
projectsRoles
.
map
((
projectRole
,
index
)
=>
{
return
(
<
TableRow
<
TableRow
key
=
{
index
}
key
=
{
index
}
sx
=
{{
'&:last-child td, &:last-child th'
:
{
border
:
0
}
}}
sx
=
{{
'&:last-child td, &:last-child th'
:
{
border
:
0
}
}}
...
@@ -41,7 +41,7 @@ const SwitchUserTable=({projectsRoles})=>{
...
@@ -41,7 +41,7 @@ const SwitchUserTable=({projectsRoles})=>{
<
/TableCell
>
<
/TableCell
>
<
TableCell
align
=
"right"
>
{
projectRole
.
roleName
}
<
/TableCell
>
<
TableCell
align
=
"right"
>
{
projectRole
.
roleName
}
<
/TableCell
>
<
/TableRow
>
<
/TableRow
>
))}
)
}
)}
<
/TableBody
>
<
/TableBody
>
<
/Table
>
<
/Table
>
<
/TableContainer
>
<
/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