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
c1d5bc88
Commit
c1d5bc88
authored
Dec 18, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#110
select project is fixed
parent
c79bfce2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
23 deletions
+31
-23
users.ts
planner-api/src/routers/users.ts
+0
-1
MultipleSelect.js
...-front/src/components/UI/MultipleSelect/MultipleSelect.js
+4
-4
UsersTaskToolBar.js
...t/src/components/UsersTasksCompoments/UsersTaskToolBar.js
+2
-2
UsersTasks.js
planner-front/src/containers/UsersTasks/UsersTasks.js
+22
-13
tasksActions.js
planner-front/src/store/actions/tasksActions.js
+3
-3
No files found.
planner-api/src/routers/users.ts
View file @
c1d5bc88
...
@@ -62,7 +62,6 @@ router.get('/all-fields/', async (req : Request, res : Response):Promise<object>
...
@@ -62,7 +62,6 @@ router.get('/all-fields/', async (req : Request, res : Response):Promise<object>
},
},
}
}
})
})
console
.
log
(
'all fields users '
,
users
)
return
res
.
send
({
users
})
return
res
.
send
({
users
})
})
})
...
...
planner-front/src/components/UI/MultipleSelect/MultipleSelect.js
View file @
c1d5bc88
...
@@ -61,11 +61,11 @@ export default function MultipleSelect({projects,projectName,onClose,setProjectN
...
@@ -61,11 +61,11 @@ export default function MultipleSelect({projects,projectName,onClose,setProjectN
>
>
{
projects
?.
map
((
project
)
=>
(
{
projects
?.
map
((
project
)
=>
(
<
MenuItem
<
MenuItem
key
=
{
project
}
key
=
{
project
.
id
}
value
=
{
project
}
value
=
{
project
.
id
}
style
=
{
getStyles
(
project
,
project
Nam
e
,
theme
)}
style
=
{
getStyles
(
project
,
project
.
titl
e
,
theme
)}
>
>
{
project
}
{
project
.
title
}
<
/MenuItem
>
<
/MenuItem
>
))}
))}
<
/Select
>
<
/Select
>
...
...
planner-front/src/components/UsersTasksCompoments/UsersTaskToolBar.js
View file @
c1d5bc88
...
@@ -8,12 +8,12 @@ import MultipleSelect from '../UI/MultipleSelect/MultipleSelect';
...
@@ -8,12 +8,12 @@ import MultipleSelect from '../UI/MultipleSelect/MultipleSelect';
import
Add
from
"@mui/icons-material/Add"
;
import
Add
from
"@mui/icons-material/Add"
;
import
Close
from
"@mui/icons-material/Close"
;
import
Close
from
"@mui/icons-material/Close"
;
export
default
function
My
TaskToolBar
({
projects
,
onClose
,
projectName
,
setProjectName
,
formStatus
,
onClick
})
{
export
default
function
Users
TaskToolBar
({
projects
,
onClose
,
projectName
,
setProjectName
,
formStatus
,
onClick
})
{
let
projectsFilter
=
let
projectsFilter
=
<><
/
>
<><
/
>
if
(
projects
)
{
if
(
Array
.
isArray
(
projects
)
)
{
projectsFilter
=
projectsFilter
=
<
MultipleSelect
<
MultipleSelect
projects
=
{
projects
}
projects
=
{
projects
}
...
...
planner-front/src/containers/UsersTasks/UsersTasks.js
View file @
c1d5bc88
...
@@ -11,7 +11,7 @@ import { useState, useEffect } from "react";
...
@@ -11,7 +11,7 @@ import { useState, useEffect } from "react";
import
{
useDispatch
,
useSelector
}
from
"react-redux"
;
import
{
useDispatch
,
useSelector
}
from
"react-redux"
;
import
TaskModal
from
"../../components/UsersTasksCompoments/TaskModal/TaskModal"
;
import
TaskModal
from
"../../components/UsersTasksCompoments/TaskModal/TaskModal"
;
import
moment
from
"moment"
;
import
moment
from
"moment"
;
import
My
TaskToolBar
from
"../../components/UsersTasksCompoments/UsersTaskToolBar"
;
import
Users
TaskToolBar
from
"../../components/UsersTasksCompoments/UsersTaskToolBar"
;
import
{
fetchAllTasks
,
deleteTask
,
editTask
,
deleteDateTimeTask
,
fetchAllTasksByMembership
}
from
"../../store/actions/tasksActions"
;
import
{
fetchAllTasks
,
deleteTask
,
editTask
,
deleteDateTimeTask
,
fetchAllTasksByMembership
}
from
"../../store/actions/tasksActions"
;
import
NewTaskForm
from
"../../components/UsersTasksCompoments/NewTaskForm"
;
import
NewTaskForm
from
"../../components/UsersTasksCompoments/NewTaskForm"
;
import
TableRowTask
from
"../../components/UsersTasksCompoments/TableRowTask/TableRowTask"
;
import
TableRowTask
from
"../../components/UsersTasksCompoments/TableRowTask/TableRowTask"
;
...
@@ -45,11 +45,13 @@ export default function UsersTasks() {
...
@@ -45,11 +45,13 @@ export default function UsersTasks() {
if
(
tasks
&&
tasks
?.
length
>
0
)
{
if
(
tasks
&&
tasks
?.
length
>
0
)
{
setRecievedTasks
(
tasks
);
setRecievedTasks
(
tasks
);
}
}
},
[
dispatch
,
tasks
?.
length
]);
},
[
dispatch
,
tasks
?.
length
,
addTaskForm
,
setAddTaskForm
]);
useEffect
(()
=>
{
//
useEffect(() => {
dispatch
(
fetchAllTasksByMembership
());
//
dispatch(fetchAllTasksByMembership());
},
[
addTaskForm
,
setAddTaskForm
]);
//
}, [addTaskForm, setAddTaskForm]);
...
@@ -112,14 +114,21 @@ useEffect(() => {
...
@@ -112,14 +114,21 @@ useEffect(() => {
const
onProjectChange
=
(
e
,
task
)
=>
{
const
onProjectChange
=
(
e
,
task
)
=>
{
const
projectId
=
e
.
target
.
value
;
const
projectId
=
e
.
target
.
value
;
const
project
=
projects
.
find
((
uniqueProject
)
=>
uniqueProject
.
id
===
projectId
)
;
const
project
=
projects
.
length
>
0
?
projects
.
find
((
uniqueProject
)
=>
uniqueProject
.
id
===
projectId
):
null
;
setCurrentProject
(
project
)
setCurrentProject
(
project
)
if
(
project
?.
members
){
for
(
let
member
of
project
.
members
){
setExecutors
([...
executors
,
member
.
user
])
}
console
.
log
(
'executors '
,
executors
)
}
const
{
id
}
=
task
;
const
{
id
}
=
task
;
const
newTasks
=
recievedTasks
.
map
((
task
)
=>
{
const
newTasks
=
recievedTasks
.
map
((
task
)
=>
{
if
(
task
.
id
===
id
)
{
if
(
task
.
id
===
id
)
{
const
updated
=
{
...
task
};
const
updated
=
{
...
task
};
updated
.
project
=
project
;
updated
.
project
=
project
;
updated
.
projectName
=
project
.
title
;
updated
.
projectName
=
project
.
title
?
project
.
title
:
null
;
return
updated
;
return
updated
;
}
}
return
task
;
return
task
;
...
@@ -209,10 +218,12 @@ useEffect(() => {
...
@@ -209,10 +218,12 @@ useEffect(() => {
const
onClose
=
(
projectName
)
=>
{
const
onClose
=
(
projectName
)
=>
{
console
.
log
(
'projectName '
,
projectName
)
let
tasksFilteredByProject
=
tasks
let
tasksFilteredByProject
=
tasks
if
(
projectName
.
length
>
0
)
{
if
(
projectName
.
length
>
0
)
{
tasksFilteredByProject
=
tasks
.
filter
(
task
=>
projectName
.
includes
(
task
.
project
?.
title
))
tasksFilteredByProject
=
tasks
.
filter
(
task
=>
projectName
.
includes
(
task
.
project
?.
id
))
}
}
console
.
log
(
'tasksFilteredByProject '
,
tasksFilteredByProject
)
setRecievedTasks
(
tasksFilteredByProject
)
setRecievedTasks
(
tasksFilteredByProject
)
setFilterProjectTumbler
(
true
)
setFilterProjectTumbler
(
true
)
}
}
...
@@ -244,7 +255,6 @@ useEffect(() => {
...
@@ -244,7 +255,6 @@ useEffect(() => {
return
results
;
return
results
;
},
[]);
},
[]);
console
.
log
(
'tasks'
,
tasks
)
if
(
if
(
tasks
&&
tasks
&&
...
@@ -255,7 +265,7 @@ console.log('tasks', tasks)
...
@@ -255,7 +265,7 @@ console.log('tasks', tasks)
return
(
return
(
<
Box
sx
=
{{
width
:
"fullwidth"
}}
>
<
Box
sx
=
{{
width
:
"fullwidth"
}}
>
<
Paper
sx
=
{{
width
:
"100%"
,
mb
:
2
}}
>
<
Paper
sx
=
{{
width
:
"100%"
,
mb
:
2
}}
>
<
My
TaskToolBar
<
Users
TaskToolBar
onClick
=
{()
=>
setAddTaskForm
(
!
addTaskForm
)}
onClick
=
{()
=>
setAddTaskForm
(
!
addTaskForm
)}
formStatus
=
{
addTaskForm
}
formStatus
=
{
addTaskForm
}
projects
=
{
projects
}
projects
=
{
projects
}
...
@@ -275,7 +285,7 @@ console.log('tasks', tasks)
...
@@ -275,7 +285,7 @@ console.log('tasks', tasks)
<
TableContainer
>
<
TableContainer
>
<
Table
sx
=
{{
minWidth
:
600
}}
aria
-
labelledby
=
"tableTitle"
>
<
Table
sx
=
{{
minWidth
:
600
}}
aria
-
labelledby
=
"tableTitle"
size
=
'small'
>
<
UsersTasksHeader
<
UsersTasksHeader
order
=
{
order
}
order
=
{
order
}
orderBy
=
{
orderBy
}
orderBy
=
{
orderBy
}
...
@@ -294,7 +304,6 @@ console.log('tasks', tasks)
...
@@ -294,7 +304,6 @@ console.log('tasks', tasks)
task
=
{
task
}
task
=
{
task
}
deleteHandle
=
{
deleteHandle
}
deleteHandle
=
{
deleteHandle
}
handleEditTask
=
{
handleEditTask
}
handleEditTask
=
{
handleEditTask
}
handleEditDateTimeTask
=
{
handleEditDateTimeTask
}
deleteDateTimeTask
=
{
deleteDateTimeTaskHandle
}
deleteDateTimeTask
=
{
deleteDateTimeTaskHandle
}
onChange
=
{
onChange
}
onChange
=
{
onChange
}
onModalOpen
=
{
onModalOpen
}
onModalOpen
=
{
onModalOpen
}
...
...
planner-front/src/store/actions/tasksActions.js
View file @
c1d5bc88
...
@@ -64,8 +64,8 @@ export const fetchAllTasks = () => {
...
@@ -64,8 +64,8 @@ export const fetchAllTasks = () => {
};
};
//**fetch tasks for table UsersTasks, start*/
//**fetch tasks for table UsersTasks, start*/
const
fetchAllTasksByMembershipSuccess
=
(
tasks
)
=>
{
const
fetchAllTasksByMembershipSuccess
=
(
tasks
,
projects
)
=>
{
return
{
type
:
FETCH_ALL_TASKS_BY_MEMBERSHIP_SUCCESS
,
tasks
}
return
{
type
:
FETCH_ALL_TASKS_BY_MEMBERSHIP_SUCCESS
,
tasks
,
projects
}
};
};
...
@@ -75,7 +75,7 @@ export const fetchAllTasksByMembership = () => {
...
@@ -75,7 +75,7 @@ export const fetchAllTasksByMembership = () => {
dispatch
(
fetchCalendarTasksRequest
());
dispatch
(
fetchCalendarTasksRequest
());
try
{
try
{
const
response
=
await
axios
.
get
(
"/tasks/users-tasks"
);
const
response
=
await
axios
.
get
(
"/tasks/users-tasks"
);
dispatch
(
fetchAllTasksByMembershipSuccess
(
response
.
data
.
tasks
))
dispatch
(
fetchAllTasksByMembershipSuccess
(
response
.
data
.
tasks
,
response
.
data
.
projects
))
}
catch
(
error
)
{
}
catch
(
error
)
{
dispatch
(
fetchCalendarTasksFailure
(
error
.
response
.
data
));
dispatch
(
fetchCalendarTasksFailure
(
error
.
response
.
data
));
}
}
...
...
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