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
2485ce07
Commit
2485ce07
authored
Dec 15, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#105
some page user tasks
parent
c45fea41
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
13 deletions
+17
-13
App.js
planner-front/src/App.js
+4
-2
TableRowTask.js
...ponents/UsersTasksCompoments/TableRowTask/TableRowTask.js
+1
-1
UsersTaskToolBar.js
...t/src/components/UsersTasksCompoments/UsersTaskToolBar.js
+1
-1
UsersTasks.js
planner-front/src/containers/UsersTasks/UsersTasks.js
+9
-7
UsersTasksHeader.js
...ontainers/UsersTasks/UsersTasksHeader/UsersTasksHeader.js
+1
-1
projectsActions.js
planner-front/src/store/actions/projectsActions.js
+1
-1
No files found.
planner-front/src/App.js
View file @
2485ce07
...
@@ -11,6 +11,7 @@ import Projects from "./containers/Projects/Projects";
...
@@ -11,6 +11,7 @@ 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
NewProject
from
"./containers/NewProject/NewProject"
;
import
WeekCalendar
from
"./containers/WeekCalendar/WeekCalendar"
;
import
WeekCalendar
from
"./containers/WeekCalendar/WeekCalendar"
;
import
UsersTasks
from
"./containers/UsersTasks/UsersTasks"
;
const
ProtectedRoute
=
({
isAllowed
,
roles
,
redirectUrl
,
children
})
=>
{
const
ProtectedRoute
=
({
isAllowed
,
roles
,
redirectUrl
,
children
})
=>
{
const
user
=
useSelector
(
state
=>
state
.
users
?.
user
);
const
user
=
useSelector
(
state
=>
state
.
users
?.
user
);
...
@@ -117,10 +118,11 @@ const App = () => {
...
@@ -117,10 +118,11 @@ const App = () => {
<
Route
path
=
{
"/workers-tasks"
}
element
=
{
<
Route
path
=
{
"/workers-tasks"
}
element
=
{
<
ProtectedRoute
<
ProtectedRoute
roles
=
{[
"superuser"
]}
isAllowed
=
{
user
}
redirectUrl
=
{
"/"
}
redirectUrl
=
{
"/"
}
>
>
<
h1
>
workers
tasks
page
<
/h1
>
<
UsersTasks
/
>
<
/ProtectedRoute
>
<
/ProtectedRoute
>
}
/
>
}
/
>
...
...
planner-front/src/components/UsersTasksCompoments/TableRowTask/TableRowTask.js
View file @
2485ce07
...
@@ -180,7 +180,7 @@ const TableRowTask= ({
...
@@ -180,7 +180,7 @@ const TableRowTask= ({
task
,
task
,
name
:
"author"
,
name
:
"author"
,
value
:
task
.
author
.
displayName
,
value
:
task
.
author
.
displayName
,
onChange
:
onAuthorChange
,
//
onChange: onAuthorChange,
user
:
user
user
:
user
}}
}}
/
>
/
>
...
...
planner-front/src/components/UsersTasksCompoments/UsersTaskToolBar.js
View file @
2485ce07
...
@@ -29,7 +29,7 @@ export default function MyTaskToolBar({projects,onClose,projectName,setProjectNa
...
@@ -29,7 +29,7 @@ export default function MyTaskToolBar({projects,onClose,projectName,setProjectNa
<
AppBar
position
=
"static"
>
<
AppBar
position
=
"static"
>
<
Toolbar
>
<
Toolbar
>
<
Typography
variant
=
"h6"
component
=
"div"
sx
=
{{
flexGrow
:
1
}}
>
<
Typography
variant
=
"h6"
component
=
"div"
sx
=
{{
flexGrow
:
1
}}
>
Мои
задачи
Задачи
сотрудников
<
/Typography
>
<
/Typography
>
{
projectsFilter
}
{
projectsFilter
}
...
...
planner-front/src/containers/UsersTasks/UsersTasks.js
View file @
2485ce07
...
@@ -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
MyTaskToolBar
from
"../../components/UsersTasksCompoments/
My
TaskToolBar"
;
import
MyTaskToolBar
from
"../../components/UsersTasksCompoments/
Users
TaskToolBar"
;
import
{
fetchAllTasks
,
deleteTask
,
editTask
,
deleteDateTimeTask
}
from
"../../store/actions/tasksActions"
;
import
{
fetchAllTasks
,
deleteTask
,
editTask
,
deleteDateTimeTask
}
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"
;
...
@@ -26,6 +26,7 @@ export default function UsersTasks() {
...
@@ -26,6 +26,7 @@ export default function UsersTasks() {
const
user
=
useSelector
((
state
)
=>
state
.
users
.
user
);
const
user
=
useSelector
((
state
)
=>
state
.
users
.
user
);
const
[
executors
,
setExecutors
]
=
useState
([])
const
[
executors
,
setExecutors
]
=
useState
([])
const
[
projects
,
setProjects
]
=
useState
([])
const
[
projects
,
setProjects
]
=
useState
([])
const
[
currentProject
,
setCurrentProject
]
=
useState
(
null
);
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"
);
...
@@ -72,7 +73,7 @@ useEffect(() => {
...
@@ -72,7 +73,7 @@ useEffect(() => {
const
name
=
e
.
target
.
name
;
const
name
=
e
.
target
.
name
;
const
{
id
}
=
task
;
const
{
id
}
=
task
;
const
newTasks
=
recievedTasks
.
map
((
task
)
=>
{
const
newTasks
=
recievedTasks
.
map
((
task
)
=>
{
console
.
log
(
task
)
console
.
log
(
'recievedTasks.map '
,
task
)
if
(
task
.
id
===
id
)
{
if
(
task
.
id
===
id
)
{
return
{
...
task
,
[
name
]:
value
};
return
{
...
task
,
[
name
]:
value
};
}
}
...
@@ -110,8 +111,8 @@ useEffect(() => {
...
@@ -110,8 +111,8 @@ useEffect(() => {
};
};
const
onProjectChange
=
(
e
,
task
)
=>
{
const
onProjectChange
=
(
e
,
task
)
=>
{
const
value
=
e
.
target
.
value
;
const
projectId
=
e
.
target
.
value
;
const
project
=
uniqueProjects
.
find
((
e
)
=>
e
.
id
===
value
);
const
project
=
uniqueProjects
.
find
((
uniqueProject
)
=>
uniqueProject
.
id
===
projectId
);
const
{
id
}
=
task
;
const
{
id
}
=
task
;
const
newTasks
=
recievedTasks
.
map
((
task
)
=>
{
const
newTasks
=
recievedTasks
.
map
((
task
)
=>
{
if
(
task
.
id
===
id
)
{
if
(
task
.
id
===
id
)
{
...
@@ -126,8 +127,8 @@ useEffect(() => {
...
@@ -126,8 +127,8 @@ useEffect(() => {
};
};
const
onExecutorChange
=
(
e
,
task
)
=>
{
const
onExecutorChange
=
(
e
,
task
)
=>
{
const
value
=
e
.
target
.
value
;
const
executorId
=
e
.
target
.
value
;
const
executor
=
uniqueExecutors
.
find
((
e
)
=>
e
.
id
===
value
);
const
executor
=
executors
.
find
((
executor
)
=>
executor
.
id
===
executorId
);
const
{
id
}
=
task
;
const
{
id
}
=
task
;
const
newTasks
=
recievedTasks
.
map
((
task
)
=>
{
const
newTasks
=
recievedTasks
.
map
((
task
)
=>
{
if
(
task
.
id
===
id
)
{
if
(
task
.
id
===
id
)
{
...
@@ -138,6 +139,7 @@ useEffect(() => {
...
@@ -138,6 +139,7 @@ useEffect(() => {
}
}
return
task
;
return
task
;
});
});
setRecievedTasks
(
newTasks
);
};
};
...
@@ -298,7 +300,7 @@ console.log('tasks', tasks)
...
@@ -298,7 +300,7 @@ console.log('tasks', tasks)
executors
=
{
executors
}
executors
=
{
executors
}
onExecutorChange
=
{
onExecutorChange
}
onExecutorChange
=
{
onExecutorChange
}
uniqueProjects
=
{
uniqueProjects
}
uniqueProjects
=
{
uniqueProjects
}
onAuthorChange
=
{
onAuthorChange
}
//
onAuthorChange={onAuthorChange}
onDateChange
=
{
onDateChange
}
onDateChange
=
{
onDateChange
}
onToggleEditMode
=
{
onToggleEditMode
}
onToggleEditMode
=
{
onToggleEditMode
}
onToggleEditModeDone
=
{
onToggleEditModeDone
}
onToggleEditModeDone
=
{
onToggleEditModeDone
}
...
...
planner-front/src/containers/UsersTasks/UsersTasksHeader/UsersTasksHeader.js
View file @
2485ce07
...
@@ -118,7 +118,7 @@ export default function UsersTasksHeader({ order, orderBy, rowCount, onRequestSo
...
@@ -118,7 +118,7 @@ export default function UsersTasksHeader({ order, orderBy, rowCount, onRequestSo
);
);
}
}
EnhancedTableHead
.
propTypes
=
{
UsersTasksHeader
.
propTypes
=
{
onRequestSort
:
PropTypes
.
func
.
isRequired
,
onRequestSort
:
PropTypes
.
func
.
isRequired
,
order
:
PropTypes
.
oneOf
([
"asc"
,
"desc"
]).
isRequired
,
order
:
PropTypes
.
oneOf
([
"asc"
,
"desc"
]).
isRequired
,
orderBy
:
PropTypes
.
string
.
isRequired
,
orderBy
:
PropTypes
.
string
.
isRequired
,
...
...
planner-front/src/store/actions/projectsActions.js
View file @
2485ce07
...
@@ -53,7 +53,7 @@ export const fetchProjects = () => {
...
@@ -53,7 +53,7 @@ export const fetchProjects = () => {
return
async
dispatch
=>
{
return
async
dispatch
=>
{
dispatch
(
fetchProjectsRequest
());
dispatch
(
fetchProjectsRequest
());
try
{
try
{
const
response
=
await
axios
.
get
(
"/projects"
);
const
response
=
await
axios
.
get
(
"/projects
/my
"
);
dispatch
(
fetchProjectsSuccess
(
response
.
data
));
dispatch
(
fetchProjectsSuccess
(
response
.
data
));
}
catch
(
e
)
{
}
catch
(
e
)
{
dispatch
(
fetchProjectsError
(
e
));
dispatch
(
fetchProjectsError
(
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