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
c45fea41
Commit
c45fea41
authored
Dec 15, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#105
added newTaskFrom
parent
c42c74d2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
5 deletions
+35
-5
NewTaskForm.js
...-front/src/components/UsersTasksCompoments/NewTaskForm.js
+30
-3
UsersTasks.js
planner-front/src/containers/UsersTasks/UsersTasks.js
+5
-2
No files found.
planner-front/src/components/UsersTasksCompoments/NewTaskForm.js
View file @
c45fea41
...
...
@@ -23,6 +23,8 @@ import TaskModal from "./TaskModal/TaskModal";
export
default
function
NewTaskForm
({
projects
,
currentProject
,
setAddTaskForm
,
})
{
const
dispatch
=
useDispatch
();
...
...
@@ -43,7 +45,7 @@ export default function NewTaskForm({
priority
:
"B"
,
author
:
{
id
:
user
.
id
},
authorDisplayName
:
user
.
displayName
,
executor
s
:
[]
,
executor
:
null
,
isEditMode
:
true
,
});
...
...
@@ -73,6 +75,14 @@ export default function NewTaskForm({
setTask
(
newTask
);
};
const
onExecutorChange
=
(
e
,
task
)
=>
{
const
value
=
e
.
target
.
value
;
const
executor
=
projects
.
find
((
e
)
=>
e
.
id
===
value
);
const
newTask
=
{
...
task
};
newTask
.
executor
=
executor
;
setTask
(
newTask
);
};
const
onDateChange
=
(
id
,
value
,
property
)
=>
{
const
newTask
=
{
...
task
,
...
...
@@ -159,6 +169,18 @@ export default function NewTaskForm({
value
=
{
task
.
project
?.
id
}
/
>
<
/TableCell
>
<
TableCell
>
<
BasicSelect
items
=
{
currentProject
.
members
.
map
((
member
)
=>
({
value
:
member
?.
id
,
title
:
member
?.
displayName
,
}))}
task
=
{
task
}
onChange
=
{
onExecutorChange
}
name
=
"executor"
value
=
{
task
.
executor
?.
id
}
/
>
<
/TableCell
>
{
/* <TableCell>
<MaterialUIPickers
...
...
@@ -231,7 +253,12 @@ export const header = [
disablePadding
:
false
,
label
:
"Проект"
,
},
{
id
:
"executorName"
,
numeric
:
false
,
disablePadding
:
false
,
label
:
"Исполнитель"
,
},
{
id
:
"dateTimeDue"
,
numeric
:
true
,
...
...
planner-front/src/containers/UsersTasks/UsersTasks.js
View file @
c45fea41
...
...
@@ -24,6 +24,8 @@ export default function UsersTasks() {
const
tasks
=
useSelector
((
state
)
=>
state
.
tasks
.
tasks
);
const
user
=
useSelector
((
state
)
=>
state
.
users
.
user
);
const
[
executors
,
setExecutors
]
=
useState
([])
const
[
projects
,
setProjects
]
=
useState
([])
const
[
recievedTasks
,
setRecievedTasks
]
=
useState
([]);
const
[
addTaskForm
,
setAddTaskForm
]
=
useState
(
false
);
const
[
order
,
setOrder
]
=
useState
(
"asc"
);
...
...
@@ -34,7 +36,7 @@ export default function UsersTasks() {
open
:
false
,
task
:
null
,
});
const
[
projects
,
setProjects
]
=
useState
([
'1'
,
'2'
])
useEffect
(()
=>
{
dispatch
(
fetchAllTasks
());
...
...
@@ -136,7 +138,6 @@ useEffect(() => {
}
return
task
;
});
setRecievedTasks
(
newTasks
);
};
...
...
@@ -263,6 +264,7 @@ console.log('tasks', tasks)
{
addTaskForm
?
(
<
NewTaskForm
projects
=
{
uniqueProjects
}
currentProject
=
{
currentProject
}
setAddTaskForm
=
{()
=>
setAddTaskForm
(
false
)}
/
>
)
:
null
}
...
...
@@ -293,6 +295,7 @@ console.log('tasks', tasks)
onChange
=
{
onChange
}
onModalOpen
=
{
onModalOpen
}
onProjectChange
=
{
onProjectChange
}
executors
=
{
executors
}
onExecutorChange
=
{
onExecutorChange
}
uniqueProjects
=
{
uniqueProjects
}
onAuthorChange
=
{
onAuthorChange
}
...
...
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