From db031485218aa63b38ceae904a9f0a140476d3ca Mon Sep 17 00:00:00 2001 From: Yasith-Heshan <81988554+Yasith-Heshan@users.noreply.github.com> Date: Sat, 12 Aug 2023 20:30:59 +0530 Subject: [PATCH 1/5] Fingerprint results dialog --- public/assets/images/fingerprint_failed.jpg | Bin 0 -> 6452 bytes public/assets/images/fingerprint_success.jpg | Bin 0 -> 6659 bytes src/components/FingerPrintResults.tsx | 126 ++++++++++++++++++ .../check-in-out/CheckInOutContainer.tsx | 57 +++++++- src/services/FingerprintAuthServices.ts | 3 +- src/types.ts | 12 +- 6 files changed, 190 insertions(+), 8 deletions(-) create mode 100644 public/assets/images/fingerprint_failed.jpg create mode 100644 public/assets/images/fingerprint_success.jpg create mode 100644 src/components/FingerPrintResults.tsx diff --git a/public/assets/images/fingerprint_failed.jpg b/public/assets/images/fingerprint_failed.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bff187dd3aba3b01a819dd5c9403397fb039a771 GIT binary patch literal 6452 zcmb7|bx;&u)c1E;TDlP=mu{p}8kXE81(XtyEE2}CHBpj2$4HeR8G)a)s?#WYWqVcubl>tMUorrAS!!;%LHMj+s!=l>_g zgCY?0(C33yh#Y_g#KHk#VgIlCe?>fGAjig`V1-hODB-f-uf!VDh2YR#J3y91Xo~v%*_w5&3kFxMHbl|0_B{bRA=Vgn zavIvsuS9gQXQDDsG?pZ(g10gZML~{3h?H3VzR&WU{URac-(c2umZscgbsCV?@|*PY zjATIoGA}+!1WL?u#rA|x%k(fK-loZzpZfV<{I=LU&bC>{U+ug=et@sCgOA z_>6ISPpD#yJQ}@k5}3JEjWq)6O`quGjwtnyETLF})!wEbNd5`37b6v@L(Un`fD6_NxTzi_7@Z7T*k&K>e0K}UPzvVp~ULk)JFYwcC};z*PO6RQ43#ROvo>^w}@*A`s_uI>C+$~gvs?W`RW1N_XoLnJ?@ zA5Wy2-8%e}SKzezOiPty@@r5~=la?1h_Js|qR=$%^u4`}rn(nSp`Ah&1C!d`ISV|ELWAED~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-fD z2MYBsU1Pu@jpPP$g}%?+L`1L|+KX>dXQ1tq!JrSVS}-bDgOb*%f(BE*(U^oC+5CxF z`)K40h0$hsa-ojxU;(Y@n}h4|)(h~RiXrKQBh6R4t>!V#{ot#-Lei*%mhC#BJ|% zG3liBIagPkduf-I?Bh9>hpI{g^v(O&GNHlL0MEEfAD{C}>qa{wV`evo>%cZhg5OSr zxI~)$f$8WvMnp83QE$Nux7W2TvU?45swW^>lK90*Q^vT9-68xahibGUi@DT}Egy}7 zJ(11-u>20vcP;>$4v6vu?&KC1>Qu#`#^6%$k?f0ds@Bx{aHdga7Jgj0wnE>iTsWeA z{-*(q=7T*;;sE)`pJ1y33IkNlc(BgZPPcJRjT?^dQXO=~UE|H_7~>}tr=9alfBAfe zvR8ULLOS;KQx;09(NZO!*1c=THJf1TjSv{W5aw5vdwz$0CF5xE(-IoE)R-kIRlS+w z_W@)~rI`~0GfMAtFNDjgf2)IN&=|CK1dh7bJ;sc_#w|U}Ndsj!nWU0Uh@0Ztb&|<5 zLGt`x793A0&|?;=E$CNpD7g|RUNd$jcSf|`JmJH)R;e@qgdL|NhdsD({zk75{OI^w zzi|&htP%`wua^Cj!tC#CfAp>X7QrK4rkCQ~?N6+jV5zOYFgtUQfh5YD+ENY^q*^zC zWY`^q+KsjEc>dYAu6JcfY(HMytP^nOUU7!X98ZKruY==H{@Pf?xknczURz;ZC~UMOR#qlPW|Lz1D+&{HJ}ZRrug)O*{Brg T0t#y#{JM4CclWUYc)#>N5=|bD literal 0 HcmV?d00001 diff --git a/public/assets/images/fingerprint_success.jpg b/public/assets/images/fingerprint_success.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1074c56f4fa635e99231f7ba8ad56b1b6a26481c GIT binary patch literal 6659 zcmb7oWl+>_)b@|=?vACqL0FWOu4O^GQ@TXDSz2~sNkwW&K^o*Q-Ko+kjnX9{5|6&~ z&NJ`V_nI^J%$akY>zwoHp1B?u9+v@S0PX(;IywgWKVV{DpkrWRVqsxnVq#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XbgO z7WB3}OPAaGAbBj2Z<>m9xeA;d=kY?5sH@rJsN+qGSO&O1)AhfEU)55%f&;^jl9`P6 z+e+!0rluZ4`s75>QRZ1J0>KSSl^J`}Tw6{$2_{JePwL6{5rtHw=dk0Yu42VCuLGtt zCd10{Fh#lCFT3A}RkgQREVK^zq#-k&;qNzMln_3lWrLezz~{LrjvA zc-S($1~Vln)$V#=`5zvEC7dx0RcYDcUvWHnb4H=sa;f;m_QVw~yk-eIKOD0KwrUAh zEI2VdCTh~OUglL5*HrQDSijJzppV_l$WWRVG+Z-onWSl5bNOjhDS5 z2|V+!KMhUwTl@l{afi1IaQztbJBmcdliFRll3@cKr&9`toqDPvL7~JD_^kP@4aO=4 z3!QM7s6LsG2po@^SgHYmGtEM?=F7+CLni#!_Cxszx*0$+!$yY22?%U9Y|@Z#*N0Um z%HVaUb?`>opKZnw#U4Y@(vlT)k5Ky$QkS$cA4CUuKCpTU8M@t?cqK>AyCH-6D7Q$Ho5v=lM%E literal 0 HcmV?d00001 diff --git a/src/components/FingerPrintResults.tsx b/src/components/FingerPrintResults.tsx new file mode 100644 index 0000000..3328be5 --- /dev/null +++ b/src/components/FingerPrintResults.tsx @@ -0,0 +1,126 @@ +import * as React from 'react'; +import {styled} from '@mui/material/styles'; +import Dialog from '@mui/material/Dialog'; +import DialogTitle from '@mui/material/DialogTitle'; +import DialogContent from '@mui/material/DialogContent'; +import IconButton from '@mui/material/IconButton'; +import CloseIcon from '@mui/icons-material/Close'; +import Typography from '@mui/material/Typography'; +import Grid from "@mui/material/Grid"; +import {FingerPrintDetails, SetDialogOpenFunction} from "../types"; + +const BootstrapDialog = styled(Dialog)(({theme}) => ({ + '& .MuiDialogContent-root': { + padding: theme.spacing(2), + }, + '& .MuiDialogActions-root': { + padding: theme.spacing(1), + }, +})); + +export interface DialogTitleProps { + id: string; + children?: React.ReactNode; + onClose: () => void; +} + +function BootstrapDialogTitle(props: DialogTitleProps) { + const {children, onClose, ...other} = props; + + return ( + + {children} + {onClose ? ( + theme.palette.grey[500], + }} + > + + + ) : null} + + ); +} + + +export const FingerPrintResults = ({ + open, + setOpen, + access, + booking + }: { open: boolean, setOpen: SetDialogOpenFunction, access: boolean, booking: FingerPrintDetails }) => { + + + const handleClose = () => { + setOpen(false); + }; + + return ( +
+ + + + + + { + access ? ( + <> + + {'fingerprint + + + + Successfully Recognized + + + + {booking.username} + + + + + + {booking.timeslot} + + + + + + + Count: {booking.count} + + + + + ) : ( + <> + + {'fingerprint + + + No Booking for this Timeslot + + + ) + } + + + + +
+ ); +} \ No newline at end of file diff --git a/src/pages/check-in-out/CheckInOutContainer.tsx b/src/pages/check-in-out/CheckInOutContainer.tsx index 2c29f5b..1819d7a 100644 --- a/src/pages/check-in-out/CheckInOutContainer.tsx +++ b/src/pages/check-in-out/CheckInOutContainer.tsx @@ -12,8 +12,12 @@ import { socket } from "../../helpers/socket"; import { AppState } from "../../redux/reducer"; import FingerprintAuthServices from "../../services/FingerprintAuthServices"; import ResourcesServices from "../../services/ResourcesServices"; -import { Resource, User } from "../../types"; +import {FingerPrintDetails, Resource, User} from "../../types"; import FingerprintUi from "./FingerprintUI"; +import {FingerPrintResults} from "../../components/FingerPrintResults"; +import dayjs from "dayjs"; +import localizedFormat from 'dayjs/plugin/localizedFormat' + const dashboardTheme = createTheme({ palette: { @@ -32,6 +36,10 @@ export default function CheckInOutContainer() { const { resourceId } = useParams(); const navigate = useNavigate(); + const [dialogOpen, setDialogOpen] = useState(false); + const [access, setAccess] = useState(false); + const [booking, setBooking] = useState(null); + useEffect(() => { if (!user) { navigate("/"); @@ -73,11 +81,34 @@ export default function CheckInOutContainer() { fingerprintData, user.token ); - console.log(authenticationData); - const { username } = authenticationData.data; - console.log(username); - setScannerActive(false); - // TODO: Display the result + if(authenticationData){ + const { username,startTime,endTime,count } = authenticationData.data; + + dayjs.extend(localizedFormat); + const booking:FingerPrintDetails = { + username, + count, + timeslot:dayjs(startTime).format('L LT')+'-'+dayjs(endTime).format('LT') + } + setBooking(booking); + + setAccess(true); + setScannerActive(false); + setDialogOpen(true); + }else { + setAccess(false); + setDialogOpen(true); + } + + setTimeout( + ()=>{ + setBooking(null); + setAccess(false) + setDialogOpen(false) + },5000 + ) + + }); }, [resource]); @@ -88,6 +119,9 @@ export default function CheckInOutContainer() { socket.emit("fingerprint", 3); } + + + return ( @@ -98,15 +132,26 @@ export default function CheckInOutContainer() { {resource && ( + <> + + + + )} {!resource && ( Resource not found. )} + diff --git a/src/services/FingerprintAuthServices.ts b/src/services/FingerprintAuthServices.ts index 4976f57..9e4eae2 100644 --- a/src/services/FingerprintAuthServices.ts +++ b/src/services/FingerprintAuthServices.ts @@ -15,7 +15,8 @@ const fpAuthenticate = async ( const response = await axios.patch("/bookings", data); return response.data; } catch (error) { - return error; + console.error(error); + return null; } }; diff --git a/src/types.ts b/src/types.ts index 8c264f1..f5c0561 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,3 +1,5 @@ +import * as React from "react"; + export type Resource = { id: string; name: string; @@ -45,4 +47,12 @@ export type BookingForm = { export const ADMIN = 'ADMIN'; export const RESOURCE_MANAGER = 'RESOURCE_MANAGER'; -export const RESOURCE_USER = 'RESOURCE_USER'; \ No newline at end of file +export const RESOURCE_USER = 'RESOURCE_USER'; + +export type SetDialogOpenFunction = React.Dispatch>; +export type FingerPrintDetails = { + username: string, + count: number, + timeslot: string, + +} \ No newline at end of file From 6268ea00fbe89dd40e04c8015cdcb2c103610dce Mon Sep 17 00:00:00 2001 From: Yasith-Heshan <81988554+Yasith-Heshan@users.noreply.github.com> Date: Sat, 12 Aug 2023 22:47:02 +0530 Subject: [PATCH 2/5] Fix issues mentioned in review --- src/components/FingerPrintResults.tsx | 17 ++--- .../check-in-out/CheckInOutContainer.tsx | 62 +++++++++---------- .../view-resources/ViewResourcesContainer.tsx | 35 +++++++---- src/services/FingerprintAuthServices.ts | 1 - 4 files changed, 64 insertions(+), 51 deletions(-) diff --git a/src/components/FingerPrintResults.tsx b/src/components/FingerPrintResults.tsx index 3328be5..afa40af 100644 --- a/src/components/FingerPrintResults.tsx +++ b/src/components/FingerPrintResults.tsx @@ -8,6 +8,8 @@ import CloseIcon from '@mui/icons-material/Close'; import Typography from '@mui/material/Typography'; import Grid from "@mui/material/Grid"; import {FingerPrintDetails, SetDialogOpenFunction} from "../types"; +import FingerPrintFailed from '../../public/assets/images/fingerprint_failed.jpg' +import FingerPrintSuccess from '../../public/assets/images/fingerprint_success.jpg' const BootstrapDialog = styled(Dialog)(({theme}) => ({ '& .MuiDialogContent-root': { @@ -77,19 +79,20 @@ export const FingerPrintResults = ({ <> {'fingerprint - - - Successfully Recognized - + + + Successfully Recognized + {booking.username} - + {booking.timeslot} @@ -108,7 +111,7 @@ export const FingerPrintResults = ({ <> {'fingerprint diff --git a/src/pages/check-in-out/CheckInOutContainer.tsx b/src/pages/check-in-out/CheckInOutContainer.tsx index 1819d7a..90a8c35 100644 --- a/src/pages/check-in-out/CheckInOutContainer.tsx +++ b/src/pages/check-in-out/CheckInOutContainer.tsx @@ -1,15 +1,15 @@ -import { Box, Container, Toolbar, Typography } from "@mui/material"; +import {Box, Container, Toolbar, Typography} from "@mui/material"; import CssBaseline from "@mui/material/CssBaseline"; -import { createTheme } from "@mui/material/styles"; +import {createTheme} from "@mui/material/styles"; import ThemeProvider from "@mui/material/styles/ThemeProvider"; -import { useEffect, useState } from "react"; -import { useSelector } from "react-redux"; -import { useNavigate, useParams } from "react-router-dom"; +import {useEffect, useState} from "react"; +import {useSelector} from "react-redux"; +import {useNavigate, useParams} from "react-router-dom"; import AppbarComponent from "../../components/AppbarComponent"; import Copyright from "../../components/Copyright"; import DrawerComponent from "../../components/DrawerComponent"; -import { socket } from "../../helpers/socket"; -import { AppState } from "../../redux/reducer"; +import {socket} from "../../helpers/socket"; +import {AppState} from "../../redux/reducer"; import FingerprintAuthServices from "../../services/FingerprintAuthServices"; import ResourcesServices from "../../services/ResourcesServices"; import {FingerPrintDetails, Resource, User} from "../../types"; @@ -33,12 +33,12 @@ const dashboardTheme = createTheme({ export default function CheckInOutContainer() { const [resource, setResource] = useState(null); const user: User | null = useSelector((state: AppState) => state.user.user); - const { resourceId } = useParams(); + const {resourceId} = useParams(); const navigate = useNavigate(); const [dialogOpen, setDialogOpen] = useState(false); const [access, setAccess] = useState(false); - const [booking, setBooking] = useState(null); + const [booking, setBooking] = useState(null); useEffect(() => { if (!user) { @@ -81,31 +81,32 @@ export default function CheckInOutContainer() { fingerprintData, user.token ); - if(authenticationData){ - const { username,startTime,endTime,count } = authenticationData.data; + if (authenticationData) { + const {username, startTime, endTime, count} = authenticationData.data; dayjs.extend(localizedFormat); - const booking:FingerPrintDetails = { + const booking: FingerPrintDetails = { username, count, - timeslot:dayjs(startTime).format('L LT')+'-'+dayjs(endTime).format('LT') + timeslot: dayjs(startTime).format('L LT') + '-' + dayjs(endTime).format('LT') } setBooking(booking); setAccess(true); setScannerActive(false); setDialogOpen(true); - }else { + } else { setAccess(false); setDialogOpen(true); } setTimeout( - ()=>{ + () => { + setScannerActive(false); setBooking(null); setAccess(false) setDialogOpen(false) - },5000 + }, 5000 ) @@ -120,31 +121,28 @@ export default function CheckInOutContainer() { } - - return ( - - - - - - - + + + + + + + {resource && ( <> - + - )} @@ -153,7 +151,7 @@ export default function CheckInOutContainer() { )} - + diff --git a/src/pages/view-resources/ViewResourcesContainer.tsx b/src/pages/view-resources/ViewResourcesContainer.tsx index 88d3c5c..fa8fe85 100644 --- a/src/pages/view-resources/ViewResourcesContainer.tsx +++ b/src/pages/view-resources/ViewResourcesContainer.tsx @@ -20,6 +20,7 @@ import resourcesServices from "src/services/ResourcesServices"; import {Booking, Resource, User} from "../../types"; import {useSelector} from "react-redux"; import {AppState} from "../../redux/reducer"; +import Grid from "@mui/material/Grid"; const dashboardTheme = createTheme({ palette: { @@ -91,14 +92,14 @@ function ResourceCard({resource}: { resource: Resource }) { setExpanded(!expanded); }; - const handleEditStart = (e: any) => { + const handleEditStart = () => { setExpanded(false); setName(resource.name); setCount(resource.count) setEditStarted(true); }; - const handleUpdate = async (e: any) => { + const handleUpdate = async () => { if (!nameError && !countError) { await resourcesServices.updateResource(parseInt(resource.id), name, count,token); setEditStarted(false); @@ -189,14 +190,26 @@ function ResourceCard({resource}: { resource: Resource }) { > { !editStarted ? ( - + + + + + + + + + ) : ( diff --git a/src/services/FingerprintAuthServices.ts b/src/services/FingerprintAuthServices.ts index 9e4eae2..e13136c 100644 --- a/src/services/FingerprintAuthServices.ts +++ b/src/services/FingerprintAuthServices.ts @@ -15,7 +15,6 @@ const fpAuthenticate = async ( const response = await axios.patch("/bookings", data); return response.data; } catch (error) { - console.error(error); return null; } }; From e749d9ec9b3b89cb6797ef4d3625515352f37242 Mon Sep 17 00:00:00 2001 From: Yasith-Heshan <81988554+Yasith-Heshan@users.noreply.github.com> Date: Sun, 13 Aug 2023 00:50:54 +0530 Subject: [PATCH 3/5] Fix 400 issue --- src/index.tsx | 4 ++-- .../check-in-out/CheckInOutContainer.tsx | 20 ++++++++++++------- src/services/FingerprintAuthServices.ts | 7 +++++-- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 6bb2ae7..4f5dac1 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -5,7 +5,7 @@ import App from './App'; const root = ReactDOM.createRoot(document.getElementById('root')); root.render( - + // - + // ); \ No newline at end of file diff --git a/src/pages/check-in-out/CheckInOutContainer.tsx b/src/pages/check-in-out/CheckInOutContainer.tsx index 90a8c35..fd2d63e 100644 --- a/src/pages/check-in-out/CheckInOutContainer.tsx +++ b/src/pages/check-in-out/CheckInOutContainer.tsx @@ -75,13 +75,15 @@ export default function CheckInOutContainer() { useEffect(() => { if (resource === null) return; socket.on("fingerprintData", async (fingerprintData) => { + try { + const authenticationData: any = await FingerprintAuthServices.fpAuthenticate( parseInt(resource.id), fingerprintData, user.token ); - if (authenticationData) { + const {username, startTime, endTime, count} = authenticationData.data; dayjs.extend(localizedFormat); @@ -95,19 +97,23 @@ export default function CheckInOutContainer() { setAccess(true); setScannerActive(false); setDialogOpen(true); - } else { + }catch (error:any){ setAccess(false); - setDialogOpen(true); + if(error.message==='400'){ + setDialogOpen(true); + }else{ + setDialogOpen(false); + } } setTimeout( () => { + setDialogOpen(false); setScannerActive(false); - setBooking(null); - setAccess(false) - setDialogOpen(false) + // setBooking(null); + // setAccess(false); }, 5000 - ) + ); }); diff --git a/src/services/FingerprintAuthServices.ts b/src/services/FingerprintAuthServices.ts index e13136c..f928f20 100644 --- a/src/services/FingerprintAuthServices.ts +++ b/src/services/FingerprintAuthServices.ts @@ -14,8 +14,11 @@ const fpAuthenticate = async ( axios.defaults.headers.common["Authorization"] = `Bearer ${token}`; const response = await axios.patch("/bookings", data); return response.data; - } catch (error) { - return null; + } catch (error:any) { + if(error.response.status){ + throw new Error('400'); + } + throw new Error('unknown'); } }; From cd10a798d4c821425f678b4ac76a47a4f65924fb Mon Sep 17 00:00:00 2001 From: Yasith-Heshan <81988554+Yasith-Heshan@users.noreply.github.com> Date: Sun, 13 Aug 2023 00:54:25 +0530 Subject: [PATCH 4/5] Fix Mosip --> CSE --- src/pages/view-resources/ViewResourcesContainer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/view-resources/ViewResourcesContainer.tsx b/src/pages/view-resources/ViewResourcesContainer.tsx index fa8fe85..4f91ff8 100644 --- a/src/pages/view-resources/ViewResourcesContainer.tsx +++ b/src/pages/view-resources/ViewResourcesContainer.tsx @@ -345,7 +345,7 @@ export default function ViewResourcesContainer() { - © {new Date().getFullYear()} MOSIP + © {new Date().getFullYear()} CSE From 210f79e69cb3c66378db9a96b05bee0117cd8ace Mon Sep 17 00:00:00 2001 From: Yasith-Heshan <81988554+Yasith-Heshan@users.noreply.github.com> Date: Sun, 13 Aug 2023 14:03:12 +0530 Subject: [PATCH 5/5] remove commented lines --- src/index.tsx | 4 ++-- src/pages/check-in-out/CheckInOutContainer.tsx | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 4f5dac1..6bb2ae7 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -5,7 +5,7 @@ import App from './App'; const root = ReactDOM.createRoot(document.getElementById('root')); root.render( - // + - // + ); \ No newline at end of file diff --git a/src/pages/check-in-out/CheckInOutContainer.tsx b/src/pages/check-in-out/CheckInOutContainer.tsx index fd2d63e..dae8a46 100644 --- a/src/pages/check-in-out/CheckInOutContainer.tsx +++ b/src/pages/check-in-out/CheckInOutContainer.tsx @@ -110,8 +110,6 @@ export default function CheckInOutContainer() { () => { setDialogOpen(false); setScannerActive(false); - // setBooking(null); - // setAccess(false); }, 5000 );