-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 11.4 KB
/
.eslintcache
1
[{"C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\index.js":"1","C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\App.js":"2","C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\success.js":"3","C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\register\\register.js":"4","C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\applicationpageview\\applicationpage.js":"5","C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\header\\header.js":"6","C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\recruiterpage\\recruiter.js":"7","C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\login\\login.js":"8","C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\applicationdetails\\applicationpagepresenter.js":"9","C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\applicationdetails\\applicationdetails.js":"10"},{"size":230,"mtime":1614595597089,"results":"11","hashOfConfig":"12"},{"size":1241,"mtime":1615537922961,"results":"13","hashOfConfig":"12"},{"size":189,"mtime":1614595597088,"results":"14","hashOfConfig":"12"},{"size":3482,"mtime":1615538145122,"results":"15","hashOfConfig":"12"},{"size":12446,"mtime":1615537922967,"results":"16","hashOfConfig":"12"},{"size":355,"mtime":1615537922968,"results":"17","hashOfConfig":"12"},{"size":4587,"mtime":1615537922972,"results":"18","hashOfConfig":"12"},{"size":1672,"mtime":1615538374293,"results":"19","hashOfConfig":"12"},{"size":3780,"mtime":1615538406224,"results":"20","hashOfConfig":"12"},{"size":5764,"mtime":1615537922963,"results":"21","hashOfConfig":"12"},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},"g8atht",{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"41","messages":"42","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"43","usedDeprecatedRules":"24"},"C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\index.js",[],["44","45"],"C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\App.js",[],"C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\success.js",[],"C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\register\\register.js",[],"C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\applicationpageview\\applicationpage.js",[],"C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\header\\header.js",[],"C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\recruiterpage\\recruiter.js",[],"C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\login\\login.js",[],"C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\applicationdetails\\applicationpagepresenter.js",["46"],"C:\\Users\\erikb\\Documents\\IV1201 ArkitekturoDesign\\Recruitment\\src\\components\\applicationdetails\\applicationdetails.js",["47","48"],"import './applicationdetails.css';\r\nimport React, { useState, useEffect} from \"react\";\r\nimport {useParams} from 'react-router-dom';\r\n\r\n/**\r\n * @description Function for the application-details page, generates all necessary frontend\r\n * @param {*} props used for sending data\r\n * @returns A react component with frontend HTML.\r\n */\r\nfunction ApplicationDetails(props) { \r\n let [availabilities, setAvailabilities] = useState(\"\");\r\n let [competencies, setCompetencies] = useState(\"\");\r\n let [status, setStatus] = useState(\"\");\r\n let [msgToUser, setMsgToUser] = useState(\"\");\r\n let myToken = window.localStorage.getItem(\"token\");\r\n \r\n /**\r\n * Creates list items containing the important availabilities data\r\n * @param {*} themProps Contains the data\r\n */\r\n function listAvailabilities(themProps) {\r\n console.log(\"props \" + JSON.stringify(themProps));\r\n let avails = themProps.availabilities;\r\n let avs = avails.map(av => (\r\n <li><p>From: {av.from_date}, To: {av.to_date}</p></li>\r\n ));\r\n setAvailabilities(avs);\r\n }\r\n\r\n /**\r\n * Creates list items containing the important competencies data\r\n * @param {*} themProps Contains the data\r\n */\r\n function listCompetencies(themProps) {\r\n let comps = themProps.competencies;\r\n\r\n\r\n let cmps = comps.map(cmp => (\r\n <li><p>Competence: {cmp.name}, Years experience: {cmp.competenceprofile.years_of_experience}</p></li>\r\n ));\r\n setCompetencies(cmps);\r\n }\r\n /**\r\n * Creates elements with important application data.\r\n * @param {*} themProps Contains the data\r\n */\r\n function listAppStatus(themProps) {\r\n let appStatus = themProps.applicationStatus;\r\n let stats = appStatus.map(st => (\r\n <li><p>Application Date: {st.application_date}, Application status: {st.status}</p></li>\r\n ));\r\n setStatus(stats);\r\n }\r\n\r\n\r\n /**\r\n * @description When component mounts, this function will be called which creates html elements containing data\r\n */\r\n useEffect(() => {\r\n listAvailabilities(props);\r\n listCompetencies(props);\r\n listAppStatus(props);\r\n console.log(\"details listed\");\r\n }, []\r\n );\r\n\r\n /**\r\n * @description Is called when user clicks accepted button, which means the application is accepted\r\n */\r\n function onAcceptClick() {\r\n let statusChange = {};\r\n statusChange.person = props.userdata.username;\r\n statusChange.applicationStatus = \"accepted\";\r\n postStatus(statusChange);\r\n }\r\n\r\n /**\r\n * @description Is called when user clicks Rejected button, which means the application is rejected\r\n */\r\n function onRejectClick() {\r\n let statusChange = {};\r\n statusChange.person = props.userdata.username;\r\n statusChange.applicationStatus = \"rejected\";\r\n console.log(statusChange);\r\n postStatus(statusChange);\r\n }\r\n\r\n /**\r\n * @description Sends a post request to server which in turn changes an applications status according to @param statusChange\r\n * @param {*} statusChange The change in the applications status.\r\n */\r\n function postStatus(statusChange) {\r\n fetch('/application/status', {\r\n method: 'POST',\r\n headers: {\r\n 'Accept': 'application/json',\r\n 'Content-Type': 'application/json',\r\n 'Authorization': 'Bearer ' + myToken\r\n },\r\n body: JSON.stringify(statusChange)\r\n }).then(response => {\r\n //If something went wrong with saving application\r\n if(response.status === 500) { // internal error\r\n console.log(\"internal error\")\r\n setMsgToUser(\"Could not save application status, internal server error, please try again\")\r\n \r\n } \r\n else if(response.status === 200) { \r\n console.log(\"Success\")\r\n setMsgToUser(\"Application status saved\")\r\n }\r\n else if (response.status === 302) {\r\n console.log(\"redirect\")\r\n window.location = \"/\" \r\n }\r\n else if (response.status === 401) {\r\n window.location = \"/\"; \r\n }\r\n else if(response.status === 400) {\r\n console.log(\"Wrong input\")\r\n //console.log(response)\r\n let errorsInRes = response.statusText;\r\n console.log(errorsInRes);\r\n setMsgToUser(\"Could not save application status: \" + errorsInRes)\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div className=\"applicationdetails\">\r\n <div id=\"userdata\">\r\n <div id=\"names\">\r\n <p>Firstname: {props.userdata.firstname}</p><p>Lastname: {props.userdata.lastname}</p>\r\n <p>Username: {props.userdata.username}</p><p>Email: {props.userdata.email}</p>\r\n </div>\r\n </div>\r\n <div id=\"availabilities\">\r\n <ul id=\"dates\">\r\n {availabilities}\r\n </ul>\r\n </div>\r\n <div id=\"competencies\">\r\n <ul id=\"comps\">\r\n {competencies}\r\n </ul>\r\n </div>\r\n <div id=\"applicationStatus\">\r\n <ul id=\"status\">\r\n {status}\r\n </ul>\r\n </div>\r\n <div></div>\r\n\r\n <p>{msgToUser}</p>\r\n <button onClick={() => onAcceptClick()}>Accept</button>\r\n <button onClick={() => onRejectClick()}>Reject</button>\r\n </div>\r\n\r\n );\r\n}\r\nexport default ApplicationDetails;",{"ruleId":"49","replacedBy":"50"},{"ruleId":"51","replacedBy":"52"},{"ruleId":"53","severity":1,"message":"54","line":77,"column":12,"nodeType":"55","endLine":77,"endColumn":14,"suggestions":"56"},{"ruleId":"57","severity":1,"message":"58","line":3,"column":9,"nodeType":"59","messageId":"60","endLine":3,"endColumn":18},{"ruleId":"53","severity":1,"message":"61","line":64,"column":12,"nodeType":"55","endLine":64,"endColumn":14,"suggestions":"62"},"no-native-reassign",["63"],"no-negated-in-lhs",["64"],"react-hooks/exhaustive-deps","React Hook useEffect has missing dependencies: 'application' and 'fetchInfo'. Either include them or remove the dependency array.","ArrayExpression",["65"],"no-unused-vars","'useParams' is defined but never used.","Identifier","unusedVar","React Hook useEffect has a missing dependency: 'props'. Either include it or remove the dependency array.",["66"],"no-global-assign","no-unsafe-negation",{"desc":"67","fix":"68"},{"desc":"69","fix":"70"},"Update the dependencies array to be: [application, fetchInfo]",{"range":"71","text":"72"},"Update the dependencies array to be: [props]",{"range":"73","text":"74"},[3298,3300],"[application, fetchInfo]",[2258,2260],"[props]"]