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
b17e0019
Commit
b17e0019
authored
Dec 23, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#119
setup tbl while user have no tasks
parent
2d68f3fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
21 deletions
+22
-21
tasks.ts
planner-api/src/routers/tasks.ts
+1
-1
MyTasks.js
planner-front/src/containers/MyTasks/MyTasks.js
+12
-11
UsersTasks.js
planner-front/src/containers/UsersTasks/UsersTasks.js
+9
-9
No files found.
planner-api/src/routers/tasks.ts
View file @
b17e0019
...
...
@@ -28,7 +28,7 @@ router.get('/', async(req:Request, res:Response):Promise<Response> => {
router
.
post
(
'/'
,
auth
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
const
{
user
,
title
,
description
,
project
,
executor
,
dateTimeStart
,
dateTimeDue
,
dateTimeDeadLine
,
priority
}
=
req
.
body
;
//** if dateTimeDue is null , then dateTimeDeadLine copied to dateTimeDue and dateTimeStart = dateTimeDue - 1 hour*/
let
dateTimeDueFinal
=
dateTimeDue
let
dateTimeDueFinal
=
dateTimeDue
let
dateTimeStartFinal
=
dateTimeStart
let
dateTimeDeadlineFinal
=
dateTimeDeadLine
if
(
!
dateTimeDue
&&
dateTimeDeadLine
)
{
...
...
planner-front/src/containers/MyTasks/MyTasks.js
View file @
b17e0019
...
...
@@ -29,7 +29,7 @@ export default function EnhancedTable() {
const
[
order
,
setOrder
]
=
useState
(
"asc"
);
const
[
orderBy
,
setOrderBy
]
=
useState
(
"id"
);
const
[
page
,
setPage
]
=
useState
(
0
);
const
[
rowsPerPage
,
setRowsPerPage
]
=
useState
(
5
);
const
[
rowsPerPage
,
setRowsPerPage
]
=
useState
(
2
5
);
const
[
modal
,
setModal
]
=
useState
({
open
:
false
,
task
:
null
,
...
...
@@ -44,7 +44,7 @@ export default function EnhancedTable() {
},
[
tasks
?.
length
,
addTaskForm
,
setAddTaskForm
,
dispatch
]);
console
.
log
(
'tasks '
,
tasks
,
'projects '
,
projects
)
console
.
log
(
'tasks '
,
tasks
,
'projects '
,
projects
,
"recievedTasks "
,
recievedTasks
)
...
...
@@ -184,12 +184,13 @@ export default function EnhancedTable() {
setFilterProjectTumbler
(
true
)
}
if
(
tasks
&&
tasks
?.
length
>
0
&&
recievedTasks
&&
recievedTasks
?.
length
>
0
)
{
// if (
// tasks &&
// tasks?.length > 0
// &&
// recievedTasks &&
// recievedTasks?.length > 0
// ) {
return
(
<
Box
sx
=
{{
width
:
"fullwidth"
}}
>
<
Paper
sx
=
{{
width
:
"100%"
,
mb
:
2
}}
>
...
...
@@ -215,7 +216,7 @@ export default function EnhancedTable() {
order
=
{
order
}
orderBy
=
{
orderBy
}
onRequestSort
=
{
handleRequestSort
}
rowCount
=
{
t
asks
.
length
}
rowCount
=
{
recievedT
asks
.
length
}
/
>
<
TableBody
>
{
stableSort
(
recievedTasks
,
getComparator
(
order
,
orderBy
))
...
...
@@ -246,7 +247,7 @@ export default function EnhancedTable() {
<
TablePagination
rowsPerPageOptions
=
{[
5
,
10
,
25
]}
component
=
"div"
count
=
{
t
asks
.
length
}
count
=
{
recievedT
asks
.
length
}
rowsPerPage
=
{
rowsPerPage
}
page
=
{
page
}
onPageChange
=
{
handleChangePage
}
...
...
@@ -263,7 +264,7 @@ export default function EnhancedTable() {
<
/Box
>
);
}
}
//
}
function
descendingComparator
(
a
,
b
,
orderBy
)
{
if
(
b
[
orderBy
]
<
a
[
orderBy
])
{
...
...
planner-front/src/containers/UsersTasks/UsersTasks.js
View file @
b17e0019
...
...
@@ -199,12 +199,12 @@ export default function UsersTasks() {
setFilterProjectTumbler
(
true
)
}
if
(
tasks
&&
tasks
?.
length
>
0
&&
recievedTasks
&&
recievedTasks
?.
length
>
0
)
{
//
if (
//
tasks &&
//
tasks?.length > 0 &&
//
recievedTasks &&
//
recievedTasks?.length > 0
//
) {
return
(
<
Box
sx
=
{{
width
:
"fullwidth"
}}
>
<
Paper
sx
=
{{
width
:
"100%"
,
mb
:
2
}}
>
...
...
@@ -233,7 +233,7 @@ export default function UsersTasks() {
order
=
{
order
}
orderBy
=
{
orderBy
}
onRequestSort
=
{
handleRequestSort
}
rowCount
=
{
t
asks
.
length
}
rowCount
=
{
recievedT
asks
.
length
}
/
>
<
TableBody
>
...
...
@@ -267,7 +267,7 @@ export default function UsersTasks() {
<
TablePagination
rowsPerPageOptions
=
{[
5
,
10
,
25
]}
component
=
"div"
count
=
{
t
asks
.
length
}
count
=
{
recievedT
asks
.
length
}
rowsPerPage
=
{
rowsPerPage
}
page
=
{
page
}
onPageChange
=
{
handleChangePage
}
...
...
@@ -284,7 +284,7 @@ export default function UsersTasks() {
<
/Box
>
);
}
}
//
}
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