Commit 9d29039a authored by Kacprzak, Izabella's avatar Kacprzak, Izabella
Browse files

Changed layout of tasks on dashboard, fixed deleting projects to delete all dependencies [IK]

parent 8155e67b
Pipeline #205277 passed with stages
in 2 minutes and 55 seconds
......@@ -4,6 +4,7 @@ from backend.database_config.database import DB
from backend.models.project_model import Project
from backend.models.task_model import Task
from backend.models.user_model import User_project
from backend.models.task_model import AssignedTask
project = Blueprint('project', __name__)
......@@ -61,12 +62,19 @@ def update_project(project_id):
@project.route('/projects/<project_id>', methods=['DELETE'])
def delete_project(project_id):
tasks = Task.query.filter_by(project_id=project_id)
for task in tasks:
DB.delete(task)
assignments = User_project.query.filter_by(project_id=project_id)
for assignment in assignments:
DB.delete(assignment)
tasks = Task.query.filter_by(project_id=project_id)
for task in tasks:
assigned_tasks = AssignedTask.query.filter_by(task_id=task.id)
for assignment in assigned_tasks:
DB.delete(assignment)
DB.delete(task)
entry = Project.query.get(project_id)
DB.delete(entry)
return ''
{
"files": {
"main.css": "/static/react/css/main.599c7cc1.chunk.css",
"main.js": "/static/react/js/main.4429b17a.chunk.js",
"main.js.map": "/static/react/js/main.4429b17a.chunk.js.map",
"main.js": "/static/react/js/main.8ac766d6.chunk.js",
"main.js.map": "/static/react/js/main.8ac766d6.chunk.js.map",
"runtime-main.js": "/static/react/js/runtime-main.094287be.js",
"runtime-main.js.map": "/static/react/js/runtime-main.094287be.js.map",
"js/2.49ea22cc.chunk.js": "/static/react/js/2.49ea22cc.chunk.js",
......@@ -17,6 +17,6 @@
"js/runtime-main.094287be.js",
"js/2.49ea22cc.chunk.js",
"css/main.599c7cc1.chunk.css",
"js/main.4429b17a.chunk.js"
"js/main.8ac766d6.chunk.js"
]
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/static/react/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/static/react/logo192.png"/><link rel="manifest" href="/static/react/manifest.json"/><title>InAGlobe Platform</title><script>window.token="{{DRP_token}}"</script><link href="/static/react/css/main.599c7cc1.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,u,i=r[0],c=r[1],l=r[2],s=0,p=[];s<i.length;s++)u=i[s],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&p.push(o[u][0]),o[u]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return a.push.apply(a,l||[]),t()}function t(){for(var e,r=0;r<a.length;r++){for(var t=a[r],n=!0,i=1;i<t.length;i++){var c=t[i];0!==o[c]&&(n=!1)}n&&(a.splice(r--,1),e=u(u.s=t[0]))}return e}var n={},o={1:0},a=[];function u(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,u),t.l=!0,t.exports}u.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var a,i=document.createElement("script");i.charset="utf-8",i.timeout=120,u.nc&&i.setAttribute("nonce",u.nc),i.src=function(e){return u.p+"js/"+({}[e]||e)+"."+{3:"ddc4d6e7"}[e]+".chunk.js"}(e);var c=new Error;a=function(r){i.onerror=i.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+a+")",c.name="ChunkLoadError",c.type=n,c.request=a,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){a({type:"timeout",target:i})}),12e4);i.onerror=i.onload=a,document.head.appendChild(i)}return Promise.all(r)},u.m=e,u.c=n,u.d=function(e,r,t){u.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,r){if(1&r&&(e=u(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(u.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)u.d(t,n,function(r){return e[r]}.bind(null,n));return t},u.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(r,"a",r),r},u.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},u.p="/static/react/",u.oe=function(e){throw console.error(e),e};var i=this["webpackJsonpinaglobe-dashboard"]=this["webpackJsonpinaglobe-dashboard"]||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var l=0;l<i.length;l++)r(i[l]);var f=c;t()}([])</script><script src="/static/react/js/2.49ea22cc.chunk.js"></script><script src="/static/react/js/main.4429b17a.chunk.js"></script></body></html>
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/static/react/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/static/react/logo192.png"/><link rel="manifest" href="/static/react/manifest.json"/><title>InAGlobe Platform</title><script>window.token="{{DRP_token}}"</script><link href="/static/react/css/main.599c7cc1.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,u,i=r[0],c=r[1],l=r[2],s=0,p=[];s<i.length;s++)u=i[s],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&p.push(o[u][0]),o[u]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return a.push.apply(a,l||[]),t()}function t(){for(var e,r=0;r<a.length;r++){for(var t=a[r],n=!0,i=1;i<t.length;i++){var c=t[i];0!==o[c]&&(n=!1)}n&&(a.splice(r--,1),e=u(u.s=t[0]))}return e}var n={},o={1:0},a=[];function u(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,u),t.l=!0,t.exports}u.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var a,i=document.createElement("script");i.charset="utf-8",i.timeout=120,u.nc&&i.setAttribute("nonce",u.nc),i.src=function(e){return u.p+"js/"+({}[e]||e)+"."+{3:"ddc4d6e7"}[e]+".chunk.js"}(e);var c=new Error;a=function(r){i.onerror=i.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+a+")",c.name="ChunkLoadError",c.type=n,c.request=a,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){a({type:"timeout",target:i})}),12e4);i.onerror=i.onload=a,document.head.appendChild(i)}return Promise.all(r)},u.m=e,u.c=n,u.d=function(e,r,t){u.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,r){if(1&r&&(e=u(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(u.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)u.d(t,n,function(r){return e[r]}.bind(null,n));return t},u.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(r,"a",r),r},u.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},u.p="/static/react/",u.oe=function(e){throw console.error(e),e};var i=this["webpackJsonpinaglobe-dashboard"]=this["webpackJsonpinaglobe-dashboard"]||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var l=0;l<i.length;l++)r(i[l]);var f=c;t()}([])</script><script src="/static/react/js/2.49ea22cc.chunk.js"></script><script src="/static/react/js/main.8ac766d6.chunk.js"></script></body></html>
\ No newline at end of file
......@@ -21,15 +21,13 @@ const MyProjectTasks = ({ tasks, title }) => {
<div className="my-project-tasks">
{tasks.map((task) => (
<div className="task-preview" key={task.id}>
<h2>{task.project_name}: {task.description}</h2>
<h3><strong>Priority level:</strong> {task.priority}</h3>
<h3><strong></strong> {task.priority}</h3>
<h3><strong>To be done by:</strong> {task.due_date}</h3>
<h3>All volunteers assigned to this task: </h3>
<UsersAssignedToTask task_id={task.id} />
<h2>{task.description} [Priority: {task.priority}]</h2>
<Link to={`/projects/${task.project_id}`}>
<h4>Click to see the project details</h4>
<h3 style={{color: "#f1356d"}}>{task.project_name}</h3>
</Link>
<h3><strong>To be done by:</strong> {task.due_date}</h3>
<h3>Assigned volunteers: </h3>
<UsersAssignedToTask task_id={task.id} />
</div>
))}
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment