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
492adeee
Commit
492adeee
authored
Jan 09, 2023
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#141
Сделал побольше разделение компонентов
parent
196709fe
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
54 deletions
+81
-54
ProjectMembersList.js
...rojectComponents/ProjectMembersList/ProjectMembersList.js
+0
-24
ColumnTitle.js
...umnsWrapper/ProjectUsersColumn/ColumnTitle/ColumnTitle.js
+14
-0
ProjectUsersColumn.js
...rsColumnsWrapper/ProjectUsersColumn/ProjectUsersColumn.js
+7
-24
UserItem.js
...Wrapper/ProjectUsersColumn/UsersList/UserItem/UserItem.js
+26
-0
UserList.js
...rsColumnsWrapper/ProjectUsersColumn/UsersList/UserList.js
+31
-0
FullProject.js
planner-front/src/containers/FullProject/FullProject.js
+3
-6
No files found.
planner-front/src/components/ProjectComponents/ProjectMembersList/ProjectMembersList.js
deleted
100644 → 0
View file @
196709fe
import
{
Grid
}
from
"@mui/material"
;
import
ProjectMembersItem
from
"../ProjectUserItem/ProjectUserItem"
;
const
ProjectMembersList
=
({
members
,
roleProjectOfAuthor
,
authorOfProject
})
=>
{
console
.
log
(
"members "
,
members
)
return
(
<
Grid
item
container
direction
=
"column"
spacing
=
{
1
}
>
{
members
?.
map
(
member
=>
{
return
<
ProjectMembersItem
displayName
=
{
member
?.
user
?.
displayName
}
roleProject
=
{
member
?.
roleProject
}
id
=
{
member
.
id
}
key
=
{
member
.
id
}
roleProjectOfAuthor
=
{
roleProjectOfAuthor
}
userId
=
{
member
?.
user
?.
id
}
members
=
{
members
}
authorOfProject
=
{
authorOfProject
}
/
>
})}
<
/Grid
>
);
};
export
default
ProjectMembersList
;
\ No newline at end of file
planner-front/src/components/ProjectComponents/ProjectUsersColumnsWrapper/ProjectUsersColumn/ColumnTitle/ColumnTitle.js
0 → 100644
View file @
492adeee
import
{
Typography
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
const
ColumnTitle
=
({
text
})
=>
{
return
<>
<
Typography
variant
=
"h4"
textAlign
=
{
'center'
}
sx
=
{{
marginBottom
:
'20px'
}}
>
{
text
}
<
/Typography
>
<
/
>
};
export
default
memo
(
ColumnTitle
);
planner-front/src/components/ProjectComponents/ProjectUsersColumnsWrapper/ProjectUsersColumn/ProjectUsersColumn.js
View file @
492adeee
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
import
{
memo
}
from
"react"
;
import
ProjectUserItem
from
"../../ProjectUserItem/ProjectUserItem"
;
import
ColumnTitle
from
"./ColumnTitle/ColumnTitle"
;
import
UsersList
from
"./UsersList/UserList"
;
const
styleColumn
=
{
const
styleColumn
=
{
border
:
'3px solid black'
,
border
:
'3px solid black'
,
...
@@ -11,34 +12,16 @@ const styleColumn = {
...
@@ -11,34 +12,16 @@ const styleColumn = {
overflowX
:
'hidden'
,
overflowX
:
'hidden'
,
}
}
const
styleList
=
{
display
:
'flex'
,
gap
:
'10px'
,
flexDirection
:
'column'
,
alignItems
:
'center'
,
}
const
ProjectUsersColumn
=
({
role
,
members
})
=>
{
const
ProjectUsersColumn
=
({
role
,
members
})
=>
{
return
(
return
(
<
Box
sx
=
{
styleColumn
}
>
<
Box
sx
=
{
styleColumn
}
>
<
Typography
variant
=
"h4"
textAlign
=
{
'center'
}
sx
=
{{
marginBottom
:
'20px'
}}
>
<
ColumnTitle
text
=
{
role
.
text
}
/
>
{
role
.
text
}
<
/Typography
>
<
Box
sx
=
{
styleList
}
>
<
UsersList
{
members
.
map
((
member
)
=>
{
role
=
{
role
}
if
(
member
.
roleProject
===
role
.
value
)
{
members
=
{
members
}
>
return
(
<
/UsersList
>
<
ProjectUserItem
key
=
{
member
.
id
}
user
=
{
member
?.
user
}
/
>
)
}
else
{
return
null
}
})}
<
/Box
>
<
/Box
>
<
/Box
>
);
);
};
};
...
...
planner-front/src/components/ProjectComponents/ProjectUsersColumnsWrapper/ProjectUsersColumn/UsersList/UserItem/UserItem.js
0 → 100644
View file @
492adeee
import
{
Grid
}
from
"@mui/material"
;
import
DeleteIcon
from
"@mui/icons-material/Delete"
;
import
{
memo
}
from
"react"
;
const
style
=
{
width
:
'90%'
,
border
:
'1px solid black'
,
borderRadius
:
'5px'
,
padding
:
'15px 15px'
,
display
:
'flex'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}
const
ProjectMembersItem
=
({
user
})
=>
{
return
<>
<
Grid
sx
=
{
style
}
>
{
user
?.
displayName
}
<
DeleteIcon
/>
<
/Grid
>
<
/
>
};
export
default
memo
(
ProjectMembersItem
);
planner-front/src/components/ProjectComponents/ProjectUsersColumnsWrapper/ProjectUsersColumn/UsersList/UserList.js
0 → 100644
View file @
492adeee
import
{
Box
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
import
UserItem
from
"./UserItem/UserItem"
;
const
styleList
=
{
display
:
'flex'
,
gap
:
'10px'
,
flexDirection
:
'column'
,
alignItems
:
'center'
,
}
const
UsersList
=
({
role
,
members
})
=>
{
return
(
<
Box
sx
=
{
styleList
}
>
{
members
.
map
((
member
)
=>
{
if
(
member
.
roleProject
===
role
.
value
)
{
return
(
<
UserItem
key
=
{
member
.
id
}
user
=
{
member
?.
user
}
/
>
)
}
else
{
return
null
}
})}
<
/Box
>
);
};
export
default
memo
(
UsersList
);
\ No newline at end of file
planner-front/src/containers/FullProject/FullProject.js
View file @
492adeee
...
@@ -4,7 +4,6 @@ import { useSelector, useDispatch } from "react-redux";
...
@@ -4,7 +4,6 @@ import { useSelector, useDispatch } from "react-redux";
import
{
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
{
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
{
fetchProject
}
from
"../../store/actions/projectsActions"
;
import
{
fetchProject
}
from
"../../store/actions/projectsActions"
;
import
{
fetchUsers
,
fetchUsersAllFields
}
from
"../../store/actions/usersActions"
;
import
{
fetchUsers
,
fetchUsersAllFields
}
from
"../../store/actions/usersActions"
;
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"
;
...
@@ -23,10 +22,10 @@ const FullProject = () => {
...
@@ -23,10 +22,10 @@ const FullProject = () => {
dispatch
(
fetchProject
(
params
.
id
))
dispatch
(
fetchProject
(
params
.
id
))
},
[
params
.
id
,
dispatch
]);
},
[
params
.
id
,
dispatch
]);
const
members
=
useMemo
(()
=>
{
const
members
=
useMemo
(()
=>
{
return
project
?.
project
?.
members
||
[]
return
project
?.
project
?.
members
||
[]
},[
project
])
},
[
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,8 +58,6 @@ const FullProject = () => {
...
@@ -59,8 +58,6 @@ const FullProject = () => {
Участники
проекта
:
<
NewMember
members
=
{
project
?.
project
?.
members
}
/
>
Участники
проекта
:
<
NewMember
members
=
{
project
?.
project
?.
members
}
/
>
<
/div
>
<
/div
>
{
/* <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
}
members
=
{
members
}
/
>
/
>
...
...
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