Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kacprzak, Izabella
DRP-InAGlobe-Platform
Commits
75409b0e
Commit
75409b0e
authored
Jun 17, 2021
by
ras19
Browse files
Display project name and link the project landing page on project task preview on dashboard [RS]
parent
15281ae6
Pipeline
#203757
passed with stage
in 1 minute and 14 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
backend/blueprints/assigned_task.py
View file @
75409b0e
...
...
@@ -4,7 +4,7 @@ from flask import Blueprint, request, jsonify
from
backend.database_config.database
import
DB
from
backend.models.task_model
import
AssignedTask
from
backend.models.task_model
import
Task
import
json
from
backend.models.project_model
import
Project
assigned_task
=
Blueprint
(
'assigned_task'
,
__name__
)
...
...
@@ -23,6 +23,8 @@ def get_all_assignments():
def
get_tasks_for_user
(
username
):
entries
=
AssignedTask
.
query
.
filter_by
(
username
=
username
)
task_list
=
[{
"description"
:
task
.
description
,
"project_id"
:
task
.
project_id
,
"project_name"
:
Project
.
query
.
get
(
task
.
project_id
).
name
,
"priority"
:
task
.
priority
,
"due_date"
:
task
.
due_date
}
for
task
in
(
Task
.
query
.
get
(
x
.
task_id
)
for
x
in
entries
)]
return
jsonify
(
task_list
)
...
...
frontend/src/MyProjectTasks.js
View file @
75409b0e
import
useFetch
from
'
./useFetch
'
import
{
useState
}
from
"
react
"
;
import
{
Link
}
from
'
react-router-dom
'
const
MyProjectTasks
=
({
tasks
,
title
})
=>
{
return
(
...
...
@@ -9,9 +8,12 @@ const MyProjectTasks = ({ tasks, title }) => {
<
div
className
=
"
my-project-tasks
"
>
{
tasks
.
map
((
task
)
=>
(
<
div
className
=
"
task-preview
"
key
=
{
task
.
id
}
>
<
h2
>
{
task
.
description
}
<
/h2
>
<
h2
>
{
task
.
project_name
}:
{
task
.
description
}
<
/h2
>
<
h3
><
strong
>
Priority
level
:
<
/strong> {task.priority}</
h3
>
<
h3
><
strong
>
To
be
done
by
:
<
/strong> {task.due_date}</
h3
>
<
Link
to
=
{
`/projects/
${
task
.
project_id
}
`
}
>
<
h4
>
Go
to
project
landing
page
<
/h4
>
<
/Link
>
<
/div
>
))}
<
/div
>
...
...
frontend/src/PersonalToDo.js
View file @
75409b0e
...
...
@@ -81,7 +81,7 @@ const PersonalToDo = ({ todos, title }) => {
<
div
className
=
"
todo-preview
"
key
=
{
todo
.
id
}
>
<
h2
>
{
todo
.
todo_desc
}
<
/h2
>
<
h3
>
Priority
level
:
{
todo
.
priority
}
<
/h3
>
<
h3
>
To
be
done
by
:{
todo
.
due_date
}
<
/h3
>
<
h3
>
To
be
done
by
:
{
todo
.
due_date
}
<
/h3
>
<
button
onClick
=
{
handleRemove
(
todo
.
id
)}
>
Complete
<
/button
>
<
/div
>
))}
...
...
Write
Preview
Supports
Markdown
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