diff --git a/.gitignore b/.gitignore index 9c1949c..fdcb16e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ # misc .DS_Store +.env .env.local .env.development.local .env.test.local diff --git a/src/components/ExportData.js b/src/components/ExportData.js index 608e81d..a525879 100644 --- a/src/components/ExportData.js +++ b/src/components/ExportData.js @@ -11,7 +11,7 @@ function ExportData({ url, show }) { const [endDate, setEndDate] = useState(""); const fetchFile = (start_date, end_date) => { - window.location.href = `https://asia-south1-hpos-preprod.cloudfunctions.net/consolidation?start_date=${moment(startDate).format("YYYY-MM-DD")}&end_date=${moment(endDate).format("YYYY-MM-DD")}`; + window.location.href = `https://asia-south1-${process.env.REACT_APP_FIREBASE_PROJECT_ID}.cloudfunctions.net/consolidation?start_date=${moment(startDate).format("YYYY-MM-DD")}&end_date=${moment(endDate).format("YYYY-MM-DD")}`; } return ( diff --git a/src/components/Registration.js b/src/components/Registration.js index 52c4b4a..b6f5150 100644 --- a/src/components/Registration.js +++ b/src/components/Registration.js @@ -16,7 +16,7 @@ function Registration() { setCounter(counter + 1); axios({ method: 'post', - url: "https://asia-south1-hpos-preprod.cloudfunctions.net/registerUser", + url: `https://asia-south1-${process.env.REACT_APP_FIREBASE_PROJECT_ID}.cloudfunctions.net/registerUser`, data: { "_id": id, "aadharId": "2808202300001", @@ -65,7 +65,7 @@ function Registration() { setMessage(""); axios({ method: 'get', - url: "https://asia-south1-hpos-preprod.cloudfunctions.net/clearUsers", + url: `https://asia-south1-${process.env.REACT_APP_FIREBASE_PROJECT_ID}.cloudfunctions.net/clearUsers`, withCredentials: false, secure: false, headers: { diff --git a/src/components/Samples.css b/src/components/Samples.css index 4439adb..5c00684 100644 --- a/src/components/Samples.css +++ b/src/components/Samples.css @@ -2,6 +2,7 @@ font-family: Arial, Helvetica, sans-serif; border-collapse: collapse; width: 100%; + font-size: small; } #samples-table td, diff --git a/src/components/Samples.js b/src/components/Samples.js index b8a6b68..a2dafe9 100644 --- a/src/components/Samples.js +++ b/src/components/Samples.js @@ -15,9 +15,10 @@ const Samples = () => { const unsub = onSnapshot(q, (querySnapshot) => { const samples = []; querySnapshot.forEach((document) => { - console.log(document.data()); - const alert = document.data(); - samples.push(alert); + console.log(document.id); + const data = document.data(); + const id = document.id; + samples.push({id, ...data}); }); setSamples(samples); }); @@ -50,13 +51,16 @@ const Samples = () => { Sample Name Pdr Class Dev Ratio Class - Dev Ratio - Device - abs1 - {/* led2Average */} - abs2 - abs3 + SR Class PDR + Dev Ratio + Slope Ratio + led1Sample + {/* led2Average */} + led2Sample + led3Sample + led4Sample + Device Time {samples.map((sample, index) => ( @@ -64,14 +68,16 @@ const Samples = () => { {sample.name || sample._id} {sample.prdClassification} {sample.deviceRatioClass} - {sample.deviceRatio} - {sample.deviceId} - {sample?.abs1?.toFixed(4)} - {/* {sample.led2Average || 'NA'} */} - {sample?.abs2?.toFixed(4) || 'NA'} - {sample?.abs3?.toFixed(4) || 'NA'} + {sample.slopeRatioClass} {sample?.predictedDenovixRatio?.toFixed(4)} - {sample.testTime} + {sample?.deviceRatio?.toFixed(4)} + {sample?.slopeRatio?.toFixed(4)} + {sample.led1Sample || 'NA'} + {sample.led2Sample || 'NA'} + {sample.led3Sample || 'NA'} + {sample.led4Sample || 'NA'} + {sample.deviceId} + {moment(sample.testTime).format('HH:MM:SS')} ))} diff --git a/src/components/nav/Topbar.js b/src/components/nav/Topbar.js index e9deca0..aaeacc5 100644 --- a/src/components/nav/Topbar.js +++ b/src/components/nav/Topbar.js @@ -16,7 +16,7 @@ const Topbar = () => { > - HPOS Web - preprod + HPOS Web - {process.env.REACT_APP_TOPBAR_TITLE}