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
196709fe
Commit
196709fe
authored
Jan 09, 2023
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#141
Добавил отображение юзеров в колонках ролей
parent
7c007486
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
103 additions
and
103 deletions
+103
-103
App.js
planner-front/src/App.js
+0
-1
MemberForm.js
planner-front/src/components/MemberForm/MemberForm.js
+0
-1
ProjectMembersItem.js
...rojectComponents/ProjectMembersItem/ProjectMembersItem.js
+0
-50
ProjectMembersList.js
...rojectComponents/ProjectMembersList/ProjectMembersList.js
+1
-1
ProjectUserItem.js
...ents/ProjectComponents/ProjectUserItem/ProjectUserItem.js
+26
-0
ProjectUsersColumn.js
...rsColumnsWrapper/ProjectUsersColumn/ProjectUsersColumn.js
+30
-6
ProjectUsersColumnsWrapper.js
.../ProjectUsersColumnsWrapper/ProjectUsersColumnsWrapper.js
+4
-2
FullProject.js
planner-front/src/containers/FullProject/FullProject.js
+41
-37
NewMember.js
planner-front/src/containers/NewMember/NewMember.js
+0
-1
projectsActions.js
planner-front/src/store/actions/projectsActions.js
+1
-3
usersActions.js
planner-front/src/store/actions/usersActions.js
+0
-1
No files found.
planner-front/src/App.js
View file @
196709fe
...
@@ -9,7 +9,6 @@ import MonthCalendar from './containers/MonthCalendar/MonthCalendar';
...
@@ -9,7 +9,6 @@ import MonthCalendar from './containers/MonthCalendar/MonthCalendar';
import
ForgottenPassword
from
"./containers/ForgottenPassword/ForgottenPassword"
;
import
ForgottenPassword
from
"./containers/ForgottenPassword/ForgottenPassword"
;
import
Projects
from
"./containers/Projects/Projects"
;
import
Projects
from
"./containers/Projects/Projects"
;
import
FullProject
from
"./containers/FullProject/FullProject"
;
import
FullProject
from
"./containers/FullProject/FullProject"
;
import
NewProject
from
"./containers/NewProject/NewProject"
;
import
WeekCalendar
from
"./containers/WeekCalendar/WeekCalendar"
;
import
WeekCalendar
from
"./containers/WeekCalendar/WeekCalendar"
;
import
UsersTasks
from
"./containers/UsersTasks/UsersTasks"
;
import
UsersTasks
from
"./containers/UsersTasks/UsersTasks"
;
...
...
planner-front/src/components/MemberForm/MemberForm.js
View file @
196709fe
...
@@ -44,7 +44,6 @@ const MemberForm = ({ onSubmit, members }) => {
...
@@ -44,7 +44,6 @@ const MemberForm = ({ onSubmit, members }) => {
onSubmit
(
members
);
onSubmit
(
members
);
setOpen
(
false
);
setOpen
(
false
);
};
};
console
.
log
(
state
);
useEffect
(()
=>
{
useEffect
(()
=>
{
dispatch
(
fetchProject
(
params
.
id
))
dispatch
(
fetchProject
(
params
.
id
))
...
...
planner-front/src/components/ProjectComponents/ProjectMembersItem/ProjectMembersItem.js
deleted
100644 → 0
View file @
7c007486
import
{
Card
,
CardContent
,
Grid
,
IconButton
,
Tooltip
}
from
"@mui/material"
;
import
{
useParams
}
from
"react-router-dom"
;
import
{
useDispatch
}
from
"react-redux"
;
import
DeleteIcon
from
"@mui/icons-material/Delete"
;
import
{
deleteMember
}
from
"../../../store/actions/projectsActions"
;
const
ProjectMembersItem
=
({
displayName
,
roleProject
,
id
,
roleProjectOfAuthor
,
userId
,
members
,
authorOfProject
})
=>
{
console
.
log
(
displayName
)
const
dispatch
=
useDispatch
();
let
params
=
useParams
()
console
.
log
(
members
)
console
.
log
(
userId
)
const
deleteHandle
=
(
userId
,
projectId
)
=>
{
dispatch
(
deleteMember
(
userId
,
params
.
id
))
};
return
<>
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
lg
=
{
4
}
>
<
Card
>
<
CardContent
>
<
strong
>
<
br
><
/br
>
{
displayName
}
<
/strong
>
<
strong
>
<
br
><
/br
>
роль
:
{
roleProject
}
<
/strong
>
<
strong
>
{(
members
.
filter
(
e
=>
e
.
user
.
displayName
===
authorOfProject
).
length
>
0
)
?
(
<
strong
>
<
Tooltip
title
=
"Удалить"
>
<
IconButton
onClick
=
{(
id
)
=>
{
deleteHandle
(
userId
);
}}
>
{(
displayName
!==
authorOfProject
)
?
<
DeleteIcon
style
=
{{
marginTop
:
"-5px"
}}
/> : null
}
<
/IconButton
>
<
/Tooltip
>
<
/strong>
)
: null
}
<
/strong
>
<
/CardContent
>
<
/Card
>
<
/Grid
>
<
/
>
};
export
default
ProjectMembersItem
;
planner-front/src/components/ProjectComponents/ProjectMembersList/ProjectMembersList.js
View file @
196709fe
import
{
Grid
}
from
"@mui/material"
;
import
{
Grid
}
from
"@mui/material"
;
import
ProjectMembersItem
from
"../Project
MembersItem/ProjectMembers
Item"
;
import
ProjectMembersItem
from
"../Project
UserItem/ProjectUser
Item"
;
const
ProjectMembersList
=
({
members
,
roleProjectOfAuthor
,
authorOfProject
})
=>
{
const
ProjectMembersList
=
({
members
,
roleProjectOfAuthor
,
authorOfProject
})
=>
{
console
.
log
(
"members "
,
members
)
console
.
log
(
"members "
,
members
)
...
...
planner-front/src/components/ProjectComponents/ProjectUserItem/ProjectUserItem.js
0 → 100644
View file @
196709fe
import
{
Grid
}
from
"@mui/material"
;
import
DeleteIcon
from
"@mui/icons-material/Delete"
;
import
{
deleteMember
}
from
"../../../store/actions/projectsActions"
;
import
{
memo
}
from
"react"
;
const
ProjectMembersItem
=
({
user
})
=>
{
const
style
=
{
width
:
'90%'
,
border
:
'1px solid black'
,
borderRadius
:
'5px'
,
padding
:
'15px 15px'
,
display
:
'flex'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}
return
<>
<
Grid
sx
=
{
style
}
>
{
user
?.
displayName
}
<
DeleteIcon
/>
<
/Grid
>
<
/
>
};
export
default
memo
(
ProjectMembersItem
);
planner-front/src/components/ProjectComponents/ProjectUsersColumnsWrapper/ProjectUsersColumn/ProjectUsersColumn.js
View file @
196709fe
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
import
ProjectUserItem
from
"../../ProjectUserItem/ProjectUserItem"
;
const
style
=
{
const
style
Column
=
{
border
:
'3px solid black'
,
border
:
'3px solid black'
,
borderRadius
:
'10px'
,
borderRadius
:
'10px'
,
height
:
'60vh'
,
height
:
'60vh'
,
flexBasis
:
60
/
3
+
'%'
,
flexBasis
:
60
/
3
+
'%'
,
overflow
:
'
scroll
'
,
overflow
:
'
auto
'
,
overflowX
:
'hidden'
,
overflowX
:
'hidden'
,
}
}
const
ProjectUsersColumn
=
({
role
})
=>
{
const
styleList
=
{
display
:
'flex'
,
gap
:
'10px'
,
flexDirection
:
'column'
,
alignItems
:
'center'
,
}
const
ProjectUsersColumn
=
({
role
,
members
})
=>
{
return
(
return
(
<
Box
sx
=
{
style
}
>
<
Box
sx
=
{
style
Column
}
>
<
Typography
variant
=
"h4"
textAlign
=
{
'center'
}
>
<
Typography
variant
=
"h4"
textAlign
=
{
'center'
}
sx
=
{{
marginBottom
:
'20px'
}}
>
{
role
.
text
}
{
role
.
text
}
<
/Typography
>
<
/Typography
>
<
Box
sx
=
{
styleList
}
>
{
members
.
map
((
member
)
=>
{
if
(
member
.
roleProject
===
role
.
value
)
{
return
(
<
ProjectUserItem
key
=
{
member
.
id
}
user
=
{
member
?.
user
}
/
>
)
}
else
{
return
null
}
})}
<
/Box
>
<
/Box
>
<
/Box
>
);
);
};
};
export
default
ProjectUsersColumn
;
export
default
memo
(
ProjectUsersColumn
);
\ No newline at end of file
\ No newline at end of file
planner-front/src/components/ProjectComponents/ProjectUsersColumnsWrapper/ProjectUsersColumnsWrapper.js
View file @
196709fe
import
{
Box
}
from
"@mui/material"
;
import
{
Box
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
import
ProjectUsersColumn
from
"./ProjectUsersColumn/ProjectUsersColumn"
;
import
ProjectUsersColumn
from
"./ProjectUsersColumn/ProjectUsersColumn"
;
...
@@ -12,7 +13,7 @@ const style = {
...
@@ -12,7 +13,7 @@ const style = {
}
}
const
ProjectUsersColumnsWrapper
=
({})
=>
{
const
ProjectUsersColumnsWrapper
=
({
members
})
=>
{
return
(
return
(
<
Box
sx
=
{
style
}
justifyContent
=
{
'space-between'
}
>
<
Box
sx
=
{
style
}
justifyContent
=
{
'space-between'
}
>
{
projectRoles
.
map
((
role
,
i
)
=>
{
{
projectRoles
.
map
((
role
,
i
)
=>
{
...
@@ -20,6 +21,7 @@ const ProjectUsersColumnsWrapper = ({}) => {
...
@@ -20,6 +21,7 @@ const ProjectUsersColumnsWrapper = ({}) => {
<
ProjectUsersColumn
<
ProjectUsersColumn
key
=
{
i
}
key
=
{
i
}
role
=
{
role
}
role
=
{
role
}
members
=
{
members
}
/
>
/
>
)
)
})}
})}
...
@@ -27,4 +29,4 @@ const ProjectUsersColumnsWrapper = ({}) => {
...
@@ -27,4 +29,4 @@ const ProjectUsersColumnsWrapper = ({}) => {
);
);
};
};
export
default
ProjectUsersColumnsWrapper
;
export
default
memo
(
ProjectUsersColumnsWrapper
);
\ No newline at end of file
\ No newline at end of file
planner-front/src/containers/FullProject/FullProject.js
View file @
196709fe
import
{
Box
,
Grid
}
from
"@mui/material"
;
import
{
Box
,
Grid
}
from
"@mui/material"
;
import
{
useParams
}
from
"react-router-dom"
;
import
{
useParams
}
from
"react-router-dom"
;
import
{
useSelector
,
useDispatch
}
from
"react-redux"
;
import
{
useSelector
,
useDispatch
}
from
"react-redux"
;
import
{
useEffect
}
from
"react"
;
import
{
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
{
fetchProject
}
from
"../../store/actions/projectsActions"
;
import
{
fetchProject
}
from
"../../store/actions/projectsActions"
;
import
{
fetchUsers
}
from
"../../store/actions/usersActions"
;
import
{
fetchUsers
,
fetchUsersAllFields
}
from
"../../store/actions/usersActions"
;
import
ProjectMembersList
from
"../../components/ProjectComponents/ProjectMembersList/ProjectMembersList"
;
import
ProjectMembersList
from
"../../components/ProjectComponents/ProjectMembersList/ProjectMembersList"
;
import
NewMember
from
"../NewMember/NewMember"
;
import
NewMember
from
"../NewMember/NewMember"
;
import
ProjectUsersColumnsWrapper
from
"../../components/ProjectComponents/ProjectUsersColumnsWrapper/ProjectUsersColumnsWrapper"
;
import
ProjectUsersColumnsWrapper
from
"../../components/ProjectComponents/ProjectUsersColumnsWrapper/ProjectUsersColumnsWrapper"
;
...
@@ -11,20 +11,22 @@ import ProjectUsersColumnsWrapper from "../../components/ProjectComponents/Proje
...
@@ -11,20 +11,22 @@ import ProjectUsersColumnsWrapper from "../../components/ProjectComponents/Proje
const
FullProject
=
()
=>
{
const
FullProject
=
()
=>
{
const
{
projects
,
project
}
=
useSelector
(
state
=>
state
.
projects
);
const
{
project
}
=
useSelector
(
state
=>
state
.
projects
);
const
users
=
useSelector
(
state
=>
state
.
users
.
users
);
const
user
=
useSelector
(
state
=>
state
.
users
.
user
);
const
user
=
useSelector
(
state
=>
state
.
users
.
user
);
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
params
=
useParams
()
const
params
=
useParams
()
useEffect
(()
=>
{
dispatch
(
fetchUsers
())
},
[
dispatch
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
dispatch
(
fetchProject
(
params
.
id
))
dispatch
(
fetchProject
(
params
.
id
))
},
[
params
.
id
,
dispatch
]);
},
[
params
.
id
,
dispatch
]);
const
members
=
useMemo
(()
=>
{
return
project
?.
project
?.
members
||
[]
},[
project
])
console
.
log
(
members
)
return
<>
return
<>
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
lg
=
{
4
}
>
<
Grid
item
xs
=
{
12
}
sm
=
{
12
}
md
=
{
6
}
lg
=
{
4
}
>
<
Box
>
<
Box
>
...
@@ -59,7 +61,9 @@ const FullProject = () => {
...
@@ -59,7 +61,9 @@ const FullProject = () => {
{
/* <ProjectMembersList users={users} project={project} members={project?.project?.members} roleProjectOfAuthor={project?.project?.members[0]?.roleProject} authorOfProject={project?.project?.members[0]?.user.displayName} /> */
}
{
/* <ProjectMembersList users={users} project={project} members={project?.project?.members} roleProjectOfAuthor={project?.project?.members[0]?.roleProject} authorOfProject={project?.project?.members[0]?.user.displayName} /> */
}
<
ProjectUsersColumnsWrapper
/>
<
ProjectUsersColumnsWrapper
members
=
{
members
}
/
>
<
/strong
>
<
/strong
>
<
/Box
>
<
/Box
>
...
...
planner-front/src/containers/NewMember/NewMember.js
View file @
196709fe
...
@@ -14,7 +14,6 @@ const NewMember = ({members}) => {
...
@@ -14,7 +14,6 @@ const NewMember = ({members}) => {
const
onSubmit
=
async
(
memberData
)
=>
{
const
onSubmit
=
async
(
memberData
)
=>
{
await
dispatch
(
createMember
(
memberData
,
navigate
));
await
dispatch
(
createMember
(
memberData
,
navigate
));
navigate
(
"/projects/"
+
memberData
.
projectId
)
navigate
(
"/projects/"
+
memberData
.
projectId
)
console
.
log
(
"memberData "
,
memberData
)
};
};
...
...
planner-front/src/store/actions/projectsActions.js
View file @
196709fe
...
@@ -51,8 +51,7 @@ export const deleteMember = (memberId, projectId) => {
...
@@ -51,8 +51,7 @@ export const deleteMember = (memberId, projectId) => {
return
async
(
dispatch
)
=>
{
return
async
(
dispatch
)
=>
{
dispatch
(
deleteMemberRequest
());
dispatch
(
deleteMemberRequest
());
try
{
try
{
const
response
=
await
axios
.
delete
(
`/projects/remove-user/
${
memberId
}
`
,
{
data
:
{
projectId
:
projectId
}
});
await
axios
.
delete
(
`/projects/remove-user/
${
memberId
}
`
,
{
data
:
{
projectId
:
projectId
}
});
console
.
log
(
"deleteMember "
,
response
.
data
)
dispatch
(
deleteMemberSuccess
())
dispatch
(
deleteMemberSuccess
())
dispatch
(
fetchProject
(
projectId
))
dispatch
(
fetchProject
(
projectId
))
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -92,7 +91,6 @@ export const fetchProject = (id) => {
...
@@ -92,7 +91,6 @@ export const fetchProject = (id) => {
try
{
try
{
const
response
=
await
axios
.
get
(
"/projects/"
+
id
);
const
response
=
await
axios
.
get
(
"/projects/"
+
id
);
dispatch
(
fetchProjectSuccess
(
response
.
data
));
dispatch
(
fetchProjectSuccess
(
response
.
data
));
console
.
log
(
"fetch project "
,
response
.
data
)
}
catch
(
e
)
{
}
catch
(
e
)
{
dispatch
(
fetchProjectsError
(
e
));
dispatch
(
fetchProjectsError
(
e
));
}
}
...
...
planner-front/src/store/actions/usersActions.js
View file @
196709fe
...
@@ -118,7 +118,6 @@ export const fetchUsers = () => {
...
@@ -118,7 +118,6 @@ export const fetchUsers = () => {
try
{
try
{
const
response
=
await
axios
.
get
(
"/users"
);
const
response
=
await
axios
.
get
(
"/users"
);
dispatch
(
fetchUsersSuccess
(
response
.
data
.
users
));
dispatch
(
fetchUsersSuccess
(
response
.
data
.
users
));
console
.
log
(
response
.
data
.
users
)
}
catch
(
e
)
{
}
catch
(
e
)
{
dispatch
(
fetchUsersFailure
(
e
));
dispatch
(
fetchUsersFailure
(
e
));
}
}
...
...
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