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
83e48c87
Commit
83e48c87
authored
Dec 20, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#110
remove consoles and comments
parent
5c5a9798
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1 addition
and
57 deletions
+1
-57
helpers.ts
planner-api/src/helpers.ts
+0
-4
projects.ts
planner-api/src/routers/projects.ts
+0
-5
tasks.ts
planner-api/src/routers/tasks.ts
+0
-5
NewTaskForm.js
...-front/src/components/UsersTasksCompoments/NewTaskForm.js
+0
-1
MyTasks.js
planner-front/src/containers/MyTasks/MyTasks.js
+1
-32
UsersTasks.js
planner-front/src/containers/UsersTasks/UsersTasks.js
+0
-10
No files found.
planner-api/src/helpers.ts
View file @
83e48c87
...
...
@@ -212,11 +212,7 @@ export let transporter = nodemailer.createTransport({
export
const
subtractHours
=
(
date
:
Date
,
hours
:
number
)
=>
{
const
dateCopy
=
new
Date
(
date
);
console
.
log
(
'dateCopy '
,
dateCopy
)
dateCopy
.
setHours
(
dateCopy
.
getHours
()
-
hours
);
console
.
log
(
'dateCopy afterset '
,
dateCopy
)
return
dateCopy
;
}
...
...
planner-api/src/routers/projects.ts
View file @
83e48c87
...
...
@@ -121,7 +121,6 @@ router.get('/user/:userId', async (req : Request, res : Response): Promise<Respo
router
.
post
(
'/add-user/'
,
authAdminProject
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
const
{
userId
,
projectId
,
roleProject
}
=
req
.
body
;
console
.
log
(
"req body"
+
req
.
body
)
const
newMember
:
Member
=
new
Member
();
try
{
newMember
.
user
=
userId
;
...
...
@@ -139,10 +138,8 @@ router.post('/add-user/', authAdminProject, async (req: Request, res: Response):
/** Remove user from specific project by userId */
router
.
delete
(
'/remove-user/:userId'
,
authAdminProject
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
console
.
log
(
'req.body '
,
req
.
body
)
const
{
projectId
}
=
req
.
body
;
const
{
userId
}
=
req
.
params
;
console
.
log
(
'projectId '
,
projectId
,
'userId '
,
userId
)
try
{
const
projectMember
=
await
dataSource
...
...
@@ -161,10 +158,8 @@ router.delete('/remove-user/:userId', authAdminProject,async (req: Request, res:
}
}
})
console
.
log
(
'projectMember '
,
projectMember
)
if
(
!
projectMember
)
return
res
.
status
(
404
).
send
({
message
:
"this member is not present"
})
await
Member
.
delete
({
id
:
projectMember
.
id
})
console
.
log
(
'projectMember deleted successfully'
)
return
res
.
send
({
message
:
"User removed from project successfully"
})
}
catch
(
e
){
return
res
.
send
({
message
:
'Failed to remove user from project'
})
...
...
planner-api/src/routers/tasks.ts
View file @
83e48c87
...
...
@@ -27,7 +27,6 @@ router.get('/', async(req:Request, res:Response):Promise<Response> => {
/**create new task for table MyTask*/
router
.
post
(
'/'
,
auth
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
const
{
user
,
title
,
description
,
project
,
executor
,
dateTimeStart
,
dateTimeDue
,
dateTimeDeadLine
,
priority
}
=
req
.
body
;
console
.
log
(
'dateTimeStart '
,
dateTimeStart
,
'dateTimeDue '
,
dateTimeDue
,
'dateTimeDeadLine '
,
dateTimeDeadLine
)
//** if dateTimeDue is null , then dateTimeDeadLine copied to dateTimeDue and dateTimeStart = dateTimeDue - 1 hour*/
let
dateTimeDueFinal
=
dateTimeDue
let
dateTimeStartFinal
=
dateTimeStart
...
...
@@ -36,7 +35,6 @@ router.post('/', auth, async(req:Request, res:Response):Promise<Response>=>{
dateTimeDueFinal
=
dateTimeDeadLine
dateTimeStartFinal
=
subtractHours
(
dateTimeDueFinal
,
1
)
}
console
.
log
(
'dateTimeDueFinal '
,
dateTimeDueFinal
,
'dateTimeStartFinal '
,
dateTimeStartFinal
,
'dateTimeDeadLine '
,
dateTimeDeadLine
,
' dateTimeDeadlineFinal '
,
dateTimeDeadlineFinal
)
const
newTask
=
new
Task
();
newTask
.
title
=
title
;
...
...
@@ -112,7 +110,6 @@ router.post('/', auth, async(req:Request, res:Response):Promise<Response>=>{
router
.
post
(
'/users'
,
auth
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
const
{
user
,
title
,
description
,
project
,
executor
,
dateTimeStart
,
dateTimeDue
,
dateTimeDeadLine
,
priority
}
=
req
.
body
;
const
newTask
=
new
Task
();
console
.
log
(
'project '
,
project
,
)
newTask
.
title
=
title
;
newTask
.
description
=
description
;
if
(
project
)
{
...
...
@@ -252,7 +249,6 @@ router.get('/my',auth, async (req: Request, res: Response):Promise<Response>=>{
/**return tasks & users of projects in which current user is involved, search by token*/
router
.
get
(
'/related'
,
auth
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
console
.
log
(
'related'
)
const
user
=
req
.
body
.
user
const
tasks
=
await
dataSource
.
createQueryBuilder
()
...
...
@@ -313,7 +309,6 @@ router.put('/:taskId',authAuthorOrExecutorOfTask,async(req:Request, res:Response
const
{
taskId
}
=
req
.
params
const
{
authorStatus
,
executorStatus
,
title
,
description
,
note
,
archive
,
project
,
dateTimeTaskId
,
dateTimeStart
,
dateTimeDue
,
executor
,
accomplish
,
dateTimeDeadLine
,
dateTimeFactDeadLine
,
priority
}
=
req
.
body
;
console
.
log
(
'dateTimeTaskId '
,
dateTimeTaskId
)
const
task
=
await
taskFinderById
(
taskId
)
if
(
!
task
)
return
res
.
status
(
404
).
send
({
Message
:
'task not found'
})
let
dateTimeTask
=
null
;
...
...
planner-front/src/components/UsersTasksCompoments/NewTaskForm.js
View file @
83e48c87
...
...
@@ -69,7 +69,6 @@ export default function NewTaskForm({
const
onProjectChange
=
(
e
,
task
)
=>
{
const
value
=
e
.
target
.
value
;
console
.
log
(
' onProjectChange value '
,
value
,
'task '
,
task
)
const
project
=
projects
.
find
((
project
)
=>
project
.
id
===
value
);
setCurrentProject
(
project
)
const
newTask
=
{
...
task
};
...
...
planner-front/src/containers/MyTasks/MyTasks.js
View file @
83e48c87
...
...
@@ -35,10 +35,6 @@ export default function EnhancedTable() {
task
:
null
,
});
// useEffect(() => {
// dispatch(fetchAllTasks());
// // filterProjectsNamesFromTasks();
// }, [dispatch]);
useEffect
(()
=>
{
dispatch
(
fetchAllTasks
());
...
...
@@ -47,9 +43,6 @@ export default function EnhancedTable() {
}
},
[
tasks
?.
length
,
addTaskForm
,
setAddTaskForm
,
dispatch
]);
console
.
log
(
'tasks '
,
tasks
,
'projects '
,
projects
)
// useEffect(() => {
// dispatch(fetchAllTasks());
// }, [addTaskForm, setAddTaskForm, dispatch]);
...
...
@@ -163,16 +156,9 @@ export default function EnhancedTable() {
};
const
deleteDateTimeTaskHandle
=
(
dateTimeTaskId
)
=>
{
console
.
log
(
'delete by dateTimeTaskId '
,
dateTimeTaskId
)
dispatch
(
deleteDateTimeTask
(
dateTimeTaskId
))
}
const
handleEditDateTimeTask
=
(
dateTimeTask
)
=>
{
console
.
log
(
'edit by dateTImeTask'
)
// dispatch(handleEditDateTimeTask(dateTimeTask))
}
const
onModalOpen
=
(
event
,
task
)
=>
{
event
.
stopPropagation
();
setModal
({
...
modal
,
open
:
true
,
id
:
task
.
id
});
...
...
@@ -187,31 +173,15 @@ export default function EnhancedTable() {
const
[
filterProjectTumbler
,
setFilterProjectTumbler
]
=
React
.
useState
(
false
);
const
onClose
=
(
projectIdListForTaskSelect
)
=>
{
console
.
log
(
'projectIdListForTaskSelect '
,
projectIdListForTaskSelect
)
let
tasksFilteredByProject
=
tasks
if
(
projectIdListForTaskSelect
.
length
>
0
)
{
tasksFilteredByProject
=
tasks
.
filter
(
task
=>
projectIdListForTaskSelect
.
includes
(
task
.
project
?.
id
))
}
console
.
log
(
'tasksFilteredByProject '
,
tasksFilteredByProject
)
setRecievedTasks
(
tasksFilteredByProject
)
setFilterProjectTumbler
(
true
)
}
// const rawProjects = tasks?.map((task) => task.project);
// const uniqueProjects = rawProjects?.reduce((results, value, index) => {
// const exist = results.find((v) => {
// return v !== null && v.id === value?.id;
// });
// if (!exist && value !== null) {
// results.push(value);
// }
// return results;
// }, []);
// console.log('tasks', tasks)
if
(
if
(
tasks
&&
tasks
?.
length
>
0
&&
recievedTasks
&&
...
...
@@ -255,7 +225,6 @@ export default function EnhancedTable() {
task
=
{
task
}
deleteHandle
=
{
deleteHandle
}
handleEditTask
=
{
handleEditTask
}
handleEditDateTimeTask
=
{
handleEditDateTimeTask
}
deleteDateTimeTask
=
{
deleteDateTimeTaskHandle
}
onChange
=
{
onChange
}
onModalOpen
=
{
onModalOpen
}
...
...
planner-front/src/containers/UsersTasks/UsersTasks.js
View file @
83e48c87
...
...
@@ -46,15 +46,8 @@ export default function UsersTasks() {
}
},
[
dispatch
,
tasks
?.
length
,
// tasks,
addTaskForm
,
setAddTaskForm
]);
// useEffect(() => {
// dispatch(fetchAllTasksByMembership());
// }, [addTaskForm, setAddTaskForm]);
const
handleRequestSort
=
(
property
)
=>
{
const
isAsc
=
orderBy
===
property
&&
order
===
"asc"
;
setOrder
(
isAsc
?
"desc"
:
"asc"
);
...
...
@@ -106,7 +99,6 @@ export default function UsersTasks() {
for
(
let
member
of
project
.
members
){
executorList
.
push
(
member
.
user
)
}
console
.
log
(
'executorList '
,
executorList
)
}
setExecutors
(
executorList
)
...
...
@@ -199,12 +191,10 @@ export default function UsersTasks() {
const
onClose
=
(
projectIdListForTaskSelect
)
=>
{
console
.
log
(
'projectIdListForTaskSelect '
,
projectIdListForTaskSelect
)
let
tasksFilteredByProject
=
tasks
if
(
projectIdListForTaskSelect
.
length
>
0
)
{
tasksFilteredByProject
=
tasks
.
filter
(
task
=>
projectIdListForTaskSelect
.
includes
(
task
.
project
?.
id
))
}
console
.
log
(
'tasksFilteredByProject '
,
tasksFilteredByProject
)
setRecievedTasks
(
tasksFilteredByProject
)
setFilterProjectTumbler
(
true
)
}
...
...
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