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
99ebd86c
Commit
99ebd86c
authored
Dec 23, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'task-119-fix/tbl_zero_tasks' into 'development'
Task 119 fix/tbl zero tasks See merge request
!98
parents
a7a0a978
b17e0019
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
26 deletions
+30
-26
helpers.ts
planner-api/src/helpers.ts
+1
-1
copyTasks.ts
planner-api/src/routers/copyTasks.ts
+3
-3
tasks.ts
planner-api/src/routers/tasks.ts
+1
-1
MyTasks.js
planner-front/src/containers/MyTasks/MyTasks.js
+16
-12
UsersTasks.js
planner-front/src/containers/UsersTasks/UsersTasks.js
+9
-9
No files found.
planner-api/src/helpers.ts
View file @
99ebd86c
planner-api/src/routers/copyTasks.ts
View file @
99ebd86c
...
@@ -2,13 +2,13 @@ import express,{Router, Request, Response } from 'express';
...
@@ -2,13 +2,13 @@ import express,{Router, Request, Response } from 'express';
import
{
Task
}
from
'../models/Task'
;
import
{
Task
}
from
'../models/Task'
;
import
{
myDataSource
}
from
'../app-data-source'
;
import
{
myDataSource
}
from
'../app-data-source'
;
import
{
DateTimeTask
}
from
'../models/DateTimeTask'
;
import
{
DateTimeTask
}
from
'../models/DateTimeTask'
;
import
{
authAuthorOrExecutorOfDateTimeTask
,
authAuthorOrExecutorOfTask
}
from
'../helpers'
;
import
{
auth
,
auth
AuthorOrExecutorOfDateTimeTask
,
authAuthorOrExecutorOfTask
}
from
'../helpers'
;
const
router
:
Router
=
express
.
Router
();
const
router
:
Router
=
express
.
Router
();
const
dataSource
=
myDataSource
;
const
dataSource
=
myDataSource
;
/** make copy of task in calendar view */
/** make copy of task in calendar view */
router
.
post
(
"/make-copy"
,
authAuthorOrExecutorOfTask
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
router
.
post
(
"/make-copy"
,
auth
,
auth
AuthorOrExecutorOfTask
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
const
{
taskId
,
dateTimeDue
,
dateTimeStart
,
authorStatus
,
executorStatus
,
task
}
=
req
.
body
;
const
{
taskId
,
dateTimeDue
,
dateTimeStart
,
authorStatus
,
executorStatus
,
task
}
=
req
.
body
;
if
(
!
task
)
return
res
.
status
(
401
).
send
({
message
:
'task with possible user involved is not found'
})
if
(
!
task
)
return
res
.
status
(
401
).
send
({
message
:
'task with possible user involved is not found'
})
const
newDateTimeTask
=
new
DateTimeTask
();
const
newDateTimeTask
=
new
DateTimeTask
();
...
@@ -20,7 +20,7 @@ router.post("/make-copy",authAuthorOrExecutorOfTask, async(req:Request, res:Resp
...
@@ -20,7 +20,7 @@ router.post("/make-copy",authAuthorOrExecutorOfTask, async(req:Request, res:Resp
}
)
}
)
/** change date time of copy of task in calendar view */
/** change date time of copy of task in calendar view */
router
.
put
(
"/change-copy/:dateTimeTaskId"
,
authAuthorOrExecutorOfTask
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
router
.
put
(
"/change-copy/:dateTimeTaskId"
,
auth
,
authAuthorOrExecutorOfTask
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
const
{
dateTimeTaskId
}
=
req
.
params
const
{
dateTimeTaskId
}
=
req
.
params
const
{
executorStatus
,
authorStatus
,
task
,
dateTimeStart
,
dateTimeDue
,
description
,
title
,
priority
}
=
req
.
body
const
{
executorStatus
,
authorStatus
,
task
,
dateTimeStart
,
dateTimeDue
,
description
,
title
,
priority
}
=
req
.
body
if
(
authorStatus
){
if
(
authorStatus
){
...
...
planner-api/src/routers/tasks.ts
View file @
99ebd86c
planner-front/src/containers/MyTasks/MyTasks.js
View file @
99ebd86c
...
@@ -29,7 +29,7 @@ export default function EnhancedTable() {
...
@@ -29,7 +29,7 @@ export default function EnhancedTable() {
const
[
order
,
setOrder
]
=
useState
(
"asc"
);
const
[
order
,
setOrder
]
=
useState
(
"asc"
);
const
[
orderBy
,
setOrderBy
]
=
useState
(
"id"
);
const
[
orderBy
,
setOrderBy
]
=
useState
(
"id"
);
const
[
page
,
setPage
]
=
useState
(
0
);
const
[
page
,
setPage
]
=
useState
(
0
);
const
[
rowsPerPage
,
setRowsPerPage
]
=
useState
(
5
);
const
[
rowsPerPage
,
setRowsPerPage
]
=
useState
(
2
5
);
const
[
modal
,
setModal
]
=
useState
({
const
[
modal
,
setModal
]
=
useState
({
open
:
false
,
open
:
false
,
task
:
null
,
task
:
null
,
...
@@ -41,8 +41,10 @@ export default function EnhancedTable() {
...
@@ -41,8 +41,10 @@ export default function EnhancedTable() {
if
(
tasks
&&
tasks
?.
length
>
0
)
{
if
(
tasks
&&
tasks
?.
length
>
0
)
{
setRecievedTasks
(
tasks
);
setRecievedTasks
(
tasks
);
}
}
},
[
tasks
?.
length
,
addTaskForm
,
setAddTaskForm
,
dispatch
]);
},
[
console
.
log
(
'tasks '
,
tasks
,
'projects '
,
projects
)
tasks
?.
length
,
addTaskForm
,
setAddTaskForm
,
dispatch
]);
console
.
log
(
'tasks '
,
tasks
,
'projects '
,
projects
,
"recievedTasks "
,
recievedTasks
)
...
@@ -177,16 +179,18 @@ export default function EnhancedTable() {
...
@@ -177,16 +179,18 @@ export default function EnhancedTable() {
if
(
projectIdListForTaskSelect
.
length
>
0
)
{
if
(
projectIdListForTaskSelect
.
length
>
0
)
{
tasksFilteredByProject
=
tasks
.
filter
(
task
=>
projectIdListForTaskSelect
.
includes
(
task
.
project
?.
id
))
tasksFilteredByProject
=
tasks
.
filter
(
task
=>
projectIdListForTaskSelect
.
includes
(
task
.
project
?.
id
))
}
}
console
.
log
(
'tasksFilteredByProject '
,
tasksFilteredByProject
)
setRecievedTasks
(
tasksFilteredByProject
)
setRecievedTasks
(
tasksFilteredByProject
)
setFilterProjectTumbler
(
true
)
setFilterProjectTumbler
(
true
)
}
}
if
(
// if (
tasks
&&
// tasks &&
tasks
?.
length
>
0
&&
// tasks?.length > 0
recievedTasks
&&
// &&
recievedTasks
?.
length
>
0
// recievedTasks &&
)
{
// recievedTasks?.length > 0
// ) {
return
(
return
(
<
Box
sx
=
{{
width
:
"fullwidth"
}}
>
<
Box
sx
=
{{
width
:
"fullwidth"
}}
>
<
Paper
sx
=
{{
width
:
"100%"
,
mb
:
2
}}
>
<
Paper
sx
=
{{
width
:
"100%"
,
mb
:
2
}}
>
...
@@ -212,7 +216,7 @@ export default function EnhancedTable() {
...
@@ -212,7 +216,7 @@ export default function EnhancedTable() {
order
=
{
order
}
order
=
{
order
}
orderBy
=
{
orderBy
}
orderBy
=
{
orderBy
}
onRequestSort
=
{
handleRequestSort
}
onRequestSort
=
{
handleRequestSort
}
rowCount
=
{
t
asks
.
length
}
rowCount
=
{
recievedT
asks
.
length
}
/
>
/
>
<
TableBody
>
<
TableBody
>
{
stableSort
(
recievedTasks
,
getComparator
(
order
,
orderBy
))
{
stableSort
(
recievedTasks
,
getComparator
(
order
,
orderBy
))
...
@@ -243,7 +247,7 @@ export default function EnhancedTable() {
...
@@ -243,7 +247,7 @@ export default function EnhancedTable() {
<
TablePagination
<
TablePagination
rowsPerPageOptions
=
{[
5
,
10
,
25
]}
rowsPerPageOptions
=
{[
5
,
10
,
25
]}
component
=
"div"
component
=
"div"
count
=
{
t
asks
.
length
}
count
=
{
recievedT
asks
.
length
}
rowsPerPage
=
{
rowsPerPage
}
rowsPerPage
=
{
rowsPerPage
}
page
=
{
page
}
page
=
{
page
}
onPageChange
=
{
handleChangePage
}
onPageChange
=
{
handleChangePage
}
...
@@ -260,7 +264,7 @@ export default function EnhancedTable() {
...
@@ -260,7 +264,7 @@ export default function EnhancedTable() {
<
/Box
>
<
/Box
>
);
);
}
}
}
//
}
function
descendingComparator
(
a
,
b
,
orderBy
)
{
function
descendingComparator
(
a
,
b
,
orderBy
)
{
if
(
b
[
orderBy
]
<
a
[
orderBy
])
{
if
(
b
[
orderBy
]
<
a
[
orderBy
])
{
...
...
planner-front/src/containers/UsersTasks/UsersTasks.js
View file @
99ebd86c
...
@@ -199,12 +199,12 @@ export default function UsersTasks() {
...
@@ -199,12 +199,12 @@ export default function UsersTasks() {
setFilterProjectTumbler
(
true
)
setFilterProjectTumbler
(
true
)
}
}
if
(
//
if (
tasks
&&
//
tasks &&
tasks
?.
length
>
0
&&
//
tasks?.length > 0 &&
recievedTasks
&&
//
recievedTasks &&
recievedTasks
?.
length
>
0
//
recievedTasks?.length > 0
)
{
//
) {
return
(
return
(
<
Box
sx
=
{{
width
:
"fullwidth"
}}
>
<
Box
sx
=
{{
width
:
"fullwidth"
}}
>
<
Paper
sx
=
{{
width
:
"100%"
,
mb
:
2
}}
>
<
Paper
sx
=
{{
width
:
"100%"
,
mb
:
2
}}
>
...
@@ -233,7 +233,7 @@ export default function UsersTasks() {
...
@@ -233,7 +233,7 @@ export default function UsersTasks() {
order
=
{
order
}
order
=
{
order
}
orderBy
=
{
orderBy
}
orderBy
=
{
orderBy
}
onRequestSort
=
{
handleRequestSort
}
onRequestSort
=
{
handleRequestSort
}
rowCount
=
{
t
asks
.
length
}
rowCount
=
{
recievedT
asks
.
length
}
/
>
/
>
<
TableBody
>
<
TableBody
>
...
@@ -267,7 +267,7 @@ export default function UsersTasks() {
...
@@ -267,7 +267,7 @@ export default function UsersTasks() {
<
TablePagination
<
TablePagination
rowsPerPageOptions
=
{[
5
,
10
,
25
]}
rowsPerPageOptions
=
{[
5
,
10
,
25
]}
component
=
"div"
component
=
"div"
count
=
{
t
asks
.
length
}
count
=
{
recievedT
asks
.
length
}
rowsPerPage
=
{
rowsPerPage
}
rowsPerPage
=
{
rowsPerPage
}
page
=
{
page
}
page
=
{
page
}
onPageChange
=
{
handleChangePage
}
onPageChange
=
{
handleChangePage
}
...
@@ -284,7 +284,7 @@ export default function UsersTasks() {
...
@@ -284,7 +284,7 @@ export default function UsersTasks() {
<
/Box
>
<
/Box
>
);
);
}
}
}
//
}
function
descendingComparator
(
a
,
b
,
orderBy
)
{
function
descendingComparator
(
a
,
b
,
orderBy
)
{
...
...
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