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

refactoring

parent 7223daef
[{"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\\components\\home\\Home.jsx":"3","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\reportForm\\ReportForm.jsx":"4","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\project\\projectOverview\\ProjectOverview.jsx":"5","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\team\\teamOverview\\TeamOverview.jsx":"6","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\project\\projectInfo\\ProjectInfo.jsx":"7","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\team\\teamInfo\\TeamInfo.jsx":"8","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\Navbar.jsx":"9","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\reportForm\\assign\\Assign.jsx":"10","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\home\\updates\\Updates.jsx":"11","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\project\\projectInfo\\activityChart\\ActivityChart.jsx":"12","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\project\\projectInfo\\activitiesDisplay\\ActivitiesDisplay.jsx":"13","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\logo\\Logo.jsx":"14","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\dropdownMenu\\NavbarDropdownMenu.jsx":"15","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\searchbar\\Searchbar.jsx":"16","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\config.js":"17","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\Messages\\Messages.jsx":"18","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\navLinks\\NavLinks.jsx":"19","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useMessages.jsx":"20","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\login\\signUp\\SignUp.jsx":"21","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\login\\signIn\\SignIn.jsx":"22","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useInput.jsx":"23"},{"size":285,"mtime":1628516023915,"results":"24","hashOfConfig":"25"},{"size":2157,"mtime":1629367680059,"results":"26","hashOfConfig":"25"},{"size":1279,"mtime":1629807516741,"results":"27","hashOfConfig":"25"},{"size":3967,"mtime":1628695632288,"results":"28","hashOfConfig":"25"},{"size":3660,"mtime":1629794572456,"results":"29","hashOfConfig":"25"},{"size":2694,"mtime":1628696113184,"results":"30","hashOfConfig":"25"},{"size":1068,"mtime":1628696051327,"results":"31","hashOfConfig":"25"},{"size":2374,"mtime":1628696187694,"results":"32","hashOfConfig":"25"},{"size":906,"mtime":1629790599062,"results":"33","hashOfConfig":"25"},{"size":3264,"mtime":1628535700010,"results":"34","hashOfConfig":"25"},{"size":2334,"mtime":1629123056814,"results":"35","hashOfConfig":"25"},{"size":3570,"mtime":1628430832688,"results":"36","hashOfConfig":"25"},{"size":2096,"mtime":1628430812599,"results":"37","hashOfConfig":"25"},{"size":548,"mtime":1628421916010,"results":"38","hashOfConfig":"25"},{"size":2674,"mtime":1629805727243,"results":"39","hashOfConfig":"25"},{"size":470,"mtime":1628430752153,"results":"40","hashOfConfig":"25"},{"size":401,"mtime":1629726035252,"results":"41","hashOfConfig":"25"},{"size":626,"mtime":1628697746462,"results":"42","hashOfConfig":"25"},{"size":697,"mtime":1628430740299,"results":"43","hashOfConfig":"25"},{"size":1489,"mtime":1629790769379,"results":"44","hashOfConfig":"25"},{"size":6133,"mtime":1629808177320,"results":"45","hashOfConfig":"25"},{"size":2380,"mtime":1629797178926,"results":"46","hashOfConfig":"25"},{"size":324,"mtime":1629371594261,"results":"47","hashOfConfig":"25"},{"filePath":"48","messages":"49","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"50"},"iyhzrm",{"filePath":"51","messages":"52","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"50"},{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"57","usedDeprecatedRules":"50"},{"filePath":"58","messages":"59","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"60","usedDeprecatedRules":"50"},{"filePath":"61","messages":"62","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"63","usedDeprecatedRules":"50"},{"filePath":"64","messages":"65","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"50"},{"filePath":"66","messages":"67","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"68","usedDeprecatedRules":"50"},{"filePath":"69","messages":"70","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"71","usedDeprecatedRules":"50"},{"filePath":"72","messages":"73","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"74","usedDeprecatedRules":"50"},{"filePath":"75","messages":"76","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"77","usedDeprecatedRules":"50"},{"filePath":"78","messages":"79","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"50"},{"filePath":"80","messages":"81","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"82","usedDeprecatedRules":"50"},{"filePath":"83","messages":"84","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"85","usedDeprecatedRules":"50"},{"filePath":"86","messages":"87","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"88","messages":"89","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"50"},{"filePath":"90","messages":"91","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"92","usedDeprecatedRules":"50"},{"filePath":"93","messages":"94","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"50"},{"filePath":"95","messages":"96","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"50"},{"filePath":"97","messages":"98","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"99","usedDeprecatedRules":"50"},{"filePath":"100","messages":"101","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"102","messages":"103","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"50"},{"filePath":"104","messages":"105","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"106"},"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\index.js",[],["107","108"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\App.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\home\\Home.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\reportForm\\ReportForm.jsx",["109"],"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\\components\\project\\projectOverview\\ProjectOverview.jsx",["110","111"],"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\\components\\team\\teamOverview\\TeamOverview.jsx",["112","113"],"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\\components\\project\\projectInfo\\ProjectInfo.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\team\\teamInfo\\TeamInfo.jsx",["114"],"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\\components\\navbar\\Navbar.jsx",["115"],"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\\reportForm\\assign\\Assign.jsx",["116","117","118","119","120","121"],"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\\components\\home\\updates\\Updates.jsx",["122","123","124","125"],"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\\components\\project\\projectInfo\\activityChart\\ActivityChart.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\project\\projectInfo\\activitiesDisplay\\ActivitiesDisplay.jsx",["126","127","128","129"],"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\\components\\navbar\\logo\\Logo.jsx",["130","131"],"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\\dropdownMenu\\NavbarDropdownMenu.jsx",["132","133"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\searchbar\\Searchbar.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\config.js",["134"],"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 }\r\n};","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\Messages\\Messages.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\navLinks\\NavLinks.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useMessages.jsx",["135"],"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\\components\\login\\signUp\\SignUp.jsx",["136","137","138"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\login\\signIn\\SignIn.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useInput.jsx",[],["139","140"],{"ruleId":"141","replacedBy":"142"},{"ruleId":"143","replacedBy":"144"},{"ruleId":"145","severity":1,"message":"146","line":1,"column":17,"nodeType":"147","messageId":"148","endLine":1,"endColumn":25},{"ruleId":"149","severity":1,"message":"150","line":75,"column":11,"nodeType":"151","endLine":75,"endColumn":123},{"ruleId":"149","severity":1,"message":"150","line":76,"column":11,"nodeType":"151","endLine":76,"endColumn":127},{"ruleId":"145","severity":1,"message":"152","line":8,"column":9,"nodeType":"147","messageId":"148","endLine":8,"endColumn":25},{"ruleId":"145","severity":1,"message":"153","line":13,"column":9,"nodeType":"147","messageId":"148","endLine":13,"endColumn":23},{"ruleId":"149","severity":1,"message":"150","line":43,"column":19,"nodeType":"151","endLine":43,"endColumn":22},{"ruleId":"145","severity":1,"message":"154","line":10,"column":22,"nodeType":"147","messageId":"148","endLine":10,"endColumn":30},{"ruleId":"145","severity":1,"message":"146","line":1,"column":17,"nodeType":"147","messageId":"148","endLine":1,"endColumn":25},{"ruleId":"149","severity":1,"message":"150","line":29,"column":13,"nodeType":"151","endLine":29,"endColumn":16},{"ruleId":"149","severity":1,"message":"150","line":39,"column":19,"nodeType":"151","endLine":39,"endColumn":22},{"ruleId":"149","severity":1,"message":"150","line":50,"column":13,"nodeType":"151","endLine":50,"endColumn":16},{"ruleId":"149","severity":1,"message":"150","line":60,"column":19,"nodeType":"151","endLine":60,"endColumn":22},{"ruleId":"149","severity":1,"message":"150","line":70,"column":25,"nodeType":"151","endLine":70,"endColumn":28},{"ruleId":"149","severity":1,"message":"150","line":23,"column":17,"nodeType":"151","endLine":23,"endColumn":20},{"ruleId":"149","severity":1,"message":"150","line":28,"column":17,"nodeType":"151","endLine":28,"endColumn":20},{"ruleId":"149","severity":1,"message":"150","line":52,"column":19,"nodeType":"151","endLine":52,"endColumn":22},{"ruleId":"149","severity":1,"message":"150","line":57,"column":19,"nodeType":"151","endLine":57,"endColumn":22},{"ruleId":"149","severity":1,"message":"150","line":20,"column":17,"nodeType":"151","endLine":20,"endColumn":20},{"ruleId":"149","severity":1,"message":"150","line":25,"column":17,"nodeType":"151","endLine":25,"endColumn":20},{"ruleId":"149","severity":1,"message":"150","line":48,"column":17,"nodeType":"151","endLine":48,"endColumn":20},{"ruleId":"149","severity":1,"message":"150","line":53,"column":17,"nodeType":"151","endLine":53,"endColumn":20},{"ruleId":"155","severity":1,"message":"156","line":12,"column":11,"nodeType":"151","endLine":12,"endColumn":58},{"ruleId":"155","severity":1,"message":"156","line":13,"column":11,"nodeType":"151","endLine":13,"endColumn":55},{"ruleId":"145","severity":1,"message":"157","line":9,"column":11,"nodeType":"147","messageId":"148","endLine":9,"endColumn":20},{"ruleId":"149","severity":1,"message":"150","line":66,"column":15,"nodeType":"151","endLine":66,"endColumn":35},{"ruleId":"158","severity":1,"message":"159","line":1,"column":1,"nodeType":"160","endLine":13,"endColumn":3},{"ruleId":"161","severity":1,"message":"162","line":47,"column":6,"nodeType":"163","endLine":47,"endColumn":17,"suggestions":"164"},{"ruleId":"145","severity":1,"message":"165","line":5,"column":10,"nodeType":"147","messageId":"148","endLine":5,"endColumn":17},{"ruleId":"161","severity":1,"message":"166","line":43,"column":6,"nodeType":"163","endLine":43,"endColumn":33,"suggestions":"167"},{"ruleId":"149","severity":1,"message":"150","line":191,"column":13,"nodeType":"151","endLine":191,"endColumn":50},{"ruleId":"141","replacedBy":"168"},{"ruleId":"143","replacedBy":"169"},"no-native-reassign",["170"],"no-negated-in-lhs",["171"],"no-unused-vars","'useState' is defined but never used.","Identifier","unusedVar","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.","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",["172"],"'NavLink' is defined but never used.","React Hook useEffect has a missing dependency: 'toggleSignInFormVisible'. Either include it or remove the dependency array.",["173"],["170"],["171"],"no-global-assign","no-unsafe-negation",{"desc":"174","fix":"175"},{"desc":"176","fix":"177"},"Update the dependencies array to be: [authState, oktaAuth]",{"range":"178","text":"179"},"Update the dependencies array to be: [signUpFormVisibilityState, toggleSignInFormVisible]",{"range":"180","text":"181"},[1422,1433],"[authState, oktaAuth]",[1442,1469],"[signUpFormVisibilityState, toggleSignInFormVisible]"]
\ No newline at end of file
[{"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\\components\\home\\Home.jsx":"3","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\reportForm\\ReportForm.jsx":"4","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\project\\projectOverview\\ProjectOverview.jsx":"5","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\team\\teamOverview\\TeamOverview.jsx":"6","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\project\\projectInfo\\ProjectInfo.jsx":"7","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\team\\teamInfo\\TeamInfo.jsx":"8","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\Navbar.jsx":"9","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\reportForm\\assign\\Assign.jsx":"10","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\home\\updates\\Updates.jsx":"11","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\project\\projectInfo\\activityChart\\ActivityChart.jsx":"12","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\project\\projectInfo\\activitiesDisplay\\ActivitiesDisplay.jsx":"13","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\logo\\Logo.jsx":"14","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\dropdownMenu\\NavbarDropdownMenu.jsx":"15","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\searchbar\\Searchbar.jsx":"16","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\config.js":"17","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\Messages\\Messages.jsx":"18","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\navLinks\\NavLinks.jsx":"19","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useMessages.jsx":"20","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useInput.jsx":"21","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\login\\Login.jsx":"22"},{"size":285,"mtime":1628516023915,"results":"23","hashOfConfig":"24"},{"size":2032,"mtime":1629808994420,"results":"25","hashOfConfig":"24"},{"size":1279,"mtime":1629807516741,"results":"26","hashOfConfig":"24"},{"size":3967,"mtime":1628695632288,"results":"27","hashOfConfig":"24"},{"size":3660,"mtime":1629794572456,"results":"28","hashOfConfig":"24"},{"size":2694,"mtime":1628696113184,"results":"29","hashOfConfig":"24"},{"size":1068,"mtime":1628696051327,"results":"30","hashOfConfig":"24"},{"size":2374,"mtime":1628696187694,"results":"31","hashOfConfig":"24"},{"size":906,"mtime":1629790599062,"results":"32","hashOfConfig":"24"},{"size":3264,"mtime":1628535700010,"results":"33","hashOfConfig":"24"},{"size":2334,"mtime":1629123056814,"results":"34","hashOfConfig":"24"},{"size":3570,"mtime":1628430832688,"results":"35","hashOfConfig":"24"},{"size":2096,"mtime":1628430812599,"results":"36","hashOfConfig":"24"},{"size":548,"mtime":1628421916010,"results":"37","hashOfConfig":"24"},{"size":2674,"mtime":1629805727243,"results":"38","hashOfConfig":"24"},{"size":470,"mtime":1628430752153,"results":"39","hashOfConfig":"24"},{"size":401,"mtime":1629726035252,"results":"40","hashOfConfig":"24"},{"size":626,"mtime":1628697746462,"results":"41","hashOfConfig":"24"},{"size":697,"mtime":1628430740299,"results":"42","hashOfConfig":"24"},{"size":1489,"mtime":1629790769379,"results":"43","hashOfConfig":"24"},{"size":324,"mtime":1629371594261,"results":"44","hashOfConfig":"24"},{"size":6129,"mtime":1629809017263,"results":"45","hashOfConfig":"24"},{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},"iyhzrm",{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"51","messages":"52","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"53","messages":"54","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"55","usedDeprecatedRules":"48"},{"filePath":"56","messages":"57","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"58","usedDeprecatedRules":"48"},{"filePath":"59","messages":"60","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"61","usedDeprecatedRules":"48"},{"filePath":"62","messages":"63","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"64","messages":"65","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"66","usedDeprecatedRules":"48"},{"filePath":"67","messages":"68","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"69","usedDeprecatedRules":"48"},{"filePath":"70","messages":"71","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"72","usedDeprecatedRules":"48"},{"filePath":"73","messages":"74","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"75","usedDeprecatedRules":"48"},{"filePath":"76","messages":"77","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"78","messages":"79","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"80","usedDeprecatedRules":"48"},{"filePath":"81","messages":"82","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"83","usedDeprecatedRules":"48"},{"filePath":"84","messages":"85","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"86","usedDeprecatedRules":"48"},{"filePath":"87","messages":"88","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"89","messages":"90","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"91","usedDeprecatedRules":"48"},{"filePath":"92","messages":"93","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"94","messages":"95","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"48"},{"filePath":"96","messages":"97","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"98","usedDeprecatedRules":"48"},{"filePath":"99","messages":"100","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"101"},{"filePath":"102","messages":"103","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"104"},"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\index.js",[],["105","106"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\App.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\home\\Home.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\reportForm\\ReportForm.jsx",["107"],"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\\components\\project\\projectOverview\\ProjectOverview.jsx",["108","109"],"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\\components\\team\\teamOverview\\TeamOverview.jsx",["110","111"],"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\\components\\project\\projectInfo\\ProjectInfo.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\team\\teamInfo\\TeamInfo.jsx",["112"],"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\\components\\navbar\\Navbar.jsx",["113"],"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\\reportForm\\assign\\Assign.jsx",["114","115","116","117","118","119"],"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\\components\\home\\updates\\Updates.jsx",["120","121","122","123"],"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\\components\\project\\projectInfo\\activityChart\\ActivityChart.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\project\\projectInfo\\activitiesDisplay\\ActivitiesDisplay.jsx",["124","125","126","127"],"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\\components\\navbar\\logo\\Logo.jsx",["128","129"],"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\\dropdownMenu\\NavbarDropdownMenu.jsx",["130","131"],"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\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 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 <a href=\"./\">\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 <li>\r\n <NavLink to=\"/messages\">\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\\components\\navbar\\searchbar\\Searchbar.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\config.js",["132"],"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 }\r\n};","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\Messages\\Messages.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\navLinks\\NavLinks.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useMessages.jsx",["133"],"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",[],["134","135"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\login\\Login.jsx",["136","137","138"],"import React, { useState, useEffect, useRef } from 'react';\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 config from \"../../config\"\r\n\r\nconst SignUp = () => {\r\n const { oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState()\r\n\r\n const signUpFormRef = useRef(null);\r\n const [signUpFormVisibilityState, showSignUpForm] = useState(false)\r\n const toggleSignInFormVisible = () => showSignUpForm(!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\r\n\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n console.log(\"Click\")\r\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\r\n console.log(\"Form visible: \" + signUpFormVisibilityState)\r\n toggleSignInFormVisible()\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 console.log(\"Add eventlistener\")\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n console.log(\"Remove eventlistener\")\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [signUpFormVisibilityState]);\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 requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSignUpFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\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()\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 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 if (sessionToken) {\r\n // Hide form while sessionToken is converted into id/access tokens\r\n return null;\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n {/* The Modal */}\r\n <div className={`modal ${signUpFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n\r\n {/* Modal content */}\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 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\r\n </div>\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={toggleSignInFormVisible}>\r\n Sign up\r\n </button>\r\n </div>\r\n </div>\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={signUpFormVisibilityState ? null : 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={signUpFormVisibilityState ? null : 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 <div className=\"signInPrompt\">\r\n <span>Dont have an account yet?&nbsp;\r\n <a onClick={toggleSignInFormVisible}>Sign up</a>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp",{"ruleId":"139","replacedBy":"140"},{"ruleId":"141","replacedBy":"142"},{"ruleId":"143","severity":1,"message":"144","line":1,"column":17,"nodeType":"145","messageId":"146","endLine":1,"endColumn":25},{"ruleId":"147","severity":1,"message":"148","line":75,"column":11,"nodeType":"149","endLine":75,"endColumn":123},{"ruleId":"147","severity":1,"message":"148","line":76,"column":11,"nodeType":"149","endLine":76,"endColumn":127},{"ruleId":"143","severity":1,"message":"150","line":8,"column":9,"nodeType":"145","messageId":"146","endLine":8,"endColumn":25},{"ruleId":"143","severity":1,"message":"151","line":13,"column":9,"nodeType":"145","messageId":"146","endLine":13,"endColumn":23},{"ruleId":"147","severity":1,"message":"148","line":43,"column":19,"nodeType":"149","endLine":43,"endColumn":22},{"ruleId":"143","severity":1,"message":"152","line":10,"column":22,"nodeType":"145","messageId":"146","endLine":10,"endColumn":30},{"ruleId":"143","severity":1,"message":"144","line":1,"column":17,"nodeType":"145","messageId":"146","endLine":1,"endColumn":25},{"ruleId":"147","severity":1,"message":"148","line":29,"column":13,"nodeType":"149","endLine":29,"endColumn":16},{"ruleId":"147","severity":1,"message":"148","line":39,"column":19,"nodeType":"149","endLine":39,"endColumn":22},{"ruleId":"147","severity":1,"message":"148","line":50,"column":13,"nodeType":"149","endLine":50,"endColumn":16},{"ruleId":"147","severity":1,"message":"148","line":60,"column":19,"nodeType":"149","endLine":60,"endColumn":22},{"ruleId":"147","severity":1,"message":"148","line":70,"column":25,"nodeType":"149","endLine":70,"endColumn":28},{"ruleId":"147","severity":1,"message":"148","line":23,"column":17,"nodeType":"149","endLine":23,"endColumn":20},{"ruleId":"147","severity":1,"message":"148","line":28,"column":17,"nodeType":"149","endLine":28,"endColumn":20},{"ruleId":"147","severity":1,"message":"148","line":52,"column":19,"nodeType":"149","endLine":52,"endColumn":22},{"ruleId":"147","severity":1,"message":"148","line":57,"column":19,"nodeType":"149","endLine":57,"endColumn":22},{"ruleId":"147","severity":1,"message":"148","line":20,"column":17,"nodeType":"149","endLine":20,"endColumn":20},{"ruleId":"147","severity":1,"message":"148","line":25,"column":17,"nodeType":"149","endLine":25,"endColumn":20},{"ruleId":"147","severity":1,"message":"148","line":48,"column":17,"nodeType":"149","endLine":48,"endColumn":20},{"ruleId":"147","severity":1,"message":"148","line":53,"column":17,"nodeType":"149","endLine":53,"endColumn":20},{"ruleId":"153","severity":1,"message":"154","line":12,"column":11,"nodeType":"149","endLine":12,"endColumn":58},{"ruleId":"153","severity":1,"message":"154","line":13,"column":11,"nodeType":"149","endLine":13,"endColumn":55},{"ruleId":"143","severity":1,"message":"155","line":9,"column":11,"nodeType":"145","messageId":"146","endLine":9,"endColumn":20},{"ruleId":"147","severity":1,"message":"148","line":66,"column":15,"nodeType":"149","endLine":66,"endColumn":35},{"ruleId":"156","severity":1,"message":"157","line":1,"column":1,"nodeType":"158","endLine":13,"endColumn":3},{"ruleId":"159","severity":1,"message":"160","line":47,"column":6,"nodeType":"161","endLine":47,"endColumn":17,"suggestions":"162"},{"ruleId":"139","replacedBy":"163"},{"ruleId":"141","replacedBy":"164"},{"ruleId":"143","severity":1,"message":"165","line":5,"column":10,"nodeType":"145","messageId":"146","endLine":5,"endColumn":17},{"ruleId":"159","severity":1,"message":"166","line":43,"column":6,"nodeType":"161","endLine":43,"endColumn":33,"suggestions":"167"},{"ruleId":"147","severity":1,"message":"148","line":191,"column":13,"nodeType":"149","endLine":191,"endColumn":50},"no-native-reassign",["168"],"no-negated-in-lhs",["169"],"no-unused-vars","'useState' is defined but never used.","Identifier","unusedVar","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.","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",["170"],["168"],["169"],"'NavLink' is defined but never used.","React Hook useEffect has a missing dependency: 'toggleSignInFormVisible'. Either include it or remove the dependency array.",["171"],"no-global-assign","no-unsafe-negation",{"desc":"172","fix":"173"},{"desc":"174","fix":"175"},"Update the dependencies array to be: [authState, oktaAuth]",{"range":"176","text":"177"},"Update the dependencies array to be: [signUpFormVisibilityState, toggleSignInFormVisible]",{"range":"178","text":"179"},[1422,1433],"[authState, oktaAuth]",[1438,1465],"[signUpFormVisibilityState, toggleSignInFormVisible]"]
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\App.jsx\",\n _s = $RefreshSig$();\n\nimport React from \"react\";\nimport { Route, Switch, useHistory } from \"react-router-dom\";\nimport { library } from '@fortawesome/fontawesome-svg-core';\nimport { fas } from '@fortawesome/free-solid-svg-icons';\nimport { OktaAuth, toRelativeUrl } from '@okta/okta-auth-js';\nimport { Security, SecureRoute, LoginCallback } from \"@okta/okta-react\";\nimport \"./style.css\";\nimport config from \"./config\"; //Components\n\nimport SignUp from \"./components/login/signUp/SignUp\";\nimport Navbar from \"./components/navbar/Navbar\";\nimport Home from \"./components/home/Home\";\nimport ReportForm from \"./components/reportForm/ReportForm\";\nimport ProjectOverview from \"./components/project/projectOverview/ProjectOverview\";\nimport ProjectInfo from \"./components/project/projectInfo/ProjectInfo\";\nimport TeamOverview from \"./components/team/teamOverview/TeamOverview\";\nimport TeamInfo from \"./components/team/teamInfo/TeamInfo\";\nimport Messages from \"./components/Messages/Messages\";\nimport Login from \"./components/login/Login\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nlibrary.add(fas);\nconst oktaAuth = new OktaAuth(config.oidc);\nconst CALLBACK_PATH = '/login/callback';\n\nconst App = () => {\n _s();\n\n const history = useHistory();\n\n const restoreOriginalUri = async (_oktaAuth, originalUri) => {\n history.replace(toRelativeUrl(originalUri || '/', window.location.origin));\n };\n\n return /*#__PURE__*/_jsxDEV(Security, {\n oktaAuth: oktaAuth,\n restoreOriginalUri: restoreOriginalUri,\n children: [/*#__PURE__*/_jsxDEV(Navbar, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(Switch, {\n children: [/*#__PURE__*/_jsxDEV(Route, {\n path: \"/\",\n exact: true,\n component: Login\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 37,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(Route, {\n path: \"/signIn\",\n exact: true,\n component: SignIn\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(Route, {\n path: CALLBACK_PATH,\n component: LoginCallback\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 39,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/home\",\n component: Home\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/reportissue\",\n component: ReportForm\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/projects\",\n component: ProjectOverview\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/ReactApp\",\n component: ProjectInfo\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/teams\",\n component: TeamOverview\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/HenriksMemeMachine\",\n component: TeamInfo\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/messages\",\n component: Messages\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 36,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 34,\n columnNumber: 5\n }, this);\n};\n\n_s(App, \"9cZfZ04734qoCGIctmKX7+sX6eU=\", false, function () {\n return [useHistory];\n});\n\n_c = App;\nexport default App;\n\nvar _c;\n\n$RefreshReg$(_c, \"App\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/App.jsx"],"names":["React","Route","Switch","useHistory","library","fas","OktaAuth","toRelativeUrl","Security","SecureRoute","LoginCallback","config","SignUp","Navbar","Home","ReportForm","ProjectOverview","ProjectInfo","TeamOverview","TeamInfo","Messages","Login","add","oktaAuth","oidc","CALLBACK_PATH","App","history","restoreOriginalUri","_oktaAuth","originalUri","replace","window","location","origin","SignIn"],"mappings":";;;AAAA,OAAOA,KAAP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AAA;AAAA;AAAA;AAAA;AAAA,UADF;AAiBD,CAvBD;;GAAMM,G;UACYvB,U;;;KADZuB,G;AAyBN,eAAeA,GAAf","sourcesContent":["import React from \"react\"\r\nimport { Route, Switch, useHistory } from \"react-router-dom\"\r\nimport { library } from '@fortawesome/fontawesome-svg-core'\r\nimport { fas } from '@fortawesome/free-solid-svg-icons'\r\nimport { OktaAuth, toRelativeUrl } from '@okta/okta-auth-js';\r\nimport { Security, SecureRoute, LoginCallback } from \"@okta/okta-react\"\r\nimport \"./style.css\"\r\nimport config from \"./config\"\r\n\r\n//Components\r\nimport SignUp from \"./components/login/signUp/SignUp\"\r\nimport Navbar from \"./components/navbar/Navbar\"\r\nimport Home from \"./components/home/Home\"\r\nimport ReportForm from \"./components/reportForm/ReportForm\"\r\nimport ProjectOverview from \"./components/project/projectOverview/ProjectOverview\"\r\nimport ProjectInfo from \"./components/project/projectInfo/ProjectInfo\"\r\nimport TeamOverview from \"./components/team/teamOverview/TeamOverview\"\r\nimport TeamInfo from \"./components/team/teamInfo/TeamInfo\"\r\nimport Messages from \"./components/Messages/Messages\"\r\nimport Login from \"./components/login/Login\"\r\n\r\nlibrary.add(fas)\r\n\r\nconst oktaAuth = new OktaAuth(config.oidc);\r\nconst CALLBACK_PATH = '/login/callback';\r\n\r\nconst App = () => {\r\n const history = useHistory()\r\n const restoreOriginalUri = async (_oktaAuth, originalUri) => {\r\n history.replace(toRelativeUrl(originalUri || '/', window.location.origin))\r\n }\r\n\r\n return (\r\n <Security oktaAuth={oktaAuth} restoreOriginalUri={restoreOriginalUri}>\r\n <Navbar />\r\n <Switch>\r\n <Route path=\"/\" exact component={Login} />\r\n <Route path=\"/signIn\" exact component={SignIn} />\r\n <Route path={CALLBACK_PATH} component={LoginCallback} />\r\n <SecureRoute path=\"/home\" component={Home} />\r\n <SecureRoute path=\"/reportissue\" component={ReportForm} />\r\n <SecureRoute path=\"/projects\" component={ProjectOverview} />\r\n <SecureRoute path=\"/ReactApp\" component={ProjectInfo} />\r\n <SecureRoute path=\"/teams\" component={TeamOverview} />\r\n <SecureRoute path=\"/HenriksMemeMachine\" component={TeamInfo} />\r\n <SecureRoute path=\"/messages\" component={Messages} />\r\n </Switch>\r\n </Security>\r\n )\r\n}\r\n\r\nexport default App"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\Login.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect, useRef } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./Login.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const signUpFormRef = useRef(null);\n const [signUpFormVisibilityState, showSignUpForm] = useState(false);\n\n const toggleSignInFormVisible = () => showSignUpForm(!signUpFormVisibilityState);\n\n const [firstname, setfirstname] = useState('');\n const [lastname, setlastname] = useState('');\n const [username, setUsername] = useState('');\n const [password, setPassword] = useState('');\n useEffect(() => {\n const pageClickEvent = e => {\n console.log(\"Click\");\n\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\n console.log(\"Form visible: \" + signUpFormVisibilityState);\n toggleSignInFormVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (signUpFormVisibilityState) {\n console.log(\"Add eventlistener\");\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n console.log(\"Remove eventlistener\");\n window.removeEventListener('click', pageClickEvent);\n };\n }, [signUpFormVisibilityState]);\n const userInputData = JSON.stringify({\n firstname: `${firstname}`,\n lastname: `${lastname}`,\n Email: `${username}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSignUpFormSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n handleSignInFormSubmit();\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 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 if (sessionToken) {\n // Hide form while sessionToken is converted into id/access tokens\n return null;\n }\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\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: 115,\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: 119,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 117,\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: 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: [\"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: 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: [\"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: 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 className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 145,\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: 150,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 148,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 113,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 110,\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: 159,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 160,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"signUpForm-show-button\",\n onClick: toggleSignInFormVisible,\n children: \"Sign up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 161,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 158,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 157,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signInForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign in to PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 168,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSignInFormSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"username\",\n type: \"text\",\n value: signUpFormVisibilityState ? null : username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 172,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 170,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: signUpFormVisibilityState ? null : password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 179,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 177,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign in\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-in-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 186,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 184,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 169,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signInPrompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Dont have an account yet?\\xA0\", /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: toggleSignInFormVisible,\n children: \"Sign up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 191,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 190,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 189,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 167,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 108,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"dJvzxnAeGIhmgkiDj0Soq4eImik=\", 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/components/login/Login.jsx"],"names":["React","useState","useEffect","useRef","useOktaAuth","FontAwesomeIcon","NavLink","config","SignUp","oktaAuth","sessionToken","setSessionToken","signUpFormRef","signUpFormVisibilityState","showSignUpForm","toggleSignInFormVisible","firstname","setfirstname","lastname","setlastname","username","setUsername","password","setPassword","pageClickEvent","e","console","log","current","contains","target","window","addEventListener","removeEventListener","userInputData","JSON","stringify","Email","requestOptions","method","body","handleSignUpFormSubmit","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","alert","Promise","reject","handleSignInFormSubmit","signInWithCredentials","signInWithRedirect","originalUri","catch","err","handlefirstnameChange","value","handlelastnameChange","handleUsernameChange","handlePasswordChange"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,QAAmD,OAAnD;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,aAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,cAAnB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA;AAAF,MAAeL,WAAW,EAAhC;AACA,QAAM,CAACM,YAAD,EAAeC,eAAf,IAAkCV,QAAQ,EAAhD;AAEA,QAAMW,aAAa,GAAGT,MAAM,CAAC,IAAD,CAA5B;AACA,QAAM,CAACU,yBAAD,EAA4BC,cAA5B,IAA8Cb,QAAQ,CAAC,KAAD,CAA5D;;AACA,QAAMc,uBAAuB,GAAG,MAAMD,cAAc,CAAC,CAACD,yBAAF,CAApD;;AAEA,QAAM,CAACG,SAAD,EAAYC,YAAZ,IAA4BhB,QAAQ,CAAC,EAAD,CAA1C;AACA,QAAM,CAACiB,QAAD,EAA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C,MADrB;AAEE,YAAA,KAAK,EAAEvC,yBAAyB,GAAG,IAAH,GAAUO,QAF5C;AAGE,YAAA,QAAQ,EAAEyC;AAHZ;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBADF,eAQE;AAAA,+CAEE;AACE,YAAA,EAAE,EAAC,UADL;AACgB,YAAA,IAAI,EAAC,UADrB;AAEE,YAAA,KAAK,EAAEhD,yBAAyB,GAAG,IAAH,GAAUS,QAF5C;AAGE,YAAA,QAAQ,EAAEwC;AAHZ;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBARF,eAeE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,IAAI,EAAC,QAA1C;AAAA,qDAEE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAfF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eAsBE;AAAK,QAAA,SAAS,EAAC,cAAf;AAAA,+BACE;AAAA,mEACE;AAAG,YAAA,OAAO,EAAE/C,uBAAZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAtBF;AAAA;AAAA;AAAA;AAAA;AAAA,YA3DF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA0FD,CA7LD;;GAAMP,M;UACiBJ,W;;;KADjBI,M;AA+LN,eAAeA,MAAf","sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\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 config from \"../../config\"\r\n\r\nconst SignUp = () => {\r\n const { oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState()\r\n\r\n const signUpFormRef = useRef(null);\r\n const [signUpFormVisibilityState, showSignUpForm] = useState(false)\r\n const toggleSignInFormVisible = () => showSignUpForm(!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\r\n\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n console.log(\"Click\")\r\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\r\n console.log(\"Form visible: \" + signUpFormVisibilityState)\r\n toggleSignInFormVisible()\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 console.log(\"Add eventlistener\")\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n console.log(\"Remove eventlistener\")\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [signUpFormVisibilityState]);\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 requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSignUpFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\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()\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 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 if (sessionToken) {\r\n // Hide form while sessionToken is converted into id/access tokens\r\n return null;\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n {/* The Modal */}\r\n <div className={`modal ${signUpFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n\r\n {/* Modal content */}\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 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\r\n </div>\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={toggleSignInFormVisible}>\r\n Sign up\r\n </button>\r\n </div>\r\n </div>\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={signUpFormVisibilityState ? null : 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={signUpFormVisibilityState ? null : 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 <div className=\"signInPrompt\">\r\n <span>Dont have an account yet?&nbsp;\r\n <a onClick={toggleSignInFormVisible}>Sign up</a>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\App.jsx\",\n _s = $RefreshSig$();\n\nimport React from \"react\";\nimport { Route, Switch, useHistory } from \"react-router-dom\";\nimport { library } from '@fortawesome/fontawesome-svg-core';\nimport { fas } from '@fortawesome/free-solid-svg-icons';\nimport { OktaAuth, toRelativeUrl } from '@okta/okta-auth-js';\nimport { Security, SecureRoute, LoginCallback } from \"@okta/okta-react\";\nimport \"./style.css\";\nimport config from \"./config\"; //Components\n\nimport SignUp from \"./components/login/signUp/SignUp\";\nimport Navbar from \"./components/navbar/Navbar\";\nimport Home from \"./components/home/Home\";\nimport ReportForm from \"./components/reportForm/ReportForm\";\nimport ProjectOverview from \"./components/project/projectOverview/ProjectOverview\";\nimport ProjectInfo from \"./components/project/projectInfo/ProjectInfo\";\nimport TeamOverview from \"./components/team/teamOverview/TeamOverview\";\nimport TeamInfo from \"./components/team/teamInfo/TeamInfo\";\nimport Messages from \"./components/Messages/Messages\";\nimport Login from \"./components/login/Login\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nlibrary.add(fas);\nconst oktaAuth = new OktaAuth(config.oidc);\nconst CALLBACK_PATH = '/login/callback';\n\nconst App = () => {\n _s();\n\n const history = useHistory();\n\n const restoreOriginalUri = async (_oktaAuth, originalUri) => {\n history.replace(toRelativeUrl(originalUri || '/', window.location.origin));\n };\n\n return /*#__PURE__*/_jsxDEV(Security, {\n oktaAuth: oktaAuth,\n restoreOriginalUri: restoreOriginalUri,\n children: [/*#__PURE__*/_jsxDEV(Navbar, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(Switch, {\n children: [/*#__PURE__*/_jsxDEV(Route, {\n path: \"/\",\n exact: true,\n component: Login\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 37,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(Route, {\n path: CALLBACK_PATH,\n component: LoginCallback\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/home\",\n component: Home\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 39,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/reportissue\",\n component: ReportForm\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/projects\",\n component: ProjectOverview\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/ReactApp\",\n component: ProjectInfo\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/teams\",\n component: TeamOverview\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/HenriksMemeMachine\",\n component: TeamInfo\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/messages\",\n component: Messages\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 36,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 34,\n columnNumber: 5\n }, this);\n};\n\n_s(App, \"9cZfZ04734qoCGIctmKX7+sX6eU=\", false, function () {\n return [useHistory];\n});\n\n_c = App;\nexport default App;\n\nvar _c;\n\n$RefreshReg$(_c, \"App\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/App.jsx"],"names":["React","Route","Switch","useHistory","library","fas","OktaAuth","toRelativeUrl","Security","SecureRoute","LoginCallback","config","SignUp","Navbar","Home","ReportForm","ProjectOverview","ProjectInfo","TeamOverview","TeamInfo","Messages","Login","add","oktaAuth","oidc","CALLBACK_PATH","App","history","restoreOriginalUri","_oktaAuth","originalUri","replace","window","location","origin"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,KAAT,EAAgBC,MAAhB,EAAwBC,UAAxB,QAA0C,kBAA1C;AACA,SAASC,OAAT,QAAwB,mCAAxB;AACA,SAASC,GAAT,QAAoB,mCAApB;AACA,SAASC,QAAT,EAAmBC,aAAnB,QAAwC,oBAAxC;AACA,SAASC,QAAT,EAAmBC,WAAnB,EAAgCC,aAAhC,QAAqD,kBAArD;AACA,OAAO,aAAP;AACA,OAAOC,MAAP,MAAmB,UAAnB,C,CAEA;;AACA,OAAOC,MAAP,MAAmB,kCAAnB;AACA,OAAOC,MAAP,MAA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A;AAAA,cAHF,eAIE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,cAAlB;AAAiC,QAAA,SAAS,EAAEC;AAA5C;AAAA;AAAA;AAAA;AAAA,cAJF,eAKE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,WAAlB;AAA8B,QAAA,SAAS,EAAEC;AAAzC;AAAA;AAAA;AAAA;AAAA,cALF,eAME,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,WAAlB;AAA8B,QAAA,SAAS,EAAEC;AAAzC;AAAA;AAAA;AAAA;AAAA,cANF,eAOE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,QAAlB;AAA2B,QAAA,SAAS,EAAEC;AAAtC;AAAA;AAAA;AAAA;AAAA,cAPF,eAQE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,qBAAlB;AAAwC,QAAA,SAAS,EAAEC;AAAnD;AAAA;AAAA;AAAA;AAAA,cARF,eASE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,WAAlB;AAA8B,QAAA,SAAS,EAAEC;AAAzC;AAAA;AAAA;AAAA;AAAA,cATF;AAAA;AAAA;AAAA;AAAA;AAAA,YAFF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAgBD,CAtBD;;GAAMM,G;UACYvB,U;;;KADZuB,G;AAwBN,eAAeA,GAAf","sourcesContent":["import React from \"react\"\r\nimport { Route, Switch, useHistory } from \"react-router-dom\"\r\nimport { library } from '@fortawesome/fontawesome-svg-core'\r\nimport { fas } from '@fortawesome/free-solid-svg-icons'\r\nimport { OktaAuth, toRelativeUrl } from '@okta/okta-auth-js';\r\nimport { Security, SecureRoute, LoginCallback } from \"@okta/okta-react\"\r\nimport \"./style.css\"\r\nimport config from \"./config\"\r\n\r\n//Components\r\nimport SignUp from \"./components/login/signUp/SignUp\"\r\nimport Navbar from \"./components/navbar/Navbar\"\r\nimport Home from \"./components/home/Home\"\r\nimport ReportForm from \"./components/reportForm/ReportForm\"\r\nimport ProjectOverview from \"./components/project/projectOverview/ProjectOverview\"\r\nimport ProjectInfo from \"./components/project/projectInfo/ProjectInfo\"\r\nimport TeamOverview from \"./components/team/teamOverview/TeamOverview\"\r\nimport TeamInfo from \"./components/team/teamInfo/TeamInfo\"\r\nimport Messages from \"./components/Messages/Messages\"\r\nimport Login from \"./components/login/Login\"\r\n\r\nlibrary.add(fas)\r\n\r\nconst oktaAuth = new OktaAuth(config.oidc);\r\nconst CALLBACK_PATH = '/login/callback';\r\n\r\nconst App = () => {\r\n const history = useHistory()\r\n const restoreOriginalUri = async (_oktaAuth, originalUri) => {\r\n history.replace(toRelativeUrl(originalUri || '/', window.location.origin))\r\n }\r\n\r\n return (\r\n <Security oktaAuth={oktaAuth} restoreOriginalUri={restoreOriginalUri}>\r\n <Navbar />\r\n <Switch>\r\n <Route path=\"/\" exact component={Login} />\r\n <Route path={CALLBACK_PATH} component={LoginCallback} />\r\n <SecureRoute path=\"/home\" component={Home} />\r\n <SecureRoute path=\"/reportissue\" component={ReportForm} />\r\n <SecureRoute path=\"/projects\" component={ProjectOverview} />\r\n <SecureRoute path=\"/ReactApp\" component={ProjectInfo} />\r\n <SecureRoute path=\"/teams\" component={TeamOverview} />\r\n <SecureRoute path=\"/HenriksMemeMachine\" component={TeamInfo} />\r\n <SecureRoute path=\"/messages\" component={Messages} />\r\n </Switch>\r\n </Security>\r\n )\r\n}\r\n\r\nexport default App"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\Login.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect, useRef } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./Login.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const signUpFormRef = useRef(null);\n const [signUpFormVisibilityState, showSignUpForm] = useState(false);\n\n const toggleSignInFormVisible = () => showSignUpForm(!signUpFormVisibilityState);\n\n const [firstname, setfirstname] = useState('');\n const [lastname, setlastname] = useState('');\n const [username, setUsername] = useState('');\n const [password, setPassword] = useState('');\n useEffect(() => {\n const pageClickEvent = e => {\n console.log(\"Click\");\n\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\n console.log(\"Form visible: \" + signUpFormVisibilityState);\n toggleSignInFormVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (signUpFormVisibilityState) {\n console.log(\"Add eventlistener\");\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n console.log(\"Remove eventlistener\");\n window.removeEventListener('click', pageClickEvent);\n };\n }, [signUpFormVisibilityState]);\n const userInputData = JSON.stringify({\n firstname: `${firstname}`,\n lastname: `${lastname}`,\n Email: `${username}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSignUpFormSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n handleSignInFormSubmit();\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 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 if (sessionToken) {\n // Hide form while sessionToken is converted into id/access tokens\n return null;\n }\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\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: 115,\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: 119,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 117,\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: 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: [\"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: 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: [\"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: 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 className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 145,\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: 150,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 148,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 113,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 110,\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: 159,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 160,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"signUpForm-show-button\",\n onClick: toggleSignInFormVisible,\n children: \"Sign up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 161,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 158,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 157,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signInForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign in to PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 168,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSignInFormSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"username\",\n type: \"text\",\n value: signUpFormVisibilityState ? null : username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 172,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 170,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: signUpFormVisibilityState ? null : password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 179,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 177,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign in\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-in-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 186,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 184,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 169,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signInPrompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Dont have an account yet?\\xA0\", /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: toggleSignInFormVisible,\n children: \"Sign up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 191,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 190,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 189,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 167,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 108,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"dJvzxnAeGIhmgkiDj0Soq4eImik=\", 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/components/login/Login.jsx"],"names":["React","useState","useEffect","useRef","useOktaAuth","FontAwesomeIcon","NavLink","config","SignUp","oktaAuth","sessionToken","setSessionToken","signUpFormRef","signUpFormVisibilityState","showSignUpForm","toggleSignInFormVisible","firstname","setfirstname","lastname","setlastname","username","setUsername","password","setPassword","pageClickEvent","e","console","log","current","contains","target","window","addEventListener","removeEventListener","userInputData","JSON","stringify","Email","requestOptions","method","body","handleSignUpFormSubmit","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","alert","Promise","reject","handleSignInFormSubmit","signInWithCredentials","signInWithRedirect","originalUri","catch","err","handlefirstnameChange","value","handlelastnameChange","handleUsernameChange","handlePas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AtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAfF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eAsBE;AAAK,QAAA,SAAS,EAAC,cAAf;AAAA,+BACE;AAAA,mEACE;AAAG,YAAA,OAAO,EAAE/C,uBAAZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAtBF;AAAA;AAAA;AAAA;AAAA;AAAA,YA3DF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA0FD,CA7LD;;GAAMP,M;UACiBJ,W;;;KADjBI,M;AA+LN,eAAeA,MAAf","sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\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 config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState()\r\n\r\n const signUpFormRef = useRef(null);\r\n const [signUpFormVisibilityState, showSignUpForm] = useState(false)\r\n const toggleSignInFormVisible = () => showSignUpForm(!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\r\n\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n console.log(\"Click\")\r\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\r\n console.log(\"Form visible: \" + signUpFormVisibilityState)\r\n toggleSignInFormVisible()\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 console.log(\"Add eventlistener\")\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n console.log(\"Remove eventlistener\")\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [signUpFormVisibilityState]);\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 requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSignUpFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\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()\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 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 if (sessionToken) {\r\n // Hide form while sessionToken is converted into id/access tokens\r\n return null;\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n {/* The Modal */}\r\n <div className={`modal ${signUpFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n\r\n {/* Modal content */}\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 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\r\n </div>\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={toggleSignInFormVisible}>\r\n Sign up\r\n </button>\r\n </div>\r\n </div>\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={signUpFormVisibilityState ? null : 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={signUpFormVisibilityState ? null : 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 <div className=\"signInPrompt\">\r\n <span>Dont have an account yet?&nbsp;\r\n <a onClick={toggleSignInFormVisible}>Sign up</a>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\Login.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect, useRef } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const signUpFormRef = useRef(null);\n const [signUpFormVisibilityState, showSignUpForm] = useState(false);\n\n const toggleSignInFormVisible = () => showSignUpForm(!signUpFormVisibilityState);\n\n const [firstname, setfirstname] = useState('');\n const [lastname, setlastname] = useState('');\n const [username, setUsername] = useState('');\n const [password, setPassword] = useState('');\n useEffect(() => {\n const pageClickEvent = e => {\n console.log(\"Click\");\n\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\n console.log(\"Form visible: \" + signUpFormVisibilityState);\n toggleSignInFormVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (signUpFormVisibilityState) {\n console.log(\"Add eventlistener\");\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n console.log(\"Remove eventlistener\");\n window.removeEventListener('click', pageClickEvent);\n };\n }, [signUpFormVisibilityState]);\n const userInputData = JSON.stringify({\n firstname: `${firstname}`,\n lastname: `${lastname}`,\n Email: `${username}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSignUpFormSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n handleSignInFormSubmit();\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 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 if (sessionToken) {\n // Hide form while sessionToken is converted into id/access tokens\n return null;\n }\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\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: 115,\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: 119,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 117,\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: 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: [\"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: 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: [\"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: 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 className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 145,\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: 150,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 148,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 113,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 110,\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: 159,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 160,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"signUpForm-show-button\",\n onClick: toggleSignInFormVisible,\n children: \"Sign up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 161,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 158,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 157,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signInForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign in to PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 168,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSignInFormSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"username\",\n type: \"text\",\n value: signUpFormVisibilityState ? null : username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 172,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 170,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: signUpFormVisibilityState ? null : password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 179,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 177,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign in\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-in-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 186,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 184,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 169,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signInPrompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Dont have an account yet?\\xA0\", /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: toggleSignInFormVisible,\n children: \"Sign up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 191,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 190,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 189,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 167,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 108,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"dJvzxnAeGIhmgkiDj0Soq4eImik=\", 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/components/login/Login.jsx"],"names":["React","useState","useEffect","useRef","useOktaAuth","FontAwesomeIcon","NavLink","config","SignUp","oktaAuth","sessionToken","setSessionToken","signUpFormRef","signUpFormVisibilityState","showSignUpForm","toggleSignInFormVisible","firstname","setfirstname","lastname","setlastname","username","setUsername","password","setPassword","pageClickEvent","e","console","log","current","contains","target","window","addEventListener","removeEventListener","userInputData","JSON","stringify","Email","requestOptions","method","body","handleSignUpFormSubmit","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","alert","Promise","reject","handleSignInFormSubmit","signInWithCredentials","signInWithRedirect","originalUri","catch","err","handlefirstnameChange","value","handlelastnameChange","handleUsernameChange","handlePasswordChange"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,QAAmD,OAAnD;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA;AAAF,MAAeL,WAAW,EAAhC;AACA,QAAM,CAACM,YAAD,EAAeC,eAAf,IAAkCV,QAAQ,EAAhD;AAEA,QAAMW,aAAa,GAAGT,MAAM,CAAC,IAAD,CAA5B;AACA,QAAM,CAACU,yBAAD,EAA4BC,cAA5B,IAA8Cb,QAAQ,CAAC,KAAD,CAA5D;;AACA,QAAMc,uBAAuB,GAAG,MAAMD,cAAc,CAAC,CAACD,yBAAF,CAApD;;AAEA,QAAM,CAACG,SAAD,EAAYC,YAAZ,IAA4BhB,QAAQ,CAAC,EAAD,CAA1C;AACA,QAAM,CAACiB,QAAD,EAAWC,WAAX,IAA0BlB,QAAQ,CAAC,EAAD,CAAxC;AACA,QAAM,CAACmB,QAAD,EAAWC,WAAX,IAA0BpB,QAAQ,CAAC,EAAD,CAAxC;AACA,QAAM,CAACqB,QAAD,EAAW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AAAA;AAAA;AAAA,gBADF,eAQE;AAAA,+CAEE;AACE,YAAA,EAAE,EAAC,UADL;AACgB,YAAA,IAAI,EAAC,UADrB;AAEE,YAAA,KAAK,EAAEhD,yBAAyB,GAAG,IAAH,GAAUS,QAF5C;AAGE,YAAA,QAAQ,EAAEwC;AAHZ;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBARF,eAeE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,IAAI,EAAC,QAA1C;AAAA,qDAEE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAfF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eAsBE;AAAK,QAAA,SAAS,EAAC,cAAf;AAAA,+BACE;AAAA,mEACE;AAAG,YAAA,OAAO,EAAE/C,uBAAZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAtBF;AAAA;AAAA;AAAA;AAAA;AAAA,YA3DF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA0FD,CA7LD;;GAAMP,M;UACiBJ,W;;;KADjBI,M;AA+LN,eAAeA,MAAf","sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./SignUp.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState()\r\n\r\n const signUpFormRef = useRef(null);\r\n const [signUpFormVisibilityState, showSignUpForm] = useState(false)\r\n const toggleSignInFormVisible = () => showSignUpForm(!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\r\n\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n console.log(\"Click\")\r\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\r\n console.log(\"Form visible: \" + signUpFormVisibilityState)\r\n toggleSignInFormVisible()\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 console.log(\"Add eventlistener\")\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n console.log(\"Remove eventlistener\")\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [signUpFormVisibilityState]);\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 requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSignUpFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\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()\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 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 if (sessionToken) {\r\n // Hide form while sessionToken is converted into id/access tokens\r\n return null;\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n {/* The Modal */}\r\n <div className={`modal ${signUpFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n\r\n {/* Modal content */}\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 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\r\n </div>\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={toggleSignInFormVisible}>\r\n Sign up\r\n </button>\r\n </div>\r\n </div>\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={signUpFormVisibilityState ? null : 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={signUpFormVisibilityState ? null : 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 <div className=\"signInPrompt\">\r\n <span>Dont have an account yet?&nbsp;\r\n <a onClick={toggleSignInFormVisible}>Sign up</a>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
......@@ -8,7 +8,7 @@ import "./style.css"
import config from "./config"
//Components
import SignUp from "./components/login/signUp/SignUp"
import Login from "./components/login/Login"
import Navbar from "./components/navbar/Navbar"
import Home from "./components/home/Home"
import ReportForm from "./components/reportForm/ReportForm"
......@@ -17,7 +17,6 @@ import ProjectInfo from "./components/project/projectInfo/ProjectInfo"
import TeamOverview from "./components/team/teamOverview/TeamOverview"
import TeamInfo from "./components/team/teamInfo/TeamInfo"
import Messages from "./components/Messages/Messages"
import SignIn from "./components/login/signIn/SignIn";
library.add(fas)
......@@ -34,8 +33,7 @@ const App = () => {
<Security oktaAuth={oktaAuth} restoreOriginalUri={restoreOriginalUri}>
<Navbar />
<Switch>
<Route path="/" exact component={SignUp} />
<Route path="/signIn" exact component={SignIn} />
<Route path="/" exact component={Login} />
<Route path={CALLBACK_PATH} component={LoginCallback} />
<SecureRoute path="/home" component={Home} />
<SecureRoute path="/reportissue" component={ReportForm} />
......
import React, { useState, useEffect, useRef } from 'react';
import { useOktaAuth } from '@okta/okta-react';
import "./SignUp.css"
import "./Login.css"
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { NavLink } from 'react-router-dom';
import config from "../../../config"
import config from "../../config"
const SignUp = () => {
const { oktaAuth } = useOktaAuth();
......
.signInPage-content {
display: flex;
justify-content: flex-start;
background: rgb(12,77,153);
background: -moz-linear-gradient(left, rgba(12,77,153,1) 0%, rgba(41,137,216,1) 61%, rgba(125,185,232,1) 100%);
background: -webkit-linear-gradient(left, rgba(12,77,153,1) 0%,rgba(41,137,216,1) 61%,rgba(125,185,232,1) 100%);
background: linear-gradient(to right, rgba(12,77,153,1) 0%,rgba(41,137,216,1) 61%,rgba(125,185,232,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0c4d99', endColorstr='#7db9e8',GradientType=1 );
height: 100vh;
}
.signInForm-container {
margin: auto;
border: 1px solid grey;
border-radius: 4px;
background-color: white;
padding: 40px;
display: inline-block;
vertical-align: middle;
}
.signInForm label {
padding-bottom: 12px;
display: block;
font-size: 12px;
}
.signInForm input {
width: 100%;
padding: 8px;
margin: 4px 60px 0 0;
border: 1px solid lightgrey;
border-radius: 4px;
resize: vertical;
}
.signInForm button {
cursor: pointer;
background-color: rgb(32, 124, 202);
color: white;
border: 1px solid white;
border-radius: 4px;
height: 36px;
width: 100%;
transition: 0.3s;
}
.signInForm button:hover {
background: white;
border-color: black;
color: black;
}
.signInForm .signInPrompt {
text-align: center;
font-size: 14px;
}
.signInForm .signInPrompt a {
cursor: pointer;
color: rgb(32, 124, 202);
}
.signInForm .signInPrompt a:hover {
text-decoration: underline;
}
.signInForm .signInPrompt .signUpLink {
text-decoration: none;
cursor: pointer;
color: rgb(32, 124, 202);
}
.signInForm .signInPrompt .signUpLink:hover {
text-decoration: underline;
}
\ No newline at end of file
import React, { useState } from 'react';
import { useOktaAuth } from '@okta/okta-react';
import "./SignIn.css"
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { NavLink } from 'react-router-dom';
const SignIn = () => {
const { oktaAuth } = useOktaAuth();
const [sessionToken, setSessionToken] = useState();
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const handleSubmit = (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));
};
const handleUsernameChange = (e) => {
setUsername(e.target.value);
};
const handlePasswordChange = (e) => {
setPassword(e.target.value);
};
if (sessionToken) {
// Hide form while sessionToken is converted into id/access tokens
return null;
}
return (
<div className="signInPage-content">
<div className="signInForm-container">
<div className="signInForm">
<h2>Sign in to PipIt</h2>
<form onSubmit={handleSubmit}>
<label>
Email:
<input
id="username" type="text"
value={username}
onChange={handleUsernameChange} />
</label>
<label>
Password:
<input
id="password" type="password"
value={password}
onChange={handlePasswordChange} />
</label>
<button className="formSubmitButton" type="submit">
Sign in&nbsp;&nbsp;
<FontAwesomeIcon icon="sign-in-alt"></FontAwesomeIcon>
</button>
</form>
<div className="signInPrompt">
<span>Dont have an account yet?&nbsp;
<NavLink to="/" className="signUpLink">
Sign up
</NavLink>
</span>
</div>
</div>
</div>
</div>
);
};
export default SignIn;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment