From 367966f7eb6c4265097a6fcff38732e2ba8937c7 Mon Sep 17 00:00:00 2001 From: "Kacprzak, Izabella" <izabella.kacprzak19@imperial.ac.uk> Date: Tue, 15 Jun 2021 19:44:50 +0100 Subject: [PATCH] Corrected typo in setting delete/edit button visible only for admin user [IK] --- backend/static/react/asset-manifest.json | 6 +++--- backend/static/react/js/main.52682509.chunk.js.map | 1 - .../js/{main.52682509.chunk.js => main.e896a0a2.chunk.js} | 4 ++-- backend/static/react/js/main.e896a0a2.chunk.js.map | 1 + backend/templates/index.html | 2 +- frontend/src/User.js | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 backend/static/react/js/main.52682509.chunk.js.map rename backend/static/react/js/{main.52682509.chunk.js => main.e896a0a2.chunk.js} (99%) create mode 100644 backend/static/react/js/main.e896a0a2.chunk.js.map diff --git a/backend/static/react/asset-manifest.json b/backend/static/react/asset-manifest.json index 305a235..9bcb430 100644 --- a/backend/static/react/asset-manifest.json +++ b/backend/static/react/asset-manifest.json @@ -1,8 +1,8 @@ { "files": { "main.css": "/static/react/css/main.893b1949.chunk.css", - "main.js": "/static/react/js/main.52682509.chunk.js", - "main.js.map": "/static/react/js/main.52682509.chunk.js.map", + "main.js": "/static/react/js/main.e896a0a2.chunk.js", + "main.js.map": "/static/react/js/main.e896a0a2.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.92bb91cc.chunk.js": "/static/react/js/2.92bb91cc.chunk.js", @@ -17,6 +17,6 @@ "js/runtime-main.094287be.js", "js/2.92bb91cc.chunk.js", "css/main.893b1949.chunk.css", - "js/main.52682509.chunk.js" + "js/main.e896a0a2.chunk.js" ] } \ No newline at end of file diff --git a/backend/static/react/js/main.52682509.chunk.js.map b/backend/static/react/js/main.52682509.chunk.js.map deleted file mode 100644 index 0d7d7d7..0000000 --- a/backend/static/react/js/main.52682509.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["useToken.js","Navbar.js","ProjectList.js","useFetch.js","PersonalToDo.js","Home.js","CreateProject.js","ProjectDetails.js","PageNotFound.js","MyProfile.js","User.js","UserList.js","Users.js","AddUser.js","EditProject.js","Sidebar.js","EditUser.js","ProjectTaskList.js","ProjectTasks.js","AddProjectTask.js","Login.js","ChangePassword.js","ProjectsRegistry.js","App.js","reportWebVitals.js","index.js"],"names":["useToken","useState","tokenString","localStorage","getItem","userToken","JSON","parse","token","getToken","setToken","setItem","stringify","Navbar","className","href","style","color","fontSize","borderRadius","to","ProjectList","projects","map","project","id","name","status","useFetch","url","data","setData","error","setError","isPending","setIsPending","useEffect","fetch","then","res","ok","Error","json","catch","err","message","PersonalToDo","todos","title","users","todo_desc","setTodoDesc","priority","setPriority","Date","now","due_date","setDueDate","username","setUsername","float","onClick","document","getElementsByClassName","display","onSubmit","e","preventDefault","newTodo","method","headers","body","window","location","reload","value","onChange","target","required","placeholder","type","user","todo","Home","isPendingTodos","errorTodos","isPendingRelevantProjects","errorRelevantProjects","width","filter","CreateProject","setName","description","setDescription","setStatus","tag","setTag","setLocation","files","setFiles","selectUsernames","setSelectUsernames","history","useHistory","usernames","handleSubmit","a","newProject","response","responseJSON","project_id","assign_project","console","log","push","includes","options","Array","isArray","x","isMulti","isClearable","ProjectDetails","useParams","assignments","errorAssignment","isPendingAssignment","marginBottom","marginright","backgroundColor","marginRight","open","PageNotFound","MyProfile","firstname","surname","email","bio","joined","availability","partnership_opportunities","interests","User","UserList","Users","AddUser","setFirstname","setSurname","password","setPassword","setTitle","setEmail","setBio","setJoined","setAvailability","setPartnership_opportunities","setInterests","newUser","EditProject","errorUsers","isPendingUsers","oldProjectDetails","useForm","defaultValues","register","htmlFor","multiple","concat","Sidebar","textDecoration","cursor","clear","EditUser","oldUserDetails","ProjectTaskList","project_tasks","completed","setCompleted","setProjectId","handleComplete","task","newTask","handleDelete","ProjectTasks","errorProject","isPendingProject","isPendingTasks","errorTasks","AddProjectTask","newProjectTask","loginUser","credentials","Login","setUserName","class","ChangePassword","oldPassword","setOldPassword","newPassword","setNewPassword","passwordUpdate","ProjectRegistry","isPendingProjects","errorProjects","App","exact","path","ProjectsRegistry","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","getElementById"],"mappings":"6NAEe,SAASA,IACpB,IAMA,EAA0BC,mBANT,WACb,IAAMC,EAAcC,aAAaC,QAAQ,SACnCC,EAAYC,KAAKC,MAAML,GAC7B,cAAOG,QAAP,IAAOA,OAAP,EAAOA,EAAWG,MAGaC,IAAnC,mBAAOD,EAAP,KAAcE,EAAd,KAOA,MAAO,CACHA,SANc,SAAAL,GACdF,aAAaQ,QAAQ,QAASL,KAAKM,UAAUP,IAC7CK,EAASL,EAAUG,QAKnBA,S,WCGOK,EAlBA,WACX,MAA0Bb,IAATQ,GAAjB,EAAOE,SAAP,EAAiBF,OAEjB,OACI,sBAAKM,UAAU,SAAf,UACI,mBAAGC,KAAK,IAAIC,MAAO,CACfC,MAAO,UACPC,SAAU,OACVC,aAAc,OAHlB,+BAKA,sBAAKL,UAAU,QAAf,UACI,cAAC,IAAD,CAAMM,GAAE,kBAAR,yBACA,cAAC,IAAD,CAAMA,GAAI,UAAYZ,EAAtB,+BCGDa,EAhBK,SAAC,GAAkB,IAAhBC,EAAe,EAAfA,SAEnB,OACI,qBAAKR,UAAU,eAAf,SACKQ,EAASC,KAAI,SAACC,GAAD,OACV,qBAAKV,UAAU,UAAf,SACI,eAAC,IAAD,CAAMM,GAAE,oBAAeI,EAAQC,IAA/B,UACI,6BAAKD,EAAQE,OACb,6BAAKF,EAAQG,aAHSH,EAAQC,UCsBvCG,EA3BE,SAACC,GAChB,MAAwB5B,mBAAS,IAAjC,mBAAO6B,EAAP,KAAaC,EAAb,KACA,EAA0B9B,mBAAS,MAAnC,mBAAO+B,EAAP,KAAcC,EAAd,KACA,EAAkChC,oBAAS,GAA3C,mBAAOiC,EAAP,KAAkBC,E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IAAD,CAAOD,OAAK,EAACC,KAAK,sBAAlB,SACE,cAAC,EAAD,MAEF,cAAC,IAAD,CAAOD,OAAK,EAACC,KAAK,gBAAlB,SACE,cAAC,EAAD,MAEF,cAAC,IAAD,CAAOD,OAAK,EAACC,KAAK,oBAAlB,SACE,cAAC,EAAD,MAEF,cAAC,IAAD,CAAOA,KAAK,IAAZ,SACE,cAAC,EAAD,gBAlDH,cAACd,EAAD,CAAOtL,SAAUA,KCfbsM,EAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,6BAAqB5K,MAAK,YAAkD,IAA/C6K,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCDdO,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEF5J,SAAS6J,eAAe,SAM1BX,M","file":"js/main.52682509.chunk.js","sourcesContent":["import { useState } from 'react';\n\nexport default function useToken() {\n const getToken = () => {\n const tokenString = localStorage.getItem('token');\n const userToken = JSON.parse(tokenString);\n return userToken?.token\n };\n \n const [token, setToken] = useState(getToken());\n\n const saveToken = userToken => {\n localStorage.setItem('token', JSON.stringify(userToken));\n setToken(userToken.token);\n };\n\n return {\n setToken: saveToken,\n token\n }\n\n}","import { Link } from 'react-router-dom'\nimport useToken from './useToken';\n\nconst Navbar = () => {\n const {setToken, token} = useToken();\n\n return (\n <nav className=\"navbar\" >\n <a href=\"/\" style={{ \n color: '#ff4e83',\n fontSize: '20px',\n borderRadius: '8px' \n }}>InAGlobe Platform</a>\n <div className=\"links\"> \n <Link to={`/create-project`}>New Project</Link>\n <Link to={`/users/` + token}>My Profile</Link>\n </div>\n </nav>\n );\n}\n \nexport default Navbar;","import { Link } from 'react-router-dom'\n\nconst ProjectList = ({ projects }) => {\n\n return (\n <div className=\"project-list\">\n {projects.map((project) => (\n <div className=\"preview\" key={project.id}>\n <Link to={`/projects/${project.id}`}>\n <h2>{project.name}</h2>\n <h3>{project.status}</h3>\n </Link>\n </div>\n ))}\n </div>\n );\n}\n \nexport default ProjectList;","import { useState, useEffect } from 'react';\n\nconst useFetch = (url) => {\n const [data, setData] = useState([]);\n const [error, setError] = useState(null);\n const [isPending, setIsPending] = useState(true);\n\n useEffect(() => {\n fetch(url)\n .then(res => {\n if (!res.ok) { // error coming back from server\n throw Error('could not fetch the data for that resource');\n } \n return res.json();\n })\n .then(data => {\n setData(data);\n setIsPending(false);\n setError(null);\n })\n .catch(err => {\n // auto catches network / connection error\n setError(err.message);\n })\n }, [url])\n\n return { data, error, isPending };\n}\n \nexport default useFetch;","import useFetch from './useFetch'\nimport { useState } from \"react\";\nimport useToken from './useToken'\n\nconst PersonalToDo = ({ todos, title }) => {\n\n const openTaskForm = () => {\n document.getElementsByClassName(\"add-todo-form\")[0].style.display = \"block\";\n }\n const {setToken, token} = useToken();\n\n\n const { data: users, error, isPending } = useFetch(\"/users\")\n\n const [todo_desc, setTodoDesc] = useState(\"\");\n const [priority, setPriority] = useState(1);\n const [due_date, setDueDate] = useState(Date.now());\n const [username, setUsername] = useState(token);\n\n const handleSubmit = e => {\n document.getElementsByClassName(\"add-todo-form\")[0].style.display = \"none\";\n\n e.preventDefault();\n const newTodo = { todo_desc, priority, due_date, username };\n\n fetch(\"/todos\", {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(newTodo)\n }).then(() => {\n window.location.reload();\n })\n }\n\n const handleRemove = id => e => {\n e.preventDefault();\n fetch(\"/todos/\" + id, { method: 'DELETE' })\n .then(() => {\n window.location.reload();\n })\n };\n\n return (\n <div className=\"todo-list\" style={{float: \"right\"}}>\n <h2>{title}</h2>\n\n <div className=\"add-todo-button\">\n <button onClick={openTaskForm}>Add a personal task</button>\n </div>\n\n { isPending && <h2>Loading...</h2> }\n\n <div className=\"add-todo-form\">\n { users && <form onSubmit={handleSubmit}>\n <label>Task description [required]</label>\n <textarea value={todo_desc} onChange={(e) => setTodoDesc(e.target.value)} required placeholder=\"Add some awesome description!\" ></textarea>\n <label>Priority level (1: lowest, 4: highest)</label>\n <select value={priority} onChange={(e) => setPriority(e.target.value)} >\n <option value=\"1\">1</option>\n <option value=\"2\">2</option>\n <option value=\"3\">3</option>\n <option value=\"4\">4</option>\n </select>\n <label>When should this task be done by? [required]</label>\n <input\n required\n type=\"date\"\n value={due_date}\n onChange={(e) => setDueDate(e.target.value)}\n />\n <label>Assigned user</label>\n <select value={username} onChange={(e) => setUsername(e.target.value)} >\n {users.map(user => <option value={user.username}>{user.username}</option>)}\n </select>\n <button>Save task</button>\n </form> }\n </div>\n\n <div className=\"personal-todos\">\n {todos.map((todo) => (\n <div className=\"todo-preview\" key={todo.id}>\n <h2>{todo.todo_desc}</h2>\n <h3>Priority level: {todo.priority}</h3>\n <h3>To be done by:{todo.due_date}</h3>\n <button onClick={handleRemove(todo.id)}>Complete</button>\n </div>\n ))}\n </div>\n\n </div>\n );\n\n}\n\nexport default PersonalToDo;","import ProjectList from './ProjectList'\nimport PersonalToDo from './PersonalToDo'\nimport useFetch from './useFetch'\nimport useToken from './useToken';\nimport { useState } from \"react\";\n\nconst Home = () => {\n\n const {data: todos, errorTodos, isPendingTodos} = useFetch(\"/todos\");\n const {setToken, token} = useToken();\n\n const {data: projects, errorRelevantProjects, isPendingRelevantProjects} = useFetch(\"/user_project/username/\" + token);\n\n return (\n <div className=\"home\">\n <h1>Dashboard</h1>\n <div className=\"home-projects\" style={{float: \"left\", width: \"600px\"}}>\n { isPendingRelevantProjects && <h2>Loading...</h2> }\n { projects && <ProjectList projects={projects} title=\"My Projects\"/> }\n </div>\n <div className=\"homeTodos\">\n { isPendingTodos && <h2>Loading...</h2> }\n { todos && <PersonalToDo todos={todos.filter(todo => todo.username === token)} title=\"My Tasks\"/> }\n </div>\n </div>\n \n );\n}\n \nexport default Home;","import { useState } from \"react\";\nimport { useHistory } from \"react-router-dom\"\nimport Select from 'react-select';\nimport useFetch from './useFetch'\n\nconst CreateProject = () => {\n const [name, setName] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [status, setStatus] = useState(\"Available\");\n const [tag, setTag] = useState(\"Other\");\n const [location, setLocation] = useState(\"\");\n const [files, setFiles] = useState(\"\");\n\n const [selectUsernames, setSelectUsernames] = useState([]);\n\n const history = useHistory();\n\n const { data: users, error, isPending } = useFetch(\"/users/user_project\");\n\n const usernames = users.map(user => user.username);\n\n const handleChange = (e) => {\n setSelectUsernames(Array.isArray(e) ? e.map(x => x.value) : []); \n }\n\n const handleSubmit = async e => {\n e.preventDefault()\n\n const newProject = { name, description, status, tag, location, files };\n\n const response = await fetch(\"/projects\", {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(newProject)\n });\n\n const responseJSON = await response.json();\n\n const project_id = responseJSON.id;\n\n selectUsernames.map(username => {\n const assign_project = { username, project_id };\n\n fetch(\"/user_project\", {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(assign_project)\n });\n });\n\n console.log(users);\n console.log(usernames);\n console.log(selectUsernames);\n history.push(\"/\");\n }\n\n return (\n <div className=\"create-project\">\n <h2>Add a new project</h2>\n <form onSubmit={handleSubmit}>\n <label>Project name [required]</label>\n <input\n type=\"text\"\n required\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder=\"Input project name\"\n />\n <label>Description [required]</label>\n <textarea required placeholder=\"Add some awesome description!\" value={description} onChange={(e) => setDescription(e.target.value)}></textarea>\n <label>Status</label>\n <select value={status} onChange={(e) => setStatus(e.target.value)}>\n <option value=\"Progress\">Progress</option>\n <option value=\"Available\">Available</option>\n <option value=\"Completed\">Completed</option>\n </select>\n <label>Location</label>\n <input\n type=\"text\"\n value={location}\n onChange={(e) => setLocation(e.target.value)}\n placeholder=\"Eg: United Kingdom\"\n />\n <label>Type of project [required]</label>\n <select required value={tag} onChange={(e) => setTag(e.target.value)}>\n <option value=\"Social\">Social</option>\n <option value=\"Education\">Education</option>\n <option value=\"Wash\">Wash</option>\n <option value=\"Environment\">Environment</option>\n <option value=\"Health\">Health</option>\n <option value=\"Other\">Other</option>\n </select>\n <label>Volunteers assigned to this project</label>\n <Select\n className=\"dropdown\"\n placeholder=\"Select Users\"\n value={users.filter(user => selectUsernames.includes(user.value))}\n options={users} // set list of the usernames\n onChange={handleChange} // assign onChange function\n isMulti\n isClearable\n />\n {/* <select multiple={true} onChange={(e) => setSelectUsernames(selectUsernames.concat(e.target.value))} value={selectUsernames} >\n {users.map(user => <option value={user.username}>{user.firstname} {user.surname}</option>)}\n </select> */}\n <label>Google Drive folder</label>\n <textarea placeholder=\"Copy the link to the Google Drive folder for this project\" value={files} onChange={(e) => setFiles(e.target.value)}></textarea>\n <button>Add project</button>\n </form>\n </div>\n );\n}\n\n\nexport default CreateProject;","import { useHistory, useParams } from 'react-router';\nimport useFetch from './useFetch'\nimport { Link } from \"react-router-dom\"\n\nconst ProjectDetails = () => {\n const { id } = useParams();\n const history = useHistory();\n\n const { data: project, error, isPending } = useFetch(\"/projects/\" + id)\n const { data: assignments, errorAssignment, isPendingAssignment } = useFetch(\"/user_project/project/\" + id)\n\n const handleRemove = e => {\n e.preventDefault()\n fetch(\"/projects/\" + id, { method: 'DELETE' })\n .then(() => { history.push('/'); })\n };\n\n return (\n <div className=\"project-details\">\n {isPending && <h2>Loading...</h2>}\n {project && <h2>{project.name}</h2>}\n {project && <button style={{\n fontSize: '20px',\n color: '#fff',\n marginBottom: '30px',\n marginright: '10px',\n borderRadius: '8px',\n backgroundColor: '#f1b535'\n }}>Status: {project.status}</button>}\n {project && <button style={{\n fontSize: '20px',\n color: '#fff',\n marginBottom: '30px',\n marginRight: '10px',\n borderRadius: '8px',\n backgroundColor: '#595bc0'\n }}>{project.tag}</button>}\n {project && <h4>Location: {project.location}</h4>}\n {project && <button onClick={(e) => {\n e.preventDefault();\n window.open(project.files, \"_blank\");\n }}>Documents</button>}\n {project && <p>{project.description}</p>}\n\n <h3>Volunteers working on this project</h3>\n <div className=\"project_user_assignment_list\">\n {assignments.map(a => (\n <div className=\"assigned_users_preview\" style={{float: \"left\", width: \"50%\"}} key={a.id}>\n <Link to={`/users/${a.username}`}>\n <h4>{a.username}</h4>\n </Link>\n </div>)\n )\n }\n </div>\n\n <div className=\"project-tasks\">\n {project && <Link to={`/projects/${project.id}/tasks`} className=\"view-tasks-button\">View Tasks</Link>}\n\n {project && <Link to={`/projects/${project.id}/add-task`} className=\"add-task-button\">Add Task</Link>}\n </div>\n\n <div>\n {project && <button onClick={handleRemove}>Delete project</button>}\n\n {project && <Link to={`/edit-project/${project.id}`} className=\"edit-project-button\">Edit project</Link>}\n </div>\n\n </div>\n\n );\n}\n\nexport default ProjectDetails;","import { Link } from \"react-router-dom\"\n\nconst PageNotFound = () => {\n return (\n <div className=\"page-not-found\">\n <h2>Something went wrong...</h2>\n <p>That page cannot be found</p>\n <Link to='/'>Back to the main page</Link>\n </div>\n );\n}\n \nexport default PageNotFound;","import { useHistory, useParams } from 'react-router';\nimport useFetch from './useFetch'\nimport useToken from './useToken';\n\nconst MyProfile = () => {\n const {setToken, token} = useToken();\n\n const {data: user, error, isPending} = useFetch(\"/users/\" + token)\n\n return (\n <div className=\"my-profile\">\n { isPending && <h2>Loading...</h2> }\n { user && <h2>{user.firstname + \" \" + user.surname}</h2> }\n { user && <h1>{\"Username: \" + user.token}</h1> }\n { user && <h1>{\"Title: \" + user.title}</h1> }\n { user && <h1>{\"Email: \" + user.email}</h1> }\n { user && <h1>{\"Bio: \" + user.bio}</h1> }\n { user && <h1>{\"Joined: \" + user.joined}</h1> }\n { user && <h1>{\"Location: \" + user.location}</h1> }\n { user && <h1>{\"Availability: \" + user.availability}</h1> }\n { user && <h1>{\"Partnership Opportunities: \" + user.partnership_opportunities}</h1> }\n { user && <h1>{\"Interests: \" + user.interests}</h1> } \n </div>\n );\n}\n\nexport default MyProfile;","import { useHistory, useParams } from 'react-router';\nimport useFetch from './useFetch'\nimport { Link } from \"react-router-dom\"\nimport useToken from './useToken';\n\nconst User = () => {\n const {username} = useParams();\n const history = useHistory();\n const {setToken, token} = useToken();\n \n const {data: user, error, isPending} = useFetch(\"/users/\" + username)\n \n const handleRemove = e => {\n e.preventDefault()\n fetch(\"/users/\" + username, {method: 'DELETE'})\n .then(()=> {history.push('/');})\n };\n\n return (\n <div className=\"user\">\n { isPending && <h2>Loading...</h2> }\n { user && <div>\n <h2>{user.firstname + \" \" + user.surname}</h2>\n </div> }\n\n { user && <div>\n <h3><strong>Username: </strong>{user.username}</h3>\n <h3><strong>Email: </strong>{user.email}</h3> \n <h3><strong>Title: </strong>{user.title}</h3>\n <h3><strong>Joined: </strong>{user.joined}</h3>\n <h3><strong>Location: </strong>{user.location}</h3>\n <h3><strong>Availability: </strong>{user.availability}</h3>\n </div> }\n\n <br />\n\n { user && <div>\n <label><strong>Bio</strong></label>\n <p>{user.bio}</p>\n </div> }\n \n { user && <div>\n <label><strong>Partnership Opportunities</strong></label>\n <p>{user.partnership_opportunities}</p>\n </div> }\n\n { user && <div>\n <label><strong>Interests</strong></label>\n <p>{user.interests}</p>\n </div> }\n\n { user && (username == \"jaimeaguilera\" || username == token) && <button onClick={handleRemove}>Delete user</button> }\n \n { user && (username == \"jaimeaguilera\" || username == token) && <Link to={`/edit-user/${username}`} className=\"edit-user-button\">Edit details</Link> }\n </div>\n );\n}\n \nexport default User;","import { Link } from 'react-router-dom'\n\nconst UserList = ({ users }) => {\n\n return (\n <div className=\"user-list\">\n\n {users.map((user) => (\n <div className=\"preview\" key={user.username}>\n <Link to={`/users/${user.username}`}>\n <h2>{user.username}</h2>\n </Link>\n </div>\n ))}\n </div>\n );\n}\n \nexport default UserList;\n","import UserList from './UserList'\nimport useFetch from './useFetch'\nimport useToken from './useToken'\nimport { Link } from 'react-router-dom'\n\nconst Users = () => {\n\n const {data: users, error, isPending} = useFetch(\"/users\")\n const {setToken, token} = useToken();\n\n return (\n <div className=\"users\">\n <h1>Users</h1>\n { token == \"jaimeaguilera\" && <Link to={`/add-user`} className=\"add-user-button\">Add User</Link> }\n <br />\n <br />\n { isPending && <h2>Loading...</h2> }\n { users && <UserList users={users} title=\"All Users\"/> }\n </div>\n );\n}\n \nexport default Users;","import { useState } from \"react\";\nimport { useHistory } from \"react-router-dom\"\n\n\n\nconst AddUser = () => {\n const [firstname, setFirstname] = useState(\"\");\n const [surname, setSurname] = useState(\"\");\n const [password, setPassword] = useState(\"\");\n const [title, setTitle] = useState(\"\")\n const [email, setEmail] = useState(\"\");\n const [bio, setBio] = useState(\"\");\n const [joined, setJoined] = useState(\"\");\n const [location, setLocation] = useState(\"\");\n const [availability, setAvailability] = useState(\"\");\n const [partnership_opportunities, setPartnership_opportunities] = useState(\"\");\n const [interests, setInterests] = useState(\"\");\n const [username, setUsername] = useState(\"\");\n\n\n const history = useHistory();\n\n const handleSubmit = e => {\n e.preventDefault()\n\n const newUser = {\n firstname,\n surname,\n password,\n title,\n email,\n bio,\n joined,\n location,\n availability,\n partnership_opportunities,\n interests,\n username\n }\n\n fetch(\"/users\", {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(newUser)\n }).then(() => {\n history.push('/users');\n })\n }\n\n return (\n <div className=\"add-user\">\n <h2>Add a new user</h2>\n <form onSubmit={handleSubmit}>\n <label>Username [required]</label>\n <input\n type=\"text\"\n required\n value={username}\n onChange={(e) => setUsername(e.target.value)}\n placeholder=\"Input username here\"\n />\n\n\n <label>Firstname [required]</label>\n <input\n type=\"text\"\n required\n value={firstname}\n onChange={(e) => setFirstname(e.target.value)}\n placeholder=\"Input your first name here\"\n />\n\n <label>Surname [required]</label>\n <input\n type=\"text\"\n required\n value={surname}\n onChange={(e) => setSurname(e.target.value)}\n placeholder=\"Input surname here\"\n />\n\n <label>Title [required]</label>\n <input\n type=\"text\"\n required\n value={title}\n onChange={(e) => setTitle(e.target.value)}\n placeholder=\"State your role at InAGlobe (eg: volunteer)\"\n />\n\n <label>Password [required]</label>\n <input\n type=\"text\"\n required\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n placeholder=\"Input the default password (to be changed by the user)\"\n />\n\n <label>Email [required]</label>\n <input\n type=\"text\"\n required\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n placeholder=\"Input InAGlobe email here\"\n />\n\n\n <label>Bio</label>\n <input\n type=\"text\"\n value={bio}\n onChange={(e) => setBio(e.target.value)}\n placeholder=\"Tell your colleagues a bit about yourself\"\n />\n\n {/* Think about changing type to force date */}\n <label>Joined</label>\n <input\n type=\"text\"\n value={joined}\n onChange={(e) => setJoined(e.target.value)}\n placeholder=\"Eg: 20th April 2020\"\n />\n\n\n <label>Location</label>\n <input\n type=\"text\"\n value={location}\n onChange={(e) => setLocation(e.target.value)}\n placeholder=\"Where are you currently based?\"\n />\n\n <label>Availibility</label>\n <input\n type=\"text\"\n value={availability}\n onChange={(e) => setAvailability(e.target.value)}\n placeholder=\"How available are you approximately per week?\"\n />\n\n <label>Partnership Opportunities</label>\n <input\n type=\"text\"\n value={partnership_opportunities}\n onChange={(e) => setPartnership_opportunities(e.target.value)}\n placeholder=\"Eg: Department of Computing at Imperial College London\"\n />\n\n <label>Interests</label>\n <input\n type=\"text\"\n value={interests}\n onChange={(e) => setInterests(e.target.value)}\n placeholder=\"What are your hobbies?\"\n />\n\n <button>Add user</button>\n </form>\n </div>\n );\n}\n\nexport default AddUser;","import { useState } from \"react\";\nimport { useHistory, useParams } from \"react-router-dom\"\nimport { useForm } from \"react-hook-form\"\nimport useFetch from './useFetch'\n\nconst EditProject = () => {\n const { id } = useParams();\n const { data: {name, description, status, location, tag, files}, error, isPending } = useFetch(\"/projects/\" + id)\n const { data: users, errorUsers, isPendingUsers } = useFetch(\"/users\")\n const [selectUsernames, setSelectUsernames] = useState([]);\n\n const history = useHistory();\n const oldProjectDetails = {\n name: name,\n description: description,\n status: status,\n location: location,\n tag: tag,\n files: files\n }\n \n const { register, handleSubmit } = useForm({\n defaultValues: oldProjectDetails\n });\n\n const onSubmit = e => {\n fetch(\"/projects/\" + id, {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(e)\n }).then(() => {\n selectUsernames.map(username => {\n const assign_project = { username: username, project_id: id };\n\n fetch(\"/user_project\", {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(assign_project)\n });\n });}).then(() => {\n history.push('/');\n })\n }\n\n return (\n <div className=\"edit-project\">\n <h2>Edit project</h2>\n { isPending && <h2>Loading...</h2> }\n { name && <form onSubmit={handleSubmit(onSubmit)}>\n <label htmlFor=\"name\">Project name</label>\n <input {...register(\"name\")}\n // type=\"text\"\n placeholder=\"Insert project name here\"\n // name=\"name\"\n />\n <label>Description</label>\n <textarea {...register(\"description\")} name=\"description\" placeholder=\"Insert description of the project here\"></textarea>\n <label>Status</label>\n <select {...register(\"status\")} name=\"status\">\n <option value=\"Progress\">Progress</option>\n <option value=\"Available\">Available</option>\n <option value=\"Completed\">Completed</option>\n </select>\n <label>Location</label>\n <input\n {...register(\"location\")}\n type=\"text\"\n placeholder=\"Insert location of project here\"\n name=\"location\"\n />\n <label>Type of project</label>\n <select {...register(\"tag\")} name=\"tag\">\n <option value=\"Social\">Social</option>\n <option value=\"Education\">Education</option>\n <option value=\"Wash\">Wash</option>\n <option value=\"Environment\">Environment</option>\n <option value=\"Health\">Health</option>\n <option value=\"Other\">Other</option>\n </select>\n <label>Volunteers assigned to this project</label>\n <select multiple={true} onChange={(e) => setSelectUsernames(selectUsernames.concat(e.target.value))} value={selectUsernames} >\n {users.map(user => <option value={user.username}>{user.firstname} {user.surname}</option>)}\n </select>\n <label>Google Drive folder</label>\n <textarea {...register(\"files\")} name=\"files\" placeholder=\"Insert Google Drive Folder link here\"></textarea>\n <button type=\"submit\">Save project details</button>\n </form> }\n </div>\n );\n}\n\nexport default EditProject;","import React from 'react';\nimport { slide as Menu } from 'react-burger-menu';\nimport { Link, useHistory } from 'react-router-dom'\nimport useToken from './useToken';\n\nconst Sidebar = () => {\n\nconst slackLink = \"https://slack.com/intl/en-gb/\"\n\nconst history = useHistory();\n\nconst {setToken, token} = useToken();\n\nconst handleSignOut = e => {\n e.preventDefault()\n\n localStorage.clear();\n\n window.location.reload();\n history.push(\"/\");\n}\n\nreturn (\n <Menu>\n <div className=\"menu-item\" > \n <Link to={`/`}>Home</Link>\n </div>\n <div className=\"menu-item\" > \n <Link to={`/users/` + token}>Profile</Link>\n </div>\n <div className=\"menu-item\" > \n <Link to={`/users`}>All Users</Link>\n </div>\n <div className=\"menu-item\" > \n <Link to={`/projects`}>All Projects</Link>\n </div>\n <div className=\"menu-item\" > \n <a href={slackLink} target=\"_blank\">Go To Slack</a>\n </div> \n <div className=\"menu-item\" >\n <a style={{textDecoration: \"underline\", cursor: \"pointer\"}} onClick={handleSignOut}>Log Out</a>\n </div> \n </Menu>\n\n);\n\n}\n\nexport default Sidebar;","import { Link, useHistory, useParams } from \"react-router-dom\"\nimport { useForm } from \"react-hook-form\"\nimport useFetch from './useFetch'\n\nconst EditUser = () => {\n const { username } = useParams();\n const { data: {firstname, surname, password, title, email, bio, joined, \n location, availability, partnership_opportunities, interests}, error, isPending } = useFetch(\"/users/\" + username)\n\n const history = useHistory();\n const oldUserDetails = {\n firstname: firstname,\n surname: surname,\n password: password,\n title: title,\n email: email,\n bio: bio,\n joined: joined,\n location: location,\n availability: availability,\n partnership_opportunities: partnership_opportunities,\n interests: interests,\n }\n \n const { register, handleSubmit } = useForm({\n defaultValues: oldUserDetails\n });\n\n const onSubmit = e => {\n fetch(\"/users/\" + username, {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(e)\n }).then(() => {\n history.push('/');\n })\n }\n\n return (\n <div className=\"edit-user\">\n <h2>Edit user</h2>\n { isPending && <h2>Loading...</h2> }\n <Link to={`/users/change-password`}>Change Password</Link>\n { firstname && <form onSubmit={handleSubmit(onSubmit)}>\n <label htmlFor=\"firstname\">Firstname</label>\n <input {...register(\"firstname\")}\n placeholder=\"Input your first name here\"\n />\n\n <label htmlFor=\"surname\">Surname</label>\n <input {...register(\"surname\")}\n placeholder=\"Input surname here\"\n />\n\n <label htmlFor=\"title\">Title</label>\n <input {...register(\"title\")}\n placeholder=\"State your role at InAGlobe (eg: volunteer)\"\n />\n\n <label htmlFor=\"password\">Password</label>\n <input {...register(\"password\")}\n placeholder=\"Input the password\"\n />\n\n <label htmlFor=\"email\">Email</label>\n <input {...register(\"email\")}\n placeholder=\"Input InAGlobe email here\"\n />\n\n\n <label htmlFor=\"bio\">Bio</label>\n <input {...register(\"bio\")}\n placeholder=\"Tell your colleagues a bit about yourself\"\n />\n\n {/* Think about changing type to force date */}\n <label htmlFor=\"joined\">Joined</label>\n <input {...register(\"joined\")}\n placeholder=\"Eg: 20th April 2020\"\n />\n\n\n <label htmlFor=\"location\">Location</label>\n <input {...register(\"location\")}\n placeholder=\"Where are you currently based?\"\n />\n\n <label htmlFor=\"availability\">Availibility</label>\n <input {...register(\"availability\")}\n placeholder=\"How available are you approximately per week?\"\n />\n\n <label htmlFor=\"partnership_opportunities\">Partnership Opportunities</label>\n <input {...register(\"partnership_opportunities\")}\n placeholder=\"Eg: Department of Computing at Imperial College London\"\n />\n\n <label htmlFor=\"interests\">Interests</label>\n <input {...register(\"interests\")}\n placeholder=\"What are your hobbies?\"\n />\n <button type=\"submit\">Save user details</button>\n </form> }\n </div>\n );\n}\n\nexport default EditUser;","import { useState } from \"react\";\nimport { useHistory } from 'react-router';\nconst ProjectTaskList = ({ project_tasks }) => {\n /* pass in filtered dataset containing tasks for a specific project*/\n const history = useHistory();\n const [description, setDescription] = useState(\"\");\n const [priority, setPriority] = useState(1);\n const [due_date, setDueDate] = useState(Date.now);\n const [completed, setCompleted] = useState(\"\");\n const [project_id, setProjectId] = useState(\"\");\n\n const handleComplete = task => e => {\n e.preventDefault();\n console.log(task.id)\n\n setDescription(task.description)\n setPriority(task.priority)\n setDueDate(task.due_date)\n setCompleted(\"Completed\")\n setProjectId(task.project_id)\n const newTask = { description, priority, due_date, completed, project_id }\n\n console.log(newTask)\n\n fetch(\"/projects/\" + task.project_id + \"/tasks/\" + task.id, {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(task)\n }).then(() => {\n window.location.reload();\n })\n \n };\n\n const handleDelete = task => e => {\n e.preventDefault();\n\n fetch(\"/projects/\" + task.project_id + \"/tasks/\" + task.id, {\n method: 'DELETE',\n }).then(() => {\n window.location.reload();\n })\n \n };\n\n return (\n <div className=\"project-tasks-list\">\n {project_tasks.map((task) => (\n <div className=\"project-task-preview\" key={task.id}>\n <div>\n <h2>{task.description}</h2>\n <h3>Due date: {task.due_date}</h3>\n </div>\n \n <h3>Priority: {task.priority}</h3>\n { !task.completed && <button className=\"task-complete-button\" onClick={handleComplete(task)}>Complete</button> }\n <button className=\"task-delete-button\"onClick={handleDelete(task)}>Delete</button>\n </div>\n ))}\n </div>\n );\n}\n \nexport default ProjectTaskList;\n","import { useParams } from 'react-router';\n\nimport ProjectTaskList from './ProjectTaskList'\nimport useFetch from './useFetch'\nimport { Link } from \"react-router-dom\"\n\nconst ProjectTasks = () => {\n const { id } = useParams();\n const { data: project, errorProject, isPendingProject } = useFetch(\"/projects/\" + id)\n\n const { data: project_tasks, errorTasks, isPendingTasks } = useFetch(\"/projects/\" + id + \"/tasks\");\n\n return (\n <div className=\"project-tasks\">\n { project && <h1>{project.name}: tasks</h1>}\n <h2>Ongoing Project Tasks</h2>\n { isPendingTasks && <h2>Loading...</h2> }\n { project_tasks && <ProjectTaskList project_tasks={project_tasks.filter(task => !task.completed)}/> }\n <h2>Completed Project Tasks</h2>\n { project_tasks && <ProjectTaskList project_tasks={project_tasks.filter(task => task.completed)}/> }\n\n <div className=\"add-task-button-wrapper\">\n { project_tasks && <Link to={`/projects/${project.id}/add-task`} className=\"add-task-button\">Add Task</Link> }\n </div>\n </div>\n );\n}\n\nexport default ProjectTasks;","import { useState } from \"react\";\nimport { useHistory } from \"react-router-dom\"\nimport { useParams } from \"react-router\"\nimport useFetch from \"./useFetch\";\n\nconst AddProjectTask = () => {\n const [description, setDescription] = useState(\"\");\n const [due_date, setDueDate] = useState(Date.now);\n const [priority, setPriority] = useState(1);\n const [completed, setCompleted] = useState(false);\n const { id } = useParams();\n const { data: project, error, isPending } = useFetch(\"/projects/\" + id)\n\n\n const history = useHistory();\n\n const handleSubmit = e => {\n e.preventDefault()\n\n const newProjectTask = {\n description,\n due_date,\n priority,\n completed\n }\n\n fetch(\"/projects/\" + project.id + \"/tasks\", {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(newProjectTask)\n }).then(() => {\n history.push('/projects/' + id + '/tasks');\n })\n }\n\n return (\n <div className=\"add-project-task\">\n <h2>Add a new task</h2>\n { isPending && <h2>Loading...</h2> }\n { project && <form onSubmit={handleSubmit}>\n <label>Description</label>\n <input\n type=\"text\"\n required\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n placeholder=\"Input description here\"\n />\n\n\n <label>Due Date [required]</label>\n <input\n type=\"date\"\n required\n value={due_date}\n onChange={(e) => setDueDate(e.target.value)}\n placeholder=\"Input your first name here\"\n />\n\n <label>Priority level (1: lowest, 4: highest) [required]</label>\n <select required value={priority} onChange={(e) => setPriority(e.target.value)} >\n <option value=\"1\">1</option>\n <option value=\"2\">2</option>\n <option value=\"3\">3</option>\n <option value=\"4\">4</option>\n </select>\n\n <label>Status</label>\n <select value={completed} onChange={(e) => setCompleted(e.target.value)}>\n <option value=\"Incomplete\">Available</option>\n <option value=\"Completed\">Completed</option>\n </select>\n <button>Add task</button>\n </form> }\n </div>\n );\n}\n\nexport default AddProjectTask;","import { useState } from 'react';\nimport PropTypes from 'prop-types';\n\nasync function loginUser(credentials) {\n return fetch('/users/login', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(credentials)\n })\n .then(data => data.json())\n }\n\nexport default function Login({ setToken }) {\n const [username, setUserName] = useState();\n const [password, setPassword] = useState();\n\n const handleSubmit = async e => {\n e.preventDefault();\n const token = await loginUser({\n username,\n password\n });\n if(token.token != \"\") {\n setToken(token);\n }\n }\n \n\n return (\n <div className=\"login\">\n <h1> InAGlobe Platform </h1>\n <form onSubmit={handleSubmit}>\n <input type=\"text\" id=\"login\" class=\"fadeIn second\" name=\"login\" placeholder=\"login\"\n onChange={e => setUserName(e.target.value)}/>\n <input type=\"password\" id=\"password\" class=\"fadeIn third\" name=\"login\" placeholder=\"password\"\n onChange={e => setPassword(e.target.value)}/> \n <div className=\"incorrect-password\" style={{display: 'none'}}>\n <h2>Incorrect password!</h2>\n </div>\n <a>Forgot Password?</a>\n <button type=\"submit\">Log In</button>\n </form>\n </div>\n );\n}\n \nLogin.propTypes = {\n setToken: PropTypes.func.isRequired\n}\n","\nimport useToken from './useToken';\nimport { Link, useHistory } from 'react-router-dom'\nimport { useState } from 'react'\n\nconst ChangePassword = () => {\n const [oldPassword, setOldPassword] = useState(\"\");\n const [newPassword, setNewPassword] = useState(\"\");\n const {setToken, token} = useToken()\n const history = useHistory()\n\nasync function passwordUpdate() {\n return fetch('/users/update-password', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n username: token,\n oldPassword: oldPassword,\n newPassword: newPassword})\n })\n .then(data => data.json())\n }\n\n const handleSubmit = async e => {\n e.preventDefault();\n const updated = await passwordUpdate();\n\n if(updated.status != \"True\") {\n document.getElementsByClassName(\"incorrect-password\")[0].style.display = \"block\";\n }\n else{\n document.getElementsByClassName(\"password-changed-msg\")[0].style.display = \"block\";\n }\n }\n \nreturn (\n <div className=\"change-password\">\n <h2>Change Password</h2>\n <label >Current Password</label>\n <input \n onChange={(e) => setOldPassword(e.target.value)}\n placeholder=\"Current Password\"\n />\n\n <label >New Password</label>\n <input \n onChange={(e) => setNewPassword(e.target.value)}\n placeholder=\"New Password\"\n />\n\n <button onClick={handleSubmit}>Change password</button>\n\n <h2 className=\"incorrect-password\" style={{display: \"none\"}}>Incorrect password</h2>\n\n <div className=\"password-changed-msg\" style={{display: \"none\"}}>\n <h3>Your password has been changed successfully</h3>\n <Link to={`/`}>Back to Dashboard</Link>\n </div>\n\n </div>\n \n )\n\n}\n\nexport default ChangePassword;","import ProjectList from './ProjectList'\nimport PersonalToDo from './PersonalToDo'\nimport useFetch from './useFetch'\nimport useToken from './useToken';\n\nconst ProjectRegistry = () => {\n\n const {data: projects, errorProjects, isPendingProjects} = useFetch(\"/projects\")\n\n return (\n <div className=\"project-registry\">\n <h1>All Projects</h1>\n <br />\n { isPendingProjects && <h2>Loading...</h2> }\n { projects && <ProjectList projects={projects} title=\"All Projects\"/> }\n </div>\n \n );\n}\n \nexport default ProjectRegistry;","import React, { useState } from 'react';\nimport {HashRouter as Router, Route, Switch} from 'react-router-dom'\n\nimport Navbar from './Navbar'\nimport Home from './Home'\nimport CreateProject from './CreateProject'\nimport ProjectDetails from './ProjectDetails'\nimport PageNotFound from './PageNotFound'\nimport MyProfile from './MyProfile'\nimport User from './User'\nimport Users from './Users'\nimport AddUser from './AddUser'\nimport EditProject from './EditProject'\nimport Sidebar from './Sidebar' \nimport EditUser from './EditUser'\nimport ProjectTasks from './ProjectTasks'\nimport AddProjectTask from './AddProjectTask'\nimport Login from './Login'\nimport useToken from './useToken';\nimport ChangePassword from './ChangePassword';\nimport ProjectsRegistry from './ProjectsRegistry'\n\nfunction App() {\n\n const { token, setToken } = useToken();\n\n if(!token) {\n return <Login setToken={setToken} />\n }\n\n return (\n <Router>\n <div className=\"App\"> \n <Sidebar />\n <Navbar />\n <div className=\"content\"> \n <Switch>\n <Route exact path=\"/\">\n <Home />\n </Route>\n <Route exact path=\"/create-project\">\n <CreateProject />\n </Route>\n <Route exact path=\"/add-user\">\n <AddUser /> \n </Route>\n <Route exact path=\"/my-profile\">\n <MyProfile />\n </Route>\n <Route exact path=\"/users\">\n <Users /> \n </Route>\n <Route exact path=\"/users/change-password\">\n <ChangePassword />\n </Route> \n <Route exact path=\"/users/:username\">\n <User />\n </Route>\n <Route exact path=\"/edit-user/:username\">\n <EditUser />\n </Route> \n <Route exact path=\"/projects\">\n <ProjectsRegistry /> \n </Route> \n <Route exact path=\"/projects/:id/add-task\">\n <AddProjectTask /> \n </Route> \n <Route exact path=\"/projects/:id/tasks\">\n <ProjectTasks /> \n </Route>\n <Route exact path=\"/projects/:id\">\n <ProjectDetails />\n </Route>\n <Route exact path=\"/edit-project/:id\">\n <EditProject />\n </Route>\n <Route path=\"*\">\n <PageNotFound />\n </Route>\n </Switch>\n </div>\n </div>\n </Router>\n );\n}\n\nexport default App;\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n <React.StrictMode>\n <App />\n </React.StrictMode>,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""} \ No newline at end of file diff --git a/backend/static/react/js/main.52682509.chunk.js b/backend/static/react/js/main.e896a0a2.chunk.js similarity index 99% rename from backend/static/react/js/main.52682509.chunk.js rename to backend/static/react/js/main.e896a0a2.chunk.js index e7bc3bf..48fab6e 100644 --- a/backend/static/react/js/main.52682509.chunk.js +++ b/backend/static/react/js/main.e896a0a2.chunk.js @@ -1,2 +1,2 @@ -(this["webpackJsonpinaglobe-dashboard"]=this["webpackJsonpinaglobe-dashboard"]||[]).push([[0],{38:function(e,t,n){},72:function(e,t,n){"use strict";n.r(t);var c=n(1),r=n.n(c),s=n(16),a=n.n(s),i=(n(38),n(5)),o=n(7),l=n(3);function j(){var e=Object(c.useState)(function(){var e=localStorage.getItem("token"),t=JSON.parse(e);return null===t||void 0===t?void 0:t.token}()),t=Object(l.a)(e,2),n=t[0],r=t[1];return{setToken:function(e){localStorage.setItem("token",JSON.stringify(e)),r(e.token)},token:n}}var d=n(0),u=function(){var e=j(),t=(e.setToken,e.token);return Object(d.jsxs)("nav",{className:"navbar",children:[Object(d.jsx)("a",{href:"/",style:{color:"#ff4e83",fontSize:"20px",borderRadius:"8px"},children:"InAGlobe Platform"}),Object(d.jsxs)("div",{className:"links",children:[Object(d.jsx)(i.b,{to:"/create-project",children:"New Project"}),Object(d.jsx)(i.b,{to:"/users/"+t,children:"My Profile"})]})]})},b=function(e){var t=e.projects;return Object(d.jsx)("div",{className:"project-list",children:t.map((function(e){return Object(d.jsx)("div",{className:"preview",children:Object(d.jsxs)(i.b,{to:"/projects/".concat(e.id),children:[Object(d.jsx)("h2",{children:e.name}),Object(d.jsx)("h3",{children:e.status})]})},e.id)}))})},h=function(e){var t=Object(c.useState)([]),n=Object(l.a)(t,2),r=n[0],s=n[1],a=Object(c.useState)(null),i=Object(l.a)(a,2),o=i[0],j=i[1],d=Object(c.useState)(!0),u=Object(l.a)(d,2),b=u[0],h=u[1];return Object(c.useEffect)((function(){fetch(e).then((function(e){if(!e.ok)throw Error("could not fetch the data for that resource");return e.json()})).then((function(e){s(e),h(!1),j(null)})).catch((function(e){j(e.message)}))}),[e]),{data:r,error:o,isPending:b}},O=function(e){var t=e.todos,n=e.title,r=j(),s=(r.setToken,r.token),a=h("/users"),i=a.data,o=(a.error,a.isPending),u=Object(c.useState)(""),b=Object(l.a)(u,2),O=b[0],p=b[1],x=Object(c.useState)(1),m=Object(l.a)(x,2),f=m[0],v=m[1],g=Object(c.useState)(Date.now()),y=Object(l.a)(g,2),k=y[0],S=y[1],w=Object(c.useState)(s),C=Object(l.a)(w,2),N=C[0],P=C[1];return Object(d.jsxs)("div",{className:"todo-list",style:{float:"right"},children:[Object(d.jsx)("h2",{children:n}),Object(d.jsx)("div",{className:"add-todo-button",children:Object(d.jsx)("button",{onClick:function(){document.getElementsByClassName("add-todo-form")[0].style.display="block"},children:"Add a personal task"})}),o&&Object(d.jsx)("h2",{children:"Loading..."}),Object(d.jsx)("div",{className:"add-todo-form",children:i&&Object(d.jsxs)("form",{onSubmit:function(e){document.getElementsByClassName("add-todo-form")[0].style.display="none",e.preventDefault();var t={todo_desc:O,priority:f,due_date:k,username:N};fetch("/todos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(){window.location.reload()}))},children:[Object(d.jsx)("label",{children:"Task description [required]"}),Object(d.jsx)("textarea",{value:O,onChange:function(e){return p(e.target.value)},required:!0,placeholder:"Add some awesome description!"}),Object(d.jsx)("label",{children:"Priority level (1: lowest, 4: highest)"}),Object(d.jsxs)("select",{value:f,onChange:function(e){return v(e.target.value)},children:[Object(d.jsx)("option",{value:"1",children:"1"}),Object(d.jsx)("option",{value:"2",children:"2"}),Object(d.jsx)("option",{value:"3",children:"3"}),Object(d.jsx)("option",{value:"4",children:"4"})]}),Object(d.jsx)("label",{children:"When should this task be done by? [required]"}),Object(d.jsx)("input",{required:!0,type:"date",value:k,onChange:function(e){return S(e.target.value)}}),Object(d.jsx)("label",{children:"Assigned user"}),Object(d.jsx)("select",{value:N,onChange:function(e){return P(e.target.value)},children:i.map((function(e){return Object(d.jsx)("option",{value:e.username,children:e.username})}))}),Object(d.jsx)("button",{children:"Save task"})]})}),Object(d.jsx)("div",{className:"personal-todos",children:t.map((function(e){return Object(d.jsxs)("div",{className:"todo-preview",children:[Object(d.jsx)("h2",{children:e.todo_desc}),Object(d.jsxs)("h3",{children:["Priority level: ",e.priority]}),Object(d.jsxs)("h3",{children:["To be done by:",e.due_date]}),Object(d.jsx)("button",{onClick:(t=e.id,function(e){e.preventDefault(),fetch("/todos/"+t,{method:"DELETE"}).then((function(){window.location.reload()}))}),children:"Complete"})]},e.id);var t}))})]})},p=function(){var e=h("/todos"),t=e.data,n=(e.errorTodos,e.isPendingTodos),c=j(),r=(c.setToken,c.token),s=h("/user_project/username/"+r),a=s.data,i=(s.errorRelevantProjects,s.isPendingRelevantProjects);return Object(d.jsxs)("div",{className:"home",children:[Object(d.jsx)("h1",{children:"Dashboard"}),Object(d.jsxs)("div",{className:"home-projects",style:{float:"left",width:"600px"},children:[i&&Object(d.jsx)("h2",{children:"Loading..."}),a&&Object(d.jsx)(b,{projects:a,title:"My Projects"})]}),Object(d.jsxs)("div",{className:"homeTodos",children:[n&&Object(d.jsx)("h2",{children:"Loading..."}),t&&Object(d.jsx)(O,{todos:t.filter((function(e){return e.username===r})),title:"My Tasks"})]})]})},x=n(6),m=n.n(x),f=n(8),v=n(33),g=function(){var e=Object(c.useState)(""),t=Object(l.a)(e,2),n=t[0],r=t[1],s=Object(c.useState)(""),a=Object(l.a)(s,2),i=a[0],j=a[1],u=Object(c.useState)("Available"),b=Object(l.a)(u,2),O=b[0],p=b[1],x=Object(c.useState)("Other"),g=Object(l.a)(x,2),y=g[0],k=g[1],S=Object(c.useState)(""),w=Object(l.a)(S,2),C=w[0],N=w[1],P=Object(c.useState)(""),T=Object(l.a)(P,2),A=T[0],D=T[1],E=Object(c.useState)([]),I=Object(l.a)(E,2),_=I[0],L=I[1],q=Object(o.f)(),F=h("/users/user_project"),J=F.data,B=(F.error,F.isPending,J.map((function(e){return e.username}))),G=function(){var e=Object(f.a)(m.a.mark((function e(t){var c,r,s,a;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),c={name:n,description:i,status:O,tag:y,location:C,files:A},e.next=4,fetch("/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});case 4:return r=e.sent,e.next=7,r.json();case 7:s=e.sent,a=s.id,_.map((function(e){var t={username:e,project_id:a};fetch("/user_project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})})),console.log(J),console.log(B),console.log(_),q.push("/");case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(d.jsxs)("div",{className:"create-project",children:[Object(d.jsx)("h2",{children:"Add a new project"}),Object(d.jsxs)("form",{onSubmit:G,children:[Object(d.jsx)("label",{children:"Project name [required]"}),Object(d.jsx)("input",{type:"text",required:!0,value:n,onChange:function(e){return r(e.target.value)},placeholder:"Input project name"}),Object(d.jsx)("label",{children:"Description [required]"}),Object(d.jsx)("textarea",{required:!0,placeholder:"Add some awesome description!",value:i,onChange:function(e){return j(e.target.value)}}),Object(d.jsx)("label",{children:"Status"}),Object(d.jsxs)("select",{value:O,onChange:function(e){return p(e.target.value)},children:[Object(d.jsx)("option",{value:"Progress",children:"Progress"}),Object(d.jsx)("option",{value:"Available",children:"Available"}),Object(d.jsx)("option",{value:"Completed",children:"Completed"})]}),Object(d.jsx)("label",{children:"Location"}),Object(d.jsx)("input",{type:"text",value:C,onChange:function(e){return N(e.target.value)},placeholder:"Eg: United Kingdom"}),Object(d.jsx)("label",{children:"Type of project [required]"}),Object(d.jsxs)("select",{required:!0,value:y,onChange:function(e){return k(e.target.value)},children:[Object(d.jsx)("option",{value:"Social",children:"Social"}),Object(d.jsx)("option",{value:"Education",children:"Education"}),Object(d.jsx)("option",{value:"Wash",children:"Wash"}),Object(d.jsx)("option",{value:"Environment",children:"Environment"}),Object(d.jsx)("option",{value:"Health",children:"Health"}),Object(d.jsx)("option",{value:"Other",children:"Other"})]}),Object(d.jsx)("label",{children:"Volunteers assigned to this project"}),Object(d.jsx)(v.a,{className:"dropdown",placeholder:"Select Users",value:J.filter((function(e){return _.includes(e.value)})),options:J,onChange:function(e){L(Array.isArray(e)?e.map((function(e){return e.value})):[])},isMulti:!0,isClearable:!0}),Object(d.jsx)("label",{children:"Google Drive folder"}),Object(d.jsx)("textarea",{placeholder:"Copy the link to the Google Drive folder for this project",value:A,onChange:function(e){return D(e.target.value)}}),Object(d.jsx)("button",{children:"Add project"})]})]})},y=function(){var e=Object(o.g)().id,t=Object(o.f)(),n=h("/projects/"+e),c=n.data,r=(n.error,n.isPending),s=h("/user_project/project/"+e),a=s.data;s.errorAssignment,s.isPendingAssignment;return Object(d.jsxs)("div",{className:"project-details",children:[r&&Object(d.jsx)("h2",{children:"Loading..."}),c&&Object(d.jsx)("h2",{children:c.name}),c&&Object(d.jsxs)("button",{style:{fontSize:"20px",color:"#fff",marginBottom:"30px",marginright:"10px",borderRadius:"8px",backgroundColor:"#f1b535"},children:["Status: ",c.status]}),c&&Object(d.jsx)("button",{style:{fontSize:"20px",color:"#fff",marginBottom:"30px",marginRight:"10px",borderRadius:"8px",backgroundColor:"#595bc0"},children:c.tag}),c&&Object(d.jsxs)("h4",{children:["Location: ",c.location]}),c&&Object(d.jsx)("button",{onClick:function(e){e.preventDefault(),window.open(c.files,"_blank")},children:"Documents"}),c&&Object(d.jsx)("p",{children:c.description}),Object(d.jsx)("h3",{children:"Volunteers working on this project"}),Object(d.jsx)("div",{className:"project_user_assignment_list",children:a.map((function(e){return Object(d.jsx)("div",{className:"assigned_users_preview",style:{float:"left",width:"50%"},children:Object(d.jsx)(i.b,{to:"/users/".concat(e.username),children:Object(d.jsx)("h4",{children:e.username})})},e.id)}))}),Object(d.jsxs)("div",{className:"project-tasks",children:[c&&Object(d.jsx)(i.b,{to:"/projects/".concat(c.id,"/tasks"),className:"view-tasks-button",children:"View Tasks"}),c&&Object(d.jsx)(i.b,{to:"/projects/".concat(c.id,"/add-task"),className:"add-task-button",children:"Add Task"})]}),Object(d.jsxs)("div",{children:[c&&Object(d.jsx)("button",{onClick:function(n){n.preventDefault(),fetch("/projects/"+e,{method:"DELETE"}).then((function(){t.push("/")}))},children:"Delete project"}),c&&Object(d.jsx)(i.b,{to:"/edit-project/".concat(c.id),className:"edit-project-button",children:"Edit project"})]})]})},k=function(){return Object(d.jsxs)("div",{className:"page-not-found",children:[Object(d.jsx)("h2",{children:"Something went wrong..."}),Object(d.jsx)("p",{children:"That page cannot be found"}),Object(d.jsx)(i.b,{to:"/",children:"Back to the main page"})]})},S=function(){var e=j(),t=(e.setToken,e.token),n=h("/users/"+t),c=n.data,r=(n.error,n.isPending);return Object(d.jsxs)("div",{className:"my-profile",children:[r&&Object(d.jsx)("h2",{children:"Loading..."}),c&&Object(d.jsx)("h2",{children:c.firstname+" "+c.surname}),c&&Object(d.jsx)("h1",{children:"Username: "+c.token}),c&&Object(d.jsx)("h1",{children:"Title: "+c.title}),c&&Object(d.jsx)("h1",{children:"Email: "+c.email}),c&&Object(d.jsx)("h1",{children:"Bio: "+c.bio}),c&&Object(d.jsx)("h1",{children:"Joined: "+c.joined}),c&&Object(d.jsx)("h1",{children:"Location: "+c.location}),c&&Object(d.jsx)("h1",{children:"Availability: "+c.availability}),c&&Object(d.jsx)("h1",{children:"Partnership Opportunities: "+c.partnership_opportunities}),c&&Object(d.jsx)("h1",{children:"Interests: "+c.interests})]})},w=function(){var e=Object(o.g)().username,t=Object(o.f)(),n=j(),c=(n.setToken,n.token),r=h("/users/"+e),s=r.data,a=(r.error,r.isPending);return Object(d.jsxs)("div",{className:"user",children:[a&&Object(d.jsx)("h2",{children:"Loading..."}),s&&Object(d.jsx)("div",{children:Object(d.jsx)("h2",{children:s.firstname+" "+s.surname})}),s&&Object(d.jsxs)("div",{children:[Object(d.jsxs)("h3",{children:[Object(d.jsx)("strong",{children:"Username: "}),s.username]}),Object(d.jsxs)("h3",{children:[Object(d.jsx)("strong",{children:"Email: "}),s.email]}),Object(d.jsxs)("h3",{children:[Object(d.jsx)("strong",{children:"Title: "}),s.title]}),Object(d.jsxs)("h3",{children:[Object(d.jsx)("strong",{children:"Joined: "}),s.joined]}),Object(d.jsxs)("h3",{children:[Object(d.jsx)("strong",{children:"Location: "}),s.location]}),Object(d.jsxs)("h3",{children:[Object(d.jsx)("strong",{children:"Availability: "}),s.availability]})]}),Object(d.jsx)("br",{}),s&&Object(d.jsxs)("div",{children:[Object(d.jsx)("label",{children:Object(d.jsx)("strong",{children:"Bio"})}),Object(d.jsx)("p",{children:s.bio})]}),s&&Object(d.jsxs)("div",{children:[Object(d.jsx)("label",{children:Object(d.jsx)("strong",{children:"Partnership Opportunities"})}),Object(d.jsx)("p",{children:s.partnership_opportunities})]}),s&&Object(d.jsxs)("div",{children:[Object(d.jsx)("label",{children:Object(d.jsx)("strong",{children:"Interests"})}),Object(d.jsx)("p",{children:s.interests})]}),s&&("jaimeaguilera"==e||e==c)&&Object(d.jsx)("button",{onClick:function(n){n.preventDefault(),fetch("/users/"+e,{method:"DELETE"}).then((function(){t.push("/")}))},children:"Delete user"}),s&&("jaimeaguilera"==e||e==c)&&Object(d.jsx)(i.b,{to:"/edit-user/".concat(e),className:"edit-user-button",children:"Edit details"})]})},C=function(e){var t=e.users;return Object(d.jsx)("div",{className:"user-list",children:t.map((function(e){return Object(d.jsx)("div",{className:"preview",children:Object(d.jsx)(i.b,{to:"/users/".concat(e.username),children:Object(d.jsx)("h2",{children:e.username})})},e.username)}))})},N=function(){var e=h("/users"),t=e.data,n=(e.error,e.isPending),c=j(),r=(c.setToken,c.token);return Object(d.jsxs)("div",{className:"users",children:[Object(d.jsx)("h1",{children:"Users"}),"jaimeaguilera"==r&&Object(d.jsx)(i.b,{to:"/add-user",className:"add-user-button",children:"Add User"}),Object(d.jsx)("br",{}),Object(d.jsx)("br",{}),n&&Object(d.jsx)("h2",{children:"Loading..."}),t&&Object(d.jsx)(C,{users:t,title:"All Users"})]})},P=function(){var e=Object(c.useState)(""),t=Object(l.a)(e,2),n=t[0],r=t[1],s=Object(c.useState)(""),a=Object(l.a)(s,2),i=a[0],j=a[1],u=Object(c.useState)(""),b=Object(l.a)(u,2),h=b[0],O=b[1],p=Object(c.useState)(""),x=Object(l.a)(p,2),m=x[0],f=x[1],v=Object(c.useState)(""),g=Object(l.a)(v,2),y=g[0],k=g[1],S=Object(c.useState)(""),w=Object(l.a)(S,2),C=w[0],N=w[1],P=Object(c.useState)(""),T=Object(l.a)(P,2),A=T[0],D=T[1],E=Object(c.useState)(""),I=Object(l.a)(E,2),_=I[0],L=I[1],q=Object(c.useState)(""),F=Object(l.a)(q,2),J=F[0],B=F[1],G=Object(c.useState)(""),U=Object(l.a)(G,2),W=U[0],H=U[1],R=Object(c.useState)(""),V=Object(l.a)(R,2),M=V[0],z=V[1],K=Object(c.useState)(""),Y=Object(l.a)(K,2),Q=Y[0],X=Y[1],Z=Object(o.f)();return Object(d.jsxs)("div",{className:"add-user",children:[Object(d.jsx)("h2",{children:"Add a new user"}),Object(d.jsxs)("form",{onSubmit:function(e){e.preventDefault();var t={firstname:n,surname:i,password:h,title:m,email:y,bio:C,joined:A,location:_,availability:J,partnership_opportunities:W,interests:M,username:Q};fetch("/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(){Z.push("/users")}))},children:[Object(d.jsx)("label",{children:"Username [required]"}),Object(d.jsx)("input",{type:"text",required:!0,value:Q,onChange:function(e){return X(e.target.value)},placeholder:"Input username here"}),Object(d.jsx)("label",{children:"Firstname [required]"}),Object(d.jsx)("input",{type:"text",required:!0,value:n,onChange:function(e){return r(e.target.value)},placeholder:"Input your first name here"}),Object(d.jsx)("label",{children:"Surname [required]"}),Object(d.jsx)("input",{type:"text",required:!0,value:i,onChange:function(e){return j(e.target.value)},placeholder:"Input surname here"}),Object(d.jsx)("label",{children:"Title [required]"}),Object(d.jsx)("input",{type:"text",required:!0,value:m,onChange:function(e){return f(e.target.value)},placeholder:"State your role at InAGlobe (eg: volunteer)"}),Object(d.jsx)("label",{children:"Password [required]"}),Object(d.jsx)("input",{type:"text",required:!0,value:h,onChange:function(e){return O(e.target.value)},placeholder:"Input the default password (to be changed by the user)"}),Object(d.jsx)("label",{children:"Email [required]"}),Object(d.jsx)("input",{type:"text",required:!0,value:y,onChange:function(e){return k(e.target.value)},placeholder:"Input InAGlobe email here"}),Object(d.jsx)("label",{children:"Bio"}),Object(d.jsx)("input",{type:"text",value:C,onChange:function(e){return N(e.target.value)},placeholder:"Tell your colleagues a bit about yourself"}),Object(d.jsx)("label",{children:"Joined"}),Object(d.jsx)("input",{type:"text",value:A,onChange:function(e){return D(e.target.value)},placeholder:"Eg: 20th April 2020"}),Object(d.jsx)("label",{children:"Location"}),Object(d.jsx)("input",{type:"text",value:_,onChange:function(e){return L(e.target.value)},placeholder:"Where are you currently based?"}),Object(d.jsx)("label",{children:"Availibility"}),Object(d.jsx)("input",{type:"text",value:J,onChange:function(e){return B(e.target.value)},placeholder:"How available are you approximately per week?"}),Object(d.jsx)("label",{children:"Partnership Opportunities"}),Object(d.jsx)("input",{type:"text",value:W,onChange:function(e){return H(e.target.value)},placeholder:"Eg: Department of Computing at Imperial College London"}),Object(d.jsx)("label",{children:"Interests"}),Object(d.jsx)("input",{type:"text",value:M,onChange:function(e){return z(e.target.value)},placeholder:"What are your hobbies?"}),Object(d.jsx)("button",{children:"Add user"})]})]})},T=n(4),A=n(21),D=function(){var e=Object(o.g)().id,t=h("/projects/"+e),n=t.data,r=n.name,s=n.description,a=n.status,i=n.location,j=n.tag,u=n.files,b=(t.error,t.isPending),O=h("/users"),p=O.data,x=(O.errorUsers,O.isPendingUsers,Object(c.useState)([])),m=Object(l.a)(x,2),f=m[0],v=m[1],g=Object(o.f)(),y={name:r,description:s,status:a,location:i,tag:j,files:u},k=Object(A.a)({defaultValues:y}),S=k.register,w=k.handleSubmit;return Object(d.jsxs)("div",{className:"edit-project",children:[Object(d.jsx)("h2",{children:"Edit project"}),b&&Object(d.jsx)("h2",{children:"Loading..."}),r&&Object(d.jsxs)("form",{onSubmit:w((function(t){fetch("/projects/"+e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(){f.map((function(t){var n={username:t,project_id:e};fetch("/user_project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}))})).then((function(){g.push("/")}))})),children:[Object(d.jsx)("label",{htmlFor:"name",children:"Project name"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},S("name")),{},{placeholder:"Insert project name here"})),Object(d.jsx)("label",{children:"Description"}),Object(d.jsx)("textarea",Object(T.a)(Object(T.a)({},S("description")),{},{name:"description",placeholder:"Insert description of the project here"})),Object(d.jsx)("label",{children:"Status"}),Object(d.jsxs)("select",Object(T.a)(Object(T.a)({},S("status")),{},{name:"status",children:[Object(d.jsx)("option",{value:"Progress",children:"Progress"}),Object(d.jsx)("option",{value:"Available",children:"Available"}),Object(d.jsx)("option",{value:"Completed",children:"Completed"})]})),Object(d.jsx)("label",{children:"Location"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},S("location")),{},{type:"text",placeholder:"Insert location of project here",name:"location"})),Object(d.jsx)("label",{children:"Type of project"}),Object(d.jsxs)("select",Object(T.a)(Object(T.a)({},S("tag")),{},{name:"tag",children:[Object(d.jsx)("option",{value:"Social",children:"Social"}),Object(d.jsx)("option",{value:"Education",children:"Education"}),Object(d.jsx)("option",{value:"Wash",children:"Wash"}),Object(d.jsx)("option",{value:"Environment",children:"Environment"}),Object(d.jsx)("option",{value:"Health",children:"Health"}),Object(d.jsx)("option",{value:"Other",children:"Other"})]})),Object(d.jsx)("label",{children:"Volunteers assigned to this project"}),Object(d.jsx)("select",{multiple:!0,onChange:function(e){return v(f.concat(e.target.value))},value:f,children:p.map((function(e){return Object(d.jsxs)("option",{value:e.username,children:[e.firstname," ",e.surname]})}))}),Object(d.jsx)("label",{children:"Google Drive folder"}),Object(d.jsx)("textarea",Object(T.a)(Object(T.a)({},S("files")),{},{name:"files",placeholder:"Insert Google Drive Folder link here"})),Object(d.jsx)("button",{type:"submit",children:"Save project details"})]})]})},E=n(32),I=function(){var e=Object(o.f)(),t=j(),n=(t.setToken,t.token);return Object(d.jsxs)(E.slide,{children:[Object(d.jsx)("div",{className:"menu-item",children:Object(d.jsx)(i.b,{to:"/",children:"Home"})}),Object(d.jsx)("div",{className:"menu-item",children:Object(d.jsx)(i.b,{to:"/users/"+n,children:"Profile"})}),Object(d.jsx)("div",{className:"menu-item",children:Object(d.jsx)(i.b,{to:"/users",children:"All Users"})}),Object(d.jsx)("div",{className:"menu-item",children:Object(d.jsx)(i.b,{to:"/projects",children:"All Projects"})}),Object(d.jsx)("div",{className:"menu-item",children:Object(d.jsx)("a",{href:"https://slack.com/intl/en-gb/",target:"_blank",children:"Go To Slack"})}),Object(d.jsx)("div",{className:"menu-item",children:Object(d.jsx)("a",{style:{textDecoration:"underline",cursor:"pointer"},onClick:function(t){t.preventDefault(),localStorage.clear(),window.location.reload(),e.push("/")},children:"Log Out"})})]})},_=function(){var e=Object(o.g)().username,t=h("/users/"+e),n=t.data,c=n.firstname,r=n.surname,s=n.password,a=n.title,l=n.email,j=n.bio,u=n.joined,b=n.location,O=n.availability,p=n.partnership_opportunities,x=n.interests,m=(t.error,t.isPending),f=Object(o.f)(),v={firstname:c,surname:r,password:s,title:a,email:l,bio:j,joined:u,location:b,availability:O,partnership_opportunities:p,interests:x},g=Object(A.a)({defaultValues:v}),y=g.register,k=g.handleSubmit;return Object(d.jsxs)("div",{className:"edit-user",children:[Object(d.jsx)("h2",{children:"Edit user"}),m&&Object(d.jsx)("h2",{children:"Loading..."}),Object(d.jsx)(i.b,{to:"/users/change-password",children:"Change Password"}),c&&Object(d.jsxs)("form",{onSubmit:k((function(t){fetch("/users/"+e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(){f.push("/")}))})),children:[Object(d.jsx)("label",{htmlFor:"firstname",children:"Firstname"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("firstname")),{},{placeholder:"Input your first name here"})),Object(d.jsx)("label",{htmlFor:"surname",children:"Surname"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("surname")),{},{placeholder:"Input surname here"})),Object(d.jsx)("label",{htmlFor:"title",children:"Title"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("title")),{},{placeholder:"State your role at InAGlobe (eg: volunteer)"})),Object(d.jsx)("label",{htmlFor:"password",children:"Password"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("password")),{},{placeholder:"Input the password"})),Object(d.jsx)("label",{htmlFor:"email",children:"Email"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("email")),{},{placeholder:"Input InAGlobe email here"})),Object(d.jsx)("label",{htmlFor:"bio",children:"Bio"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("bio")),{},{placeholder:"Tell your colleagues a bit about yourself"})),Object(d.jsx)("label",{htmlFor:"joined",children:"Joined"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("joined")),{},{placeholder:"Eg: 20th April 2020"})),Object(d.jsx)("label",{htmlFor:"location",children:"Location"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("location")),{},{placeholder:"Where are you currently based?"})),Object(d.jsx)("label",{htmlFor:"availability",children:"Availibility"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("availability")),{},{placeholder:"How available are you approximately per week?"})),Object(d.jsx)("label",{htmlFor:"partnership_opportunities",children:"Partnership Opportunities"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("partnership_opportunities")),{},{placeholder:"Eg: Department of Computing at Imperial College London"})),Object(d.jsx)("label",{htmlFor:"interests",children:"Interests"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("interests")),{},{placeholder:"What are your hobbies?"})),Object(d.jsx)("button",{type:"submit",children:"Save user details"})]})]})},L=function(e){var t=e.project_tasks,n=(Object(o.f)(),Object(c.useState)("")),r=Object(l.a)(n,2),s=r[0],a=r[1],i=Object(c.useState)(1),j=Object(l.a)(i,2),u=j[0],b=j[1],h=Object(c.useState)(Date.now),O=Object(l.a)(h,2),p=O[0],x=O[1],m=Object(c.useState)(""),f=Object(l.a)(m,2),v=f[0],g=f[1],y=Object(c.useState)(""),k=Object(l.a)(y,2),S=k[0],w=k[1],C=function(e){return function(t){t.preventDefault(),console.log(e.id),a(e.description),b(e.priority),x(e.due_date),g("Completed"),w(e.project_id);var n={description:s,priority:u,due_date:p,completed:v,project_id:S};console.log(n),fetch("/projects/"+e.project_id+"/tasks/"+e.id,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then((function(){window.location.reload()}))}},N=function(e){return function(t){t.preventDefault(),fetch("/projects/"+e.project_id+"/tasks/"+e.id,{method:"DELETE"}).then((function(){window.location.reload()}))}};return Object(d.jsx)("div",{className:"project-tasks-list",children:t.map((function(e){return Object(d.jsxs)("div",{className:"project-task-preview",children:[Object(d.jsxs)("div",{children:[Object(d.jsx)("h2",{children:e.description}),Object(d.jsxs)("h3",{children:["Due date: ",e.due_date]})]}),Object(d.jsxs)("h3",{children:["Priority: ",e.priority]}),!e.completed&&Object(d.jsx)("button",{className:"task-complete-button",onClick:C(e),children:"Complete"}),Object(d.jsx)("button",{className:"task-delete-button",onClick:N(e),children:"Delete"})]},e.id)}))})},q=function(){var e=Object(o.g)().id,t=h("/projects/"+e),n=t.data,c=(t.errorProject,t.isPendingProject,h("/projects/"+e+"/tasks")),r=c.data,s=(c.errorTasks,c.isPendingTasks);return Object(d.jsxs)("div",{className:"project-tasks",children:[n&&Object(d.jsxs)("h1",{children:[n.name,": tasks"]}),Object(d.jsx)("h2",{children:"Ongoing Project Tasks"}),s&&Object(d.jsx)("h2",{children:"Loading..."}),r&&Object(d.jsx)(L,{project_tasks:r.filter((function(e){return!e.completed}))}),Object(d.jsx)("h2",{children:"Completed Project Tasks"}),r&&Object(d.jsx)(L,{project_tasks:r.filter((function(e){return e.completed}))}),Object(d.jsx)("div",{className:"add-task-button-wrapper",children:r&&Object(d.jsx)(i.b,{to:"/projects/".concat(n.id,"/add-task"),className:"add-task-button",children:"Add Task"})})]})},F=function(){var e=Object(c.useState)(""),t=Object(l.a)(e,2),n=t[0],r=t[1],s=Object(c.useState)(Date.now),a=Object(l.a)(s,2),i=a[0],j=a[1],u=Object(c.useState)(1),b=Object(l.a)(u,2),O=b[0],p=b[1],x=Object(c.useState)(!1),m=Object(l.a)(x,2),f=m[0],v=m[1],g=Object(o.g)().id,y=h("/projects/"+g),k=y.data,S=(y.error,y.isPending),w=Object(o.f)();return Object(d.jsxs)("div",{className:"add-project-task",children:[Object(d.jsx)("h2",{children:"Add a new task"}),S&&Object(d.jsx)("h2",{children:"Loading..."}),k&&Object(d.jsxs)("form",{onSubmit:function(e){e.preventDefault();var t={description:n,due_date:i,priority:O,completed:f};fetch("/projects/"+k.id+"/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(){w.push("/projects/"+g+"/tasks")}))},children:[Object(d.jsx)("label",{children:"Description"}),Object(d.jsx)("input",{type:"text",required:!0,value:n,onChange:function(e){return r(e.target.value)},placeholder:"Input description here"}),Object(d.jsx)("label",{children:"Due Date [required]"}),Object(d.jsx)("input",{type:"date",required:!0,value:i,onChange:function(e){return j(e.target.value)},placeholder:"Input your first name here"}),Object(d.jsx)("label",{children:"Priority level (1: lowest, 4: highest) [required]"}),Object(d.jsxs)("select",{required:!0,value:O,onChange:function(e){return p(e.target.value)},children:[Object(d.jsx)("option",{value:"1",children:"1"}),Object(d.jsx)("option",{value:"2",children:"2"}),Object(d.jsx)("option",{value:"3",children:"3"}),Object(d.jsx)("option",{value:"4",children:"4"})]}),Object(d.jsx)("label",{children:"Status"}),Object(d.jsxs)("select",{value:f,onChange:function(e){return v(e.target.value)},children:[Object(d.jsx)("option",{value:"Incomplete",children:"Available"}),Object(d.jsx)("option",{value:"Completed",children:"Completed"})]}),Object(d.jsx)("button",{children:"Add task"})]})]})};function J(e){return B.apply(this,arguments)}function B(){return(B=Object(f.a)(m.a.mark((function e(t){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fetch("/users/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(e){return e.json()})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G(e){var t=e.setToken,n=Object(c.useState)(),r=Object(l.a)(n,2),s=r[0],a=r[1],i=Object(c.useState)(),o=Object(l.a)(i,2),j=o[0],u=o[1],b=function(){var e=Object(f.a)(m.a.mark((function e(n){var c;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),e.next=3,J({username:s,password:j});case 3:""!=(c=e.sent).token&&t(c);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(d.jsxs)("div",{className:"login",children:[Object(d.jsx)("h1",{children:" InAGlobe Platform "}),Object(d.jsxs)("form",{onSubmit:b,children:[Object(d.jsx)("input",{type:"text",id:"login",class:"fadeIn second",name:"login",placeholder:"login",onChange:function(e){return a(e.target.value)}}),Object(d.jsx)("input",{type:"password",id:"password",class:"fadeIn third",name:"login",placeholder:"password",onChange:function(e){return u(e.target.value)}}),Object(d.jsx)("div",{className:"incorrect-password",style:{display:"none"},children:Object(d.jsx)("h2",{children:"Incorrect password!"})}),Object(d.jsx)("a",{children:"Forgot Password?"}),Object(d.jsx)("button",{type:"submit",children:"Log In"})]})]})}var U=function(){var e=Object(c.useState)(""),t=Object(l.a)(e,2),n=t[0],r=t[1],s=Object(c.useState)(""),a=Object(l.a)(s,2),u=a[0],b=a[1],h=j(),O=(h.setToken,h.token);Object(o.f)();function p(){return x.apply(this,arguments)}function x(){return(x=Object(f.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fetch("/users/update-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:O,oldPassword:n,newPassword:u})}).then((function(e){return e.json()})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var v=function(){var e=Object(f.a)(m.a.mark((function e(t){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.next=3,p();case 3:"True"!=e.sent.status?document.getElementsByClassName("incorrect-password")[0].style.display="block":document.getElementsByClassName("password-changed-msg")[0].style.display="block";case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(d.jsxs)("div",{className:"change-password",children:[Object(d.jsx)("h2",{children:"Change Password"}),Object(d.jsx)("label",{children:"Current Password"}),Object(d.jsx)("input",{onChange:function(e){return r(e.target.value)},placeholder:"Current Password"}),Object(d.jsx)("label",{children:"New Password"}),Object(d.jsx)("input",{onChange:function(e){return b(e.target.value)},placeholder:"New Password"}),Object(d.jsx)("button",{onClick:v,children:"Change password"}),Object(d.jsx)("h2",{className:"incorrect-password",style:{display:"none"},children:"Incorrect password"}),Object(d.jsxs)("div",{className:"password-changed-msg",style:{display:"none"},children:[Object(d.jsx)("h3",{children:"Your password has been changed successfully"}),Object(d.jsx)(i.b,{to:"/",children:"Back to Dashboard"})]})]})},W=function(){var e=h("/projects"),t=e.data,n=(e.errorProjects,e.isPendingProjects);return Object(d.jsxs)("div",{className:"project-registry",children:[Object(d.jsx)("h1",{children:"All Projects"}),Object(d.jsx)("br",{}),n&&Object(d.jsx)("h2",{children:"Loading..."}),t&&Object(d.jsx)(b,{projects:t,title:"All Projects"})]})};var H=function(){var e=j(),t=e.token,n=e.setToken;return t?Object(d.jsx)(i.a,{children:Object(d.jsxs)("div",{className:"App",children:[Object(d.jsx)(I,{}),Object(d.jsx)(u,{}),Object(d.jsx)("div",{className:"content",children:Object(d.jsxs)(o.c,{children:[Object(d.jsx)(o.a,{exact:!0,path:"/",children:Object(d.jsx)(p,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/create-project",children:Object(d.jsx)(g,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/add-user",children:Object(d.jsx)(P,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/my-profile",children:Object(d.jsx)(S,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/users",children:Object(d.jsx)(N,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/users/change-password",children:Object(d.jsx)(U,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/users/:username",children:Object(d.jsx)(w,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/edit-user/:username",children:Object(d.jsx)(_,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/projects",children:Object(d.jsx)(W,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/projects/:id/add-task",children:Object(d.jsx)(F,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/projects/:id/tasks",children:Object(d.jsx)(q,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/projects/:id",children:Object(d.jsx)(y,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/edit-project/:id",children:Object(d.jsx)(D,{})}),Object(d.jsx)(o.a,{path:"*",children:Object(d.jsx)(k,{})})]})})]})}):Object(d.jsx)(G,{setToken:n})},R=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,73)).then((function(t){var n=t.getCLS,c=t.getFID,r=t.getFCP,s=t.getLCP,a=t.getTTFB;n(e),c(e),r(e),s(e),a(e)}))};a.a.render(Object(d.jsx)(r.a.StrictMode,{children:Object(d.jsx)(H,{})}),document.getElementById("root")),R()}},[[72,1,2]]]); -//# sourceMappingURL=main.52682509.chunk.js.map \ No newline at end of file +(this["webpackJsonpinaglobe-dashboard"]=this["webpackJsonpinaglobe-dashboard"]||[]).push([[0],{38:function(e,t,n){},72:function(e,t,n){"use strict";n.r(t);var c=n(1),r=n.n(c),s=n(16),a=n.n(s),i=(n(38),n(5)),o=n(7),l=n(3);function j(){var e=Object(c.useState)(function(){var e=localStorage.getItem("token"),t=JSON.parse(e);return null===t||void 0===t?void 0:t.token}()),t=Object(l.a)(e,2),n=t[0],r=t[1];return{setToken:function(e){localStorage.setItem("token",JSON.stringify(e)),r(e.token)},token:n}}var d=n(0),u=function(){var e=j(),t=(e.setToken,e.token);return Object(d.jsxs)("nav",{className:"navbar",children:[Object(d.jsx)("a",{href:"/",style:{color:"#ff4e83",fontSize:"20px",borderRadius:"8px"},children:"InAGlobe Platform"}),Object(d.jsxs)("div",{className:"links",children:[Object(d.jsx)(i.b,{to:"/create-project",children:"New Project"}),Object(d.jsx)(i.b,{to:"/users/"+t,children:"My Profile"})]})]})},b=function(e){var t=e.projects;return Object(d.jsx)("div",{className:"project-list",children:t.map((function(e){return Object(d.jsx)("div",{className:"preview",children:Object(d.jsxs)(i.b,{to:"/projects/".concat(e.id),children:[Object(d.jsx)("h2",{children:e.name}),Object(d.jsx)("h3",{children:e.status})]})},e.id)}))})},h=function(e){var t=Object(c.useState)([]),n=Object(l.a)(t,2),r=n[0],s=n[1],a=Object(c.useState)(null),i=Object(l.a)(a,2),o=i[0],j=i[1],d=Object(c.useState)(!0),u=Object(l.a)(d,2),b=u[0],h=u[1];return Object(c.useEffect)((function(){fetch(e).then((function(e){if(!e.ok)throw Error("could not fetch the data for that resource");return e.json()})).then((function(e){s(e),h(!1),j(null)})).catch((function(e){j(e.message)}))}),[e]),{data:r,error:o,isPending:b}},O=function(e){var t=e.todos,n=e.title,r=j(),s=(r.setToken,r.token),a=h("/users"),i=a.data,o=(a.error,a.isPending),u=Object(c.useState)(""),b=Object(l.a)(u,2),O=b[0],p=b[1],x=Object(c.useState)(1),m=Object(l.a)(x,2),f=m[0],v=m[1],g=Object(c.useState)(Date.now()),y=Object(l.a)(g,2),k=y[0],S=y[1],w=Object(c.useState)(s),C=Object(l.a)(w,2),N=C[0],P=C[1];return Object(d.jsxs)("div",{className:"todo-list",style:{float:"right"},children:[Object(d.jsx)("h2",{children:n}),Object(d.jsx)("div",{className:"add-todo-button",children:Object(d.jsx)("button",{onClick:function(){document.getElementsByClassName("add-todo-form")[0].style.display="block"},children:"Add a personal task"})}),o&&Object(d.jsx)("h2",{children:"Loading..."}),Object(d.jsx)("div",{className:"add-todo-form",children:i&&Object(d.jsxs)("form",{onSubmit:function(e){document.getElementsByClassName("add-todo-form")[0].style.display="none",e.preventDefault();var t={todo_desc:O,priority:f,due_date:k,username:N};fetch("/todos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(){window.location.reload()}))},children:[Object(d.jsx)("label",{children:"Task description [required]"}),Object(d.jsx)("textarea",{value:O,onChange:function(e){return p(e.target.value)},required:!0,placeholder:"Add some awesome description!"}),Object(d.jsx)("label",{children:"Priority level (1: lowest, 4: highest)"}),Object(d.jsxs)("select",{value:f,onChange:function(e){return v(e.target.value)},children:[Object(d.jsx)("option",{value:"1",children:"1"}),Object(d.jsx)("option",{value:"2",children:"2"}),Object(d.jsx)("option",{value:"3",children:"3"}),Object(d.jsx)("option",{value:"4",children:"4"})]}),Object(d.jsx)("label",{children:"When should this task be done by? [required]"}),Object(d.jsx)("input",{required:!0,type:"date",value:k,onChange:function(e){return S(e.target.value)}}),Object(d.jsx)("label",{children:"Assigned user"}),Object(d.jsx)("select",{value:N,onChange:function(e){return P(e.target.value)},children:i.map((function(e){return Object(d.jsx)("option",{value:e.username,children:e.username})}))}),Object(d.jsx)("button",{children:"Save task"})]})}),Object(d.jsx)("div",{className:"personal-todos",children:t.map((function(e){return Object(d.jsxs)("div",{className:"todo-preview",children:[Object(d.jsx)("h2",{children:e.todo_desc}),Object(d.jsxs)("h3",{children:["Priority level: ",e.priority]}),Object(d.jsxs)("h3",{children:["To be done by:",e.due_date]}),Object(d.jsx)("button",{onClick:(t=e.id,function(e){e.preventDefault(),fetch("/todos/"+t,{method:"DELETE"}).then((function(){window.location.reload()}))}),children:"Complete"})]},e.id);var t}))})]})},p=function(){var e=h("/todos"),t=e.data,n=(e.errorTodos,e.isPendingTodos),c=j(),r=(c.setToken,c.token),s=h("/user_project/username/"+r),a=s.data,i=(s.errorRelevantProjects,s.isPendingRelevantProjects);return Object(d.jsxs)("div",{className:"home",children:[Object(d.jsx)("h1",{children:"Dashboard"}),Object(d.jsxs)("div",{className:"home-projects",style:{float:"left",width:"600px"},children:[i&&Object(d.jsx)("h2",{children:"Loading..."}),a&&Object(d.jsx)(b,{projects:a,title:"My Projects"})]}),Object(d.jsxs)("div",{className:"homeTodos",children:[n&&Object(d.jsx)("h2",{children:"Loading..."}),t&&Object(d.jsx)(O,{todos:t.filter((function(e){return e.username===r})),title:"My Tasks"})]})]})},x=n(6),m=n.n(x),f=n(8),v=n(33),g=function(){var e=Object(c.useState)(""),t=Object(l.a)(e,2),n=t[0],r=t[1],s=Object(c.useState)(""),a=Object(l.a)(s,2),i=a[0],j=a[1],u=Object(c.useState)("Available"),b=Object(l.a)(u,2),O=b[0],p=b[1],x=Object(c.useState)("Other"),g=Object(l.a)(x,2),y=g[0],k=g[1],S=Object(c.useState)(""),w=Object(l.a)(S,2),C=w[0],N=w[1],P=Object(c.useState)(""),T=Object(l.a)(P,2),A=T[0],D=T[1],E=Object(c.useState)([]),I=Object(l.a)(E,2),_=I[0],L=I[1],q=Object(o.f)(),F=h("/users/user_project"),J=F.data,B=(F.error,F.isPending,J.map((function(e){return e.username}))),G=function(){var e=Object(f.a)(m.a.mark((function e(t){var c,r,s,a;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),c={name:n,description:i,status:O,tag:y,location:C,files:A},e.next=4,fetch("/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});case 4:return r=e.sent,e.next=7,r.json();case 7:s=e.sent,a=s.id,_.map((function(e){var t={username:e,project_id:a};fetch("/user_project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})})),console.log(J),console.log(B),console.log(_),q.push("/");case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(d.jsxs)("div",{className:"create-project",children:[Object(d.jsx)("h2",{children:"Add a new project"}),Object(d.jsxs)("form",{onSubmit:G,children:[Object(d.jsx)("label",{children:"Project name [required]"}),Object(d.jsx)("input",{type:"text",required:!0,value:n,onChange:function(e){return r(e.target.value)},placeholder:"Input project name"}),Object(d.jsx)("label",{children:"Description [required]"}),Object(d.jsx)("textarea",{required:!0,placeholder:"Add some awesome description!",value:i,onChange:function(e){return j(e.target.value)}}),Object(d.jsx)("label",{children:"Status"}),Object(d.jsxs)("select",{value:O,onChange:function(e){return p(e.target.value)},children:[Object(d.jsx)("option",{value:"Progress",children:"Progress"}),Object(d.jsx)("option",{value:"Available",children:"Available"}),Object(d.jsx)("option",{value:"Completed",children:"Completed"})]}),Object(d.jsx)("label",{children:"Location"}),Object(d.jsx)("input",{type:"text",value:C,onChange:function(e){return N(e.target.value)},placeholder:"Eg: United Kingdom"}),Object(d.jsx)("label",{children:"Type of project [required]"}),Object(d.jsxs)("select",{required:!0,value:y,onChange:function(e){return k(e.target.value)},children:[Object(d.jsx)("option",{value:"Social",children:"Social"}),Object(d.jsx)("option",{value:"Education",children:"Education"}),Object(d.jsx)("option",{value:"Wash",children:"Wash"}),Object(d.jsx)("option",{value:"Environment",children:"Environment"}),Object(d.jsx)("option",{value:"Health",children:"Health"}),Object(d.jsx)("option",{value:"Other",children:"Other"})]}),Object(d.jsx)("label",{children:"Volunteers assigned to this project"}),Object(d.jsx)(v.a,{className:"dropdown",placeholder:"Select Users",value:J.filter((function(e){return _.includes(e.value)})),options:J,onChange:function(e){L(Array.isArray(e)?e.map((function(e){return e.value})):[])},isMulti:!0,isClearable:!0}),Object(d.jsx)("label",{children:"Google Drive folder"}),Object(d.jsx)("textarea",{placeholder:"Copy the link to the Google Drive folder for this project",value:A,onChange:function(e){return D(e.target.value)}}),Object(d.jsx)("button",{children:"Add project"})]})]})},y=function(){var e=Object(o.g)().id,t=Object(o.f)(),n=h("/projects/"+e),c=n.data,r=(n.error,n.isPending),s=h("/user_project/project/"+e),a=s.data;s.errorAssignment,s.isPendingAssignment;return Object(d.jsxs)("div",{className:"project-details",children:[r&&Object(d.jsx)("h2",{children:"Loading..."}),c&&Object(d.jsx)("h2",{children:c.name}),c&&Object(d.jsxs)("button",{style:{fontSize:"20px",color:"#fff",marginBottom:"30px",marginright:"10px",borderRadius:"8px",backgroundColor:"#f1b535"},children:["Status: ",c.status]}),c&&Object(d.jsx)("button",{style:{fontSize:"20px",color:"#fff",marginBottom:"30px",marginRight:"10px",borderRadius:"8px",backgroundColor:"#595bc0"},children:c.tag}),c&&Object(d.jsxs)("h4",{children:["Location: ",c.location]}),c&&Object(d.jsx)("button",{onClick:function(e){e.preventDefault(),window.open(c.files,"_blank")},children:"Documents"}),c&&Object(d.jsx)("p",{children:c.description}),Object(d.jsx)("h3",{children:"Volunteers working on this project"}),Object(d.jsx)("div",{className:"project_user_assignment_list",children:a.map((function(e){return Object(d.jsx)("div",{className:"assigned_users_preview",style:{float:"left",width:"50%"},children:Object(d.jsx)(i.b,{to:"/users/".concat(e.username),children:Object(d.jsx)("h4",{children:e.username})})},e.id)}))}),Object(d.jsxs)("div",{className:"project-tasks",children:[c&&Object(d.jsx)(i.b,{to:"/projects/".concat(c.id,"/tasks"),className:"view-tasks-button",children:"View Tasks"}),c&&Object(d.jsx)(i.b,{to:"/projects/".concat(c.id,"/add-task"),className:"add-task-button",children:"Add Task"})]}),Object(d.jsxs)("div",{children:[c&&Object(d.jsx)("button",{onClick:function(n){n.preventDefault(),fetch("/projects/"+e,{method:"DELETE"}).then((function(){t.push("/")}))},children:"Delete project"}),c&&Object(d.jsx)(i.b,{to:"/edit-project/".concat(c.id),className:"edit-project-button",children:"Edit project"})]})]})},k=function(){return Object(d.jsxs)("div",{className:"page-not-found",children:[Object(d.jsx)("h2",{children:"Something went wrong..."}),Object(d.jsx)("p",{children:"That page cannot be found"}),Object(d.jsx)(i.b,{to:"/",children:"Back to the main page"})]})},S=function(){var e=j(),t=(e.setToken,e.token),n=h("/users/"+t),c=n.data,r=(n.error,n.isPending);return Object(d.jsxs)("div",{className:"my-profile",children:[r&&Object(d.jsx)("h2",{children:"Loading..."}),c&&Object(d.jsx)("h2",{children:c.firstname+" "+c.surname}),c&&Object(d.jsx)("h1",{children:"Username: "+c.token}),c&&Object(d.jsx)("h1",{children:"Title: "+c.title}),c&&Object(d.jsx)("h1",{children:"Email: "+c.email}),c&&Object(d.jsx)("h1",{children:"Bio: "+c.bio}),c&&Object(d.jsx)("h1",{children:"Joined: "+c.joined}),c&&Object(d.jsx)("h1",{children:"Location: "+c.location}),c&&Object(d.jsx)("h1",{children:"Availability: "+c.availability}),c&&Object(d.jsx)("h1",{children:"Partnership Opportunities: "+c.partnership_opportunities}),c&&Object(d.jsx)("h1",{children:"Interests: "+c.interests})]})},w=function(){var e=Object(o.g)().username,t=Object(o.f)(),n=j(),c=(n.setToken,n.token),r=h("/users/"+e),s=r.data,a=(r.error,r.isPending);return Object(d.jsxs)("div",{className:"user",children:[a&&Object(d.jsx)("h2",{children:"Loading..."}),s&&Object(d.jsx)("div",{children:Object(d.jsx)("h2",{children:s.firstname+" "+s.surname})}),s&&Object(d.jsxs)("div",{children:[Object(d.jsxs)("h3",{children:[Object(d.jsx)("strong",{children:"Username: "}),s.username]}),Object(d.jsxs)("h3",{children:[Object(d.jsx)("strong",{children:"Email: "}),s.email]}),Object(d.jsxs)("h3",{children:[Object(d.jsx)("strong",{children:"Title: "}),s.title]}),Object(d.jsxs)("h3",{children:[Object(d.jsx)("strong",{children:"Joined: "}),s.joined]}),Object(d.jsxs)("h3",{children:[Object(d.jsx)("strong",{children:"Location: "}),s.location]}),Object(d.jsxs)("h3",{children:[Object(d.jsx)("strong",{children:"Availability: "}),s.availability]})]}),Object(d.jsx)("br",{}),s&&Object(d.jsxs)("div",{children:[Object(d.jsx)("label",{children:Object(d.jsx)("strong",{children:"Bio"})}),Object(d.jsx)("p",{children:s.bio})]}),s&&Object(d.jsxs)("div",{children:[Object(d.jsx)("label",{children:Object(d.jsx)("strong",{children:"Partnership Opportunities"})}),Object(d.jsx)("p",{children:s.partnership_opportunities})]}),s&&Object(d.jsxs)("div",{children:[Object(d.jsx)("label",{children:Object(d.jsx)("strong",{children:"Interests"})}),Object(d.jsx)("p",{children:s.interests})]}),s&&("jaimeaguilera"==c||e==c)&&Object(d.jsx)("button",{onClick:function(n){n.preventDefault(),fetch("/users/"+e,{method:"DELETE"}).then((function(){t.push("/")}))},children:"Delete user"}),s&&("jaimeaguilera"==c||e==c)&&Object(d.jsx)(i.b,{to:"/edit-user/".concat(e),className:"edit-user-button",children:"Edit details"})]})},C=function(e){var t=e.users;return Object(d.jsx)("div",{className:"user-list",children:t.map((function(e){return Object(d.jsx)("div",{className:"preview",children:Object(d.jsx)(i.b,{to:"/users/".concat(e.username),children:Object(d.jsx)("h2",{children:e.username})})},e.username)}))})},N=function(){var e=h("/users"),t=e.data,n=(e.error,e.isPending),c=j(),r=(c.setToken,c.token);return Object(d.jsxs)("div",{className:"users",children:[Object(d.jsx)("h1",{children:"Users"}),"jaimeaguilera"==r&&Object(d.jsx)(i.b,{to:"/add-user",className:"add-user-button",children:"Add User"}),Object(d.jsx)("br",{}),Object(d.jsx)("br",{}),n&&Object(d.jsx)("h2",{children:"Loading..."}),t&&Object(d.jsx)(C,{users:t,title:"All Users"})]})},P=function(){var e=Object(c.useState)(""),t=Object(l.a)(e,2),n=t[0],r=t[1],s=Object(c.useState)(""),a=Object(l.a)(s,2),i=a[0],j=a[1],u=Object(c.useState)(""),b=Object(l.a)(u,2),h=b[0],O=b[1],p=Object(c.useState)(""),x=Object(l.a)(p,2),m=x[0],f=x[1],v=Object(c.useState)(""),g=Object(l.a)(v,2),y=g[0],k=g[1],S=Object(c.useState)(""),w=Object(l.a)(S,2),C=w[0],N=w[1],P=Object(c.useState)(""),T=Object(l.a)(P,2),A=T[0],D=T[1],E=Object(c.useState)(""),I=Object(l.a)(E,2),_=I[0],L=I[1],q=Object(c.useState)(""),F=Object(l.a)(q,2),J=F[0],B=F[1],G=Object(c.useState)(""),U=Object(l.a)(G,2),W=U[0],H=U[1],R=Object(c.useState)(""),V=Object(l.a)(R,2),M=V[0],z=V[1],K=Object(c.useState)(""),Y=Object(l.a)(K,2),Q=Y[0],X=Y[1],Z=Object(o.f)();return Object(d.jsxs)("div",{className:"add-user",children:[Object(d.jsx)("h2",{children:"Add a new user"}),Object(d.jsxs)("form",{onSubmit:function(e){e.preventDefault();var t={firstname:n,surname:i,password:h,title:m,email:y,bio:C,joined:A,location:_,availability:J,partnership_opportunities:W,interests:M,username:Q};fetch("/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(){Z.push("/users")}))},children:[Object(d.jsx)("label",{children:"Username [required]"}),Object(d.jsx)("input",{type:"text",required:!0,value:Q,onChange:function(e){return X(e.target.value)},placeholder:"Input username here"}),Object(d.jsx)("label",{children:"Firstname [required]"}),Object(d.jsx)("input",{type:"text",required:!0,value:n,onChange:function(e){return r(e.target.value)},placeholder:"Input your first name here"}),Object(d.jsx)("label",{children:"Surname [required]"}),Object(d.jsx)("input",{type:"text",required:!0,value:i,onChange:function(e){return j(e.target.value)},placeholder:"Input surname here"}),Object(d.jsx)("label",{children:"Title [required]"}),Object(d.jsx)("input",{type:"text",required:!0,value:m,onChange:function(e){return f(e.target.value)},placeholder:"State your role at InAGlobe (eg: volunteer)"}),Object(d.jsx)("label",{children:"Password [required]"}),Object(d.jsx)("input",{type:"text",required:!0,value:h,onChange:function(e){return O(e.target.value)},placeholder:"Input the default password (to be changed by the user)"}),Object(d.jsx)("label",{children:"Email [required]"}),Object(d.jsx)("input",{type:"text",required:!0,value:y,onChange:function(e){return k(e.target.value)},placeholder:"Input InAGlobe email here"}),Object(d.jsx)("label",{children:"Bio"}),Object(d.jsx)("input",{type:"text",value:C,onChange:function(e){return N(e.target.value)},placeholder:"Tell your colleagues a bit about yourself"}),Object(d.jsx)("label",{children:"Joined"}),Object(d.jsx)("input",{type:"text",value:A,onChange:function(e){return D(e.target.value)},placeholder:"Eg: 20th April 2020"}),Object(d.jsx)("label",{children:"Location"}),Object(d.jsx)("input",{type:"text",value:_,onChange:function(e){return L(e.target.value)},placeholder:"Where are you currently based?"}),Object(d.jsx)("label",{children:"Availibility"}),Object(d.jsx)("input",{type:"text",value:J,onChange:function(e){return B(e.target.value)},placeholder:"How available are you approximately per week?"}),Object(d.jsx)("label",{children:"Partnership Opportunities"}),Object(d.jsx)("input",{type:"text",value:W,onChange:function(e){return H(e.target.value)},placeholder:"Eg: Department of Computing at Imperial College London"}),Object(d.jsx)("label",{children:"Interests"}),Object(d.jsx)("input",{type:"text",value:M,onChange:function(e){return z(e.target.value)},placeholder:"What are your hobbies?"}),Object(d.jsx)("button",{children:"Add user"})]})]})},T=n(4),A=n(21),D=function(){var e=Object(o.g)().id,t=h("/projects/"+e),n=t.data,r=n.name,s=n.description,a=n.status,i=n.location,j=n.tag,u=n.files,b=(t.error,t.isPending),O=h("/users"),p=O.data,x=(O.errorUsers,O.isPendingUsers,Object(c.useState)([])),m=Object(l.a)(x,2),f=m[0],v=m[1],g=Object(o.f)(),y={name:r,description:s,status:a,location:i,tag:j,files:u},k=Object(A.a)({defaultValues:y}),S=k.register,w=k.handleSubmit;return Object(d.jsxs)("div",{className:"edit-project",children:[Object(d.jsx)("h2",{children:"Edit project"}),b&&Object(d.jsx)("h2",{children:"Loading..."}),r&&Object(d.jsxs)("form",{onSubmit:w((function(t){fetch("/projects/"+e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(){f.map((function(t){var n={username:t,project_id:e};fetch("/user_project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}))})).then((function(){g.push("/")}))})),children:[Object(d.jsx)("label",{htmlFor:"name",children:"Project name"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},S("name")),{},{placeholder:"Insert project name here"})),Object(d.jsx)("label",{children:"Description"}),Object(d.jsx)("textarea",Object(T.a)(Object(T.a)({},S("description")),{},{name:"description",placeholder:"Insert description of the project here"})),Object(d.jsx)("label",{children:"Status"}),Object(d.jsxs)("select",Object(T.a)(Object(T.a)({},S("status")),{},{name:"status",children:[Object(d.jsx)("option",{value:"Progress",children:"Progress"}),Object(d.jsx)("option",{value:"Available",children:"Available"}),Object(d.jsx)("option",{value:"Completed",children:"Completed"})]})),Object(d.jsx)("label",{children:"Location"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},S("location")),{},{type:"text",placeholder:"Insert location of project here",name:"location"})),Object(d.jsx)("label",{children:"Type of project"}),Object(d.jsxs)("select",Object(T.a)(Object(T.a)({},S("tag")),{},{name:"tag",children:[Object(d.jsx)("option",{value:"Social",children:"Social"}),Object(d.jsx)("option",{value:"Education",children:"Education"}),Object(d.jsx)("option",{value:"Wash",children:"Wash"}),Object(d.jsx)("option",{value:"Environment",children:"Environment"}),Object(d.jsx)("option",{value:"Health",children:"Health"}),Object(d.jsx)("option",{value:"Other",children:"Other"})]})),Object(d.jsx)("label",{children:"Volunteers assigned to this project"}),Object(d.jsx)("select",{multiple:!0,onChange:function(e){return v(f.concat(e.target.value))},value:f,children:p.map((function(e){return Object(d.jsxs)("option",{value:e.username,children:[e.firstname," ",e.surname]})}))}),Object(d.jsx)("label",{children:"Google Drive folder"}),Object(d.jsx)("textarea",Object(T.a)(Object(T.a)({},S("files")),{},{name:"files",placeholder:"Insert Google Drive Folder link here"})),Object(d.jsx)("button",{type:"submit",children:"Save project details"})]})]})},E=n(32),I=function(){var e=Object(o.f)(),t=j(),n=(t.setToken,t.token);return Object(d.jsxs)(E.slide,{children:[Object(d.jsx)("div",{className:"menu-item",children:Object(d.jsx)(i.b,{to:"/",children:"Home"})}),Object(d.jsx)("div",{className:"menu-item",children:Object(d.jsx)(i.b,{to:"/users/"+n,children:"Profile"})}),Object(d.jsx)("div",{className:"menu-item",children:Object(d.jsx)(i.b,{to:"/users",children:"All Users"})}),Object(d.jsx)("div",{className:"menu-item",children:Object(d.jsx)(i.b,{to:"/projects",children:"All Projects"})}),Object(d.jsx)("div",{className:"menu-item",children:Object(d.jsx)("a",{href:"https://slack.com/intl/en-gb/",target:"_blank",children:"Go To Slack"})}),Object(d.jsx)("div",{className:"menu-item",children:Object(d.jsx)("a",{style:{textDecoration:"underline",cursor:"pointer"},onClick:function(t){t.preventDefault(),localStorage.clear(),window.location.reload(),e.push("/")},children:"Log Out"})})]})},_=function(){var e=Object(o.g)().username,t=h("/users/"+e),n=t.data,c=n.firstname,r=n.surname,s=n.password,a=n.title,l=n.email,j=n.bio,u=n.joined,b=n.location,O=n.availability,p=n.partnership_opportunities,x=n.interests,m=(t.error,t.isPending),f=Object(o.f)(),v={firstname:c,surname:r,password:s,title:a,email:l,bio:j,joined:u,location:b,availability:O,partnership_opportunities:p,interests:x},g=Object(A.a)({defaultValues:v}),y=g.register,k=g.handleSubmit;return Object(d.jsxs)("div",{className:"edit-user",children:[Object(d.jsx)("h2",{children:"Edit user"}),m&&Object(d.jsx)("h2",{children:"Loading..."}),Object(d.jsx)(i.b,{to:"/users/change-password",children:"Change Password"}),c&&Object(d.jsxs)("form",{onSubmit:k((function(t){fetch("/users/"+e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(){f.push("/")}))})),children:[Object(d.jsx)("label",{htmlFor:"firstname",children:"Firstname"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("firstname")),{},{placeholder:"Input your first name here"})),Object(d.jsx)("label",{htmlFor:"surname",children:"Surname"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("surname")),{},{placeholder:"Input surname here"})),Object(d.jsx)("label",{htmlFor:"title",children:"Title"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("title")),{},{placeholder:"State your role at InAGlobe (eg: volunteer)"})),Object(d.jsx)("label",{htmlFor:"password",children:"Password"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("password")),{},{placeholder:"Input the password"})),Object(d.jsx)("label",{htmlFor:"email",children:"Email"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("email")),{},{placeholder:"Input InAGlobe email here"})),Object(d.jsx)("label",{htmlFor:"bio",children:"Bio"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("bio")),{},{placeholder:"Tell your colleagues a bit about yourself"})),Object(d.jsx)("label",{htmlFor:"joined",children:"Joined"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("joined")),{},{placeholder:"Eg: 20th April 2020"})),Object(d.jsx)("label",{htmlFor:"location",children:"Location"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("location")),{},{placeholder:"Where are you currently based?"})),Object(d.jsx)("label",{htmlFor:"availability",children:"Availibility"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("availability")),{},{placeholder:"How available are you approximately per week?"})),Object(d.jsx)("label",{htmlFor:"partnership_opportunities",children:"Partnership Opportunities"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("partnership_opportunities")),{},{placeholder:"Eg: Department of Computing at Imperial College London"})),Object(d.jsx)("label",{htmlFor:"interests",children:"Interests"}),Object(d.jsx)("input",Object(T.a)(Object(T.a)({},y("interests")),{},{placeholder:"What are your hobbies?"})),Object(d.jsx)("button",{type:"submit",children:"Save user details"})]})]})},L=function(e){var t=e.project_tasks,n=(Object(o.f)(),Object(c.useState)("")),r=Object(l.a)(n,2),s=r[0],a=r[1],i=Object(c.useState)(1),j=Object(l.a)(i,2),u=j[0],b=j[1],h=Object(c.useState)(Date.now),O=Object(l.a)(h,2),p=O[0],x=O[1],m=Object(c.useState)(""),f=Object(l.a)(m,2),v=f[0],g=f[1],y=Object(c.useState)(""),k=Object(l.a)(y,2),S=k[0],w=k[1],C=function(e){return function(t){t.preventDefault(),console.log(e.id),a(e.description),b(e.priority),x(e.due_date),g("Completed"),w(e.project_id);var n={description:s,priority:u,due_date:p,completed:v,project_id:S};console.log(n),fetch("/projects/"+e.project_id+"/tasks/"+e.id,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then((function(){window.location.reload()}))}},N=function(e){return function(t){t.preventDefault(),fetch("/projects/"+e.project_id+"/tasks/"+e.id,{method:"DELETE"}).then((function(){window.location.reload()}))}};return Object(d.jsx)("div",{className:"project-tasks-list",children:t.map((function(e){return Object(d.jsxs)("div",{className:"project-task-preview",children:[Object(d.jsxs)("div",{children:[Object(d.jsx)("h2",{children:e.description}),Object(d.jsxs)("h3",{children:["Due date: ",e.due_date]})]}),Object(d.jsxs)("h3",{children:["Priority: ",e.priority]}),!e.completed&&Object(d.jsx)("button",{className:"task-complete-button",onClick:C(e),children:"Complete"}),Object(d.jsx)("button",{className:"task-delete-button",onClick:N(e),children:"Delete"})]},e.id)}))})},q=function(){var e=Object(o.g)().id,t=h("/projects/"+e),n=t.data,c=(t.errorProject,t.isPendingProject,h("/projects/"+e+"/tasks")),r=c.data,s=(c.errorTasks,c.isPendingTasks);return Object(d.jsxs)("div",{className:"project-tasks",children:[n&&Object(d.jsxs)("h1",{children:[n.name,": tasks"]}),Object(d.jsx)("h2",{children:"Ongoing Project Tasks"}),s&&Object(d.jsx)("h2",{children:"Loading..."}),r&&Object(d.jsx)(L,{project_tasks:r.filter((function(e){return!e.completed}))}),Object(d.jsx)("h2",{children:"Completed Project Tasks"}),r&&Object(d.jsx)(L,{project_tasks:r.filter((function(e){return e.completed}))}),Object(d.jsx)("div",{className:"add-task-button-wrapper",children:r&&Object(d.jsx)(i.b,{to:"/projects/".concat(n.id,"/add-task"),className:"add-task-button",children:"Add Task"})})]})},F=function(){var e=Object(c.useState)(""),t=Object(l.a)(e,2),n=t[0],r=t[1],s=Object(c.useState)(Date.now),a=Object(l.a)(s,2),i=a[0],j=a[1],u=Object(c.useState)(1),b=Object(l.a)(u,2),O=b[0],p=b[1],x=Object(c.useState)(!1),m=Object(l.a)(x,2),f=m[0],v=m[1],g=Object(o.g)().id,y=h("/projects/"+g),k=y.data,S=(y.error,y.isPending),w=Object(o.f)();return Object(d.jsxs)("div",{className:"add-project-task",children:[Object(d.jsx)("h2",{children:"Add a new task"}),S&&Object(d.jsx)("h2",{children:"Loading..."}),k&&Object(d.jsxs)("form",{onSubmit:function(e){e.preventDefault();var t={description:n,due_date:i,priority:O,completed:f};fetch("/projects/"+k.id+"/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(){w.push("/projects/"+g+"/tasks")}))},children:[Object(d.jsx)("label",{children:"Description"}),Object(d.jsx)("input",{type:"text",required:!0,value:n,onChange:function(e){return r(e.target.value)},placeholder:"Input description here"}),Object(d.jsx)("label",{children:"Due Date [required]"}),Object(d.jsx)("input",{type:"date",required:!0,value:i,onChange:function(e){return j(e.target.value)},placeholder:"Input your first name here"}),Object(d.jsx)("label",{children:"Priority level (1: lowest, 4: highest) [required]"}),Object(d.jsxs)("select",{required:!0,value:O,onChange:function(e){return p(e.target.value)},children:[Object(d.jsx)("option",{value:"1",children:"1"}),Object(d.jsx)("option",{value:"2",children:"2"}),Object(d.jsx)("option",{value:"3",children:"3"}),Object(d.jsx)("option",{value:"4",children:"4"})]}),Object(d.jsx)("label",{children:"Status"}),Object(d.jsxs)("select",{value:f,onChange:function(e){return v(e.target.value)},children:[Object(d.jsx)("option",{value:"Incomplete",children:"Available"}),Object(d.jsx)("option",{value:"Completed",children:"Completed"})]}),Object(d.jsx)("button",{children:"Add task"})]})]})};function J(e){return B.apply(this,arguments)}function B(){return(B=Object(f.a)(m.a.mark((function e(t){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fetch("/users/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(e){return e.json()})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G(e){var t=e.setToken,n=Object(c.useState)(),r=Object(l.a)(n,2),s=r[0],a=r[1],i=Object(c.useState)(),o=Object(l.a)(i,2),j=o[0],u=o[1],b=function(){var e=Object(f.a)(m.a.mark((function e(n){var c;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),e.next=3,J({username:s,password:j});case 3:""!=(c=e.sent).token&&t(c);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(d.jsxs)("div",{className:"login",children:[Object(d.jsx)("h1",{children:" InAGlobe Platform "}),Object(d.jsxs)("form",{onSubmit:b,children:[Object(d.jsx)("input",{type:"text",id:"login",class:"fadeIn second",name:"login",placeholder:"login",onChange:function(e){return a(e.target.value)}}),Object(d.jsx)("input",{type:"password",id:"password",class:"fadeIn third",name:"login",placeholder:"password",onChange:function(e){return u(e.target.value)}}),Object(d.jsx)("div",{className:"incorrect-password",style:{display:"none"},children:Object(d.jsx)("h2",{children:"Incorrect password!"})}),Object(d.jsx)("a",{children:"Forgot Password?"}),Object(d.jsx)("button",{type:"submit",children:"Log In"})]})]})}var U=function(){var e=Object(c.useState)(""),t=Object(l.a)(e,2),n=t[0],r=t[1],s=Object(c.useState)(""),a=Object(l.a)(s,2),u=a[0],b=a[1],h=j(),O=(h.setToken,h.token);Object(o.f)();function p(){return x.apply(this,arguments)}function x(){return(x=Object(f.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fetch("/users/update-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:O,oldPassword:n,newPassword:u})}).then((function(e){return e.json()})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var v=function(){var e=Object(f.a)(m.a.mark((function e(t){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.next=3,p();case 3:"True"!=e.sent.status?document.getElementsByClassName("incorrect-password")[0].style.display="block":document.getElementsByClassName("password-changed-msg")[0].style.display="block";case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(d.jsxs)("div",{className:"change-password",children:[Object(d.jsx)("h2",{children:"Change Password"}),Object(d.jsx)("label",{children:"Current Password"}),Object(d.jsx)("input",{onChange:function(e){return r(e.target.value)},placeholder:"Current Password"}),Object(d.jsx)("label",{children:"New Password"}),Object(d.jsx)("input",{onChange:function(e){return b(e.target.value)},placeholder:"New Password"}),Object(d.jsx)("button",{onClick:v,children:"Change password"}),Object(d.jsx)("h2",{className:"incorrect-password",style:{display:"none"},children:"Incorrect password"}),Object(d.jsxs)("div",{className:"password-changed-msg",style:{display:"none"},children:[Object(d.jsx)("h3",{children:"Your password has been changed successfully"}),Object(d.jsx)(i.b,{to:"/",children:"Back to Dashboard"})]})]})},W=function(){var e=h("/projects"),t=e.data,n=(e.errorProjects,e.isPendingProjects);return Object(d.jsxs)("div",{className:"project-registry",children:[Object(d.jsx)("h1",{children:"All Projects"}),Object(d.jsx)("br",{}),n&&Object(d.jsx)("h2",{children:"Loading..."}),t&&Object(d.jsx)(b,{projects:t,title:"All Projects"})]})};var H=function(){var e=j(),t=e.token,n=e.setToken;return t?Object(d.jsx)(i.a,{children:Object(d.jsxs)("div",{className:"App",children:[Object(d.jsx)(I,{}),Object(d.jsx)(u,{}),Object(d.jsx)("div",{className:"content",children:Object(d.jsxs)(o.c,{children:[Object(d.jsx)(o.a,{exact:!0,path:"/",children:Object(d.jsx)(p,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/create-project",children:Object(d.jsx)(g,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/add-user",children:Object(d.jsx)(P,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/my-profile",children:Object(d.jsx)(S,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/users",children:Object(d.jsx)(N,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/users/change-password",children:Object(d.jsx)(U,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/users/:username",children:Object(d.jsx)(w,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/edit-user/:username",children:Object(d.jsx)(_,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/projects",children:Object(d.jsx)(W,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/projects/:id/add-task",children:Object(d.jsx)(F,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/projects/:id/tasks",children:Object(d.jsx)(q,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/projects/:id",children:Object(d.jsx)(y,{})}),Object(d.jsx)(o.a,{exact:!0,path:"/edit-project/:id",children:Object(d.jsx)(D,{})}),Object(d.jsx)(o.a,{path:"*",children:Object(d.jsx)(k,{})})]})})]})}):Object(d.jsx)(G,{setToken:n})},R=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,73)).then((function(t){var n=t.getCLS,c=t.getFID,r=t.getFCP,s=t.getLCP,a=t.getTTFB;n(e),c(e),r(e),s(e),a(e)}))};a.a.render(Object(d.jsx)(r.a.StrictMode,{children:Object(d.jsx)(H,{})}),document.getElementById("root")),R()}},[[72,1,2]]]); +//# sourceMappingURL=main.e896a0a2.chunk.js.map \ No newline at end of file diff --git a/backend/static/react/js/main.e896a0a2.chunk.js.map b/backend/static/react/js/main.e896a0a2.chunk.js.map new file mode 100644 index 0000000..34bb2c3 --- /dev/null +++ b/backend/static/react/js/main.e896a0a2.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["useToken.js","Navbar.js","ProjectList.js","useFetch.js","PersonalToDo.js","Home.js","CreateProject.js","ProjectDetails.js","PageNotFound.js","MyProfile.js","User.js","UserList.js","Users.js","AddUser.js","EditProject.js","Sidebar.js","EditUser.js","ProjectTaskList.js","ProjectTasks.js","AddProjectTask.js","Login.js","ChangePassword.js","ProjectsRegistry.js","App.js","reportWebVitals.js","index.js"],"names":["useToken","useState","tokenString","localStorage","getItem","userToken","JSON","parse","token","getToken","setToken","setItem","stringify","Navbar","className","href","style","color","fontSize","borderRadius","to","ProjectList","projects","map","project","id","name","status","useFetch","url","data","setData","error","setError","isPending","setIsPending","useEffect","fetch","then","res","ok","Error","json","catch","err","message","PersonalToDo","todos","title","users","todo_desc","setTodoDesc","priority","setPriority","Date","now","due_date","setDueDate","username","setUsername","float","onClick","document","getElementsByClassName","display","onSubmit","e","preventDefault","newTodo","method","headers","body","window","location","reload","value","onChange","target","required","placeholder","type","user","todo","Home","isPendingTodos","errorTodos","isPendingRelevantProjects","errorRelevantProjects","width","filter","CreateProject","setName","description","setDescription","setStatus","tag","setTag","setLocation","files","setFiles","selectUsernames","setSelectUsernames","history","useHistory","usernames","handleSubmit","a","newProject","response","responseJSON","project_id","assign_project","console","log","push","includes","options","Array","isArray","x","isMulti","isClearable","ProjectDetails","useParams","assignments","errorAssignment","isPendingAssignment","marginBottom","marginright","backgroundColor","marginRight","open","PageNotFound","MyProfile","firstname","surname","email","bio","joined","availability","partnership_opportunities","interests","User","UserList","Users","AddUser","setFirstname","setSurname","password","setPassword","setTitle","setEmail","setBio","setJoined","setAvailability","setPartnership_opportunities","setInterests","newUser","EditProject","errorUsers","isPendingUsers","oldProjectDetails","useForm","defaultValues","register","htmlFor","multiple","concat","Sidebar","textDecoration","cursor","clear","EditUser","oldUserDetails","ProjectTaskList","project_tasks","completed","setCompleted","setProjectId","handleComplete","task","newTask","handleDelete","ProjectTasks","errorProject","isPendingProject","isPendingTasks","errorTasks","AddProjectTask","newProjectTask","loginUser","credentials","Login","setUserName","class","ChangePassword","oldPassword","setOldPassword","newPassword","setNewPassword","passwordUpdate","ProjectRegistry","isPendingProjects","errorProjects","App","exact","path","ProjectsRegistry","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","getElementById"],"mappings":"6NAEe,SAASA,IACpB,IAMA,EAA0BC,mBANT,WACb,IAAMC,EAAcC,aAAaC,QAAQ,SACnCC,EAAYC,KAAKC,MAAML,GAC7B,cAAOG,QAAP,IAAOA,OAAP,EAAOA,EAAWG,MAGaC,IAAnC,mBAAOD,EAAP,KAAcE,EAAd,KAOA,MAAO,CACHA,SANc,SAAAL,GACdF,aAAaQ,QAAQ,QAASL,KAAKM,UAAUP,IAC7CK,EAASL,EAAUG,QAKnBA,S,WCGOK,EAlBA,WACX,MAA0Bb,IAATQ,GAAjB,EAAOE,SAAP,EAAiBF,OAEjB,OACI,sBAAKM,UAAU,SAAf,UACI,mBAAGC,KAAK,IAAIC,MAAO,CACfC,MAAO,UACPC,SAAU,OACVC,aAAc,OAHlB,+BAKA,sBAAKL,UAAU,QAAf,UACI,cAAC,IAAD,CAAMM,GAAE,kBAAR,yBACA,cAAC,IAAD,CAAMA,GAAI,UAAYZ,EAAtB,+BCGDa,EAhBK,SAAC,GAAkB,IAAhBC,EAAe,EAAfA,SAEnB,OACI,qBAAKR,UAAU,eAAf,SACKQ,EAASC,KAAI,SAACC,GAAD,OACV,qBAAKV,UAAU,UAA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,SACE,cAAC,EAAD,MAEF,cAAC,IAAD,CAAOD,OAAK,EAACC,KAAK,mBAAlB,SACE,cAAC,EAAD,MAEF,cAAC,IAAD,CAAOD,OAAK,EAACC,KAAK,uBAAlB,SACE,cAAC,EAAD,MAEF,cAAC,IAAD,CAAOD,OAAK,EAACC,KAAK,YAAlB,SACE,cAACC,EAAD,MAEF,cAAC,IAAD,CAAOF,OAAK,EAACC,KAAK,yBAAlB,SACE,cAAC,EAAD,MAEF,cAAC,IAAD,CAAOD,OAAK,EAACC,KAAK,sBAAlB,SACE,cAAC,EAAD,MAEF,cAAC,IAAD,CAAOD,OAAK,EAACC,KAAK,gBAAlB,SACE,cAAC,EAAD,MAEF,cAAC,IAAD,CAAOD,OAAK,EAACC,KAAK,oBAAlB,SACE,cAAC,EAAD,MAEF,cAAC,IAAD,CAAOA,KAAK,IAAZ,SACE,cAAC,EAAD,gBAlDH,cAACd,EAAD,CAAOtL,SAAUA,KCfbsM,EAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,6BAAqB5K,MAAK,YAAkD,IAA/C6K,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCDdO,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEF5J,SAAS6J,eAAe,SAM1BX,M","file":"js/main.e896a0a2.chunk.js","sourcesContent":["import { useState } from 'react';\n\nexport default function useToken() {\n const getToken = () => {\n const tokenString = localStorage.getItem('token');\n const userToken = JSON.parse(tokenString);\n return userToken?.token\n };\n \n const [token, setToken] = useState(getToken());\n\n const saveToken = userToken => {\n localStorage.setItem('token', JSON.stringify(userToken));\n setToken(userToken.token);\n };\n\n return {\n setToken: saveToken,\n token\n }\n\n}","import { Link } from 'react-router-dom'\nimport useToken from './useToken';\n\nconst Navbar = () => {\n const {setToken, token} = useToken();\n\n return (\n <nav className=\"navbar\" >\n <a href=\"/\" style={{ \n color: '#ff4e83',\n fontSize: '20px',\n borderRadius: '8px' \n }}>InAGlobe Platform</a>\n <div className=\"links\"> \n <Link to={`/create-project`}>New Project</Link>\n <Link to={`/users/` + token}>My Profile</Link>\n </div>\n </nav>\n );\n}\n \nexport default Navbar;","import { Link } from 'react-router-dom'\n\nconst ProjectList = ({ projects }) => {\n\n return (\n <div className=\"project-list\">\n {projects.map((project) => (\n <div className=\"preview\" key={project.id}>\n <Link to={`/projects/${project.id}`}>\n <h2>{project.name}</h2>\n <h3>{project.status}</h3>\n </Link>\n </div>\n ))}\n </div>\n );\n}\n \nexport default ProjectList;","import { useState, useEffect } from 'react';\n\nconst useFetch = (url) => {\n const [data, setData] = useState([]);\n const [error, setError] = useState(null);\n const [isPending, setIsPending] = useState(true);\n\n useEffect(() => {\n fetch(url)\n .then(res => {\n if (!res.ok) { // error coming back from server\n throw Error('could not fetch the data for that resource');\n } \n return res.json();\n })\n .then(data => {\n setData(data);\n setIsPending(false);\n setError(null);\n })\n .catch(err => {\n // auto catches network / connection error\n setError(err.message);\n })\n }, [url])\n\n return { data, error, isPending };\n}\n \nexport default useFetch;","import useFetch from './useFetch'\nimport { useState } from \"react\";\nimport useToken from './useToken'\n\nconst PersonalToDo = ({ todos, title }) => {\n\n const openTaskForm = () => {\n document.getElementsByClassName(\"add-todo-form\")[0].style.display = \"block\";\n }\n const {setToken, token} = useToken();\n\n\n const { data: users, error, isPending } = useFetch(\"/users\")\n\n const [todo_desc, setTodoDesc] = useState(\"\");\n const [priority, setPriority] = useState(1);\n const [due_date, setDueDate] = useState(Date.now());\n const [username, setUsername] = useState(token);\n\n const handleSubmit = e => {\n document.getElementsByClassName(\"add-todo-form\")[0].style.display = \"none\";\n\n e.preventDefault();\n const newTodo = { todo_desc, priority, due_date, username };\n\n fetch(\"/todos\", {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(newTodo)\n }).then(() => {\n window.location.reload();\n })\n }\n\n const handleRemove = id => e => {\n e.preventDefault();\n fetch(\"/todos/\" + id, { method: 'DELETE' })\n .then(() => {\n window.location.reload();\n })\n };\n\n return (\n <div className=\"todo-list\" style={{float: \"right\"}}>\n <h2>{title}</h2>\n\n <div className=\"add-todo-button\">\n <button onClick={openTaskForm}>Add a personal task</button>\n </div>\n\n { isPending && <h2>Loading...</h2> }\n\n <div className=\"add-todo-form\">\n { users && <form onSubmit={handleSubmit}>\n <label>Task description [required]</label>\n <textarea value={todo_desc} onChange={(e) => setTodoDesc(e.target.value)} required placeholder=\"Add some awesome description!\" ></textarea>\n <label>Priority level (1: lowest, 4: highest)</label>\n <select value={priority} onChange={(e) => setPriority(e.target.value)} >\n <option value=\"1\">1</option>\n <option value=\"2\">2</option>\n <option value=\"3\">3</option>\n <option value=\"4\">4</option>\n </select>\n <label>When should this task be done by? [required]</label>\n <input\n required\n type=\"date\"\n value={due_date}\n onChange={(e) => setDueDate(e.target.value)}\n />\n <label>Assigned user</label>\n <select value={username} onChange={(e) => setUsername(e.target.value)} >\n {users.map(user => <option value={user.username}>{user.username}</option>)}\n </select>\n <button>Save task</button>\n </form> }\n </div>\n\n <div className=\"personal-todos\">\n {todos.map((todo) => (\n <div className=\"todo-preview\" key={todo.id}>\n <h2>{todo.todo_desc}</h2>\n <h3>Priority level: {todo.priority}</h3>\n <h3>To be done by:{todo.due_date}</h3>\n <button onClick={handleRemove(todo.id)}>Complete</button>\n </div>\n ))}\n </div>\n\n </div>\n );\n\n}\n\nexport default PersonalToDo;","import ProjectList from './ProjectList'\nimport PersonalToDo from './PersonalToDo'\nimport useFetch from './useFetch'\nimport useToken from './useToken';\nimport { useState } from \"react\";\n\nconst Home = () => {\n\n const {data: todos, errorTodos, isPendingTodos} = useFetch(\"/todos\");\n const {setToken, token} = useToken();\n\n const {data: projects, errorRelevantProjects, isPendingRelevantProjects} = useFetch(\"/user_project/username/\" + token);\n\n return (\n <div className=\"home\">\n <h1>Dashboard</h1>\n <div className=\"home-projects\" style={{float: \"left\", width: \"600px\"}}>\n { isPendingRelevantProjects && <h2>Loading...</h2> }\n { projects && <ProjectList projects={projects} title=\"My Projects\"/> }\n </div>\n <div className=\"homeTodos\">\n { isPendingTodos && <h2>Loading...</h2> }\n { todos && <PersonalToDo todos={todos.filter(todo => todo.username === token)} title=\"My Tasks\"/> }\n </div>\n </div>\n \n );\n}\n \nexport default Home;","import { useState } from \"react\";\nimport { useHistory } from \"react-router-dom\"\nimport Select from 'react-select';\nimport useFetch from './useFetch'\n\nconst CreateProject = () => {\n const [name, setName] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [status, setStatus] = useState(\"Available\");\n const [tag, setTag] = useState(\"Other\");\n const [location, setLocation] = useState(\"\");\n const [files, setFiles] = useState(\"\");\n\n const [selectUsernames, setSelectUsernames] = useState([]);\n\n const history = useHistory();\n\n const { data: users, error, isPending } = useFetch(\"/users/user_project\");\n\n const usernames = users.map(user => user.username);\n\n const handleChange = (e) => {\n setSelectUsernames(Array.isArray(e) ? e.map(x => x.value) : []); \n }\n\n const handleSubmit = async e => {\n e.preventDefault()\n\n const newProject = { name, description, status, tag, location, files };\n\n const response = await fetch(\"/projects\", {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(newProject)\n });\n\n const responseJSON = await response.json();\n\n const project_id = responseJSON.id;\n\n selectUsernames.map(username => {\n const assign_project = { username, project_id };\n\n fetch(\"/user_project\", {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(assign_project)\n });\n });\n\n console.log(users);\n console.log(usernames);\n console.log(selectUsernames);\n history.push(\"/\");\n }\n\n return (\n <div className=\"create-project\">\n <h2>Add a new project</h2>\n <form onSubmit={handleSubmit}>\n <label>Project name [required]</label>\n <input\n type=\"text\"\n required\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder=\"Input project name\"\n />\n <label>Description [required]</label>\n <textarea required placeholder=\"Add some awesome description!\" value={description} onChange={(e) => setDescription(e.target.value)}></textarea>\n <label>Status</label>\n <select value={status} onChange={(e) => setStatus(e.target.value)}>\n <option value=\"Progress\">Progress</option>\n <option value=\"Available\">Available</option>\n <option value=\"Completed\">Completed</option>\n </select>\n <label>Location</label>\n <input\n type=\"text\"\n value={location}\n onChange={(e) => setLocation(e.target.value)}\n placeholder=\"Eg: United Kingdom\"\n />\n <label>Type of project [required]</label>\n <select required value={tag} onChange={(e) => setTag(e.target.value)}>\n <option value=\"Social\">Social</option>\n <option value=\"Education\">Education</option>\n <option value=\"Wash\">Wash</option>\n <option value=\"Environment\">Environment</option>\n <option value=\"Health\">Health</option>\n <option value=\"Other\">Other</option>\n </select>\n <label>Volunteers assigned to this project</label>\n <Select\n className=\"dropdown\"\n placeholder=\"Select Users\"\n value={users.filter(user => selectUsernames.includes(user.value))}\n options={users} // set list of the usernames\n onChange={handleChange} // assign onChange function\n isMulti\n isClearable\n />\n {/* <select multiple={true} onChange={(e) => setSelectUsernames(selectUsernames.concat(e.target.value))} value={selectUsernames} >\n {users.map(user => <option value={user.username}>{user.firstname} {user.surname}</option>)}\n </select> */}\n <label>Google Drive folder</label>\n <textarea placeholder=\"Copy the link to the Google Drive folder for this project\" value={files} onChange={(e) => setFiles(e.target.value)}></textarea>\n <button>Add project</button>\n </form>\n </div>\n );\n}\n\n\nexport default CreateProject;","import { useHistory, useParams } from 'react-router';\nimport useFetch from './useFetch'\nimport { Link } from \"react-router-dom\"\n\nconst ProjectDetails = () => {\n const { id } = useParams();\n const history = useHistory();\n\n const { data: project, error, isPending } = useFetch(\"/projects/\" + id)\n const { data: assignments, errorAssignment, isPendingAssignment } = useFetch(\"/user_project/project/\" + id)\n\n const handleRemove = e => {\n e.preventDefault()\n fetch(\"/projects/\" + id, { method: 'DELETE' })\n .then(() => { history.push('/'); })\n };\n\n return (\n <div className=\"project-details\">\n {isPending && <h2>Loading...</h2>}\n {project && <h2>{project.name}</h2>}\n {project && <button style={{\n fontSize: '20px',\n color: '#fff',\n marginBottom: '30px',\n marginright: '10px',\n borderRadius: '8px',\n backgroundColor: '#f1b535'\n }}>Status: {project.status}</button>}\n {project && <button style={{\n fontSize: '20px',\n color: '#fff',\n marginBottom: '30px',\n marginRight: '10px',\n borderRadius: '8px',\n backgroundColor: '#595bc0'\n }}>{project.tag}</button>}\n {project && <h4>Location: {project.location}</h4>}\n {project && <button onClick={(e) => {\n e.preventDefault();\n window.open(project.files, \"_blank\");\n }}>Documents</button>}\n {project && <p>{project.description}</p>}\n\n <h3>Volunteers working on this project</h3>\n <div className=\"project_user_assignment_list\">\n {assignments.map(a => (\n <div className=\"assigned_users_preview\" style={{float: \"left\", width: \"50%\"}} key={a.id}>\n <Link to={`/users/${a.username}`}>\n <h4>{a.username}</h4>\n </Link>\n </div>)\n )\n }\n </div>\n\n <div className=\"project-tasks\">\n {project && <Link to={`/projects/${project.id}/tasks`} className=\"view-tasks-button\">View Tasks</Link>}\n\n {project && <Link to={`/projects/${project.id}/add-task`} className=\"add-task-button\">Add Task</Link>}\n </div>\n\n <div>\n {project && <button onClick={handleRemove}>Delete project</button>}\n\n {project && <Link to={`/edit-project/${project.id}`} className=\"edit-project-button\">Edit project</Link>}\n </div>\n\n </div>\n\n );\n}\n\nexport default ProjectDetails;","import { Link } from \"react-router-dom\"\n\nconst PageNotFound = () => {\n return (\n <div className=\"page-not-found\">\n <h2>Something went wrong...</h2>\n <p>That page cannot be found</p>\n <Link to='/'>Back to the main page</Link>\n </div>\n );\n}\n \nexport default PageNotFound;","import { useHistory, useParams } from 'react-router';\nimport useFetch from './useFetch'\nimport useToken from './useToken';\n\nconst MyProfile = () => {\n const {setToken, token} = useToken();\n\n const {data: user, error, isPending} = useFetch(\"/users/\" + token)\n\n return (\n <div className=\"my-profile\">\n { isPending && <h2>Loading...</h2> }\n { user && <h2>{user.firstname + \" \" + user.surname}</h2> }\n { user && <h1>{\"Username: \" + user.token}</h1> }\n { user && <h1>{\"Title: \" + user.title}</h1> }\n { user && <h1>{\"Email: \" + user.email}</h1> }\n { user && <h1>{\"Bio: \" + user.bio}</h1> }\n { user && <h1>{\"Joined: \" + user.joined}</h1> }\n { user && <h1>{\"Location: \" + user.location}</h1> }\n { user && <h1>{\"Availability: \" + user.availability}</h1> }\n { user && <h1>{\"Partnership Opportunities: \" + user.partnership_opportunities}</h1> }\n { user && <h1>{\"Interests: \" + user.interests}</h1> } \n </div>\n );\n}\n\nexport default MyProfile;","import { useHistory, useParams } from 'react-router';\nimport useFetch from './useFetch'\nimport { Link } from \"react-router-dom\"\nimport useToken from './useToken';\n\nconst User = () => {\n const {username} = useParams();\n const history = useHistory();\n const {setToken, token} = useToken();\n \n const {data: user, error, isPending} = useFetch(\"/users/\" + username)\n \n const handleRemove = e => {\n e.preventDefault()\n fetch(\"/users/\" + username, {method: 'DELETE'})\n .then(()=> {history.push('/');})\n };\n\n return (\n <div className=\"user\">\n { isPending && <h2>Loading...</h2> }\n { user && <div>\n <h2>{user.firstname + \" \" + user.surname}</h2>\n </div> }\n\n { user && <div>\n <h3><strong>Username: </strong>{user.username}</h3>\n <h3><strong>Email: </strong>{user.email}</h3> \n <h3><strong>Title: </strong>{user.title}</h3>\n <h3><strong>Joined: </strong>{user.joined}</h3>\n <h3><strong>Location: </strong>{user.location}</h3>\n <h3><strong>Availability: </strong>{user.availability}</h3>\n </div> }\n\n <br />\n\n { user && <div>\n <label><strong>Bio</strong></label>\n <p>{user.bio}</p>\n </div> }\n \n { user && <div>\n <label><strong>Partnership Opportunities</strong></label>\n <p>{user.partnership_opportunities}</p>\n </div> }\n\n { user && <div>\n <label><strong>Interests</strong></label>\n <p>{user.interests}</p>\n </div> }\n\n { user && (token == \"jaimeaguilera\" || username == token) && <button onClick={handleRemove}>Delete user</button> }\n \n { user && (token == \"jaimeaguilera\" || username == token) && <Link to={`/edit-user/${username}`} className=\"edit-user-button\">Edit details</Link> }\n </div>\n );\n}\n \nexport default User;","import { Link } from 'react-router-dom'\n\nconst UserList = ({ users }) => {\n\n return (\n <div className=\"user-list\">\n\n {users.map((user) => (\n <div className=\"preview\" key={user.username}>\n <Link to={`/users/${user.username}`}>\n <h2>{user.username}</h2>\n </Link>\n </div>\n ))}\n </div>\n );\n}\n \nexport default UserList;\n","import UserList from './UserList'\nimport useFetch from './useFetch'\nimport useToken from './useToken'\nimport { Link } from 'react-router-dom'\n\nconst Users = () => {\n\n const {data: users, error, isPending} = useFetch(\"/users\")\n const {setToken, token} = useToken();\n\n return (\n <div className=\"users\">\n <h1>Users</h1>\n { token == \"jaimeaguilera\" && <Link to={`/add-user`} className=\"add-user-button\">Add User</Link> }\n <br />\n <br />\n { isPending && <h2>Loading...</h2> }\n { users && <UserList users={users} title=\"All Users\"/> }\n </div>\n );\n}\n \nexport default Users;","import { useState } from \"react\";\nimport { useHistory } from \"react-router-dom\"\n\n\n\nconst AddUser = () => {\n const [firstname, setFirstname] = useState(\"\");\n const [surname, setSurname] = useState(\"\");\n const [password, setPassword] = useState(\"\");\n const [title, setTitle] = useState(\"\")\n const [email, setEmail] = useState(\"\");\n const [bio, setBio] = useState(\"\");\n const [joined, setJoined] = useState(\"\");\n const [location, setLocation] = useState(\"\");\n const [availability, setAvailability] = useState(\"\");\n const [partnership_opportunities, setPartnership_opportunities] = useState(\"\");\n const [interests, setInterests] = useState(\"\");\n const [username, setUsername] = useState(\"\");\n\n\n const history = useHistory();\n\n const handleSubmit = e => {\n e.preventDefault()\n\n const newUser = {\n firstname,\n surname,\n password,\n title,\n email,\n bio,\n joined,\n location,\n availability,\n partnership_opportunities,\n interests,\n username\n }\n\n fetch(\"/users\", {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(newUser)\n }).then(() => {\n history.push('/users');\n })\n }\n\n return (\n <div className=\"add-user\">\n <h2>Add a new user</h2>\n <form onSubmit={handleSubmit}>\n <label>Username [required]</label>\n <input\n type=\"text\"\n required\n value={username}\n onChange={(e) => setUsername(e.target.value)}\n placeholder=\"Input username here\"\n />\n\n\n <label>Firstname [required]</label>\n <input\n type=\"text\"\n required\n value={firstname}\n onChange={(e) => setFirstname(e.target.value)}\n placeholder=\"Input your first name here\"\n />\n\n <label>Surname [required]</label>\n <input\n type=\"text\"\n required\n value={surname}\n onChange={(e) => setSurname(e.target.value)}\n placeholder=\"Input surname here\"\n />\n\n <label>Title [required]</label>\n <input\n type=\"text\"\n required\n value={title}\n onChange={(e) => setTitle(e.target.value)}\n placeholder=\"State your role at InAGlobe (eg: volunteer)\"\n />\n\n <label>Password [required]</label>\n <input\n type=\"text\"\n required\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n placeholder=\"Input the default password (to be changed by the user)\"\n />\n\n <label>Email [required]</label>\n <input\n type=\"text\"\n required\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n placeholder=\"Input InAGlobe email here\"\n />\n\n\n <label>Bio</label>\n <input\n type=\"text\"\n value={bio}\n onChange={(e) => setBio(e.target.value)}\n placeholder=\"Tell your colleagues a bit about yourself\"\n />\n\n {/* Think about changing type to force date */}\n <label>Joined</label>\n <input\n type=\"text\"\n value={joined}\n onChange={(e) => setJoined(e.target.value)}\n placeholder=\"Eg: 20th April 2020\"\n />\n\n\n <label>Location</label>\n <input\n type=\"text\"\n value={location}\n onChange={(e) => setLocation(e.target.value)}\n placeholder=\"Where are you currently based?\"\n />\n\n <label>Availibility</label>\n <input\n type=\"text\"\n value={availability}\n onChange={(e) => setAvailability(e.target.value)}\n placeholder=\"How available are you approximately per week?\"\n />\n\n <label>Partnership Opportunities</label>\n <input\n type=\"text\"\n value={partnership_opportunities}\n onChange={(e) => setPartnership_opportunities(e.target.value)}\n placeholder=\"Eg: Department of Computing at Imperial College London\"\n />\n\n <label>Interests</label>\n <input\n type=\"text\"\n value={interests}\n onChange={(e) => setInterests(e.target.value)}\n placeholder=\"What are your hobbies?\"\n />\n\n <button>Add user</button>\n </form>\n </div>\n );\n}\n\nexport default AddUser;","import { useState } from \"react\";\nimport { useHistory, useParams } from \"react-router-dom\"\nimport { useForm } from \"react-hook-form\"\nimport useFetch from './useFetch'\n\nconst EditProject = () => {\n const { id } = useParams();\n const { data: {name, description, status, location, tag, files}, error, isPending } = useFetch(\"/projects/\" + id)\n const { data: users, errorUsers, isPendingUsers } = useFetch(\"/users\")\n const [selectUsernames, setSelectUsernames] = useState([]);\n\n const history = useHistory();\n const oldProjectDetails = {\n name: name,\n description: description,\n status: status,\n location: location,\n tag: tag,\n files: files\n }\n \n const { register, handleSubmit } = useForm({\n defaultValues: oldProjectDetails\n });\n\n const onSubmit = e => {\n fetch(\"/projects/\" + id, {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(e)\n }).then(() => {\n selectUsernames.map(username => {\n const assign_project = { username: username, project_id: id };\n\n fetch(\"/user_project\", {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(assign_project)\n });\n });}).then(() => {\n history.push('/');\n })\n }\n\n return (\n <div className=\"edit-project\">\n <h2>Edit project</h2>\n { isPending && <h2>Loading...</h2> }\n { name && <form onSubmit={handleSubmit(onSubmit)}>\n <label htmlFor=\"name\">Project name</label>\n <input {...register(\"name\")}\n // type=\"text\"\n placeholder=\"Insert project name here\"\n // name=\"name\"\n />\n <label>Description</label>\n <textarea {...register(\"description\")} name=\"description\" placeholder=\"Insert description of the project here\"></textarea>\n <label>Status</label>\n <select {...register(\"status\")} name=\"status\">\n <option value=\"Progress\">Progress</option>\n <option value=\"Available\">Available</option>\n <option value=\"Completed\">Completed</option>\n </select>\n <label>Location</label>\n <input\n {...register(\"location\")}\n type=\"text\"\n placeholder=\"Insert location of project here\"\n name=\"location\"\n />\n <label>Type of project</label>\n <select {...register(\"tag\")} name=\"tag\">\n <option value=\"Social\">Social</option>\n <option value=\"Education\">Education</option>\n <option value=\"Wash\">Wash</option>\n <option value=\"Environment\">Environment</option>\n <option value=\"Health\">Health</option>\n <option value=\"Other\">Other</option>\n </select>\n <label>Volunteers assigned to this project</label>\n <select multiple={true} onChange={(e) => setSelectUsernames(selectUsernames.concat(e.target.value))} value={selectUsernames} >\n {users.map(user => <option value={user.username}>{user.firstname} {user.surname}</option>)}\n </select>\n <label>Google Drive folder</label>\n <textarea {...register(\"files\")} name=\"files\" placeholder=\"Insert Google Drive Folder link here\"></textarea>\n <button type=\"submit\">Save project details</button>\n </form> }\n </div>\n );\n}\n\nexport default EditProject;","import React from 'react';\nimport { slide as Menu } from 'react-burger-menu';\nimport { Link, useHistory } from 'react-router-dom'\nimport useToken from './useToken';\n\nconst Sidebar = () => {\n\nconst slackLink = \"https://slack.com/intl/en-gb/\"\n\nconst history = useHistory();\n\nconst {setToken, token} = useToken();\n\nconst handleSignOut = e => {\n e.preventDefault()\n\n localStorage.clear();\n\n window.location.reload();\n history.push(\"/\");\n}\n\nreturn (\n <Menu>\n <div className=\"menu-item\" > \n <Link to={`/`}>Home</Link>\n </div>\n <div className=\"menu-item\" > \n <Link to={`/users/` + token}>Profile</Link>\n </div>\n <div className=\"menu-item\" > \n <Link to={`/users`}>All Users</Link>\n </div>\n <div className=\"menu-item\" > \n <Link to={`/projects`}>All Projects</Link>\n </div>\n <div className=\"menu-item\" > \n <a href={slackLink} target=\"_blank\">Go To Slack</a>\n </div> \n <div className=\"menu-item\" >\n <a style={{textDecoration: \"underline\", cursor: \"pointer\"}} onClick={handleSignOut}>Log Out</a>\n </div> \n </Menu>\n\n);\n\n}\n\nexport default Sidebar;","import { Link, useHistory, useParams } from \"react-router-dom\"\nimport { useForm } from \"react-hook-form\"\nimport useFetch from './useFetch'\n\nconst EditUser = () => {\n const { username } = useParams();\n const { data: {firstname, surname, password, title, email, bio, joined, \n location, availability, partnership_opportunities, interests}, error, isPending } = useFetch(\"/users/\" + username)\n\n const history = useHistory();\n const oldUserDetails = {\n firstname: firstname,\n surname: surname,\n password: password,\n title: title,\n email: email,\n bio: bio,\n joined: joined,\n location: location,\n availability: availability,\n partnership_opportunities: partnership_opportunities,\n interests: interests,\n }\n \n const { register, handleSubmit } = useForm({\n defaultValues: oldUserDetails\n });\n\n const onSubmit = e => {\n fetch(\"/users/\" + username, {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(e)\n }).then(() => {\n history.push('/');\n })\n }\n\n return (\n <div className=\"edit-user\">\n <h2>Edit user</h2>\n { isPending && <h2>Loading...</h2> }\n <Link to={`/users/change-password`}>Change Password</Link>\n { firstname && <form onSubmit={handleSubmit(onSubmit)}>\n <label htmlFor=\"firstname\">Firstname</label>\n <input {...register(\"firstname\")}\n placeholder=\"Input your first name here\"\n />\n\n <label htmlFor=\"surname\">Surname</label>\n <input {...register(\"surname\")}\n placeholder=\"Input surname here\"\n />\n\n <label htmlFor=\"title\">Title</label>\n <input {...register(\"title\")}\n placeholder=\"State your role at InAGlobe (eg: volunteer)\"\n />\n\n <label htmlFor=\"password\">Password</label>\n <input {...register(\"password\")}\n placeholder=\"Input the password\"\n />\n\n <label htmlFor=\"email\">Email</label>\n <input {...register(\"email\")}\n placeholder=\"Input InAGlobe email here\"\n />\n\n\n <label htmlFor=\"bio\">Bio</label>\n <input {...register(\"bio\")}\n placeholder=\"Tell your colleagues a bit about yourself\"\n />\n\n {/* Think about changing type to force date */}\n <label htmlFor=\"joined\">Joined</label>\n <input {...register(\"joined\")}\n placeholder=\"Eg: 20th April 2020\"\n />\n\n\n <label htmlFor=\"location\">Location</label>\n <input {...register(\"location\")}\n placeholder=\"Where are you currently based?\"\n />\n\n <label htmlFor=\"availability\">Availibility</label>\n <input {...register(\"availability\")}\n placeholder=\"How available are you approximately per week?\"\n />\n\n <label htmlFor=\"partnership_opportunities\">Partnership Opportunities</label>\n <input {...register(\"partnership_opportunities\")}\n placeholder=\"Eg: Department of Computing at Imperial College London\"\n />\n\n <label htmlFor=\"interests\">Interests</label>\n <input {...register(\"interests\")}\n placeholder=\"What are your hobbies?\"\n />\n <button type=\"submit\">Save user details</button>\n </form> }\n </div>\n );\n}\n\nexport default EditUser;","import { useState } from \"react\";\nimport { useHistory } from 'react-router';\nconst ProjectTaskList = ({ project_tasks }) => {\n /* pass in filtered dataset containing tasks for a specific project*/\n const history = useHistory();\n const [description, setDescription] = useState(\"\");\n const [priority, setPriority] = useState(1);\n const [due_date, setDueDate] = useState(Date.now);\n const [completed, setCompleted] = useState(\"\");\n const [project_id, setProjectId] = useState(\"\");\n\n const handleComplete = task => e => {\n e.preventDefault();\n console.log(task.id)\n\n setDescription(task.description)\n setPriority(task.priority)\n setDueDate(task.due_date)\n setCompleted(\"Completed\")\n setProjectId(task.project_id)\n const newTask = { description, priority, due_date, completed, project_id }\n\n console.log(newTask)\n\n fetch(\"/projects/\" + task.project_id + \"/tasks/\" + task.id, {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(task)\n }).then(() => {\n window.location.reload();\n })\n \n };\n\n const handleDelete = task => e => {\n e.preventDefault();\n\n fetch(\"/projects/\" + task.project_id + \"/tasks/\" + task.id, {\n method: 'DELETE',\n }).then(() => {\n window.location.reload();\n })\n \n };\n\n return (\n <div className=\"project-tasks-list\">\n {project_tasks.map((task) => (\n <div className=\"project-task-preview\" key={task.id}>\n <div>\n <h2>{task.description}</h2>\n <h3>Due date: {task.due_date}</h3>\n </div>\n \n <h3>Priority: {task.priority}</h3>\n { !task.completed && <button className=\"task-complete-button\" onClick={handleComplete(task)}>Complete</button> }\n <button className=\"task-delete-button\"onClick={handleDelete(task)}>Delete</button>\n </div>\n ))}\n </div>\n );\n}\n \nexport default ProjectTaskList;\n","import { useParams } from 'react-router';\n\nimport ProjectTaskList from './ProjectTaskList'\nimport useFetch from './useFetch'\nimport { Link } from \"react-router-dom\"\n\nconst ProjectTasks = () => {\n const { id } = useParams();\n const { data: project, errorProject, isPendingProject } = useFetch(\"/projects/\" + id)\n\n const { data: project_tasks, errorTasks, isPendingTasks } = useFetch(\"/projects/\" + id + \"/tasks\");\n\n return (\n <div className=\"project-tasks\">\n { project && <h1>{project.name}: tasks</h1>}\n <h2>Ongoing Project Tasks</h2>\n { isPendingTasks && <h2>Loading...</h2> }\n { project_tasks && <ProjectTaskList project_tasks={project_tasks.filter(task => !task.completed)}/> }\n <h2>Completed Project Tasks</h2>\n { project_tasks && <ProjectTaskList project_tasks={project_tasks.filter(task => task.completed)}/> }\n\n <div className=\"add-task-button-wrapper\">\n { project_tasks && <Link to={`/projects/${project.id}/add-task`} className=\"add-task-button\">Add Task</Link> }\n </div>\n </div>\n );\n}\n\nexport default ProjectTasks;","import { useState } from \"react\";\nimport { useHistory } from \"react-router-dom\"\nimport { useParams } from \"react-router\"\nimport useFetch from \"./useFetch\";\n\nconst AddProjectTask = () => {\n const [description, setDescription] = useState(\"\");\n const [due_date, setDueDate] = useState(Date.now);\n const [priority, setPriority] = useState(1);\n const [completed, setCompleted] = useState(false);\n const { id } = useParams();\n const { data: project, error, isPending } = useFetch(\"/projects/\" + id)\n\n\n const history = useHistory();\n\n const handleSubmit = e => {\n e.preventDefault()\n\n const newProjectTask = {\n description,\n due_date,\n priority,\n completed\n }\n\n fetch(\"/projects/\" + project.id + \"/tasks\", {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(newProjectTask)\n }).then(() => {\n history.push('/projects/' + id + '/tasks');\n })\n }\n\n return (\n <div className=\"add-project-task\">\n <h2>Add a new task</h2>\n { isPending && <h2>Loading...</h2> }\n { project && <form onSubmit={handleSubmit}>\n <label>Description</label>\n <input\n type=\"text\"\n required\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n placeholder=\"Input description here\"\n />\n\n\n <label>Due Date [required]</label>\n <input\n type=\"date\"\n required\n value={due_date}\n onChange={(e) => setDueDate(e.target.value)}\n placeholder=\"Input your first name here\"\n />\n\n <label>Priority level (1: lowest, 4: highest) [required]</label>\n <select required value={priority} onChange={(e) => setPriority(e.target.value)} >\n <option value=\"1\">1</option>\n <option value=\"2\">2</option>\n <option value=\"3\">3</option>\n <option value=\"4\">4</option>\n </select>\n\n <label>Status</label>\n <select value={completed} onChange={(e) => setCompleted(e.target.value)}>\n <option value=\"Incomplete\">Available</option>\n <option value=\"Completed\">Completed</option>\n </select>\n <button>Add task</button>\n </form> }\n </div>\n );\n}\n\nexport default AddProjectTask;","import { useState } from 'react';\nimport PropTypes from 'prop-types';\n\nasync function loginUser(credentials) {\n return fetch('/users/login', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(credentials)\n })\n .then(data => data.json())\n }\n\nexport default function Login({ setToken }) {\n const [username, setUserName] = useState();\n const [password, setPassword] = useState();\n\n const handleSubmit = async e => {\n e.preventDefault();\n const token = await loginUser({\n username,\n password\n });\n if(token.token != \"\") {\n setToken(token);\n }\n }\n \n\n return (\n <div className=\"login\">\n <h1> InAGlobe Platform </h1>\n <form onSubmit={handleSubmit}>\n <input type=\"text\" id=\"login\" class=\"fadeIn second\" name=\"login\" placeholder=\"login\"\n onChange={e => setUserName(e.target.value)}/>\n <input type=\"password\" id=\"password\" class=\"fadeIn third\" name=\"login\" placeholder=\"password\"\n onChange={e => setPassword(e.target.value)}/> \n <div className=\"incorrect-password\" style={{display: 'none'}}>\n <h2>Incorrect password!</h2>\n </div>\n <a>Forgot Password?</a>\n <button type=\"submit\">Log In</button>\n </form>\n </div>\n );\n}\n \nLogin.propTypes = {\n setToken: PropTypes.func.isRequired\n}\n","\nimport useToken from './useToken';\nimport { Link, useHistory } from 'react-router-dom'\nimport { useState } from 'react'\n\nconst ChangePassword = () => {\n const [oldPassword, setOldPassword] = useState(\"\");\n const [newPassword, setNewPassword] = useState(\"\");\n const {setToken, token} = useToken()\n const history = useHistory()\n\nasync function passwordUpdate() {\n return fetch('/users/update-password', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n username: token,\n oldPassword: oldPassword,\n newPassword: newPassword})\n })\n .then(data => data.json())\n }\n\n const handleSubmit = async e => {\n e.preventDefault();\n const updated = await passwordUpdate();\n\n if(updated.status != \"True\") {\n document.getElementsByClassName(\"incorrect-password\")[0].style.display = \"block\";\n }\n else{\n document.getElementsByClassName(\"password-changed-msg\")[0].style.display = \"block\";\n }\n }\n \nreturn (\n <div className=\"change-password\">\n <h2>Change Password</h2>\n <label >Current Password</label>\n <input \n onChange={(e) => setOldPassword(e.target.value)}\n placeholder=\"Current Password\"\n />\n\n <label >New Password</label>\n <input \n onChange={(e) => setNewPassword(e.target.value)}\n placeholder=\"New Password\"\n />\n\n <button onClick={handleSubmit}>Change password</button>\n\n <h2 className=\"incorrect-password\" style={{display: \"none\"}}>Incorrect password</h2>\n\n <div className=\"password-changed-msg\" style={{display: \"none\"}}>\n <h3>Your password has been changed successfully</h3>\n <Link to={`/`}>Back to Dashboard</Link>\n </div>\n\n </div>\n \n )\n\n}\n\nexport default ChangePassword;","import ProjectList from './ProjectList'\nimport PersonalToDo from './PersonalToDo'\nimport useFetch from './useFetch'\nimport useToken from './useToken';\n\nconst ProjectRegistry = () => {\n\n const {data: projects, errorProjects, isPendingProjects} = useFetch(\"/projects\")\n\n return (\n <div className=\"project-registry\">\n <h1>All Projects</h1>\n <br />\n { isPendingProjects && <h2>Loading...</h2> }\n { projects && <ProjectList projects={projects} title=\"All Projects\"/> }\n </div>\n \n );\n}\n \nexport default ProjectRegistry;","import React, { useState } from 'react';\nimport {HashRouter as Router, Route, Switch} from 'react-router-dom'\n\nimport Navbar from './Navbar'\nimport Home from './Home'\nimport CreateProject from './CreateProject'\nimport ProjectDetails from './ProjectDetails'\nimport PageNotFound from './PageNotFound'\nimport MyProfile from './MyProfile'\nimport User from './User'\nimport Users from './Users'\nimport AddUser from './AddUser'\nimport EditProject from './EditProject'\nimport Sidebar from './Sidebar' \nimport EditUser from './EditUser'\nimport ProjectTasks from './ProjectTasks'\nimport AddProjectTask from './AddProjectTask'\nimport Login from './Login'\nimport useToken from './useToken';\nimport ChangePassword from './ChangePassword';\nimport ProjectsRegistry from './ProjectsRegistry'\n\nfunction App() {\n\n const { token, setToken } = useToken();\n\n if(!token) {\n return <Login setToken={setToken} />\n }\n\n return (\n <Router>\n <div className=\"App\"> \n <Sidebar />\n <Navbar />\n <div className=\"content\"> \n <Switch>\n <Route exact path=\"/\">\n <Home />\n </Route>\n <Route exact path=\"/create-project\">\n <CreateProject />\n </Route>\n <Route exact path=\"/add-user\">\n <AddUser /> \n </Route>\n <Route exact path=\"/my-profile\">\n <MyProfile />\n </Route>\n <Route exact path=\"/users\">\n <Users /> \n </Route>\n <Route exact path=\"/users/change-password\">\n <ChangePassword />\n </Route> \n <Route exact path=\"/users/:username\">\n <User />\n </Route>\n <Route exact path=\"/edit-user/:username\">\n <EditUser />\n </Route> \n <Route exact path=\"/projects\">\n <ProjectsRegistry /> \n </Route> \n <Route exact path=\"/projects/:id/add-task\">\n <AddProjectTask /> \n </Route> \n <Route exact path=\"/projects/:id/tasks\">\n <ProjectTasks /> \n </Route>\n <Route exact path=\"/projects/:id\">\n <ProjectDetails />\n </Route>\n <Route exact path=\"/edit-project/:id\">\n <EditProject />\n </Route>\n <Route path=\"*\">\n <PageNotFound />\n </Route>\n </Switch>\n </div>\n </div>\n </Router>\n );\n}\n\nexport default App;\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n <React.StrictMode>\n <App />\n </React.StrictMode>,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""} \ No newline at end of file diff --git a/backend/templates/index.html b/backend/templates/index.html index fb641a4..edc3a5a 100644 --- a/backend/templates/index.html +++ b/backend/templates/index.html @@ -1 +1 @@ -<!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>React App</title><script>window.token="{{DRP_token}}"</script><link href="/static/react/css/main.893b1949.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.92bb91cc.chunk.js"></script><script src="/static/react/js/main.52682509.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>React App</title><script>window.token="{{DRP_token}}"</script><link href="/static/react/css/main.893b1949.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.92bb91cc.chunk.js"></script><script src="/static/react/js/main.e896a0a2.chunk.js"></script></body></html> \ No newline at end of file diff --git a/frontend/src/User.js b/frontend/src/User.js index dd7dd92..f13f6a9 100644 --- a/frontend/src/User.js +++ b/frontend/src/User.js @@ -49,9 +49,9 @@ const User = () => { <p>{user.interests}</p> </div> } - { user && (username == "jaimeaguilera" || username == token) && <button onClick={handleRemove}>Delete user</button> } + { user && (token == "jaimeaguilera" || username == token) && <button onClick={handleRemove}>Delete user</button> } - { user && (username == "jaimeaguilera" || username == token) && <Link to={`/edit-user/${username}`} className="edit-user-button">Edit details</Link> } + { user && (token == "jaimeaguilera" || username == token) && <Link to={`/edit-user/${username}`} className="edit-user-button">Edit details</Link> } </div> ); } -- GitLab