-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintcache
1 lines (1 loc) · 16.7 KB
/
.eslintcache
1
[{"F:\\cloudstorage\\client\\src\\index.js":"1","F:\\cloudstorage\\client\\src\\App.js":"2","F:\\cloudstorage\\client\\src\\reportWebVitals.js":"3","F:\\cloudstorage\\client\\src\\components\\Homepage\\Homepage.js":"4","F:\\cloudstorage\\client\\src\\components\\Login\\Login.js":"5","F:\\cloudstorage\\client\\src\\components\\AdditionalComponents\\Loading.js":"6","F:\\cloudstorage\\client\\src\\components\\Signup\\Signup.js":"7","F:\\cloudstorage\\client\\src\\components\\Dashboard\\Dashboard.js":"8","F:\\cloudstorage\\client\\src\\components\\Dashboard\\StoragePie.js":"9","F:\\cloudstorage\\client\\src\\components\\Dashboard\\ProfileCard.js":"10","F:\\cloudstorage\\client\\src\\components\\Dashboard\\AllFiles.js":"11","F:\\cloudstorage\\client\\src\\components\\Dashboard\\EachFileOptions.js":"12","F:\\cloudstorage\\client\\src\\components\\Dashboard\\AddFiles.js":"13","F:\\cloudstorage\\client\\src\\components\\AdditionalComponents\\Footer.js":"14","F:\\cloudstorage\\client\\src\\components\\AdditionalComponents\\GoogleOAuth.js":"15"},{"size":455,"mtime":1607440964814,"results":"16","hashOfConfig":"17"},{"size":770,"mtime":1607614883916,"results":"18","hashOfConfig":"17"},{"size":362,"mtime":499162500000,"results":"19","hashOfConfig":"17"},{"size":5607,"mtime":1607776022031,"results":"20","hashOfConfig":"17"},{"size":7105,"mtime":1608718024436,"results":"21","hashOfConfig":"17"},{"size":717,"mtime":1607607035371,"results":"22","hashOfConfig":"17"},{"size":8023,"mtime":1608718064608,"results":"23","hashOfConfig":"17"},{"size":5531,"mtime":1607924877880,"results":"24","hashOfConfig":"17"},{"size":2841,"mtime":1608136818587,"results":"25","hashOfConfig":"17"},{"size":2578,"mtime":1608136810355,"results":"26","hashOfConfig":"17"},{"size":7426,"mtime":1608136794820,"results":"27","hashOfConfig":"17"},{"size":4897,"mtime":1608194609455,"results":"28","hashOfConfig":"17"},{"size":8994,"mtime":1608194417337,"results":"29","hashOfConfig":"17"},{"size":403,"mtime":1607927956859,"results":"30","hashOfConfig":"17"},{"size":2324,"mtime":1608718211765,"results":"31","hashOfConfig":"17"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},"k82jsb",{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"43","messages":"44","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"51","usedDeprecatedRules":"34"},{"filePath":"52","messages":"53","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"54","messages":"55","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"56","usedDeprecatedRules":"34"},{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"61","messages":"62","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"63","messages":"64","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"F:\\cloudstorage\\client\\src\\index.js",[],["65","66"],"F:\\cloudstorage\\client\\src\\App.js",[],"F:\\cloudstorage\\client\\src\\reportWebVitals.js",[],"F:\\cloudstorage\\client\\src\\components\\Homepage\\Homepage.js",[],"F:\\cloudstorage\\client\\src\\components\\Login\\Login.js",[],"F:\\cloudstorage\\client\\src\\components\\AdditionalComponents\\Loading.js",[],"F:\\cloudstorage\\client\\src\\components\\Signup\\Signup.js",[],"F:\\cloudstorage\\client\\src\\components\\Dashboard\\Dashboard.js",[],"F:\\cloudstorage\\client\\src\\components\\Dashboard\\StoragePie.js",["67"]," /* Utility Modules*/\r\n import React,{useEffect,useState} from 'react'\r\n import {Card,Alert} from 'react-bootstrap'\r\n import axios from 'axios'\r\n\r\n\r\n /* Components */\r\n import Loading from '../AdditionalComponents/Loading';\r\n\r\nexport default function StoragePie({accessToken,show}) {\r\n\r\n const [freestorage,setfreestorage] = useState(20);\r\n const [utilityStates,setUtilityStates] = useState({\r\n alert:'',\r\n variant:'',\r\n showAlert:false\r\n })\r\n const [loading,setLoading] = useState(false);\r\n\r\n\r\n /**\r\n * Fetches the current user's storage value\r\n */\r\n const fetchStorage = ()=>{\r\n\r\n if(accessToken==='')\r\n return;\r\n\r\n \r\n const URL_PREFIX = process.env.REACT_APP_SERVER_URL_PREFIX;\r\n const URL = `${URL_PREFIX}/home/storagedet`;\r\n\r\n setLoading(true);\r\n\r\n axios.get(URL,{headers:{'authorization':`Token ${accessToken}`}})\r\n .then(response=>{\r\n\r\n setfreestorage(response.data.storage);\r\n setUtilityStates({alert:response.data.message,variant:'success',showAlert:true});\r\n\r\n // stop loading\r\n setLoading(false);\r\n\r\n let pieChart = document.getElementById('pieChart');\r\n pieChart.style.backgroundImage = `conic-gradient(lightblue ${(freestorage/20)*360}deg,pink 0)`;\r\n })\r\n .catch(error=>{\r\n const errMsg = error.response ? (error.response.data.errors.message):('Unknown Error Occured');\r\n setUtilityStates({variant:'danger',alert:errMsg,showAlert:true});\r\n // stop loading\r\n setLoading(false);\r\n })\r\n }\r\n\r\n useEffect(() => {\r\n fetchStorage();\r\n }, [show])\r\n\r\n return (\r\n <Card className=\"userInfoCards\" style={{height:'20rem'}}>\r\n <Loading show={loading}/>\r\n <Alert \r\n variant={utilityStates.variant} \r\n id=\"fileAlert\"\r\n show={utilityStates.showAlert}\r\n onClose={() => setUtilityStates({showAlert:false})} \r\n style={{textAlign:'center',overflowWrap: 'break-word'}}\r\n dismissible\r\n >\r\n {utilityStates.alert}\r\n </Alert>\r\n\r\n <Card.Body>\r\n <div id=\"pieChart\"></div>\r\n </Card.Body>\r\n <Card.Body>\r\n <div id=\"storageDetails\">\r\n <p>\r\n <span id=\"freeLegend\"></span>Free {(freestorage/20*100).toFixed(2)}%\r\n </p>\r\n <p>\r\n <span id=\"usedLegend\"></span>Used {(100-(freestorage/20*100)).toFixed(2)}%\r\n </p>\r\n </div>\r\n </Card.Body>\r\n </Card>\r\n )\r\n}\r\n","F:\\cloudstorage\\client\\src\\components\\Dashboard\\ProfileCard.js",[],"F:\\cloudstorage\\client\\src\\components\\Dashboard\\AllFiles.js",["68"]," /* Utility Modules*/\r\n import React,{useState,useEffect} from 'react'\r\n import {Jumbotron,Alert,Card,Col,Row} from 'react-bootstrap'\r\n import axios from 'axios'\r\n\r\n\r\n /* Components */\r\n import Loading from '../AdditionalComponents/Loading';\r\n import EachFileOptions from './EachFileOptions';\r\n\r\n /*extra import*/\r\n import ApplicationType from '../../assets/images/allFiles/application.jpg'\r\n import AudioType from '../../assets/images/allFiles/audio.png'\r\n import DocumentType from '../../assets/images/allFiles/document.jpg'\r\n import ImageType from '../../assets/images/allFiles/image.jpg'\r\n import VideoType from '../../assets/images/allFiles/video.jpg'\r\n import AddFiles from '../../assets/images/allFiles/add.jpg'\r\n\r\nfunction AllFiles({accessToken,show,refreshFilesFunc,currShowAllFiles}) {\r\n\r\n const [myFiles,setMyFiles] = useState([]);\r\n const [utilityStates,setUtilityStates] = useState({alert:'',variant:'light',showAlert:false})\r\n const [childStates,setchildStates] = useState({alert:'',variant:'light',showAlert:false})\r\n const [loading,setLoading] = useState(false);\r\n\r\n\r\n /**\r\n * Get all the files\r\n */\r\n const fetchFiles=()=>{\r\n if(accessToken==='')\r\n return;\r\n //loading icon\r\n setLoading(true);\r\n\r\n const url = `${process.env.REACT_APP_SERVER_URL_PREFIX}/files/allfiles`;\r\n\r\n\r\n // fetch files\r\n axios.get(url,{headers:{authorization: `Token ${accessToken}`}})\r\n .then(response=>{\r\n setMyFiles([...response.data.files]);\r\n setUtilityStates({alert:response.data.message,variant:'success'});\r\n setLoading(false);\r\n \r\n })\r\n .catch(error=>{\r\n const errMsg = error.response ? (error.response.data.errors.message):('Unknown Error Occured');\r\n setUtilityStates({alert:errMsg,variant:'danger'});\r\n setLoading(false);\r\n })\r\n }\r\n\r\n\r\n /**\r\n * Fetch files as soon as component\r\n * loads or updates\r\n */\r\n useEffect(()=>{\r\n fetchFiles();\r\n },[show])\r\n\r\n\r\n /**\r\n * \r\n * @param {*} contentType : type of content \r\n * \r\n */\r\n const checkMimeType = (contentType)=>{\r\n var type = contentType.split('/')[0];\r\n var subType = contentType.split('/')[1];\r\n\r\n if(type==='image')\r\n return ImageType;\r\n else if(type==='text')\r\n return DocumentType;\r\n else if(type==='audio')\r\n return AudioType;\r\n else if(type==='video')\r\n return VideoType;\r\n else{\r\n if(subType==='pdf'||subType==='json'||subType==='csv'||subType.includes('word'))\r\n return DocumentType;\r\n else\r\n return ApplicationType\r\n }\r\n \r\n }\r\n\r\n /**\r\n * \r\n * Show alerts from child components\r\n * \r\n * @param {*} alertMsg \r\n * @param {*} variantType \r\n */\r\n const showEachFileMessage = (alertMsg,variantType)=>{\r\n setchildStates({alert:alertMsg,variant:variantType});\r\n } \r\n\r\n /**\r\n * Add URL to input fields\r\n * \r\n * @param {*} eleID : unique input field id based on fileKey\r\n * @param {*} URL \r\n */\r\n const setURL = (eleID='',URL='')=>{\r\n document.getElementById(`${eleID}`).value = URL;\r\n }\r\n\r\n\r\n /**\r\n * Copy to clipboard\r\n * \r\n * @param {*} e : input field of a card\r\n */\r\n const handleCopyToClipboard = (e)=>{\r\n e.target.select();\r\n e.target.setSelectionRange(0,99999);\r\n document.execCommand('copy');\r\n\r\n let oldVal = e.target.value;\r\n\r\n e.target.value = 'Copied to clipboard!!';\r\n\r\n setTimeout(()=>{\r\n e.target.value = oldVal;\r\n },2000);\r\n }\r\n\r\n\r\n \r\n return (\r\n <Jumbotron id=\"filesView\">\r\n <Loading show={loading}/>\r\n\r\n <Alert \r\n variant={utilityStates.variant} \r\n id=\"fileAlert\"\r\n show={utilityStates.showAlert}\r\n onClose={() => setUtilityStates({showAlert:false})} \r\n style={{textAlign:'center',overflowWrap: 'break-word'}}\r\n dismissible\r\n >\r\n {utilityStates.alert}\r\n </Alert>\r\n\r\n <Alert \r\n variant={childStates.variant} \r\n id=\"fileAlert\"\r\n show={childStates.showAlert}\r\n onClose={() => setchildStates({showAlert:false})} \r\n style={{textAlign:'center',overflowWrap: 'break-word'}}\r\n dismissible\r\n >\r\n {childStates.alert}\r\n </Alert>\r\n\r\n <Row>\r\n {\r\n myFiles.length ? (\r\n myFiles.map(file=>{\r\n return (\r\n <Col key={file._id} xs={8} sm={6} md={6} lg={4} xl={3} id=\"colCards\" style={{margin:\"auto\"}}>\r\n \r\n <Card className=\"myFilesCard\">\r\n <div id=\"moreOptionsBtn\">\r\n <EachFileOptions \r\n fileKey={file.fileKey}\r\n ACL={file.ACL}\r\n accessToken={accessToken}\r\n sendResMsg={showEachFileMessage}\r\n setURL={setURL}\r\n fileId={file._id}\r\n refreshFilesFunc={refreshFilesFunc}\r\n currShowAllFiles={currShowAllFiles}\r\n />\r\n </div>\r\n <Card.Img variant=\"top\" src={checkMimeType(file.contentType)} \r\n style={{width:'100%',margin:'0 auto'}}\r\n />\r\n <Card.Body style={{margin:'2px auto',padding:'0%'}}>\r\n <Card.Title className=\"cardTitle\">{file.originalname}</Card.Title>\r\n </Card.Body>\r\n <input \r\n id={file._id} \r\n style={{marginTop:\"10px\",scrollBehavior:\"smooth\",overflowX:\"scroll\"}}\r\n value={(file.ACL==='private')?('URL Private'):(file.url)}\r\n readOnly\r\n className=\"cardURLInputField\"\r\n onClick = {handleCopyToClipboard}\r\n />\r\n </Card>\r\n\r\n </Col>)\r\n })\r\n ):(\r\n <Card id=\"noFilesFound\">\r\n <Card.Img variant=\"top\" src={AddFiles} />\r\n <Card.Body>\r\n <Card.Title>Add Files</Card.Title>\r\n <Card.Text>\r\n Add files to view them\r\n </Card.Text>\r\n </Card.Body>\r\n </Card>\r\n )\r\n }\r\n </Row>\r\n </Jumbotron>\r\n )\r\n}\r\n\r\nexport default AllFiles\r\n","F:\\cloudstorage\\client\\src\\components\\Dashboard\\EachFileOptions.js",[],"F:\\cloudstorage\\client\\src\\components\\Dashboard\\AddFiles.js",[],"F:\\cloudstorage\\client\\src\\components\\AdditionalComponents\\Footer.js",[],"F:\\cloudstorage\\client\\src\\components\\AdditionalComponents\\GoogleOAuth.js",[],{"ruleId":"69","replacedBy":"70"},{"ruleId":"71","replacedBy":"72"},{"ruleId":"73","severity":1,"message":"74","line":57,"column":8,"nodeType":"75","endLine":57,"endColumn":14,"suggestions":"76"},{"ruleId":"73","severity":1,"message":"77","line":61,"column":7,"nodeType":"75","endLine":61,"endColumn":13,"suggestions":"78"},"no-native-reassign",["79"],"no-negated-in-lhs",["80"],"react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'fetchStorage'. Either include it or remove the dependency array.","ArrayExpression",["81"],"React Hook useEffect has a missing dependency: 'fetchFiles'. Either include it or remove the dependency array.",["82"],"no-global-assign","no-unsafe-negation",{"desc":"83","fix":"84"},{"desc":"85","fix":"86"},"Update the dependencies array to be: [fetchStorage, show]",{"range":"87","text":"88"},"Update the dependencies array to be: [fetchFiles, show]",{"range":"89","text":"90"},[1774,1780],"[fetchStorage, show]",[2142,2148],"[fetchFiles, show]"]