Commit c95d4c42 authored by Mathias Engelbrecht Pilegård's avatar Mathias Engelbrecht Pilegård
Browse files

added ability to update user profile data through http requests

parent 7f0c1ae3
[{"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\index.js":"1","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\App.jsx":"2","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\config.js":"3","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useMessages.jsx":"4","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useInput.jsx":"5","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\Login.jsx":"6","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\Messages\\Messages.jsx":"7","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\ReportForm.jsx":"8","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\Home.jsx":"9","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\ProjectInfo.jsx":"10","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectOverview\\ProjectOverview.jsx":"11","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamInfo\\TeamInfo.jsx":"12","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamOverview\\TeamOverview.jsx":"13","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\assign\\Assign.jsx":"14","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\updates\\Updates.jsx":"15","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activitiesDisplay\\ActivitiesDisplay.jsx":"16","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activityChart\\ActivityChart.jsx":"17","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\Navbar.jsx":"18","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\logo\\Logo.jsx":"19","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\navLinks\\NavLinks.jsx":"20","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\searchbar\\Searchbar.jsx":"21","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\dropdownMenu\\NavbarDropdownMenu.jsx":"22","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\account\\Account.jsx":"23","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\signUp\\SignUp.jsx":"24","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\passwordReset\\PasswordForgotModal.jsx":"25","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\messageModal\\MessageModal.jsx":"26","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\confirmRemoveAccountModal\\ConfirmRemoveAccountModal.jsx":"27"},{"size":285,"mtime":1628516023915,"results":"28","hashOfConfig":"29"},{"size":2100,"mtime":1630074941213,"results":"30","hashOfConfig":"29"},{"size":538,"mtime":1630351419891,"results":"31","hashOfConfig":"29"},{"size":1489,"mtime":1629790769379,"results":"32","hashOfConfig":"29"},{"size":324,"mtime":1629371594261,"results":"33","hashOfConfig":"29"},{"size":2713,"mtime":1630270705373,"results":"34","hashOfConfig":"29"},{"size":626,"mtime":1628697746462,"results":"35","hashOfConfig":"29"},{"size":3967,"mtime":1628695632288,"results":"36","hashOfConfig":"29"},{"size":1279,"mtime":1630089091700,"results":"37","hashOfConfig":"29"},{"size":1068,"mtime":1628696051327,"results":"38","hashOfConfig":"29"},{"size":3660,"mtime":1629794572456,"results":"39","hashOfConfig":"29"},{"size":2374,"mtime":1628696187694,"results":"40","hashOfConfig":"29"},{"size":2694,"mtime":1628696113184,"results":"41","hashOfConfig":"29"},{"size":3264,"mtime":1628535700010,"results":"42","hashOfConfig":"29"},{"size":2334,"mtime":1630060568411,"results":"43","hashOfConfig":"29"},{"size":2096,"mtime":1628430812599,"results":"44","hashOfConfig":"29"},{"size":3570,"mtime":1628430832688,"results":"45","hashOfConfig":"29"},{"size":906,"mtime":1630073002522,"results":"46","hashOfConfig":"29"},{"size":548,"mtime":1628421916010,"results":"47","hashOfConfig":"29"},{"size":697,"mtime":1628430740299,"results":"48","hashOfConfig":"29"},{"size":470,"mtime":1628430752153,"results":"49","hashOfConfig":"29"},{"size":3533,"mtime":1630069281308,"results":"50","hashOfConfig":"29"},{"size":4590,"mtime":1630353798924,"results":"51","hashOfConfig":"29"},{"size":4940,"mtime":1630212726060,"results":"52","hashOfConfig":"29"},{"size":3623,"mtime":1630354196170,"results":"53","hashOfConfig":"29"},{"size":546,"mtime":1630352571382,"results":"54","hashOfConfig":"29"},{"size":1907,"mtime":1630356326831,"results":"55","hashOfConfig":"29"},{"filePath":"56","messages":"57","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},"iyhzrm",{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"61","messages":"62","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"63","messages":"64","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"65","usedDeprecatedRules":"58"},{"filePath":"66","messages":"67","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"68"},{"filePath":"69","messages":"70","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"71","usedDeprecatedRules":"58"},{"filePath":"72","messages":"73","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"74","messages":"75","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"76","usedDeprecatedRules":"58"},{"filePath":"77","messages":"78","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"79","messages":"80","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"81","messages":"82","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"83","usedDeprecatedRules":"58"},{"filePath":"84","messages":"85","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"86","usedDeprecatedRules":"58"},{"filePath":"87","messages":"88","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"89","usedDeprecatedRules":"58"},{"filePath":"90","messages":"91","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"92","usedDeprecatedRules":"58"},{"filePath":"93","messages":"94","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"95","usedDeprecatedRules":"58"},{"filePath":"96","messages":"97","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"98","usedDeprecatedRules":"58"},{"filePath":"99","messages":"100","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"101","messages":"102","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"103","usedDeprecatedRules":"58"},{"filePath":"104","messages":"105","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"106","usedDeprecatedRules":"58"},{"filePath":"107","messages":"108","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"109","messages":"110","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"111","messages":"112","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"113","usedDeprecatedRules":"58"},{"filePath":"114","messages":"115","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"118","usedDeprecatedRules":"58"},{"filePath":"119","messages":"120","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"121","messages":"122","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"123","messages":"124","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\index.js",[],["125","126"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\App.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\config.js",["127"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useMessages.jsx",["128"],"import { useState, useEffect } from 'react';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\n\r\nimport config from \"../config\"\r\n\r\nconst useMessages = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [messages, setMessages] = useState(null);\r\n\r\n // fetch messages\r\n useEffect(() => {\r\n if (authState && authState.isAuthenticated) {\r\n const accessToken = oktaAuth.getAccessToken();\r\n fetch(config.serviceAPI.messagesURL, {\r\n method: 'GET',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n })\r\n .then((response) => {\r\n if (!response.ok) {\r\n return Promise.reject();\r\n }\r\n return response.json();\r\n })\r\n .then((data) => {\r\n let index = 0;\r\n const formattedMessages = data.messages.map((message) => {\r\n const date = new Date(message.date);\r\n const day = date.toLocaleDateString();\r\n const time = date.toLocaleTimeString();\r\n index += 1;\r\n return {\r\n date: `${day} ${time}`,\r\n sender: message.sender,\r\n text: message.text,\r\n id: `message-${index}`,\r\n };\r\n });\r\n setMessages(formattedMessages);\r\n })\r\n .catch((err) => {\r\n /* eslint-disable no-console */\r\n console.error(err);\r\n });\r\n }\r\n }, [authState]);\r\n\r\n return messages\r\n}\r\n\r\nexport default useMessages","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useInput.jsx",[],["129","130"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\Login.jsx",["131","132","133","134","135","136"],"import React, { useState, useEffect, useRef } from 'react';\r\nimport { Redirect } from 'react-router-dom'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./Login.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { NavLink } from 'react-router-dom';\r\nimport signUp from './signUp/SignUp';\r\nimport config from '../../config';\r\nimport SignUp from './signUp/SignUp';\r\nimport PasswordForgotModal from './passwordReset/PasswordForgotModal';\r\n\r\nconst Login = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState()\r\n\r\n const [username, setUsername] = useState('');\r\n const [password, setPassword] = useState('');\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n password: `${password}`\r\n })\r\n\r\n const loginRequestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSignInFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n oktaAuth.signInWithCredentials({ username, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n };\r\n\r\n if (sessionToken) {\r\n // Hide form while sessionToken is converted into id/access tokens\r\n return null;\r\n }\r\n\r\n if (!authState || !authState.isAuthenticated) {\r\n return (\r\n <div className=\"pageContainer\">\r\n <SignUp />\r\n\r\n <div className=\"signInForm\">\r\n <h2>Sign in to PipIt</h2>\r\n <form onSubmit={handleSignInFormSubmit}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"username\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign in&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"sign-in-alt\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <PasswordForgotModal />\r\n </div>\r\n </div>\r\n )\r\n } else {\r\n return <Redirect to=\"/home\" />\r\n }\r\n}\r\n\r\nexport default Login","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\Messages\\Messages.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\ReportForm.jsx",["137"],"import React, { useState } from 'react'\r\nimport \"./ReportForm.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport Assign from './assign/Assign'\r\n\r\nconst ReportForm = () => {\r\n return (\r\n <div className=\"page-content-container\">\r\n <h2 className=\"reportissuePageText\">Report an issue</h2>\r\n <form action=\"/reportFormData\">\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueType\">Type of issue</label>\r\n </div>\r\n <div className=\"col-75\">\r\n <select id=\"fissueType\" className=\"issueType\">\r\n <option value=\"bug\">Bug</option>\r\n <option value=\"usabilityissue\">Usability error</option>\r\n <option value=\"other\">Other</option>\r\n </select>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-25\">\r\n <label for=\"fissueLocation\">Where did you encounter the issue?</label>\r\n </div>\r\n <div class=\"col-75\">\r\n <input type=\"text\" id=\"fissueLocation\" className=\"issueLocation\" ></input>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-25\">\r\n <label for=\"fissueDescription\">Describe the issue</label>\r\n </div>\r\n <div class=\"col-75\">\r\n <textarea id=\"fissueDescription\" className=\"issueDescription\"></textarea>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-25\">\r\n <label for=\"fissueStepsToTeproduce\">What steps did you take before the issue happened?</label>\r\n </div>\r\n <div class=\"col-75\">\r\n <textarea id=\"fissueStepsToTeproduce\" className=\"issueStepsToReproduce\"\r\n placeholder=\"List the steps that occurred before the issue happened:\r\n1.\r\n2.\r\n3.\r\nExpected Result:\r\nActual Result:\">\r\n </textarea>\r\n </div>\r\n </div>\r\n\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueSeverity\">Severity level</label>\r\n </div>\r\n <div className=\"col-75\">\r\n <select id=\"fissueSeverity\" className=\"issueSeverity\">\r\n <option value=\"cosmetic\">Cosmetic - should be corrected when time permits</option>\r\n <option value=\"serious\">Serious - should be corrected in the next release</option>\r\n <option value=\"critical\">Critical - should be corrected as soon as possible</option>\r\n </select>\r\n </div>\r\n </div>\r\n\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueTimeToCorrect\">Time to Correct</label>\r\n </div>\r\n <div className=\"col-75\">\r\n <select id=\"fissueSeverity\" className=\"issueTimeToCorrect\">\r\n <option value=\"lessThanTwoHours\">Less than 2 minutes</option>\r\n <option value=\"lessThanOneToTwoDays\">Less than 1 or 2 days</option>\r\n <option value=\"lessThanOneToTwoWeeks\">Less than 1 or 2 weeks</option>\r\n <option value=\"atLeastTwoWeeks\">More than 2 weeks</option>\r\n </select>\r\n </div>\r\n </div>\r\n\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueAssignToProject\">Assign to</label>\r\n </div>\r\n <div className=\"col-75\">\r\n {/*\r\n <select id=\"fissueAssignToProject\" className=\"issueAssignToProject\">\r\n <option value=\"lessThanTwoHours\">Henriks meme machine - ReactApp</option>\r\n </select>\r\n */}\r\n <Assign />\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row\">\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </form>\r\n </div >\r\n )\r\n}\r\n\r\nexport default ReportForm","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\Home.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\ProjectInfo.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectOverview\\ProjectOverview.jsx",["138","139"],"import React, { useState } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport \"./ProjectOverview.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst ProjectOverview = () => {\r\n const personalProjects = [\r\n { id: \"MyApp\", type: \"personal\" },\r\n { id: \"MyOtherApp\", type: \"personal\" }\r\n ]\r\n\r\n const sharedProjects = [\r\n { id: \"ReactApp\", type: \"shared\", teams: [{ name: \"Henriks Meme Machine\" }, { name: \"Teskeholdet\" }] },\r\n { id: \"Very big ReactApp\", type: \"shared\", teams: [{ name: \"Aubergine\" }] }\r\n ]\r\n\r\n const [sharedProjectsButtonState, setSharedProjectsButtonState] = useState(true);\r\n const [personalProjectsButtonState, setPersonalProjectsButtonState] = useState(false);\r\n\r\n const SharedProjectsButtonActive = () => {\r\n setSharedProjectsButtonState(true);\r\n setPersonalProjectsButtonState(false);\r\n };\r\n\r\n const PersonalProjectsButtonActive = () => {\r\n setSharedProjectsButtonState(false);\r\n setPersonalProjectsButtonState(true);\r\n };\r\n\r\n const ProjectsDisplay = (projects) => {\r\n return (\r\n <div className=\"projectlist\">\r\n <ul>\r\n {projects.map((elements, index) => (\r\n <li>\r\n <div className=\"project-entry\">\r\n <div className=\"project-team-name\">\r\n <NavLink to={`/${projects[index].id}`}>{projects[index].id}&nbsp;\r\n <FontAwesomeIcon className=\"icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </NavLink>\r\n </div>\r\n <div className=\"project-status-info-container\">\r\n <div className=\"new-issues-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"bug\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Total issues</span>\r\n </div>\r\n <div className=\"issues-solved-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"check\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Issues solved</span>\r\n </div>\r\n <div className=\"last-updated-info\">\r\n <p>Last updated: &nbsp;1 day ago</p>\r\n </div>\r\n </div>\r\n </div>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"projectlist-title\">Your Projects</h2>\r\n <button className=\"create-new-project-button\">\r\n New Project\r\n </button>\r\n </div>\r\n <div className=\"project-sort-menu-container\">\r\n <div className=\"personal-shared-projects-container\">\r\n <a className={sharedProjectsButtonState ? \"activeUnderlined\" : \"inactive\"} onClick={SharedProjectsButtonActive}>Shared Projects</a>\r\n <a className={personalProjectsButtonState ? \"activeUnderlined\" : \"inactive\"} onClick={PersonalProjectsButtonActive}>Personal Projects</a>\r\n </div>\r\n <div className=\"project-sort-select-container\">\r\n <p>Sort by:</p>\r\n <select>\r\n <option>Last updated</option>\r\n <option>Last created</option>\r\n <option>Name</option>\r\n <option>Name descending</option>\r\n <option>Oldest created</option>\r\n <option>Oldest updated</option>\r\n </select>\r\n </div>\r\n </div>\r\n {sharedProjectsButtonState ? ProjectsDisplay(sharedProjects) : ProjectsDisplay(personalProjects)}\r\n </div >\r\n )\r\n}\r\n\r\nexport default ProjectOverview","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamInfo\\TeamInfo.jsx",["140"],"import React, { useRef, useState, useEffect } from 'react'\r\nimport \"./TeamInfo.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\n\r\nconst TeamInfo = () => {\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"teamInformationPage-content-header\">\r\n <div className=\"header-text\">\r\n <h2 className=\"teamInformationPage-title\">Henriks Meme machine > overview</h2>\r\n </div>\r\n <div className=\"header-notification-select-settings-button-container\">\r\n <div className=\"notification-button-container\">\r\n <button className={`notification-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"bell-icon\" icon=\"bell\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <a>\r\n <FontAwesomeIcon icon=\"user\"></FontAwesomeIcon>&nbsp;&nbsp;Account\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n <div className=\"settings-button-container\">\r\n <button>\r\n <FontAwesomeIcon icon=\"cog\"></FontAwesomeIcon>\r\n &nbsp;Settings\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div className=\"teamInformationPage-content-container\">\r\n {/*TODO: components goes here */}\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default TeamInfo","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamOverview\\TeamOverview.jsx",["141","142"],"import React from 'react'\r\nimport { NavLink } from 'react-router-dom'\r\nimport \"./TeamOverview.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst TeamOverview = () => {\r\n\r\n const personalProjects = [\r\n { id: \"MyApp\", type: \"personal\" },\r\n { id: \"MyOtherApp\", type: \"personal\" }\r\n ]\r\n\r\n const sharedProjects = [\r\n { id: \"ReactApp\", type: \"shared\", teams: [{ name: \"Henriks Meme Machine\" }, { name: \"Teskeholdet\" }] },\r\n { id: \"Very big ReactApp\", type: \"shared\", teams: [{ name: \"Aubergine\" }] }\r\n ]\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"teamlist-title\">Teams</h2>\r\n <div className=\"buttons-container\">\r\n <button className=\"join-team-button\">\r\n Join Team\r\n </button>\r\n <button className=\"create-new-team-button\">\r\n New team\r\n </button>\r\n </div>\r\n </div>\r\n <div className=\"teamlist\">\r\n <ul>\r\n <li>\r\n <div className=\"team-entry\">\r\n <div className=\"image-team-name\">\r\n <NavLink to=\"/HenriksMemeMachine\" className=\"team-image-container\">\r\n <FontAwesomeIcon className=\"team-icon\" icon=\"dice-d6\"></FontAwesomeIcon>\r\n </NavLink>\r\n <NavLink to=\"/HenriksMemeMachine\">Henriks meme machine - ReactApp&nbsp;\r\n <FontAwesomeIcon className=\"icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </NavLink>\r\n </div>\r\n <div className=\"team-status-info-container\">\r\n <div className=\"new-messages-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"envelope\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">New messages</span>\r\n </div>\r\n <div className=\"projects-maintained-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"project-diagram\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Projects maintained</span>\r\n </div>\r\n <div className=\"team-members-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"users\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Team members</span>\r\n </div>\r\n <div className=\"last-updated-info\">\r\n <p>Date created: &nbsp;21/ 07/ 2021</p>\r\n </div>\r\n </div>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </div >\r\n )\r\n}\r\n\r\nexport default TeamOverview","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\assign\\Assign.jsx",["143","144","145","146","147","148"],"import React, { useState } from 'react'\r\nimport \"./Assign.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst Assign = () => {\r\n const personalProjects = [\r\n { id: \"MyApp\", type: \"personal\" },\r\n { id: \"MyOtherApp\", type: \"personal\" }\r\n ]\r\n\r\n const sharedProjects = [\r\n { id: \"ReactApp\", type: \"shared\", teams: [{ name: \"Henriks Meme Machine\" }, { name: \"Teskeholdet\" }] },\r\n { id: \"Very big ReactApp\", type: \"shared\", teams: [{ name: \"Aubergine\" }] }\r\n ]\r\n\r\n\r\n const rootDirectoryObjects = [\r\n { id: \"Personal projects\" },\r\n { id: \"Shared projects\" }\r\n ]\r\n\r\n const DirectoryItems = () => {\r\n return (\r\n <div className=\"multi-level\">\r\n <div className=\"item\">\r\n <input type=\"checkbox\" id=\"A\" />\r\n <label for=\"A\">\r\n <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n <a>&nbsp; {rootDirectoryObjects[0].id} &nbsp;</a>\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </label>\r\n\r\n <ul>\r\n {personalProjects.map((elements, index) => (\r\n <li className=\"personalProjectsItem\">\r\n <input type=\"checkbox\" id={`A-${index}`} />\r\n <label for={`A-${index}`}>\r\n <FontAwesomeIcon icon=\"angle-right\" className=\"project-icon\"></FontAwesomeIcon>\r\n <a>&nbsp; {personalProjects[index].id} &nbsp;</a>\r\n </label>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n\r\n <div className=\"item\">\r\n <input type=\"checkbox\" id=\"B\" />\r\n <label for=\"B\">\r\n <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n <a>&nbsp; {rootDirectoryObjects[1].id} &nbsp;</a>\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </label>\r\n\r\n <ul>\r\n {sharedProjects.map((elements, index) => (\r\n <li><div className=\"sub-item\">\r\n <input type=\"checkbox\" id={`B-${index}`} />\r\n <label for={`B-${index}`}>\r\n <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n <a>&nbsp; {sharedProjects[index].id} &nbsp;</a>\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </label>\r\n\r\n <ul>\r\n {sharedProjects[index].teams.map(team => (\r\n <li><div className=\"team-item\">\r\n <input type=\"checkbox\" id={`team-${team.name}`} />\r\n <label for={`team-${team.name}`}>\r\n <FontAwesomeIcon icon=\"users\" className=\"users-icon\"></FontAwesomeIcon>\r\n <a>&nbsp; {team.name} &nbsp;</a>\r\n </label>\r\n </div>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"assignSelectContainer\">\r\n <DirectoryItems />\r\n </div >\r\n )\r\n}\r\n\r\nexport default Assign","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\updates\\Updates.jsx",["149","150","151","152"],"import React from 'react'\r\nimport \"./Updates.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport useMessages from '../../../util/useMessages'\r\n\r\nconst Updates = () => {\r\n const messages = useMessages()\r\n\r\n return (\r\n <div className=\"project-updates-new-messages-container\">\r\n\r\n <div className=\"project-updates-display-container\">\r\n <div className=\"project-updates-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"exclamation\"></FontAwesomeIcon>\r\n &nbsp;&nbsp;New project updates\r\n </p>\r\n </div>\r\n <div className=\"project-updates-display-content\">\r\n <div className=\"project-update-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [project] [new issues] [issues fixed]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [team] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"new-messages-display-container\">\r\n <div className=\"new-messages-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>\r\n &nbsp;&nbsp;New messages\r\n </p>\r\n </div>\r\n {messages ? messages.map((message) => (\r\n <div className=\"new-messages-display-content\">\r\n <div className=\"new-message-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [{message.sender}] [{message.id}]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [team] [{message.date}]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n )) : \"Loading messages\"}\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default Updates","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activitiesDisplay\\ActivitiesDisplay.jsx",["153","154","155","156"],"import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport React from 'react'\r\nimport \"./ActivitiesDisplay.css\"\r\n\r\nconst ActivitiesDisplay = () => {\r\n return (\r\n <div className=\"activity-new-issues-display-container\">\r\n\r\n <div className=\"new-issues-display-container\">\r\n <div className=\"new-issues-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"inbox\"></FontAwesomeIcon>\r\n &nbsp;&nbsp;New issue reports\r\n </p>\r\n </div>\r\n <div className=\"new-issues-display-content\">\r\n <div className=\"new-issue-report-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [Severity] [type]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [project] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"activity-display-container\">\r\n <div className=\"activity-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"sticky-note\"></FontAwesomeIcon>\r\n &nbsp;&nbsp;Recent Team activities\r\n </p>\r\n </div>\r\n <div className=\"activity-display-content\">\r\n <div className=\"new-issue-report-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [Name] [action]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [project] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ActivitiesDisplay","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activityChart\\ActivityChart.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\Navbar.jsx",["157"],"import React from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./Navbar.css\"\r\nimport Logo from './logo/Logo'\r\nimport NavLinks from './navLinks/NavLinks'\r\nimport Searchbar from './searchbar/Searchbar'\r\nimport NavbarDropdownMenu from './dropdownMenu/NavbarDropdownMenu'\r\n\r\nconst Navbar = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n\r\n if (!authState || !authState.isAuthenticated) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className=\"navbar\" >\r\n <div className=\"header-content\">\r\n <div className=\"title-navigation-links-container\">\r\n <Logo />\r\n <NavLinks />\r\n </div>\r\n <div className=\"searchbar-profile-container\">\r\n <ul className=\"right-unstyled-navbar\">\r\n <Searchbar />\r\n <NavbarDropdownMenu />\r\n </ul>\r\n </div>\r\n </div>\r\n </div >\r\n )\r\n}\r\n\r\nexport default Navbar","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\logo\\Logo.jsx",["158","159"],"import React from 'react'\r\nimport { NavLink } from 'react-router-dom'\r\nimport \"./Logo.css\"\r\nimport logo_picture from \"../../../images/bird-logo.jpg\"\r\nimport logo_text from \"../../../images/logo-text.jpg\"\r\n\r\nconst Logo = () => {\r\n return (\r\n <h1 className=\"title\">\r\n <span className=\"title-icon\">\r\n <NavLink to=\"/home\" id=\"logo\">\r\n <img src={logo_picture} width=\"24\" height=\"24\"></img>\r\n <img src={logo_text} width=\"48\" height=\"24\"></img>\r\n </NavLink>\r\n </span>\r\n </h1>\r\n )\r\n}\r\n\r\nexport default Logo","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\navLinks\\NavLinks.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\searchbar\\Searchbar.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\dropdownMenu\\NavbarDropdownMenu.jsx",["160"],"import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const logout = () => {\r\n oktaAuth.signOut()\r\n }\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <NavLink to=\"/account\" onClick={onClick} className=\"top-item\">\r\n <div>\r\n <FontAwesomeIcon icon=\"user\" className=\"item-icon-top\"></FontAwesomeIcon>&nbsp;&nbsp;\r\n </div>\r\n <div className=\"item-top-text\">\r\n <span>\r\n <p className=\"top-row\">Account</p>\r\n <p className=\"bottom-row\">{userInfo ? userInfo.email : \"...\"}</p>\r\n </span>\r\n </div>\r\n <div className=\"item-last-flex-item\">\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"item-icon-top\"></FontAwesomeIcon>\r\n </div>\r\n </NavLink>\r\n </li>\r\n <li>\r\n <NavLink to=\"/messages\" onClick={onClick}>\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>&nbsp;&nbsp;Messages\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </NavLink>\r\n </li>\r\n {/* <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li> */}\r\n <li>\r\n <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\account\\Account.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\signUp\\SignUp.jsx",["161","162"],"import React, { useState, useEffect, useRef } from 'react'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport config from '../../../config';\r\nimport \"./SignUp.css\"\r\n\r\nconst SignUp = () => {\r\n const [signUpFormVisibilityState, showSignUpForm] = useState(false)\r\n const signUpFormRef = useRef(null);\r\n const toggleSignUpFormVisible = () => showSignUpForm(!signUpFormVisibilityState)\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\r\n toggleSignUpFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (signUpFormVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [signUpFormVisibilityState]);\r\n\r\n const [firstname, setfirstname] = useState('')\r\n const [lastname, setlastname] = useState('')\r\n const [username, setUsername] = useState('');\r\n const [password, setPassword] = useState('');\r\n const [confirmPassword, setConfirmPassword] = useState('');\r\n\r\n const userInputData = JSON.stringify({\r\n firstname: `${firstname}`,\r\n lastname: `${lastname}`,\r\n email: `${username}`,\r\n password: `${password}`\r\n })\r\n\r\n const loginRequestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handlefirstnameChange = (e) => {\r\n setfirstname(e.target.value)\r\n }\r\n\r\n const handlelastnameChange = (e) => {\r\n setlastname(e.target.value)\r\n }\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n const handleConfirmPasswordChange = (e) => {\r\n setConfirmPassword(e.target.value)\r\n }\r\n\r\n const handleSignUpFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n if (!password || !confirmPassword) {\r\n window.alert(\"A password field is blank\")\r\n return\r\n }\r\n\r\n if (!(confirmPassword.length >= 7)) {\r\n window.alert(\"Password must consist of 8 characters or more\")\r\n return\r\n }\r\n\r\n if (!(password == confirmPassword)) {\r\n window.alert(\"Passwords fo not match\")\r\n return\r\n }\r\n\r\n else {\r\n fetch(config.serviceAPI.createNewUserURL, loginRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n // handleSignInFormSubmit(e)\r\n }\r\n })\r\n }\r\n }\r\n\r\n return (\r\n <div className=\"signUpContainer\">\r\n <div className={`modal ${signUpFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={signUpFormRef} className=\"modal-content\">\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSignUpFormSubmit}>\r\n <label>\r\n First name:\r\n <input\r\n id=\"firstname\" type=\"text\"\r\n value={firstname}\r\n onChange={handlefirstnameChange} />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n id=\"lastname\" type=\"text\"\r\n value={lastname}\r\n onChange={handlelastnameChange} />\r\n </label>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <label>\r\n Confirm Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={confirmPassword}\r\n onChange={handleConfirmPasswordChange} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n <button className=\"signUpForm-show-button\" onClick={toggleSignUpFormVisible}>\r\n Sign up\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default SignUp\r\n","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\passwordReset\\PasswordForgotModal.jsx",["163","164"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\messageModal\\MessageModal.jsx",["165"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\confirmRemoveAccountModal\\ConfirmRemoveAccountModal.jsx",["166"],{"ruleId":"167","replacedBy":"168"},{"ruleId":"169","replacedBy":"170"},{"ruleId":"171","severity":1,"message":"172","line":1,"column":1,"nodeType":"173","endLine":15,"endColumn":3},{"ruleId":"174","severity":1,"message":"175","line":47,"column":6,"nodeType":"176","endLine":47,"endColumn":17,"suggestions":"177"},{"ruleId":"167","replacedBy":"178"},{"ruleId":"169","replacedBy":"179"},{"ruleId":"180","severity":1,"message":"181","line":1,"column":27,"nodeType":"182","messageId":"183","endLine":1,"endColumn":36},{"ruleId":"180","severity":1,"message":"184","line":1,"column":38,"nodeType":"182","messageId":"183","endLine":1,"endColumn":44},{"ruleId":"180","severity":1,"message":"185","line":6,"column":10,"nodeType":"182","messageId":"183","endLine":6,"endColumn":17},{"ruleId":"180","severity":1,"message":"186","line":7,"column":8,"nodeType":"182","messageId":"183","endLine":7,"endColumn":14},{"ruleId":"180","severity":1,"message":"187","line":8,"column":8,"nodeType":"182","messageId":"183","endLine":8,"endColumn":14},{"ruleId":"180","severity":1,"message":"188","line":32,"column":9,"nodeType":"182","messageId":"183","endLine":32,"endColumn":28},{"ruleId":"180","severity":1,"message":"189","line":1,"column":17,"nodeType":"182","messageId":"183","endLine":1,"endColumn":25},{"ruleId":"190","severity":1,"message":"191","line":75,"column":11,"nodeType":"192","endLine":75,"endColumn":123},{"ruleId":"190","severity":1,"message":"191","line":76,"column":11,"nodeType":"192","endLine":76,"endColumn":127},{"ruleId":"190","severity":1,"message":"191","line":43,"column":19,"nodeType":"192","endLine":43,"endColumn":22},{"ruleId":"180","severity":1,"message":"193","line":8,"column":9,"nodeType":"182","messageId":"183","endLine":8,"endColumn":25},{"ruleId":"180","severity":1,"message":"194","line":13,"column":9,"nodeType":"182","messageId":"183","endLine":13,"endColumn":23},{"ruleId":"180","severity":1,"message":"189","line":1,"column":17,"nodeType":"182","messageId":"183","endLine":1,"endColumn":25},{"ruleId":"190","severity":1,"message":"191","line":29,"column":13,"nodeType":"192","endLine":29,"endColumn":16},{"ruleId":"190","severity":1,"message":"191","line":39,"column":19,"nodeType":"192","endLine":39,"endColumn":22},{"ruleId":"190","severity":1,"message":"191","line":50,"column":13,"nodeType":"192","endLine":50,"endColumn":16},{"ruleId":"190","severity":1,"message":"191","line":60,"column":19,"nodeType":"192","endLine":60,"endColumn":22},{"ruleId":"190","severity":1,"message":"191","line":70,"column":25,"nodeType":"192","endLine":70,"endColumn":28},{"ruleId":"190","severity":1,"message":"191","line":23,"column":17,"nodeType":"192","endLine":23,"endColumn":20},{"ruleId":"190","severity":1,"message":"191","line":28,"column":17,"nodeType":"192","endLine":28,"endColumn":20},{"ruleId":"190","severity":1,"message":"191","line":52,"column":19,"nodeType":"192","endLine":52,"endColumn":22},{"ruleId":"190","severity":1,"message":"191","line":57,"column":19,"nodeType":"192","endLine":57,"endColumn":22},{"ruleId":"190","severity":1,"message":"191","line":20,"column":17,"nodeType":"192","endLine":20,"endColumn":20},{"ruleId":"190","severity":1,"message":"191","line":25,"column":17,"nodeType":"192","endLine":25,"endColumn":20},{"ruleId":"190","severity":1,"message":"191","line":48,"column":17,"nodeType":"192","endLine":48,"endColumn":20},{"ruleId":"190","severity":1,"message":"191","line":53,"column":17,"nodeType":"192","endLine":53,"endColumn":20},{"ruleId":"180","severity":1,"message":"195","line":10,"column":22,"nodeType":"182","messageId":"183","endLine":10,"endColumn":30},{"ruleId":"196","severity":1,"message":"197","line":12,"column":11,"nodeType":"192","endLine":12,"endColumn":58},{"ruleId":"196","severity":1,"message":"197","line":13,"column":11,"nodeType":"192","endLine":13,"endColumn":55},{"ruleId":"190","severity":1,"message":"191","line":88,"column":15,"nodeType":"192","endLine":88,"endColumn":35},{"ruleId":"174","severity":1,"message":"198","line":27,"column":6,"nodeType":"176","endLine":27,"endColumn":33,"suggestions":"199"},{"ruleId":"200","severity":1,"message":"201","line":80,"column":20,"nodeType":"202","messageId":"203","endLine":80,"endColumn":22},{"ruleId":"174","severity":1,"message":"204","line":38,"column":6,"nodeType":"176","endLine":38,"endColumn":41,"suggestions":"205"},{"ruleId":"190","severity":1,"message":"191","line":71,"column":11,"nodeType":"192","endLine":71,"endColumn":56},{"ruleId":"180","severity":1,"message":"206","line":4,"column":9,"nodeType":"182","messageId":"183","endLine":4,"endColumn":17},{"ruleId":"180","severity":1,"message":"206","line":10,"column":9,"nodeType":"182","messageId":"183","endLine":10,"endColumn":17},"no-native-reassign",["207"],"no-negated-in-lhs",["208"],"import/no-anonymous-default-export","Assign object to a variable before exporting as module default","ExportDefaultDeclaration","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'oktaAuth'. Either include it or remove the dependency array.","ArrayExpression",["209"],["207"],["208"],"no-unused-vars","'useEffect' is defined but never used.","Identifier","unusedVar","'useRef' is defined but never used.","'NavLink' is defined but never used.","'signUp' is defined but never used.","'config' is defined but never used.","'loginRequestOptions' is assigned a value but never used.","'useState' is defined but never used.","jsx-a11y/anchor-is-valid","The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md","JSXOpeningElement","'personalProjects' is assigned a value but never used.","'sharedProjects' is assigned a value but never used.","'oktaAuth' is assigned a value but never used.","jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","React Hook useEffect has a missing dependency: 'toggleSignUpFormVisible'. Either include it or remove the dependency array.",["210"],"eqeqeq","Expected '===' and instead saw '=='.","BinaryExpression","unexpected","React Hook useEffect has a missing dependency: 'toggleForgotPasswordFormVisible'. Either include it or remove the dependency array.",["211"],"'stopProp' is assigned a value but never used.","no-global-assign","no-unsafe-negation",{"desc":"212","fix":"213"},{"desc":"214","fix":"215"},{"desc":"216","fix":"217"},"Update the dependencies array to be: [authState, oktaAuth]",{"range":"218","text":"219"},"Update the dependencies array to be: [signUpFormVisibilityState, toggleSignUpFormVisible]",{"range":"220","text":"221"},"Update the dependencies array to be: [forgotPasswordFormVisibilityState, toggleForgotPasswordFormVisible]",{"range":"222","text":"223"},[1422,1433],"[authState, oktaAuth]",[873,900],"[signUpFormVisibilityState, toggleSignUpFormVisible]",[1372,1407],"[forgotPasswordFormVisibilityState, toggleForgotPasswordFormVisible]"] [{"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\index.js":"1","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\App.jsx":"2","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\config.js":"3","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useMessages.jsx":"4","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useInput.jsx":"5","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\Login.jsx":"6","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\Messages\\Messages.jsx":"7","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\ReportForm.jsx":"8","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\Home.jsx":"9","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\ProjectInfo.jsx":"10","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectOverview\\ProjectOverview.jsx":"11","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamInfo\\TeamInfo.jsx":"12","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamOverview\\TeamOverview.jsx":"13","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\assign\\Assign.jsx":"14","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\updates\\Updates.jsx":"15","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activitiesDisplay\\ActivitiesDisplay.jsx":"16","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activityChart\\ActivityChart.jsx":"17","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\Navbar.jsx":"18","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\logo\\Logo.jsx":"19","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\navLinks\\NavLinks.jsx":"20","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\searchbar\\Searchbar.jsx":"21","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\dropdownMenu\\NavbarDropdownMenu.jsx":"22","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\account\\Account.jsx":"23","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\signUp\\SignUp.jsx":"24","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\passwordReset\\PasswordForgotModal.jsx":"25","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\messageModal\\MessageModal.jsx":"26","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\account\\confirmRemoveAccountModal\\ConfirmRemoveAccountModal.jsx":"27"},{"size":285,"mtime":1628516023915,"results":"28","hashOfConfig":"29"},{"size":2100,"mtime":1630074941213,"results":"30","hashOfConfig":"29"},{"size":540,"mtime":1630395532044,"results":"31","hashOfConfig":"29"},{"size":1489,"mtime":1629790769379,"results":"32","hashOfConfig":"29"},{"size":324,"mtime":1629371594261,"results":"33","hashOfConfig":"29"},{"size":2713,"mtime":1630395059503,"results":"34","hashOfConfig":"29"},{"size":626,"mtime":1628697746462,"results":"35","hashOfConfig":"29"},{"size":3967,"mtime":1628695632288,"results":"36","hashOfConfig":"29"},{"size":1279,"mtime":1630089091700,"results":"37","hashOfConfig":"29"},{"size":1068,"mtime":1628696051327,"results":"38","hashOfConfig":"29"},{"size":3660,"mtime":1629794572456,"results":"39","hashOfConfig":"29"},{"size":2374,"mtime":1628696187694,"results":"40","hashOfConfig":"29"},{"size":2694,"mtime":1628696113184,"results":"41","hashOfConfig":"29"},{"size":3264,"mtime":1628535700010,"results":"42","hashOfConfig":"29"},{"size":2334,"mtime":1630060568411,"results":"43","hashOfConfig":"29"},{"size":2096,"mtime":1628430812599,"results":"44","hashOfConfig":"29"},{"size":3570,"mtime":1628430832688,"results":"45","hashOfConfig":"29"},{"size":906,"mtime":1630073002522,"results":"46","hashOfConfig":"29"},{"size":548,"mtime":1628421916010,"results":"47","hashOfConfig":"29"},{"size":697,"mtime":1628430740299,"results":"48","hashOfConfig":"29"},{"size":470,"mtime":1628430752153,"results":"49","hashOfConfig":"29"},{"size":3533,"mtime":1630069281308,"results":"50","hashOfConfig":"29"},{"size":4569,"mtime":1630395290095,"results":"51","hashOfConfig":"29"},{"size":5569,"mtime":1630395219983,"results":"52","hashOfConfig":"29"},{"size":3623,"mtime":1630354196170,"results":"53","hashOfConfig":"29"},{"size":546,"mtime":1630352571382,"results":"54","hashOfConfig":"29"},{"size":2031,"mtime":1630394986741,"results":"55","hashOfConfig":"29"},{"filePath":"56","messages":"57","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},"iyhzrm",{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"61","messages":"62","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"63"},{"filePath":"64","messages":"65","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"66","usedDeprecatedRules":"58"},{"filePath":"67","messages":"68","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"69"},{"filePath":"70","messages":"71","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"72"},{"filePath":"73","messages":"74","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"75","messages":"76","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"77","usedDeprecatedRules":"58"},{"filePath":"78","messages":"79","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"80","messages":"81","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"82","messages":"83","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"84","usedDeprecatedRules":"58"},{"filePath":"85","messages":"86","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"87","usedDeprecatedRules":"58"},{"filePath":"88","messages":"89","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"90","usedDeprecatedRules":"58"},{"filePath":"91","messages":"92","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"93","usedDeprecatedRules":"58"},{"filePath":"94","messages":"95","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"96","usedDeprecatedRules":"58"},{"filePath":"97","messages":"98","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"99","usedDeprecatedRules":"58"},{"filePath":"100","messages":"101","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"102","messages":"103","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"104","usedDeprecatedRules":"58"},{"filePath":"105","messages":"106","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"107","usedDeprecatedRules":"58"},{"filePath":"108","messages":"109","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"110","messages":"111","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"58"},{"filePath":"112","messages":"113","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"114","usedDeprecatedRules":"58"},{"filePath":"115","messages":"116","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"117","messages":"118","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"119"},{"filePath":"120","messages":"121","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"122","usedDeprecatedRules":"58"},{"filePath":"123","messages":"124","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"125","usedDeprecatedRules":"58"},{"filePath":"126","messages":"127","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"128"},"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\index.js",[],["129","130"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\App.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\config.js",["131"],"export default {\r\n oidc: {\r\n clientId: '0oa1f4zfeiiZPB6DF5d7',\r\n issuer: 'https://dev-91882654.okta.com/oauth2/default',\r\n redirectUri: window.location.origin + '/login/callback',\r\n scopes: ['openid', 'profile', 'email'],\r\n pkce: true\r\n },\r\n serviceAPI: {\r\n messagesURL: 'http://localhost:3030/api/messages',\r\n createNewUserURL: 'http://localhost:3030/api/create-user',\r\n forgotPasswordURL: 'http://localhost:3030/api/recover-user-password',\r\n removeAccountURL: 'http://localhost:3030/api/remove-user'\r\n }\r\n};","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useMessages.jsx",["132"],"import { useState, useEffect } from 'react';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\n\r\nimport config from \"../config\"\r\n\r\nconst useMessages = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [messages, setMessages] = useState(null);\r\n\r\n // fetch messages\r\n useEffect(() => {\r\n if (authState && authState.isAuthenticated) {\r\n const accessToken = oktaAuth.getAccessToken();\r\n fetch(config.serviceAPI.messagesURL, {\r\n method: 'GET',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n })\r\n .then((response) => {\r\n if (!response.ok) {\r\n return Promise.reject();\r\n }\r\n return response.json();\r\n })\r\n .then((data) => {\r\n let index = 0;\r\n const formattedMessages = data.messages.map((message) => {\r\n const date = new Date(message.date);\r\n const day = date.toLocaleDateString();\r\n const time = date.toLocaleTimeString();\r\n index += 1;\r\n return {\r\n date: `${day} ${time}`,\r\n sender: message.sender,\r\n text: message.text,\r\n id: `message-${index}`,\r\n };\r\n });\r\n setMessages(formattedMessages);\r\n })\r\n .catch((err) => {\r\n /* eslint-disable no-console */\r\n console.error(err);\r\n });\r\n }\r\n }, [authState]);\r\n\r\n return messages\r\n}\r\n\r\nexport default useMessages","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useInput.jsx",[],["133","134"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\Login.jsx",["135","136","137","138","139","140"],"import React, { useState, useEffect, useRef } from 'react';\r\nimport { Redirect } from 'react-router-dom'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./Login.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { NavLink } from 'react-router-dom';\r\nimport signUp from './signUp/SignUp';\r\nimport config from '../../config';\r\nimport SignUp from './signUp/SignUp';\r\nimport PasswordForgotModal from './passwordReset/PasswordForgotModal';\r\n\r\nconst Login = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState()\r\n\r\n const [username, setUsername] = useState('');\r\n const [password, setPassword] = useState('');\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n password: `${password}`\r\n })\r\n\r\n const loginRequestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSignInFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n oktaAuth.signInWithCredentials({ username, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n };\r\n\r\n if (sessionToken) {\r\n // Hide form while sessionToken is converted into id/access tokens\r\n return null;\r\n }\r\n\r\n if (!authState || !authState.isAuthenticated) {\r\n return (\r\n <div className=\"pageContainer\">\r\n <SignUp />\r\n\r\n <div className=\"signInForm\">\r\n <h2>Sign in to PipIt</h2>\r\n <form onSubmit={handleSignInFormSubmit}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"username\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign in&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"sign-in-alt\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <PasswordForgotModal />\r\n </div>\r\n </div>\r\n )\r\n } else {\r\n return <Redirect to=\"/home\" />\r\n }\r\n}\r\n\r\nexport default Login","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\Messages\\Messages.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\ReportForm.jsx",["141"],"import React, { useState } from 'react'\r\nimport \"./ReportForm.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport Assign from './assign/Assign'\r\n\r\nconst ReportForm = () => {\r\n return (\r\n <div className=\"page-content-container\">\r\n <h2 className=\"reportissuePageText\">Report an issue</h2>\r\n <form action=\"/reportFormData\">\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueType\">Type of issue</label>\r\n </div>\r\n <div className=\"col-75\">\r\n <select id=\"fissueType\" className=\"issueType\">\r\n <option value=\"bug\">Bug</option>\r\n <option value=\"usabilityissue\">Usability error</option>\r\n <option value=\"other\">Other</option>\r\n </select>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-25\">\r\n <label for=\"fissueLocation\">Where did you encounter the issue?</label>\r\n </div>\r\n <div class=\"col-75\">\r\n <input type=\"text\" id=\"fissueLocation\" className=\"issueLocation\" ></input>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-25\">\r\n <label for=\"fissueDescription\">Describe the issue</label>\r\n </div>\r\n <div class=\"col-75\">\r\n <textarea id=\"fissueDescription\" className=\"issueDescription\"></textarea>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-25\">\r\n <label for=\"fissueStepsToTeproduce\">What steps did you take before the issue happened?</label>\r\n </div>\r\n <div class=\"col-75\">\r\n <textarea id=\"fissueStepsToTeproduce\" className=\"issueStepsToReproduce\"\r\n placeholder=\"List the steps that occurred before the issue happened:\r\n1.\r\n2.\r\n3.\r\nExpected Result:\r\nActual Result:\">\r\n </textarea>\r\n </div>\r\n </div>\r\n\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueSeverity\">Severity level</label>\r\n </div>\r\n <div className=\"col-75\">\r\n <select id=\"fissueSeverity\" className=\"issueSeverity\">\r\n <option value=\"cosmetic\">Cosmetic - should be corrected when time permits</option>\r\n <option value=\"serious\">Serious - should be corrected in the next release</option>\r\n <option value=\"critical\">Critical - should be corrected as soon as possible</option>\r\n </select>\r\n </div>\r\n </div>\r\n\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueTimeToCorrect\">Time to Correct</label>\r\n </div>\r\n <div className=\"col-75\">\r\n <select id=\"fissueSeverity\" className=\"issueTimeToCorrect\">\r\n <option value=\"lessThanTwoHours\">Less than 2 minutes</option>\r\n <option value=\"lessThanOneToTwoDays\">Less than 1 or 2 days</option>\r\n <option value=\"lessThanOneToTwoWeeks\">Less than 1 or 2 weeks</option>\r\n <option value=\"atLeastTwoWeeks\">More than 2 weeks</option>\r\n </select>\r\n </div>\r\n </div>\r\n\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueAssignToProject\">Assign to</label>\r\n </div>\r\n <div className=\"col-75\">\r\n {/*\r\n <select id=\"fissueAssignToProject\" className=\"issueAssignToProject\">\r\n <option value=\"lessThanTwoHours\">Henriks meme machine - ReactApp</option>\r\n </select>\r\n */}\r\n <Assign />\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row\">\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </form>\r\n </div >\r\n )\r\n}\r\n\r\nexport default ReportForm","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\Home.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\ProjectInfo.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectOverview\\ProjectOverview.jsx",["142","143"],"import React, { useState } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport \"./ProjectOverview.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst ProjectOverview = () => {\r\n const personalProjects = [\r\n { id: \"MyApp\", type: \"personal\" },\r\n { id: \"MyOtherApp\", type: \"personal\" }\r\n ]\r\n\r\n const sharedProjects = [\r\n { id: \"ReactApp\", type: \"shared\", teams: [{ name: \"Henriks Meme Machine\" }, { name: \"Teskeholdet\" }] },\r\n { id: \"Very big ReactApp\", type: \"shared\", teams: [{ name: \"Aubergine\" }] }\r\n ]\r\n\r\n const [sharedProjectsButtonState, setSharedProjectsButtonState] = useState(true);\r\n const [personalProjectsButtonState, setPersonalProjectsButtonState] = useState(false);\r\n\r\n const SharedProjectsButtonActive = () => {\r\n setSharedProjectsButtonState(true);\r\n setPersonalProjectsButtonState(false);\r\n };\r\n\r\n const PersonalProjectsButtonActive = () => {\r\n setSharedProjectsButtonState(false);\r\n setPersonalProjectsButtonState(true);\r\n };\r\n\r\n const ProjectsDisplay = (projects) => {\r\n return (\r\n <div className=\"projectlist\">\r\n <ul>\r\n {projects.map((elements, index) => (\r\n <li>\r\n <div className=\"project-entry\">\r\n <div className=\"project-team-name\">\r\n <NavLink to={`/${projects[index].id}`}>{projects[index].id}&nbsp;\r\n <FontAwesomeIcon className=\"icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </NavLink>\r\n </div>\r\n <div className=\"project-status-info-container\">\r\n <div className=\"new-issues-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"bug\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Total issues</span>\r\n </div>\r\n <div className=\"issues-solved-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"check\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Issues solved</span>\r\n </div>\r\n <div className=\"last-updated-info\">\r\n <p>Last updated: &nbsp;1 day ago</p>\r\n </div>\r\n </div>\r\n </div>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"projectlist-title\">Your Projects</h2>\r\n <button className=\"create-new-project-button\">\r\n New Project\r\n </button>\r\n </div>\r\n <div className=\"project-sort-menu-container\">\r\n <div className=\"personal-shared-projects-container\">\r\n <a className={sharedProjectsButtonState ? \"activeUnderlined\" : \"inactive\"} onClick={SharedProjectsButtonActive}>Shared Projects</a>\r\n <a className={personalProjectsButtonState ? \"activeUnderlined\" : \"inactive\"} onClick={PersonalProjectsButtonActive}>Personal Projects</a>\r\n </div>\r\n <div className=\"project-sort-select-container\">\r\n <p>Sort by:</p>\r\n <select>\r\n <option>Last updated</option>\r\n <option>Last created</option>\r\n <option>Name</option>\r\n <option>Name descending</option>\r\n <option>Oldest created</option>\r\n <option>Oldest updated</option>\r\n </select>\r\n </div>\r\n </div>\r\n {sharedProjectsButtonState ? ProjectsDisplay(sharedProjects) : ProjectsDisplay(personalProjects)}\r\n </div >\r\n )\r\n}\r\n\r\nexport default ProjectOverview","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamInfo\\TeamInfo.jsx",["144"],"import React, { useRef, useState, useEffect } from 'react'\r\nimport \"./TeamInfo.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\n\r\nconst TeamInfo = () => {\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"teamInformationPage-content-header\">\r\n <div className=\"header-text\">\r\n <h2 className=\"teamInformationPage-title\">Henriks Meme machine > overview</h2>\r\n </div>\r\n <div className=\"header-notification-select-settings-button-container\">\r\n <div className=\"notification-button-container\">\r\n <button className={`notification-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"bell-icon\" icon=\"bell\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <a>\r\n <FontAwesomeIcon icon=\"user\"></FontAwesomeIcon>&nbsp;&nbsp;Account\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n <div className=\"settings-button-container\">\r\n <button>\r\n <FontAwesomeIcon icon=\"cog\"></FontAwesomeIcon>\r\n &nbsp;Settings\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div className=\"teamInformationPage-content-container\">\r\n {/*TODO: components goes here */}\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default TeamInfo","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamOverview\\TeamOverview.jsx",["145","146"],"import React from 'react'\r\nimport { NavLink } from 'react-router-dom'\r\nimport \"./TeamOverview.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst TeamOverview = () => {\r\n\r\n const personalProjects = [\r\n { id: \"MyApp\", type: \"personal\" },\r\n { id: \"MyOtherApp\", type: \"personal\" }\r\n ]\r\n\r\n const sharedProjects = [\r\n { id: \"ReactApp\", type: \"shared\", teams: [{ name: \"Henriks Meme Machine\" }, { name: \"Teskeholdet\" }] },\r\n { id: \"Very big ReactApp\", type: \"shared\", teams: [{ name: \"Aubergine\" }] }\r\n ]\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"teamlist-title\">Teams</h2>\r\n <div className=\"buttons-container\">\r\n <button className=\"join-team-button\">\r\n Join Team\r\n </button>\r\n <button className=\"create-new-team-button\">\r\n New team\r\n </button>\r\n </div>\r\n </div>\r\n <div className=\"teamlist\">\r\n <ul>\r\n <li>\r\n <div className=\"team-entry\">\r\n <div className=\"image-team-name\">\r\n <NavLink to=\"/HenriksMemeMachine\" className=\"team-image-container\">\r\n <FontAwesomeIcon className=\"team-icon\" icon=\"dice-d6\"></FontAwesomeIcon>\r\n </NavLink>\r\n <NavLink to=\"/HenriksMemeMachine\">Henriks meme machine - ReactApp&nbsp;\r\n <FontAwesomeIcon className=\"icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </NavLink>\r\n </div>\r\n <div className=\"team-status-info-container\">\r\n <div className=\"new-messages-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"envelope\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">New messages</span>\r\n </div>\r\n <div className=\"projects-maintained-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"project-diagram\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Projects maintained</span>\r\n </div>\r\n <div className=\"team-members-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"users\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Team members</span>\r\n </div>\r\n <div className=\"last-updated-info\">\r\n <p>Date created: &nbsp;21/ 07/ 2021</p>\r\n </div>\r\n </div>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </div >\r\n )\r\n}\r\n\r\nexport default TeamOverview","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\assign\\Assign.jsx",["147","148","149","150","151","152"],"import React, { useState } from 'react'\r\nimport \"./Assign.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst Assign = () => {\r\n const personalProjects = [\r\n { id: \"MyApp\", type: \"personal\" },\r\n { id: \"MyOtherApp\", type: \"personal\" }\r\n ]\r\n\r\n const sharedProjects = [\r\n { id: \"ReactApp\", type: \"shared\", teams: [{ name: \"Henriks Meme Machine\" }, { name: \"Teskeholdet\" }] },\r\n { id: \"Very big ReactApp\", type: \"shared\", teams: [{ name: \"Aubergine\" }] }\r\n ]\r\n\r\n\r\n const rootDirectoryObjects = [\r\n { id: \"Personal projects\" },\r\n { id: \"Shared projects\" }\r\n ]\r\n\r\n const DirectoryItems = () => {\r\n return (\r\n <div className=\"multi-level\">\r\n <div className=\"item\">\r\n <input type=\"checkbox\" id=\"A\" />\r\n <label for=\"A\">\r\n <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n <a>&nbsp; {rootDirectoryObjects[0].id} &nbsp;</a>\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </label>\r\n\r\n <ul>\r\n {personalProjects.map((elements, index) => (\r\n <li className=\"personalProjectsItem\">\r\n <input type=\"checkbox\" id={`A-${index}`} />\r\n <label for={`A-${index}`}>\r\n <FontAwesomeIcon icon=\"angle-right\" className=\"project-icon\"></FontAwesomeIcon>\r\n <a>&nbsp; {personalProjects[index].id} &nbsp;</a>\r\n </label>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n\r\n <div className=\"item\">\r\n <input type=\"checkbox\" id=\"B\" />\r\n <label for=\"B\">\r\n <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n <a>&nbsp; {rootDirectoryObjects[1].id} &nbsp;</a>\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </label>\r\n\r\n <ul>\r\n {sharedProjects.map((elements, index) => (\r\n <li><div className=\"sub-item\">\r\n <input type=\"checkbox\" id={`B-${index}`} />\r\n <label for={`B-${index}`}>\r\n <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n <a>&nbsp; {sharedProjects[index].id} &nbsp;</a>\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </label>\r\n\r\n <ul>\r\n {sharedProjects[index].teams.map(team => (\r\n <li><div className=\"team-item\">\r\n <input type=\"checkbox\" id={`team-${team.name}`} />\r\n <label for={`team-${team.name}`}>\r\n <FontAwesomeIcon icon=\"users\" className=\"users-icon\"></FontAwesomeIcon>\r\n <a>&nbsp; {team.name} &nbsp;</a>\r\n </label>\r\n </div>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"assignSelectContainer\">\r\n <DirectoryItems />\r\n </div >\r\n )\r\n}\r\n\r\nexport default Assign","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\updates\\Updates.jsx",["153","154","155","156"],"import React from 'react'\r\nimport \"./Updates.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport useMessages from '../../../util/useMessages'\r\n\r\nconst Updates = () => {\r\n const messages = useMessages()\r\n\r\n return (\r\n <div className=\"project-updates-new-messages-container\">\r\n\r\n <div className=\"project-updates-display-container\">\r\n <div className=\"project-updates-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"exclamation\"></FontAwesomeIcon>\r\n &nbsp;&nbsp;New project updates\r\n </p>\r\n </div>\r\n <div className=\"project-updates-display-content\">\r\n <div className=\"project-update-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [project] [new issues] [issues fixed]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [team] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"new-messages-display-container\">\r\n <div className=\"new-messages-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>\r\n &nbsp;&nbsp;New messages\r\n </p>\r\n </div>\r\n {messages ? messages.map((message) => (\r\n <div className=\"new-messages-display-content\">\r\n <div className=\"new-message-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [{message.sender}] [{message.id}]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [team] [{message.date}]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n )) : \"Loading messages\"}\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default Updates","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activitiesDisplay\\ActivitiesDisplay.jsx",["157","158","159","160"],"import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport React from 'react'\r\nimport \"./ActivitiesDisplay.css\"\r\n\r\nconst ActivitiesDisplay = () => {\r\n return (\r\n <div className=\"activity-new-issues-display-container\">\r\n\r\n <div className=\"new-issues-display-container\">\r\n <div className=\"new-issues-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"inbox\"></FontAwesomeIcon>\r\n &nbsp;&nbsp;New issue reports\r\n </p>\r\n </div>\r\n <div className=\"new-issues-display-content\">\r\n <div className=\"new-issue-report-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [Severity] [type]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [project] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"activity-display-container\">\r\n <div className=\"activity-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"sticky-note\"></FontAwesomeIcon>\r\n &nbsp;&nbsp;Recent Team activities\r\n </p>\r\n </div>\r\n <div className=\"activity-display-content\">\r\n <div className=\"new-issue-report-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [Name] [action]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [project] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ActivitiesDisplay","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activityChart\\ActivityChart.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\Navbar.jsx",["161"],"import React from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./Navbar.css\"\r\nimport Logo from './logo/Logo'\r\nimport NavLinks from './navLinks/NavLinks'\r\nimport Searchbar from './searchbar/Searchbar'\r\nimport NavbarDropdownMenu from './dropdownMenu/NavbarDropdownMenu'\r\n\r\nconst Navbar = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n\r\n if (!authState || !authState.isAuthenticated) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className=\"navbar\" >\r\n <div className=\"header-content\">\r\n <div className=\"title-navigation-links-container\">\r\n <Logo />\r\n <NavLinks />\r\n </div>\r\n <div className=\"searchbar-profile-container\">\r\n <ul className=\"right-unstyled-navbar\">\r\n <Searchbar />\r\n <NavbarDropdownMenu />\r\n </ul>\r\n </div>\r\n </div>\r\n </div >\r\n )\r\n}\r\n\r\nexport default Navbar","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\logo\\Logo.jsx",["162","163"],"import React from 'react'\r\nimport { NavLink } from 'react-router-dom'\r\nimport \"./Logo.css\"\r\nimport logo_picture from \"../../../images/bird-logo.jpg\"\r\nimport logo_text from \"../../../images/logo-text.jpg\"\r\n\r\nconst Logo = () => {\r\n return (\r\n <h1 className=\"title\">\r\n <span className=\"title-icon\">\r\n <NavLink to=\"/home\" id=\"logo\">\r\n <img src={logo_picture} width=\"24\" height=\"24\"></img>\r\n <img src={logo_text} width=\"48\" height=\"24\"></img>\r\n </NavLink>\r\n </span>\r\n </h1>\r\n )\r\n}\r\n\r\nexport default Logo","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\navLinks\\NavLinks.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\searchbar\\Searchbar.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\dropdownMenu\\NavbarDropdownMenu.jsx",["164"],"import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const logout = () => {\r\n oktaAuth.signOut()\r\n }\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <NavLink to=\"/account\" onClick={onClick} className=\"top-item\">\r\n <div>\r\n <FontAwesomeIcon icon=\"user\" className=\"item-icon-top\"></FontAwesomeIcon>&nbsp;&nbsp;\r\n </div>\r\n <div className=\"item-top-text\">\r\n <span>\r\n <p className=\"top-row\">Account</p>\r\n <p className=\"bottom-row\">{userInfo ? userInfo.email : \"...\"}</p>\r\n </span>\r\n </div>\r\n <div className=\"item-last-flex-item\">\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"item-icon-top\"></FontAwesomeIcon>\r\n </div>\r\n </NavLink>\r\n </li>\r\n <li>\r\n <NavLink to=\"/messages\" onClick={onClick}>\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>&nbsp;&nbsp;Messages\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </NavLink>\r\n </li>\r\n {/* <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li> */}\r\n <li>\r\n <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\account\\Account.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\signUp\\SignUp.jsx",["165","166","167","168"],"import React, { useState, useEffect, useRef } from 'react'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport config from '../../../config';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./SignUp.css\"\r\n\r\nconst SignUp = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState()\r\n\r\n const [signUpFormVisibilityState, showSignUpForm] = useState(false)\r\n const signUpFormRef = useRef(null);\r\n const toggleSignUpFormVisible = () => showSignUpForm(!signUpFormVisibilityState)\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\r\n toggleSignUpFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (signUpFormVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [signUpFormVisibilityState]);\r\n\r\n const [firstname, setfirstname] = useState('')\r\n const [lastname, setlastname] = useState('')\r\n const [username, setUsername] = useState('');\r\n const [password, setPassword] = useState('');\r\n const [confirmPassword, setConfirmPassword] = useState('');\r\n\r\n const userInputData = JSON.stringify({\r\n firstname: `${firstname}`,\r\n lastname: `${lastname}`,\r\n email: `${username}`,\r\n password: `${password}`\r\n })\r\n\r\n const loginRequestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handlefirstnameChange = (e) => {\r\n setfirstname(e.target.value)\r\n }\r\n\r\n const handlelastnameChange = (e) => {\r\n setlastname(e.target.value)\r\n }\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n const handleConfirmPasswordChange = (e) => {\r\n setConfirmPassword(e.target.value)\r\n }\r\n\r\n const handleSignUpFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n if (!password || !confirmPassword) {\r\n window.alert(\"A password field is blank\")\r\n return\r\n }\r\n\r\n if (!(confirmPassword.length >= 7)) {\r\n window.alert(\"Password must consist of 8 characters or more\")\r\n return\r\n }\r\n\r\n if (!(password == confirmPassword)) {\r\n window.alert(\"Passwords fo not match\")\r\n return\r\n }\r\n\r\n else {\r\n fetch(config.serviceAPI.createNewUserURL, loginRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n handleSignInFormSubmit(e)\r\n }\r\n })\r\n }\r\n }\r\n\r\n const handleSignInFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n oktaAuth.signInWithCredentials({ username, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n };\r\n\r\n return (\r\n <div className=\"signUpContainer\">\r\n <div className={`modal ${signUpFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={signUpFormRef} className=\"modal-content\">\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSignUpFormSubmit}>\r\n <label>\r\n First name:\r\n <input\r\n id=\"firstname\" type=\"text\"\r\n value={firstname}\r\n onChange={handlefirstnameChange} />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n id=\"lastname\" type=\"text\"\r\n value={lastname}\r\n onChange={handlelastnameChange} />\r\n </label>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <label>\r\n Confirm Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={confirmPassword}\r\n onChange={handleConfirmPasswordChange} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n <button className=\"signUpForm-show-button\" onClick={toggleSignUpFormVisible}>\r\n Sign up\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default SignUp\r\n","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\passwordReset\\PasswordForgotModal.jsx",["169","170"],"import React, { useState, useRef, useEffect } from 'react'\r\nimport config from '../../../config'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport \"./PasswordForgotModal.css\"\r\nimport MessageModal from '../../../components/messageModal/MessageModal';\r\n\r\n\r\n// TODO : Clean up and make more like the message modal component\r\nconst PasswordForgotModal = () => {\r\n const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false)\r\n const forgotPasswordFormRef = useRef(null)\r\n const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState)\r\n\r\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\r\n\r\n const [username, setUsername] = useState('');\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\r\n toggleForgotPasswordFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (forgotPasswordFormVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [forgotPasswordFormVisibilityState]);\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n })\r\n\r\n const ForgotPasswordRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n }\r\n\r\n const handlePasswordForgot = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.forgotPasswordURL, ForgotPasswordRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error: something went wrong\")\r\n console.log(res)\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n toggleForgotPasswordFormVisible()\r\n setSubmitOkMessageModalState(true)\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div>\r\n <div className=\"password-forgot-prompt\">\r\n <span>\r\n <a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>\r\n </span>\r\n </div>\r\n\r\n {/* Forgot password modal */}\r\n <div className={`modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={forgotPasswordFormRef} className=\"modal-content\">\r\n <div className=\"recoverPasswordForm\">\r\n <h2>Recover password</h2>\r\n <form onSubmit={handlePasswordForgot}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n An email with a password recovery link will be sent if it is registered in our system\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n <div className={`modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`}>\r\n <MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={\"Email submitted!\"} bodyMessage={\"An email with a password recovery link will be sent if it is registered in our system\"} />\r\n </div>\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default PasswordForgotModal\r\n","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\messageModal\\MessageModal.jsx",["171"],"import React from 'react'\r\n\r\nconst MessageModal = ({ removeModal, headerMessage, bodyMessage }) => {\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\" onClick={e => removeModal()}>\r\n <div className=\"submitOkModal\">\r\n <h2>{headerMessage}</h2>\r\n <label>\r\n {bodyMessage}\r\n </label>\r\n <button className=\"formSubmitButton\" onClick={e => removeModal()}>\r\n Ok\r\n </button>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default MessageModal\r\n","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\account\\confirmRemoveAccountModal\\ConfirmRemoveAccountModal.jsx",["172"],"import React, { useEffect, useState } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./ConfirmRemoveAccountModal.css\"\r\nimport config from '../../../config';\r\n\r\nconst ConfirmRemoveAccountModal = ({ removeModal, headerMessage, bodyMessage }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n const accessToken = oktaAuth.getAccessToken();\r\n\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const removeAccountRequestOptions = {\r\n method: 'DELETE',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(\r\n {\r\n email: `${userInfo && userInfo.email}`,\r\n }\r\n )\r\n }\r\n\r\n const handleRemoveAccount = () => {\r\n console.log(removeAccountRequestOptions.body)\r\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n console.log(res)\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n oktaAuth.signOut()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\">\r\n <div className=\"confirmRemoveAccountModal\">\r\n <h2>Delete account</h2>\r\n <label>\r\n Are you sure you want to delete your account?\r\n </label>\r\n <div className=\"buttonContainer\">\r\n <button className=\"noButton\" onClick={e => removeModal()}>\r\n No\r\n </button>\r\n <button className=\"yesButton\" onClick={handleRemoveAccount}>\r\n Yes\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ConfirmRemoveAccountModal\r\n",{"ruleId":"173","replacedBy":"174"},{"ruleId":"175","replacedBy":"176"},{"ruleId":"177","severity":1,"message":"178","line":1,"column":1,"nodeType":"179","endLine":15,"endColumn":3},{"ruleId":"180","severity":1,"message":"181","line":47,"column":6,"nodeType":"182","endLine":47,"endColumn":17,"suggestions":"183"},{"ruleId":"173","replacedBy":"184"},{"ruleId":"175","replacedBy":"185"},{"ruleId":"186","severity":1,"message":"187","line":1,"column":27,"nodeType":"188","messageId":"189","endLine":1,"endColumn":36},{"ruleId":"186","severity":1,"message":"190","line":1,"column":38,"nodeType":"188","messageId":"189","endLine":1,"endColumn":44},{"ruleId":"186","severity":1,"message":"191","line":6,"column":10,"nodeType":"188","messageId":"189","endLine":6,"endColumn":17},{"ruleId":"186","severity":1,"message":"192","line":7,"column":8,"nodeType":"188","messageId":"189","endLine":7,"endColumn":14},{"ruleId":"186","severity":1,"message":"193","line":8,"column":8,"nodeType":"188","messageId":"189","endLine":8,"endColumn":14},{"ruleId":"186","severity":1,"message":"194","line":32,"column":9,"nodeType":"188","messageId":"189","endLine":32,"endColumn":28},{"ruleId":"186","severity":1,"message":"195","line":1,"column":17,"nodeType":"188","messageId":"189","endLine":1,"endColumn":25},{"ruleId":"196","severity":1,"message":"197","line":75,"column":11,"nodeType":"198","endLine":75,"endColumn":123},{"ruleId":"196","severity":1,"message":"197","line":76,"column":11,"nodeType":"198","endLine":76,"endColumn":127},{"ruleId":"196","severity":1,"message":"197","line":43,"column":19,"nodeType":"198","endLine":43,"endColumn":22},{"ruleId":"186","severity":1,"message":"199","line":8,"column":9,"nodeType":"188","messageId":"189","endLine":8,"endColumn":25},{"ruleId":"186","severity":1,"message":"200","line":13,"column":9,"nodeType":"188","messageId":"189","endLine":13,"endColumn":23},{"ruleId":"186","severity":1,"message":"195","line":1,"column":17,"nodeType":"188","messageId":"189","endLine":1,"endColumn":25},{"ruleId":"196","severity":1,"message":"197","line":29,"column":13,"nodeType":"198","endLine":29,"endColumn":16},{"ruleId":"196","severity":1,"message":"197","line":39,"column":19,"nodeType":"198","endLine":39,"endColumn":22},{"ruleId":"196","severity":1,"message":"197","line":50,"column":13,"nodeType":"198","endLine":50,"endColumn":16},{"ruleId":"196","severity":1,"message":"197","line":60,"column":19,"nodeType":"198","endLine":60,"endColumn":22},{"ruleId":"196","severity":1,"message":"197","line":70,"column":25,"nodeType":"198","endLine":70,"endColumn":28},{"ruleId":"196","severity":1,"message":"197","line":23,"column":17,"nodeType":"198","endLine":23,"endColumn":20},{"ruleId":"196","severity":1,"message":"197","line":28,"column":17,"nodeType":"198","endLine":28,"endColumn":20},{"ruleId":"196","severity":1,"message":"197","line":52,"column":19,"nodeType":"198","endLine":52,"endColumn":22},{"ruleId":"196","severity":1,"message":"197","line":57,"column":19,"nodeType":"198","endLine":57,"endColumn":22},{"ruleId":"196","severity":1,"message":"197","line":20,"column":17,"nodeType":"198","endLine":20,"endColumn":20},{"ruleId":"196","severity":1,"message":"197","line":25,"column":17,"nodeType":"198","endLine":25,"endColumn":20},{"ruleId":"196","severity":1,"message":"197","line":48,"column":17,"nodeType":"198","endLine":48,"endColumn":20},{"ruleId":"196","severity":1,"message":"197","line":53,"column":17,"nodeType":"198","endLine":53,"endColumn":20},{"ruleId":"186","severity":1,"message":"201","line":10,"column":22,"nodeType":"188","messageId":"189","endLine":10,"endColumn":30},{"ruleId":"202","severity":1,"message":"203","line":12,"column":11,"nodeType":"198","endLine":12,"endColumn":58},{"ruleId":"202","severity":1,"message":"203","line":13,"column":11,"nodeType":"198","endLine":13,"endColumn":55},{"ruleId":"196","severity":1,"message":"197","line":88,"column":15,"nodeType":"198","endLine":88,"endColumn":35},{"ruleId":"186","severity":1,"message":"204","line":8,"column":11,"nodeType":"188","messageId":"189","endLine":8,"endColumn":20},{"ruleId":"186","severity":1,"message":"205","line":9,"column":10,"nodeType":"188","messageId":"189","endLine":9,"endColumn":22},{"ruleId":"180","severity":1,"message":"206","line":31,"column":6,"nodeType":"182","endLine":31,"endColumn":33,"suggestions":"207"},{"ruleId":"208","severity":1,"message":"209","line":84,"column":20,"nodeType":"210","messageId":"211","endLine":84,"endColumn":22},{"ruleId":"180","severity":1,"message":"212","line":38,"column":6,"nodeType":"182","endLine":38,"endColumn":41,"suggestions":"213"},{"ruleId":"196","severity":1,"message":"197","line":71,"column":11,"nodeType":"198","endLine":71,"endColumn":56},{"ruleId":"186","severity":1,"message":"214","line":4,"column":9,"nodeType":"188","messageId":"189","endLine":4,"endColumn":17},{"ruleId":"186","severity":1,"message":"214","line":11,"column":9,"nodeType":"188","messageId":"189","endLine":11,"endColumn":17},"no-native-reassign",["215"],"no-negated-in-lhs",["216"],"import/no-anonymous-default-export","Assign object to a variable before exporting as module default","ExportDefaultDeclaration","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'oktaAuth'. Either include it or remove the dependency array.","ArrayExpression",["217"],["215"],["216"],"no-unused-vars","'useEffect' is defined but never used.","Identifier","unusedVar","'useRef' is defined but never used.","'NavLink' is defined but never used.","'signUp' is defined but never used.","'config' is defined but never used.","'loginRequestOptions' is assigned a value but never used.","'useState' is defined but never used.","jsx-a11y/anchor-is-valid","The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md","JSXOpeningElement","'personalProjects' is assigned a value but never used.","'sharedProjects' is assigned a value but never used.","'oktaAuth' is assigned a value but never used.","jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","'authState' is assigned a value but never used.","'sessionToken' is assigned a value but never used.","React Hook useEffect has a missing dependency: 'toggleSignUpFormVisible'. Either include it or remove the dependency array.",["218"],"eqeqeq","Expected '===' and instead saw '=='.","BinaryExpression","unexpected","React Hook useEffect has a missing dependency: 'toggleForgotPasswordFormVisible'. Either include it or remove the dependency array.",["219"],"'stopProp' is assigned a value but never used.","no-global-assign","no-unsafe-negation",{"desc":"220","fix":"221"},{"desc":"222","fix":"223"},{"desc":"224","fix":"225"},"Update the dependencies array to be: [authState, oktaAuth]",{"range":"226","text":"227"},"Update the dependencies array to be: [signUpFormVisibilityState, toggleSignUpFormVisible]",{"range":"228","text":"229"},"Update the dependencies array to be: [forgotPasswordFormVisibilityState, toggleForgotPasswordFormVisible]",{"range":"230","text":"231"},[1422,1433],"[authState, oktaAuth]",[1028,1055],"[signUpFormVisibilityState, toggleSignUpFormVisible]",[1372,1407],"[forgotPasswordFormVisibilityState, toggleForgotPasswordFormVisible]"]
\ No newline at end of file \ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\account\\\\confirmRemoveAccountModal\\\\ConfirmRemoveAccountModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useEffect, useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./ConfirmRemoveAccountModal.css\";\nimport config from '../../config';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ConfirmRemoveAccountModal = ({\n removeModal,\n headerMessage,\n bodyMessage\n}) => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const accessToken = oktaAuth.getAccessToken();\n\n const stopProp = e => {\n e.stopPropagation();\n };\n\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const removeAccountRequestOptions = {\n method: 'DELETE',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: JSON.stringify({\n email: `${userInfo && userInfo.email}`\n })\n };\n\n const handleRemoveAccount = () => {\n console.log(removeAccountRequestOptions.body);\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions).then(res => {\n if (!res.ok) {\n console.log(res);\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n oktaAuth.signOut();\n }\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"confirmRemoveAccountModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Are you sure you want to delete your account?\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"buttonContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: \"noButton\",\n onClick: e => removeModal(),\n children: \"No\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"yesButton\",\n onClick: handleRemoveAccount,\n children: \"Yes\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 5\n }, this);\n};\n\n_s(ConfirmRemoveAccountModal, \"/7FunoA1ejJNU8uKGTy1GZFqU2I=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = ConfirmRemoveAccountModal;\nexport default ConfirmRemoveAccountModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"ConfirmRemoveAccountModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/confirmRemoveAccountModal/ConfirmRemoveAccountModal.jsx"],"names":["React","useEffect","useState","useOktaAuth","config","ConfirmRemoveAccountModal","removeModal","headerMessage","bodyMessage","authState","oktaAuth","userInfo","setUserInfo","accessToken","getAccessToken","stopProp","e","stopPropagation","isAuthenticated","getUser","then","info","removeAccountRequestOptions","method","headers","Authorization","body","JSON","stringify","email","handleRemoveAccount","console","log","fetch","serviceAPI","removeAccountURL","res","ok","window","alert","Promise","reject","signOut"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,QAA3B,QAA2C,OAA3C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,iCAAP;AACA,OAAOC,MAAP,MAAmB,cAAnB;;;AAEA,MAAMC,yBAAyB,GAAG,CAAC;AAAEC,EAAAA,WAAF;AAAeC,EAAAA,aAAf;AAA8BC,EAAAA;AAA9B,CAAD,KAAiD;AAAA;;AACjF,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BP,WAAW,EAA3C;AACA,QAAM,CAACQ,QAAD,EAAWC,WAAX,IAA0BV,QAAQ,CAAC,IAAD,CAAxC;AACA,QAAMW,WAAW,GAAGH,QAAQ,CAACI,cAAT,EAApB;;AAEA,QAAMC,QAAQ,GAAGC,CAAC,IAAI;AACpBA,IAAAA,CAAC,CAACC,eAAF;AACD,GAFD;;AAIAhB,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACQ,SAAS,CAACS,eAAf,EAAgC;AAC9B;AACAN,MAAAA,WAAW,CAAC,IAAD,CAAX;AACD,KAHD,MAGO;AACLF,MAAAA,QAAQ,CAACS,OAAT,GAAmBC,IAAnB,CAAwBC,IAAI,IAAI;AAC9BT,QAAAA,WAAW,CAACS,IAAD,CAAX;AACD,OAFD;AAGD;AACF,GATQ,EASN,CAACZ,SAAD,EAAYC,QAAZ,CATM,CAAT,CATiF,CAkBtD;;AAE3B,QAAM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AA;AAAA;AAAA,gBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,cALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAkBD,CAlED;;GAAMzB,yB;UAC4BF,W;;;KAD5BE,yB;AAoEN,eAAeA,yBAAf","sourcesContent":["import React, { useEffect, useState } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./ConfirmRemoveAccountModal.css\"\r\nimport config from '../../config';\r\n\r\nconst ConfirmRemoveAccountModal = ({ removeModal, headerMessage, bodyMessage }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n const accessToken = oktaAuth.getAccessToken();\r\n\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const removeAccountRequestOptions = {\r\n method: 'DELETE',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(\r\n {\r\n email: `${userInfo && userInfo.email}`,\r\n }\r\n )\r\n }\r\n\r\n const handleRemoveAccount = () => {\r\n console.log(removeAccountRequestOptions.body)\r\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n console.log(res)\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n oktaAuth.signOut()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\">\r\n <div className=\"confirmRemoveAccountModal\">\r\n <h2>Delete account</h2>\r\n <label>\r\n Are you sure you want to delete your account?\r\n </label>\r\n <div className=\"buttonContainer\">\r\n <button className=\"noButton\" onClick={e => removeModal()}>\r\n No\r\n </button>\r\n <button className=\"yesButton\" onClick={handleRemoveAccount}>\r\n Yes\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ConfirmRemoveAccountModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect, useRef } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport config from '../../../config';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const [signUpFormVisibilityState, showSignUpForm] = useState(false);\n const signUpFormRef = useRef(null);\n\n const toggleSignUpFormVisible = () => showSignUpForm(!signUpFormVisibilityState);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\n toggleSignUpFormVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (signUpFormVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [signUpFormVisibilityState]);\n const [firstname, setfirstname] = useState('');\n const [lastname, setlastname] = useState('');\n const [username, setUsername] = useState('');\n const [password, setPassword] = useState('');\n const [confirmPassword, setConfirmPassword] = useState('');\n const userInputData = JSON.stringify({\n firstname: `${firstname}`,\n lastname: `${lastname}`,\n email: `${username}`,\n password: `${password}`\n });\n const loginRequestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handlefirstnameChange = e => {\n setfirstname(e.target.value);\n };\n\n const handlelastnameChange = e => {\n setlastname(e.target.value);\n };\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n const handlePasswordChange = e => {\n setPassword(e.target.value);\n };\n\n const handleConfirmPasswordChange = e => {\n setConfirmPassword(e.target.value);\n };\n\n const handleSignUpFormSubmit = e => {\n e.preventDefault();\n\n if (!password || !confirmPassword) {\n window.alert(\"A password field is blank\");\n return;\n }\n\n if (!(confirmPassword.length >= 7)) {\n window.alert(\"Password must consist of 8 characters or more\");\n return;\n }\n\n if (!(password == confirmPassword)) {\n window.alert(\"Passwords fo not match\");\n return;\n } else {\n fetch(config.serviceAPI.createNewUserURL, loginRequestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n handleSignInFormSubmit(e);\n }\n });\n }\n };\n\n const handleSignInFormSubmit = e => {\n e.preventDefault();\n oktaAuth.signInWithCredentials({\n username,\n password\n }).then(res => {\n const sessionToken = res.sessionToken;\n setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once\n\n oktaAuth.signInWithRedirect({\n sessionToken,\n originalUri: '/home'\n });\n }).catch(err => console.log('Found an error', err));\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${signUpFormVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n ref: signUpFormRef,\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 122,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSignUpFormSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"First name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"firstname\",\n type: \"text\",\n value: firstname,\n onChange: handlefirstnameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 126,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 124,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Last Name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"lastname\",\n type: \"text\",\n value: lastname,\n onChange: handlelastnameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 133,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 131,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 140,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 138,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 147,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 145,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Confirm Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: confirmPassword,\n onChange: handleConfirmPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 154,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 152,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 159,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 164,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 162,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 123,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 121,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 120,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 119,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 173,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 174,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"signUpForm-show-button\",\n onClick: toggleSignUpFormVisible,\n children: \"Sign up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 175,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 172,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 171,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 118,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"zaW+hWyZ5ozdpRaUbww+EQWIQgM=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/signUp/SignUp.jsx"],"names":["React","useState","useEffect","useRef","FontAwesomeIcon","config","useOktaAuth","SignUp","authState","oktaAuth","sessionToken","setSessionToken","signUpFormVisibilityState","showSignUpForm","signUpFormRef","toggleSignUpFormVisible","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","firstname","setfirstname","lastname","setlastname","username","setUsername","password","setPassword","confirmPassword","setConfirmPassword","userInputData","JSON","stringify","email","loginRequestOptions","method","body","handlefirstnameChange","value","handlelastnameChange","handleUsernameChange","handlePasswordChange","handleConfirmPasswordChange","handleSignUpFormSubmit","preventDefault","alert","length","fetch","serviceAPI","createNewUserURL","then","res","ok","Promise","reject","handleSignInFormSubmit","signInWithCredentials","signInWithRedirect","originalUri","catch","err","console","log"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,QAAmD,OAAnD;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,cAAP;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BH,WAAW,EAA3C;AACA,QAAM,CAACI,YAAD,EAAeC,eAAf,IAAkCV,QAAQ,EAAhD;AAEA,QAAM,CAACW,yBAAD,EAA4BC,cAA5B,IAA8CZ,QAAQ,CAAC,KAAD,CAA5D;AACA,QAAMa,aAAa,GAAGX,MAAM,CAAC,IAAD,CAA5B;;AACA,QAAMY,uBAAuB,GAAG,MAAMF,cAAc,CAAC,CAACD,y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kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YADF,eAqDE;AAAK,MAAA,SAAS,EAAC,QAAf;AAAA,6BACE;AAAK,QAAA,SAAS,EAAC,gBAAf;AAAA,gCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBADF,eAEE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAFF,eAGE;AAAQ,UAAA,SAAS,EAAC,wBAAlB;AAA2C,UAAA,OAAO,EAAE/B,uBAApD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAHF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YArDF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAkED,CAhLD;;GAAMR,M;UAC4BD,W;;;KAD5BC,M;AAkLN,eAAeA,MAAf","sourcesContent":["import React, { useState, useEffect, useRef } from 'react'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport config from '../../../config';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./SignUp.css\"\r\n\r\nconst SignUp = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState()\r\n\r\n const [signUpFormVisibilityState, showSignUpForm] = useState(false)\r\n const signUpFormRef = useRef(null);\r\n const toggleSignUpFormVisible = () => showSignUpForm(!signUpFormVisibilityState)\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\r\n toggleSignUpFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (signUpFormVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [signUpFormVisibilityState]);\r\n\r\n const [firstname, setfirstname] = useState('')\r\n const [lastname, setlastname] = useState('')\r\n const [username, setUsername] = useState('');\r\n const [password, setPassword] = useState('');\r\n const [confirmPassword, setConfirmPassword] = useState('');\r\n\r\n const userInputData = JSON.stringify({\r\n firstname: `${firstname}`,\r\n lastname: `${lastname}`,\r\n email: `${username}`,\r\n password: `${password}`\r\n })\r\n\r\n const loginRequestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handlefirstnameChange = (e) => {\r\n setfirstname(e.target.value)\r\n }\r\n\r\n const handlelastnameChange = (e) => {\r\n setlastname(e.target.value)\r\n }\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n const handleConfirmPasswordChange = (e) => {\r\n setConfirmPassword(e.target.value)\r\n }\r\n\r\n const handleSignUpFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n if (!password || !confirmPassword) {\r\n window.alert(\"A password field is blank\")\r\n return\r\n }\r\n\r\n if (!(confirmPassword.length >= 7)) {\r\n window.alert(\"Password must consist of 8 characters or more\")\r\n return\r\n }\r\n\r\n if (!(password == confirmPassword)) {\r\n window.alert(\"Passwords fo not match\")\r\n return\r\n }\r\n\r\n else {\r\n fetch(config.serviceAPI.createNewUserURL, loginRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n handleSignInFormSubmit(e)\r\n }\r\n })\r\n }\r\n }\r\n\r\n const handleSignInFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n oktaAuth.signInWithCredentials({ username, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n };\r\n\r\n return (\r\n <div className=\"signUpContainer\">\r\n <div className={`modal ${signUpFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={signUpFormRef} className=\"modal-content\">\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSignUpFormSubmit}>\r\n <label>\r\n First name:\r\n <input\r\n id=\"firstname\" type=\"text\"\r\n value={firstname}\r\n onChange={handlefirstnameChange} />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n id=\"lastname\" type=\"text\"\r\n value={lastname}\r\n onChange={handlelastnameChange} />\r\n </label>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <label>\r\n Confirm Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={confirmPassword}\r\n onChange={handleConfirmPasswordChange} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n <button className=\"signUpForm-show-button\" onClick={toggleSignUpFormVisible}>\r\n Sign up\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default SignUp\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect, useRef } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport config from '../../../config';\nimport \"./SignUp.css\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const [signUpFormVisibilityState, showSignUpForm] = useState(false);\n const signUpFormRef = useRef(null);\n\n const toggleSignUpFormVisible = () => showSignUpForm(!signUpFormVisibilityState);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\n toggleSignUpFormVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (signUpFormVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [signUpFormVisibilityState]);\n const [firstname, setfirstname] = useState('');\n const [lastname, setlastname] = useState('');\n const [username, setUsername] = useState('');\n const [password, setPassword] = useState('');\n const [confirmPassword, setConfirmPassword] = useState('');\n const userInputData = JSON.stringify({\n firstname: `${firstname}`,\n lastname: `${lastname}`,\n email: `${username}`,\n password: `${password}`\n });\n const loginRequestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handlefirstnameChange = e => {\n setfirstname(e.target.value);\n };\n\n const handlelastnameChange = e => {\n setlastname(e.target.value);\n };\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n const handlePasswordChange = e => {\n setPassword(e.target.value);\n };\n\n const handleConfirmPasswordChange = e => {\n setConfirmPassword(e.target.value);\n };\n\n const handleSignUpFormSubmit = e => {\n e.preventDefault();\n\n if (!password || !confirmPassword) {\n window.alert(\"A password field is blank\");\n return;\n }\n\n if (!(confirmPassword.length >= 7)) {\n window.alert(\"Password must consist of 8 characters or more\");\n return;\n }\n\n if (!(password == confirmPassword)) {\n window.alert(\"Passwords fo not match\");\n return;\n } else {\n fetch(config.serviceAPI.createNewUserURL, loginRequestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {// handleSignInFormSubmit(e)\n }\n });\n }\n };\n\n const handleSignInFormSubmit = e => {\n e.preventDefault();\n oktaAuth.signInWithCredentials({\n username,\n password\n }).then(res => {\n const sessionToken = res.sessionToken;\n setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once\n\n oktaAuth.signInWithRedirect({\n sessionToken,\n originalUri: '/home'\n });\n }).catch(err => console.log('Found an error', err));\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${signUpFormVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n ref: signUpFormRef,\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 118,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSignUpFormSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"First name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"firstname\",\n type: \"text\",\n value: firstname,\n onChange: handlefirstnameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 122,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 120,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Last Name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"lastname\",\n type: \"text\",\n value: lastname,\n onChange: handlelastnameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 129,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 127,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 136,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 134,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 143,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 141,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Confirm Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: confirmPassword,\n onChange: handleConfirmPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 150,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 148,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 155,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 160,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 158,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 119,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 117,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 115,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 169,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 170,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"signUpForm-show-button\",\n onClick: toggleSignUpFormVisible,\n children: \"Sign up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 171,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 168,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 167,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"qUYGdR3iJtgTZKOx1lTzbuiYPaU=\");\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/signUp/SignUp.jsx"],"names":["React","useState","useEffect","useRef","FontAwesomeIcon","config","SignUp","signUpFormVisibilityState","showSignUpForm","signUpFormRef","toggleSignUpFormVisible","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","firstname","setfirstname","lastname","setlastname","username","setUsername","password","setPassword","confirmPassword","setConfirmPassword","userInputData","JSON","stringify","email","loginRequestOptions","method","body","handlefirstnameChange","value","handlelastnameChange","handleUsernameChange","handlePasswordChange","handleConfirmPasswordChange","handleSignUpFormSubmit","preventDefault","alert","length","fetch","serviceAPI","createNewUserURL","then","res","ok","Promise","reject","handleSignInFormSubmit","oktaAuth","signInWithCredentials","sessionToken","setSessionToken","signInWithRedirect","originalUri","catch","err","console","log"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,QAAmD,OAAnD;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,OAAO,cAAP;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM,CAACC,yBAAD,EAA4BC,cAA5B,IAA8CP,QAAQ,CAAC,KAAD,CAA5D;AACA,QAAMQ,aAAa,GAAGN,MAAM,CAAC,IAAD,CAA5B;;AACA,QAAMO,uBAAuB,GAAG,MAAMF,cAAc,CAAC,CAACD,yBAAF,CAApD;;AAEAL,EAAAA,SAAS,CAAC,MAAM;AACd,UAAMS,cAAc,GAAIC,CAAD,IAAO;AAC5B,UAAIH,aAAa,CAACI,OAAd,KAA0B,IAA1B,IAAkC,CAACJ,aAAa,CAACI,OAAd,CAAsBC,QAAtB,CAA+BF,CAAC,CAACG,MAAjC,CAAvC,EAAiF;AAC/EL,QAAAA,uBAAuB;AACxB;AACF,KAJD,CADc,CAOd;;;AACA,QAAIH,yBAAJ,EAA+B;AAC7BS,MAAAA,MAAM,CAACC,gBAAP,CAAwB,OAAxB,EAAiCN,cAAjC;AACD;;AAED,WAAO,MAAM;AACXK,MAAAA,MAAM,CAACE,mBAAP,CAA2B,OAA3B,EAAoCP,cAApC;AACD,KAFD;AAID,GAhBQ,EAgBN,CAACJ,yBAAD,CAhBM,CAAT;AAkBA,QAAM,CAACY,SAAD,EAAYC,YAAZ,IAA4BnB,QAAQ,CAAC,EAAD,CAA1C;AACA,QAAM,CAACoB,QAAD,EAAWC,W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;AAAA;AAAA;AAAA,oBAtBF,eA6BE;AAAA,2DAEE;AACE,gBAAA,EAAE,EAAC,UADL;AACgB,gBAAA,IAAI,EAAC,UADrB;AAEE,gBAAA,KAAK,EAAEb,eAFT;AAGE,gBAAA,QAAQ,EAAEc;AAHZ;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBA7BF,eAoCE;AAAO,cAAA,SAAS,EAAC,uBAAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBApCF,eAuCE;AAAQ,cAAA,SAAS,EAAC,kBAAlB;AAAqC,cAAA,IAAI,EAAC,QAA1C;AAAA,yDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBAvCF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YADF,eAqDE;AAAK,MAAA,SAAS,EAAC,QAAf;AAAA,6BACE;AAAK,QAAA,SAAS,EAAC,gBAAf;AAAA,gCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBADF,eAEE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAFF,eAGE;AAAQ,UAAA,SAAS,EAAC,wBAAlB;AAA2C,UAAA,OAAO,EAAE/B,uBAApD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAHF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YArDF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAkED,CA7KD;;GAAMJ,M;;KAAAA,M;AA+KN,eAAeA,MAAf","sourcesContent":["import React, { useState, useEffect, useRef } from 'react'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport config from '../../../config';\r\nimport \"./SignUp.css\"\r\n\r\nconst SignUp = () => {\r\n const [signUpFormVisibilityState, showSignUpForm] = useState(false)\r\n const signUpFormRef = useRef(null);\r\n const toggleSignUpFormVisible = () => showSignUpForm(!signUpFormVisibilityState)\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\r\n toggleSignUpFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (signUpFormVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [signUpFormVisibilityState]);\r\n\r\n const [firstname, setfirstname] = useState('')\r\n const [lastname, setlastname] = useState('')\r\n const [username, setUsername] = useState('');\r\n const [password, setPassword] = useState('');\r\n const [confirmPassword, setConfirmPassword] = useState('');\r\n\r\n const userInputData = JSON.stringify({\r\n firstname: `${firstname}`,\r\n lastname: `${lastname}`,\r\n email: `${username}`,\r\n password: `${password}`\r\n })\r\n\r\n const loginRequestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handlefirstnameChange = (e) => {\r\n setfirstname(e.target.value)\r\n }\r\n\r\n const handlelastnameChange = (e) => {\r\n setlastname(e.target.value)\r\n }\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n const handleConfirmPasswordChange = (e) => {\r\n setConfirmPassword(e.target.value)\r\n }\r\n\r\n const handleSignUpFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n if (!password || !confirmPassword) {\r\n window.alert(\"A password field is blank\")\r\n return\r\n }\r\n\r\n if (!(confirmPassword.length >= 7)) {\r\n window.alert(\"Password must consist of 8 characters or more\")\r\n return\r\n }\r\n\r\n if (!(password == confirmPassword)) {\r\n window.alert(\"Passwords fo not match\")\r\n return\r\n }\r\n\r\n else {\r\n fetch(config.serviceAPI.createNewUserURL, loginRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n // handleSignInFormSubmit(e)\r\n }\r\n })\r\n }\r\n }\r\n\r\n const handleSignInFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n oktaAuth.signInWithCredentials({ username, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n };\r\n\r\n return (\r\n <div className=\"signUpContainer\">\r\n <div className={`modal ${signUpFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={signUpFormRef} className=\"modal-content\">\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSignUpFormSubmit}>\r\n <label>\r\n First name:\r\n <input\r\n id=\"firstname\" type=\"text\"\r\n value={firstname}\r\n onChange={handlefirstnameChange} />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n id=\"lastname\" type=\"text\"\r\n value={lastname}\r\n onChange={handlelastnameChange} />\r\n </label>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <label>\r\n Confirm Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={confirmPassword}\r\n onChange={handleConfirmPasswordChange} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n <button className=\"signUpForm-show-button\" onClick={toggleSignUpFormVisible}>\r\n Sign up\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default SignUp\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\account\\\\Account.jsx\",\n _s = $RefreshSig$();\n\n// rfce\nimport React, { useState, useEffect } from 'react';\nimport \"./Account.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useOktaAuth } from '@okta/okta-react';\nimport ConfirmRemoveAccountModal from \"./confirmRemoveAccountModal/ConfirmRemoveAccountModal\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nfunction Account() {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false);\n\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState);\n\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"page-content-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content-header\",\n children: /*#__PURE__*/_jsxDEV(\"h2\", {\n className: \"welcome-text\",\n children: \"Account information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 28,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"accountpage-content\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"personal-information-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-circle\",\n className: \"user-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Personal information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 36,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"pen\",\n className: \"pen-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 15\n }, this), \"Edit\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 37,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 34,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Name:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? userInfo.name : \"Fetching firstname\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? userInfo.email : \"fetching email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 33,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"change-password-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"lock\",\n className: \"lock-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Change password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Password requirements:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: \"At least 8 characters\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"No parts of username may be included\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"Your password may not be any of the last 4 passwords\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"reset-password-form-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Old password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 81,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"New password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Confirm new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 93,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"passwordResetSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 101,\n columnNumber: 21\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"deactivate-account-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"trash\",\n className: \"trash-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 111,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 112,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 110,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Your account and all your data will be permanently deleted\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 115,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n onClick: toggleConfirmAccountRemoveModalState,\n children: \"Delete\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 118,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 109,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${confirmAccountRemoveModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(ConfirmRemoveAccountModal, {\n removeModal: () => setConfirmAccountRemoveModalState(false)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 125,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 124,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 27,\n columnNumber: 5\n }, this);\n}\n\n_s(Account, \"Q9dz9d9vt2i1tyA3W6mcd1htZ7g=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = Account;\nexport default Account;\n\nvar _c;\n\n$RefreshReg$(_c, \"Account\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/Account.jsx"],"names":["React","useState","useEffect","FontAwesomeIcon","useOktaAuth","ConfirmRemoveAccountModal","Account","authState","oktaAuth","userInfo","setUserInfo","confirmAccountRemoveModalState","setConfirmAccountRemoveModalState","toggleConfirmAccountRemoveModalState","isAuthenticated","getUser","then","info","name","email"],"mappings":";;;AAAA;AACA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAO,eAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAOC,yBAAP,MAAsC,uDAAtC;;;AAEA,SAASC,OAAT,GA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ADF,eAEE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBADF,eAKE;AAAK,UAAA,SAAS,EAAC,SAAf;AAAA,kCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF,eAIE;AAAQ,YAAA,OAAO,EAAEN,oCAAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,gBALF;AAAA;AAAA;AAAA;AAAA;AAAA,cA9EF;AAAA;AAAA;AAAA;AAAA;AAAA,YAJF,eAiGE;AAAK,MAAA,SAAS,EAAG,SAAQF,8BAA8B,GAAG,QAAH,GAAc,UAAW,EAAhF;AAAA,6BACE,QAAC,yBAAD;AAA2B,QAAA,WAAW,EAAE,MAAMC,iCAAiC,CAAC,KAAD;AAA/E;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAjGF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAuGD;;GAzHQN,O;UACyBF,W;;;KADzBE,O;AA2HT,eAAeA,OAAf","sourcesContent":["// rfce\r\nimport React, { useState, useEffect } from 'react'\r\nimport \"./Account.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport ConfirmRemoveAccountModal from \"./confirmRemoveAccountModal/ConfirmRemoveAccountModal\"\r\n\r\nfunction Account() {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false)\r\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState)\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"welcome-text\">Account information</h2>\r\n </div>\r\n <div className=\"accountpage-content\">\r\n\r\n <div className=\"personal-information-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"user-circle\" className=\"user-icon\"></FontAwesomeIcon>\r\n <h5>Personal information</h5>\r\n <button>\r\n <FontAwesomeIcon icon=\"pen\" className=\"pen-icon\"></FontAwesomeIcon>\r\n Edit\r\n </button>\r\n </div>\r\n <div className=\"content\">\r\n <ul>\r\n <li>\r\n <b>Name:</b>\r\n </li>\r\n <li>\r\n {userInfo ? userInfo.name : \"Fetching firstname\"}\r\n </li>\r\n <li>\r\n <b>Email</b>\r\n </li>\r\n <li>\r\n {userInfo ? userInfo.email : \"fetching email\"}\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n <div className=\"change-password-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"lock\" className=\"lock-icon\"></FontAwesomeIcon>\r\n <h5>Change password</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>Password requirements:</p>\r\n <ul>\r\n <li>\r\n At least 8 characters\r\n </li>\r\n <li>\r\n No parts of username may be included\r\n </li>\r\n <li>\r\n Your password may not be any of the last 4 passwords\r\n </li>\r\n </ul>\r\n <form>\r\n <div className=\"reset-password-form-container\">\r\n <div className=\"form-item\">\r\n <label>\r\n Old password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n New password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n Confirm new password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <button className=\"passwordResetSubmitButton\" type=\"submit\">\r\n Submit&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n\r\n <div className=\"deactivate-account-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"trash\" className=\"trash-icon\"></FontAwesomeIcon>\r\n <h5>Delete account</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>\r\n Your account and all your data will be permanently deleted\r\n </p>\r\n <button onClick={toggleConfirmAccountRemoveModalState}>\r\n Delete\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div className={`modal ${confirmAccountRemoveModalState ? \"active\" : \"inactive\"}`}>\r\n <ConfirmRemoveAccountModal removeModal={() => setConfirmAccountRemoveModalState(false)} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default Account\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"export default {\n oidc: {\n clientId: '0oa1f4zfeiiZPB6DF5d7',\n issuer: 'https://dev-91882654.okta.com/oauth2/default',\n redirectUri: window.location.origin + '/login/callback',\n scopes: ['openid', 'profile', 'email'],\n pkce: true\n },\n serviceAPI: {\n messagesURL: 'http://localhost:3030/api/messages',\n createNewUserURL: 'http://localhost:3030/api/create-user',\n forgotPasswordURL: 'http://localhost:3030/api/recover-user-password',\n removeAccountURL: 'http://localhost:3030/api/remove-user'\n }\n};","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/config.js"],"names":["oidc","clientId","issuer","redirectUri","window","location","origin","scopes","pkce","serviceAPI","messagesURL","createNewUserURL","forgotPasswordURL","removeAccountURL"],"mappings":"AAAA,eAAe;AACbA,EAAAA,IAAI,EAAE;AACJC,IAAAA,QAAQ,EAAE,sBADN;AAEJC,IAAAA,MAAM,EAAE,8CAFJ;AAGJC,IAAAA,WAAW,EAAEC,MAAM,CAACC,QAAP,CAAgBC,MAAhB,GAAyB,iBAHlC;AAIJC,IAAAA,MAAM,EAAE,CAAC,QAAD,EAAW,SAAX,EAAsB,OAAtB,CAJJ;AAKJC,IAAAA,IAAI,EAAE;AALF,GADO;AAQbC,EAAAA,UAAU,EAAE;AACVC,IAAAA,WAAW,EAAE,oCADH;AAEVC,IAAAA,gBAAgB,EAAE,uCAFR;AAGVC,IAAAA,iBAAiB,EAAE,iDAHT;AAIVC,IAAAA,gBAAgB,EAAE;AAJR;AARC,CAAf","sourcesContent":["export default {\r\n oidc: {\r\n clientId: '0oa1f4zfeiiZPB6DF5d7',\r\n issuer: 'https://dev-91882654.okta.com/oauth2/default',\r\n redirectUri: window.location.origin + '/login/callback',\r\n scopes: ['openid', 'profile', 'email'],\r\n pkce: true\r\n },\r\n serviceAPI: {\r\n messagesURL: 'http://localhost:3030/api/messages',\r\n createNewUserURL: 'http://localhost:3030/api/create-user',\r\n forgotPasswordURL: 'http://localhost:3030/api/recover-user-password',\r\n removeAccountURL: 'http://localhost:3030/api/remove-user'\r\n }\r\n};"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\confirmRemoveAccountModal\\\\ConfirmRemoveAccountModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useEffect, useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./ConfirmRemoveAccountModal.css\";\nimport config from '../../config';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ConfirmRemoveAccountModal = ({\n removeModal,\n headerMessage,\n bodyMessage\n}) => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const accessToken = oktaAuth.getAccessToken();\n\n const stopProp = e => {\n e.stopPropagation();\n };\n\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const removeAccountRequestOptions = {\n method: 'DELETE',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: JSON.stringify({\n email: `${userInfo && userInfo.email}`\n })\n };\n\n const handleRemoveAccount = () => {\n console.log(removeAccountRequestOptions.body);\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions).then(res => {\n if (!res.ok) {\n console.log(res);\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n oktaAuth.signOut();\n }\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"confirmRemoveAccountModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Are you sure you want to delete your account?\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"buttonContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: \"noButton\",\n onClick: e => removeModal(),\n children: \"No\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"yesButton\",\n onClick: handleRemoveAccount,\n children: \"Yes\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 5\n }, this);\n};\n\n_s(ConfirmRemoveAccountModal, \"/7FunoA1ejJNU8uKGTy1GZFqU2I=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = ConfirmRemoveAccountModal;\nexport default ConfirmRemoveAccountModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"ConfirmRemoveAccountModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/confirmRemoveAccountModal/ConfirmRemoveAccountModal.jsx"],"names":["React","useEffect","useState","useOktaAuth","config","ConfirmRemoveAccountModal","removeModal","headerMessage","bodyMessage","authState","oktaAuth","userInfo","setUserInfo","accessToken","getAccessToken","stopProp","e","stopPropagation","isAuthenticated","getUser","then","info","removeAccountRequestOptions","method","headers","Authorization","body","JSON","stringify","email","handleRemoveAccount","console","log","fetch","serviceAPI","removeAccountURL","res","ok","window","alert","Promise","reject","signOut"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,QAA3B,QAA2C,OAA3C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,iCAAP;AACA,OAAOC,MAAP,MAAmB,cAAnB;;;AAEA,MAAMC,yBAAyB,GAAG,CAAC;AAAEC,EAAAA,WAAF;AAAeC,EAAAA,aAAf;AAA8BC,EAAAA;AAA9B,CAAD,KAAiD;AAAA;;AACjF,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BP,WAAW,EAA3C;AACA,QAAM,CAACQ,QAAD,EAAWC,WAAX,IAA0BV,QAAQ,CAAC,IAAD,CAAxC;AACA,QAAMW,WAAW,GAAGH,QAAQ,CAACI,cAAT,EAApB;;AAEA,QAAMC,QAAQ,GAAGC,CAAC,IAAI;AACpBA,IAAAA,CAAC,CAACC,eAAF;AACD,GAFD;;AAIAhB,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACQ,SAAS,CAACS,eAAf,EAAgC;AAC9B;AACAN,MAAAA,WAAW,CAAC,IAAD,CAAX;AACD,KAHD,MAGO;AACLF,MAAAA,QAAQ,CAACS,OAAT,GAAmBC,IAAnB,CAAwBC,IAAI,IAAI;AAC9BT,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AAA;AAAA;AAAA;AAAA;AAAA,gBADF,eAIE;AAAQ,UAAA,SAAS,EAAC,WAAlB;AAA8B,UAAA,OAAO,EAAEwB,mBAAvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,cALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAkBD,CAlED;;GAAMzB,yB;UAC4BF,W;;;KAD5BE,yB;AAoEN,eAAeA,yBAAf","sourcesContent":["import React, { useEffect, useState } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./ConfirmRemoveAccountModal.css\"\r\nimport config from '../../config';\r\n\r\nconst ConfirmRemoveAccountModal = ({ removeModal, headerMessage, bodyMessage }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n const accessToken = oktaAuth.getAccessToken();\r\n\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const removeAccountRequestOptions = {\r\n method: 'DELETE',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(\r\n {\r\n email: `${userInfo && userInfo.email}`,\r\n }\r\n )\r\n }\r\n\r\n const handleRemoveAccount = () => {\r\n console.log(removeAccountRequestOptions.body)\r\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n console.log(res)\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n oktaAuth.signOut()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\">\r\n <div className=\"confirmRemoveAccountModal\">\r\n <h2>Delete account</h2>\r\n <label>\r\n Are you sure you want to delete your account?\r\n </label>\r\n <div className=\"buttonContainer\">\r\n <button className=\"noButton\" onClick={e => removeModal()}>\r\n No\r\n </button>\r\n <button className=\"yesButton\" onClick={handleRemoveAccount}>\r\n Yes\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ConfirmRemoveAccountModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect, useRef } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport config from '../../../config';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const [signUpFormVisibilityState, showSignUpForm] = useState(false);\n const signUpFormRef = useRef(null);\n\n const toggleSignUpFormVisible = () => showSignUpForm(!signUpFormVisibilityState);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\n toggleSignUpFormVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (signUpFormVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [signUpFormVisibilityState]);\n const [firstname, setfirstname] = useState('');\n const [lastname, setlastname] = useState('');\n const [username, setUsername] = useState('');\n const [password, setPassword] = useState('');\n const [confirmPassword, setConfirmPassword] = useState('');\n const userInputData = JSON.stringify({\n firstname: `${firstname}`,\n lastname: `${lastname}`,\n email: `${username}`,\n password: `${password}`\n });\n const loginRequestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handlefirstnameChange = e => {\n setfirstname(e.target.value);\n };\n\n const handlelastnameChange = e => {\n setlastname(e.target.value);\n };\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n const handlePasswordChange = e => {\n setPassword(e.target.value);\n };\n\n const handleConfirmPasswordChange = e => {\n setConfirmPassword(e.target.value);\n };\n\n const handleSignUpFormSubmit = e => {\n e.preventDefault();\n\n if (!password || !confirmPassword) {\n window.alert(\"A password field is blank\");\n return;\n }\n\n if (!(confirmPassword.length >= 7)) {\n window.alert(\"Password must consist of 8 characters or more\");\n return;\n }\n\n if (!(password == confirmPassword)) {\n window.alert(\"Passwords fo not match\");\n return;\n } else {\n fetch(config.serviceAPI.createNewUserURL, loginRequestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {// handleSignInFormSubmit(e)\n }\n });\n }\n };\n\n const handleSignInFormSubmit = e => {\n e.preventDefault();\n oktaAuth.signInWithCredentials({\n username,\n password\n }).then(res => {\n const sessionToken = res.sessionToken;\n setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once\n\n oktaAuth.signInWithRedirect({\n sessionToken,\n originalUri: '/home'\n });\n }).catch(err => console.log('Found an error', err));\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${signUpFormVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n ref: signUpFormRef,\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 122,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSignUpFormSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"First name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"firstname\",\n type: \"text\",\n value: firstname,\n onChange: handlefirstnameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 126,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 124,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Last Name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"lastname\",\n type: \"text\",\n value: lastname,\n onChange: handlelastnameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 133,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 131,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 140,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 138,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 147,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 145,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Confirm Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: confirmPassword,\n onChange: handleConfirmPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 154,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 152,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 159,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 164,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 162,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 123,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 121,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 120,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 119,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 173,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 174,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"signUpForm-show-button\",\n onClick: toggleSignUpFormVisible,\n children: \"Sign up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 175,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 172,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 171,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 118,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"zaW+hWyZ5ozdpRaUbww+EQWIQgM=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/signUp/SignUp.jsx"],"names":["React","useState","useEffect","useRef","FontAwesomeIcon","config","useOktaAuth","SignUp","authState","oktaAuth","sessionToken","setSessionToken","signUpFormVisibilityState","showSignUpForm","signUpFormRef","toggleSignUpFormVisible","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","firstname","setfirstname","lastname","setlastname","username","setUsername","password","setPassword","confirmPassword","setConfirmPassword","userInputData","JSON","stringify","email","loginRequestOptions","method","body","handlefirstnameChange","value","handlelastnameChange","handleUsernameChange","handlePasswordChange","handleConfirmPasswordChange","handleSignUpFormSubmit","preventDefault","alert","length","fetch","serviceAPI","createNewUserURL","then","res","ok","Promise","reject","handleSignInFormSubmit","signInWithCredentials","signInWithRedirect","originalUri","catch","err","console","log"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,QAAmD,OAAnD;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,cAAP;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BH,WAAW,EAA3C;AACA,QAAM,CAACI,YAAD,EAAeC,eAAf,IAAkCV,QAAQ,EAAhD;AAEA,QAAM,CAACW,yBAAD,EAA4BC,cAA5B,IAA8CZ,QA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;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBAvCF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YADF,eAqDE;AAAK,MAAA,SAAS,EAAC,QAAf;AAAA,6BACE;AAAK,QAAA,SAAS,EAAC,gBAAf;AAAA,gCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBADF,eAEE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAFF,eAGE;AAAQ,UAAA,SAAS,EAAC,wBAAlB;AAA2C,UAAA,OAAO,EAAE/B,uBAApD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAHF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YArDF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAkED,CAhLD;;GAAMR,M;UAC4BD,W;;;KAD5BC,M;AAkLN,eAAeA,MAAf","sourcesContent":["import React, { useState, useEffect, useRef } from 'react'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport config from '../../../config';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./SignUp.css\"\r\n\r\nconst SignUp = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState()\r\n\r\n const [signUpFormVisibilityState, showSignUpForm] = useState(false)\r\n const signUpFormRef = useRef(null);\r\n const toggleSignUpFormVisible = () => showSignUpForm(!signUpFormVisibilityState)\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\r\n toggleSignUpFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (signUpFormVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [signUpFormVisibilityState]);\r\n\r\n const [firstname, setfirstname] = useState('')\r\n const [lastname, setlastname] = useState('')\r\n const [username, setUsername] = useState('');\r\n const [password, setPassword] = useState('');\r\n const [confirmPassword, setConfirmPassword] = useState('');\r\n\r\n const userInputData = JSON.stringify({\r\n firstname: `${firstname}`,\r\n lastname: `${lastname}`,\r\n email: `${username}`,\r\n password: `${password}`\r\n })\r\n\r\n const loginRequestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handlefirstnameChange = (e) => {\r\n setfirstname(e.target.value)\r\n }\r\n\r\n const handlelastnameChange = (e) => {\r\n setlastname(e.target.value)\r\n }\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n const handleConfirmPasswordChange = (e) => {\r\n setConfirmPassword(e.target.value)\r\n }\r\n\r\n const handleSignUpFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n if (!password || !confirmPassword) {\r\n window.alert(\"A password field is blank\")\r\n return\r\n }\r\n\r\n if (!(confirmPassword.length >= 7)) {\r\n window.alert(\"Password must consist of 8 characters or more\")\r\n return\r\n }\r\n\r\n if (!(password == confirmPassword)) {\r\n window.alert(\"Passwords fo not match\")\r\n return\r\n }\r\n\r\n else {\r\n fetch(config.serviceAPI.createNewUserURL, loginRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n // handleSignInFormSubmit(e)\r\n }\r\n })\r\n }\r\n }\r\n\r\n const handleSignInFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n oktaAuth.signInWithCredentials({ username, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n };\r\n\r\n return (\r\n <div className=\"signUpContainer\">\r\n <div className={`modal ${signUpFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={signUpFormRef} className=\"modal-content\">\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSignUpFormSubmit}>\r\n <label>\r\n First name:\r\n <input\r\n id=\"firstname\" type=\"text\"\r\n value={firstname}\r\n onChange={handlefirstnameChange} />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n id=\"lastname\" type=\"text\"\r\n value={lastname}\r\n onChange={handlelastnameChange} />\r\n </label>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <label>\r\n Confirm Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={confirmPassword}\r\n onChange={handleConfirmPasswordChange} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n <button className=\"signUpForm-show-button\" onClick={toggleSignUpFormVisible}>\r\n Sign up\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default SignUp\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\account\\\\Account.jsx\",\n _s = $RefreshSig$();\n\n// rfce\nimport React, { useState, useEffect } from 'react';\nimport \"./Account.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useOktaAuth } from '@okta/okta-react';\nimport ConfirmRemoveAccountModal from \"./confirmRemoveAccountModal/ConfirmRemoveAccountModal\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nfunction Account() {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false);\n\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState);\n\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"page-content-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content-header\",\n children: /*#__PURE__*/_jsxDEV(\"h2\", {\n className: \"welcome-text\",\n children: \"Account information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 28,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"accountpage-content\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"personal-information-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-circle\",\n className: \"user-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Personal information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 36,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"pen\",\n className: \"pen-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 15\n }, this), \"Edit\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 37,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 34,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Full name:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? userInfo.name : \"Fetching firstname\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? userInfo.email : \"fetching email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 33,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"change-password-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"lock\",\n className: \"lock-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Change password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Password requirements:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: \"At least 8 characters\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"No parts of username may be included\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"Your password may not be any of the last 4 passwords\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"reset-password-form-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Old password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 81,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"New password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Confirm new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 93,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"passwordResetSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 101,\n columnNumber: 21\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"deactivate-account-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"trash\",\n className: \"trash-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 111,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 112,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 110,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Your account and all your data will be permanently deleted\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 115,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n onClick: toggleConfirmAccountRemoveModalState,\n children: \"Delete\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 118,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 109,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${confirmAccountRemoveModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(ConfirmRemoveAccountModal, {\n removeModal: () => setConfirmAccountRemoveModalState(false)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 125,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 124,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 27,\n columnNumber: 5\n }, this);\n}\n\n_s(Account, \"Q9dz9d9vt2i1tyA3W6mcd1htZ7g=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = Account;\nexport default Account;\n\nvar _c;\n\n$RefreshReg$(_c, \"Account\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/Account.jsx"],"names":["React","useState","useEffect","FontAwesomeIcon","useOktaAuth","ConfirmRemoveAccountModal","Account","authState","oktaAuth","userInfo","setUserInfo","confirmAccountRemoveModalState","setConfirmAccountRemoveModalState","toggleConfirmAccountRemoveModalState","isAuthenticated","getUser","then","info","name","email"],"mappings":";;;AAAA;AACA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAO,eAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAOC,yBAAP,MAAsC,uDAAtC;;;AAEA,SAASC,OAAT,GAAmB;AAAA;;AACjB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BJ,WAAW,EAA3C;AACA,QAAM,CAACK,QAAD,EAAWC,WAAX,IAA0BT,QAAQ,CAAC,IAAD,CAAxC;AAEA,QAAM,CAACU,8BAAD,EAAiCC,iCAAjC,IAAsEX,QAAQ,CAAC,KAAD,CAApF;;AACA,QAAMY,oCAAoC,GAAG,MAAMD,iCAAiC,CAAC,CAACD,8BAAF,CAApF;;AAEAT,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACK,SAAS,CAACO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A,YAJF,eAiGE;AAAK,MAAA,SAAS,EAAG,SAAQF,8BAA8B,GAAG,QAAH,GAAc,UAAW,EAAhF;AAAA,6BACE,QAAC,yBAAD;AAA2B,QAAA,WAAW,EAAE,MAAMC,iCAAiC,CAAC,KAAD;AAA/E;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAjGF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAuGD;;GAzHQN,O;UACyBF,W;;;KADzBE,O;AA2HT,eAAeA,OAAf","sourcesContent":["// rfce\r\nimport React, { useState, useEffect } from 'react'\r\nimport \"./Account.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport ConfirmRemoveAccountModal from \"./confirmRemoveAccountModal/ConfirmRemoveAccountModal\"\r\n\r\nfunction Account() {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false)\r\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState)\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"welcome-text\">Account information</h2>\r\n </div>\r\n <div className=\"accountpage-content\">\r\n\r\n <div className=\"personal-information-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"user-circle\" className=\"user-icon\"></FontAwesomeIcon>\r\n <h5>Personal information</h5>\r\n <button>\r\n <FontAwesomeIcon icon=\"pen\" className=\"pen-icon\"></FontAwesomeIcon>\r\n Edit\r\n </button>\r\n </div>\r\n <div className=\"content\">\r\n <ul>\r\n <li>\r\n <b>Full name:</b>\r\n </li>\r\n <li>\r\n {userInfo ? userInfo.name : \"Fetching firstname\"}\r\n </li>\r\n <li>\r\n <b>Email</b>\r\n </li>\r\n <li>\r\n {userInfo ? userInfo.email : \"fetching email\"}\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n <div className=\"change-password-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"lock\" className=\"lock-icon\"></FontAwesomeIcon>\r\n <h5>Change password</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>Password requirements:</p>\r\n <ul>\r\n <li>\r\n At least 8 characters\r\n </li>\r\n <li>\r\n No parts of username may be included\r\n </li>\r\n <li>\r\n Your password may not be any of the last 4 passwords\r\n </li>\r\n </ul>\r\n <form>\r\n <div className=\"reset-password-form-container\">\r\n <div className=\"form-item\">\r\n <label>\r\n Old password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n New password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n Confirm new password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <button className=\"passwordResetSubmitButton\" type=\"submit\">\r\n Submit&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n\r\n <div className=\"deactivate-account-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"trash\" className=\"trash-icon\"></FontAwesomeIcon>\r\n <h5>Delete account</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>\r\n Your account and all your data will be permanently deleted\r\n </p>\r\n <button onClick={toggleConfirmAccountRemoveModalState}>\r\n Delete\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div className={`modal ${confirmAccountRemoveModalState ? \"active\" : \"inactive\"}`}>\r\n <ConfirmRemoveAccountModal removeModal={() => setConfirmAccountRemoveModalState(false)} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default Account\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\account\\\\confirmRemoveAccountModal\\\\ConfirmRemoveAccountModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useEffect, useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./ConfirmRemoveAccountModal.css\";\nimport config from '../../../config';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ConfirmRemoveAccountModal = ({\n removeModal,\n headerMessage,\n bodyMessage\n}) => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const accessToken = oktaAuth.getAccessToken();\n\n const stopProp = e => {\n e.stopPropagation();\n };\n\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const removeAccountRequestOptions = {\n method: 'DELETE',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: JSON.stringify({\n email: `${userInfo && userInfo.email}`\n })\n };\n\n const handleRemoveAccount = () => {\n console.log(removeAccountRequestOptions.body);\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions).then(res => {\n if (!res.ok) {\n console.log(res);\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n oktaAuth.signOut();\n }\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"confirmRemoveAccountModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Are you sure you want to delete your account?\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"buttonContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: \"noButton\",\n onClick: e => removeModal(),\n children: \"No\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"yesButton\",\n onClick: handleRemoveAccount,\n children: \"Yes\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 5\n }, this);\n};\n\n_s(ConfirmRemoveAccountModal, \"/7FunoA1ejJNU8uKGTy1GZFqU2I=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = ConfirmRemoveAccountModal;\nexport default ConfirmRemoveAccountModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"ConfirmRemoveAccountModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/confirmRemoveAccountModal/ConfirmRemoveAccountModal.jsx"],"names":["React","useEffect","useState","useOktaAuth","config","ConfirmRemoveAccountModal","removeModal","headerMessage","bodyMessage","authState","oktaAuth","userInfo","setUserInfo","accessToken","getAccessToken","stopProp","e","stopPropagation","isAuthenticated","getUser","then","info","removeAccountRequestOptions","method","headers","Authorization","body","JSON","stringify","email","handleRemoveAccount","console","log","fetch","serviceAPI","removeAccountURL","res","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G,MAAM;AAChCC,IAAAA,OAAO,CAACC,GAAR,CAAYV,2BAA2B,CAACI,IAAxC;AACAO,IAAAA,KAAK,CAAC7B,MAAM,CAAC8B,UAAP,CAAkBC,gBAAnB,EAAqCb,2BAArC,CAAL,CACGF,IADH,CACSgB,GAAD,IAAS;AACb,UAAI,CAACA,GAAG,CAACC,EAAT,EAAa;AACXN,QAAAA,OAAO,CAACC,GAAR,CAAYI,GAAZ;AACAE,QAAAA,MAAM,CAACC,KAAP,CAAa,OAAb;AACAC,QAAAA,OAAO,CAACC,MAAR,CAAe,EAAf;AACA;AACD;;AACD,UAAIL,GAAG,CAACC,EAAR,EAAY;AACV3B,QAAAA,QAAQ,CAACgC,OAAT;AACD;AACF,KAXH;AAYD,GAdD;;AAgBA,sBACE;AAAK,IAAA,SAAS,EAAC,eAAf;AAAA,2BACE;AAAK,MAAA,SAAS,EAAC,2BAAf;AAAA,8BACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cADF,eAEE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eAKE;AAAK,QAAA,SAAS,EAAC,iBAAf;AAAA,gCACE;AAAQ,UAAA,SAAS,EAAC,UAAlB;AAA6B,UAAA,OAAO,EAAE1B,CAAC,IAAIV,WAAW,EAAtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBADF,eAIE;AAAQ,UAAA,SAAS,EAAC,WAAlB;AAA8B,UAAA,OAAO,EAAEwB,mBAAvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,cALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAkBD,CAlED;;GAAMzB,yB;UAC4BF,W;;;KAD5BE,yB;AAoEN,eAAeA,yBAAf","sourcesContent":["import React, { useEffect, useState } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./ConfirmRemoveAccountModal.css\"\r\nimport config from '../../../config';\r\n\r\nconst ConfirmRemoveAccountModal = ({ removeModal, headerMessage, bodyMessage }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n const accessToken = oktaAuth.getAccessToken();\r\n\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const removeAccountRequestOptions = {\r\n method: 'DELETE',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(\r\n {\r\n email: `${userInfo && userInfo.email}`,\r\n }\r\n )\r\n }\r\n\r\n const handleRemoveAccount = () => {\r\n console.log(removeAccountRequestOptions.body)\r\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n console.log(res)\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n oktaAuth.signOut()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\">\r\n <div className=\"confirmRemoveAccountModal\">\r\n <h2>Delete account</h2>\r\n <label>\r\n Are you sure you want to delete your account?\r\n </label>\r\n <div className=\"buttonContainer\">\r\n <button className=\"noButton\" onClick={e => removeModal()}>\r\n No\r\n </button>\r\n <button className=\"yesButton\" onClick={handleRemoveAccount}>\r\n Yes\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ConfirmRemoveAccountModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
...@@ -9,7 +9,7 @@ export default { ...@@ -9,7 +9,7 @@ export default {
serviceAPI: { serviceAPI: {
messagesURL: 'http://localhost:3030/api/messages', messagesURL: 'http://localhost:3030/api/messages',
createNewUserURL: 'http://localhost:3030/api/create-user', createNewUserURL: 'http://localhost:3030/api/create-user',
forgotPasswordURL: 'http://localhost:3030/api/reset-user-password', forgotPasswordURL: 'http://localhost:3030/api/recover-user-password',
removeAccountURL: 'http://localhost:3030/api/remove-user' removeAccountURL: 'http://localhost:3030/api/remove-user'
} }
}; };
\ No newline at end of file
...@@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react' ...@@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react'
import "./Account.css" import "./Account.css"
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { useOktaAuth } from '@okta/okta-react'; import { useOktaAuth } from '@okta/okta-react';
import ConfirmRemoveAccountModal from '../../components/confirmRemoveAccountModal/ConfirmRemoveAccountModal'; import ConfirmRemoveAccountModal from "./confirmRemoveAccountModal/ConfirmRemoveAccountModal"
function Account() { function Account() {
const { authState, oktaAuth } = useOktaAuth(); const { authState, oktaAuth } = useOktaAuth();
...@@ -42,7 +42,7 @@ function Account() { ...@@ -42,7 +42,7 @@ function Account() {
<div className="content"> <div className="content">
<ul> <ul>
<li> <li>
<b>Full name:</b> <b>Name:</b>
</li> </li>
<li> <li>
{userInfo ? userInfo.name : "Fetching firstname"} {userInfo ? userInfo.name : "Fetching firstname"}
......
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import { useOktaAuth } from '@okta/okta-react'; import { useOktaAuth } from '@okta/okta-react';
import "./ConfirmRemoveAccountModal.css" import "./ConfirmRemoveAccountModal.css"
import config from '../../config'; import config from '../../../config';
const ConfirmRemoveAccountModal = ({ removeModal, headerMessage, bodyMessage }) => { const ConfirmRemoveAccountModal = ({ removeModal, headerMessage, bodyMessage }) => {
const { authState, oktaAuth } = useOktaAuth(); const { authState, oktaAuth } = useOktaAuth();
const [userInfo, setUserInfo] = useState(null); const [userInfo, setUserInfo] = useState(null);
const accessToken = oktaAuth.getAccessToken();
const stopProp = e => { const stopProp = e => {
e.stopPropagation() e.stopPropagation()
...@@ -24,6 +25,9 @@ const ConfirmRemoveAccountModal = ({ removeModal, headerMessage, bodyMessage }) ...@@ -24,6 +25,9 @@ const ConfirmRemoveAccountModal = ({ removeModal, headerMessage, bodyMessage })
const removeAccountRequestOptions = { const removeAccountRequestOptions = {
method: 'DELETE', method: 'DELETE',
headers: {
Authorization: `Bearer ${accessToken}`,
},
body: JSON.stringify( body: JSON.stringify(
{ {
email: `${userInfo && userInfo.email}`, email: `${userInfo && userInfo.email}`,
......
import React, { useState, useEffect, useRef } from 'react' import React, { useState, useEffect, useRef } from 'react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import config from '../../../config'; import config from '../../../config';
import { useOktaAuth } from '@okta/okta-react';
import "./SignUp.css" import "./SignUp.css"
const SignUp = () => { const SignUp = () => {
const { authState, oktaAuth } = useOktaAuth();
const [sessionToken, setSessionToken] = useState()
const [signUpFormVisibilityState, showSignUpForm] = useState(false) const [signUpFormVisibilityState, showSignUpForm] = useState(false)
const signUpFormRef = useRef(null); const signUpFormRef = useRef(null);
const toggleSignUpFormVisible = () => showSignUpForm(!signUpFormVisibilityState) const toggleSignUpFormVisible = () => showSignUpForm(!signUpFormVisibilityState)
...@@ -91,12 +95,25 @@ const SignUp = () => { ...@@ -91,12 +95,25 @@ const SignUp = () => {
return return
} }
if (res.ok) { if (res.ok) {
// handleSignInFormSubmit(e) handleSignInFormSubmit(e)
} }
}) })
} }
} }
const handleSignInFormSubmit = (e) => {
e.preventDefault();
oktaAuth.signInWithCredentials({ username, password })
.then(res => {
const sessionToken = res.sessionToken;
setSessionToken(sessionToken);
// sessionToken is a one-use token, so make sure this is only called once
oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });
})
.catch(err => console.log('Found an error', err));
};
return ( return (
<div className="signUpContainer"> <div className="signUpContainer">
<div className={`modal ${signUpFormVisibilityState ? "active" : "inactive"}`}> <div className={`modal ${signUpFormVisibilityState ? "active" : "inactive"}`}>
......
...@@ -11,7 +11,7 @@ import ( ...@@ -11,7 +11,7 @@ import (
"serviceAPI/service" "serviceAPI/service"
) )
// TODO: Wrap "service.Authenticate()" around methods when done testing // TODO: Wrap "service.Authenticate()" around methods when done testing - just like "remove-user" request
func main() { func main() {
oktaUtils.ParseEnvironment() oktaUtils.ParseEnvironment()
router := mux.NewRouter() router := mux.NewRouter()
...@@ -22,8 +22,10 @@ func main() { ...@@ -22,8 +22,10 @@ func main() {
// User Request Endpoints // User Request Endpoints
router.HandleFunc("/api/get-users", service.GetUsers()).Methods("GET") router.HandleFunc("/api/get-users", service.GetUsers()).Methods("GET")
router.HandleFunc("/api/create-user", service.CreateUser()).Methods("POST") router.HandleFunc("/api/create-user", service.CreateUser()).Methods("POST")
router.HandleFunc("/api/remove-user", service.RemoveUser()).Methods("DELETE") router.HandleFunc("/api/remove-user", service.Authenticate(service.RemoveUser())).Methods("DELETE")
router.HandleFunc("/api/reset-user-password", service.ResetUserPassword()).Methods("PUT") router.HandleFunc("/api/recover-user-password", service.RecoverUserPassword()).Methods("PUT")
router.HandleFunc("/api/update-user-data", service.UpdateUserData()).Methods("PUT")
// Setup cors // Setup cors
......
...@@ -195,24 +195,40 @@ func RemoveUser() http.HandlerFunc { ...@@ -195,24 +195,40 @@ func RemoveUser() http.HandlerFunc {
// Now Remove user // Now Remove user
response, err := client.User.DeactivateOrDeleteUser(context.Background(), userId, &query.Params{}) response, err := client.User.DeactivateOrDeleteUser(context.Background(), userId, &query.Params{})
if _, err := w.Write([]byte(response.Self));
err != nil {
ReturnError(w, http.StatusInternalServerError, err.Error())
return
}
fmt.Printf("\n User removal success")
}
}
func RecoverUserPassword() http.HandlerFunc {
return func(w http.ResponseWriter, r*http.Request) {
fmt.Printf("\n User requesting password reset. Sending email with password recovery link")
_, client, err := okta.NewClient(context.Background(), okta.WithOrgUrl("https://" + os.Getenv("CLIENT_ID")), okta.WithToken("007XkBhvAfeVf1jUB0xhdwQJJEvWNSBQ6bbO4MoEaV"))
if err != nil { if err != nil {
ReturnError(w, http.StatusInternalServerError, err.Error()) ReturnError(w, http.StatusInternalServerError, err.Error())
return return
} }
if _, err := w.Write([]byte(response.Self)); _, resp, err := client.User.ForgotPasswordGenerateOneTimeToken(context.Background(), GetUser(w, r).Email, &query.Params{})
if _, err := w.Write([]byte(resp.Self));
err != nil { err != nil {
ReturnError(w, http.StatusInternalServerError, err.Error()) ReturnError(w, http.StatusInternalServerError, err.Error())
return return
} }
fmt.Printf("\n User removal success") fmt.Println("\n A password recovery email has been sent to the user")
} }
} }
func ResetUserPassword() http.HandlerFunc { func UpdateUserData() http.HandlerFunc {
return func(w http.ResponseWriter, r*http.Request) { return func (w http.ResponseWriter, r*http.Request) {
fmt.Printf("\n User requesting password reset. Sending email with password recovery link") fmt.Printf("\n User requesting profile data update")
_, client, err := okta.NewClient(context.Background(), okta.WithOrgUrl("https://" + os.Getenv("CLIENT_ID")), okta.WithToken("007XkBhvAfeVf1jUB0xhdwQJJEvWNSBQ6bbO4MoEaV")) _, client, err := okta.NewClient(context.Background(), okta.WithOrgUrl("https://" + os.Getenv("CLIENT_ID")), okta.WithToken("007XkBhvAfeVf1jUB0xhdwQJJEvWNSBQ6bbO4MoEaV"))
if err != nil { if err != nil {
...@@ -220,13 +236,31 @@ func ResetUserPassword() http.HandlerFunc { ...@@ -220,13 +236,31 @@ func ResetUserPassword() http.HandlerFunc {
return return
} }
forgotPasswordToken, resp, err := client.User.ForgotPasswordGenerateOneTimeToken(context.Background(), GetUser(w, r).Email, &query.Params{}) // Parse the userData and append to new okta.user object
userData := User{}
if err := json.NewDecoder(r.Body).Decode(&userData);
err != nil {
ReturnError(w, http.StatusInternalServerError, err.Error())
return
}
profile := okta.UserProfile{}
profile["firstName"] = userData.FirstName
profile["lastName"] = userData.LastName
profile["email"] = userData.Email
profile["login"] = userData.Login
updatedUser := &okta.User{