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";
...
@@ -23,6 +23,8 @@ import TaskModal from "./TaskModal/TaskModal";
export
default
function
NewTaskForm
({
export
default
function
NewTaskForm
({
projects
,
projects
,
currentProject
,
setAddTaskForm
,
setAddTaskForm
,
})
{
})
{
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
...
@@ -43,7 +45,7 @@ export default function NewTaskForm({
...
@@ -43,7 +45,7 @@ export default function NewTaskForm({
priority
:
"B"
,
priority
:
"B"
,
author
:
{
id
:
user
.
id
},
author
:
{
id
:
user
.
id
},
authorDisplayName
:
user
.
displayName
,
authorDisplayName
:
user
.
displayName
,
executor
s
:
[]
,
executor
:
null
,
isEditMode
:
true
,
isEditMode
:
true
,
});
});
...
@@ -73,6 +75,14 @@ export default function NewTaskForm({
...
@@ -73,6 +75,14 @@ export default function NewTaskForm({
setTask
(
newTask
);
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
onDateChange
=
(
id
,
value
,
property
)
=>
{
const
newTask
=
{
const
newTask
=
{
...
task
,
...
task
,
...
@@ -159,6 +169,18 @@ export default function NewTaskForm({
...
@@ -159,6 +169,18 @@ export default function NewTaskForm({
value
=
{
task
.
project
?.
id
}
value
=
{
task
.
project
?.
id
}
/
>
/
>
<
/TableCell
>
<
/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>
{
/* <TableCell>
<MaterialUIPickers
<MaterialUIPickers
...
@@ -231,7 +253,12 @@ export const header = [
...
@@ -231,7 +253,12 @@ export const header = [
disablePadding
:
false
,
disablePadding
:
false
,
label
:
"Проект"
,
label
:
"Проект"
,
},
},
{
id
:
"executorName"
,
numeric
:
false
,
disablePadding
:
false
,
label
:
"Исполнитель"
,
},
{
{
id
:
"dateTimeDue"
,
id
:
"dateTimeDue"
,
numeric
:
true
,
numeric
:
true
,
...
...
planner-front/src/containers/UsersTasks/UsersTasks.js
View file @
c45fea41
...
@@ -24,6 +24,8 @@ export default function UsersTasks() {
...
@@ -24,6 +24,8 @@ export default function UsersTasks() {
const
tasks
=
useSelector
((
state
)
=>
state
.
tasks
.
tasks
);
const
tasks
=
useSelector
((
state
)
=>
state
.
tasks
.
tasks
);
const
user
=
useSelector
((
state
)
=>
state
.
users
.
user
);
const
user
=
useSelector
((
state
)
=>
state
.
users
.
user
);
const
[
executors
,
setExecutors
]
=
useState
([])
const
[
projects
,
setProjects
]
=
useState
([])
const
[
recievedTasks
,
setRecievedTasks
]
=
useState
([]);
const
[
recievedTasks
,
setRecievedTasks
]
=
useState
([]);
const
[
addTaskForm
,
setAddTaskForm
]
=
useState
(
false
);
const
[
addTaskForm
,
setAddTaskForm
]
=
useState
(
false
);
const
[
order
,
setOrder
]
=
useState
(
"asc"
);
const
[
order
,
setOrder
]
=
useState
(
"asc"
);
...
@@ -34,7 +36,7 @@ export default function UsersTasks() {
...
@@ -34,7 +36,7 @@ export default function UsersTasks() {
open
:
false
,
open
:
false
,
task
:
null
,
task
:
null
,
});
});
const
[
projects
,
setProjects
]
=
useState
([
'1'
,
'2'
])
useEffect
(()
=>
{
useEffect
(()
=>
{
dispatch
(
fetchAllTasks
());
dispatch
(
fetchAllTasks
());
...
@@ -136,7 +138,6 @@ useEffect(() => {
...
@@ -136,7 +138,6 @@ useEffect(() => {
}
}
return
task
;
return
task
;
});
});
setRecievedTasks
(
newTasks
);
};
};
...
@@ -263,6 +264,7 @@ console.log('tasks', tasks)
...
@@ -263,6 +264,7 @@ console.log('tasks', tasks)
{
addTaskForm
?
(
{
addTaskForm
?
(
<
NewTaskForm
<
NewTaskForm
projects
=
{
uniqueProjects
}
projects
=
{
uniqueProjects
}
currentProject
=
{
currentProject
}
setAddTaskForm
=
{()
=>
setAddTaskForm
(
false
)}
setAddTaskForm
=
{()
=>
setAddTaskForm
(
false
)}
/
>
/
>
)
:
null
}
)
:
null
}
...
@@ -293,6 +295,7 @@ console.log('tasks', tasks)
...
@@ -293,6 +295,7 @@ console.log('tasks', tasks)
onChange
=
{
onChange
}
onChange
=
{
onChange
}
onModalOpen
=
{
onModalOpen
}
onModalOpen
=
{
onModalOpen
}
onProjectChange
=
{
onProjectChange
}
onProjectChange
=
{
onProjectChange
}
executors
=
{
executors
}
onExecutorChange
=
{
onExecutorChange
}
onExecutorChange
=
{
onExecutorChange
}
uniqueProjects
=
{
uniqueProjects
}
uniqueProjects
=
{
uniqueProjects
}
onAuthorChange
=
{
onAuthorChange
}
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