From 698056e6b4d1e8816c828751ce364a1090a255a0 Mon Sep 17 00:00:00 2001 From: Atikpui007 <106533812+Atikpui007@users.noreply.github.com> Date: Mon, 11 Nov 2024 02:32:12 -0500 Subject: [PATCH 1/3] Update README.md --- README.md | 116 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 69 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 02dc75c3..a068e7f6 100644 --- a/README.md +++ b/README.md @@ -26,50 +26,72 @@ The **Rider App** branch can be found [here](https://github.com/cornell-dti/carr ## Contributors: -**Current Contributors** - -- Harrison Chin - Software Developer -- Andrew Choi - Product Manager -- Rohit Valiveti - Software Developer -- Pratyush Sudhakar - Technical Project Manager -- Enoch Chen - Software Developer -- Desmond Atikpui - Software Developer -- Stuti Gupta - Software Developer -- Kevin Lin - Software Developer -- Colin Wu - Software Developer -- Raissa Ji - Software Developer -- Nam Anh Dang - Software Developer -- Selena Liu - Software Developer -- Dwain Anderson - Software Developer - -**Past Contributors** - -- Daniel Wei - Technical Project Manager -- Bryan Graeser - Product Manager -- Nina Xie - Product Manager -- Matthew Guo - Technical Project Manager -- Aaron Kang - Software Developer -- Zack Ashen - Software Developer -- Tucker Stanley - Software Developer -- Justin Kang - Software Developer -- Michael Torku - Technical Project Manager -- Austin Wu - Software Developer -- Li Fengyu - Software Developer -- Sam Steinberg - Product Manager -- Laura Sizemore - Technical Project Manager, Software Developer -- Christopher Hansen - Technical Project Manager -- Jessica Chen - Software Developer -- Bryan Graeser - Software Developer -- Matthew Guo - Software Developer -- Ishika Jain - Software Developer -- Lucy Wang - Software Developer -- Michael Ye - Software Developer -- Becky Hu - Software Developer -- Laura Sizemore - Software Developer -- Pinxuan Huang - Software Developer -- Jay Joo - Software Developer -- Simran Puri - Software Developer -- Aiden Kim - Designer -- Yisu Zheng - Designer -- Chelsea Wang - Designer -- Joanne Lee - Designer +## Contributors + +### Current Contributors + +#### Product Manager +- Matthias Choi + +#### Technical Project Manager +- Desmond Atikpui + +#### Software Developers +- Dwain Anderson +- Nam Anh Dang +- Raissa Ji +- Selena Liu + +--- + +### Past Contributors + +#### Product Managers +- Andrew Choi +- Bryan Graeser +- Nina Xie +- Sam Steinberg +- Stephy Chen + +#### Technical Project Managers +- Christopher Hansen +- Daniel Wei +- Laura Sizemore +- Matthew Guo +- Michael Torku +- Pratyush Sudhakar + +#### Software Developers +- Aaron Kang +- Aiden Kim +- Andrew Choi +- Becky Hu +- Bryan Graeser +- Chelsea Wang +- Colin Wu +- Enoch Chen +- Harrison Chin +- Ishika Jain +- Jay Joo +- Jessica Chen +- Joanne Lee +- Justin Kang +- Kevin Lin +- Laura Sizemore +- Li Fengyu +- Lucy Wang +- Matthew Guo +- Michael Ye +- Pinxuan Huang +- Rohit Valiveti +- Simran Puri +- Stuti Gupta +- Tucker Stanley +- Zack Ashen + +#### Designers +- Aiden Kim +- Chelsea Wang +- Joanne Lee +- Yisu Zheng + From 67e40c78ad3694a76e70372a3dfb34c907b71831 Mon Sep 17 00:00:00 2001 From: Desmond Atikpui Date: Mon, 11 Nov 2024 14:26:39 -0500 Subject: [PATCH 2/3] Prettier Fix --- frontend/src/components/Modal/AssignDriverModal.tsx | 11 ++++++----- frontend/src/components/UserTables/RidesTable.tsx | 9 ++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/Modal/AssignDriverModal.tsx b/frontend/src/components/Modal/AssignDriverModal.tsx index 46591c98..a89152b1 100644 --- a/frontend/src/components/Modal/AssignDriverModal.tsx +++ b/frontend/src/components/Modal/AssignDriverModal.tsx @@ -10,7 +10,7 @@ type AssignModalProps = { ride: Ride; allDrivers: Driver[]; reassign: boolean; - buttonRef: any + buttonRef: any; }; type DriverRowProps = { @@ -44,8 +44,10 @@ const AssignDriverModal = ({ useEffect(() => { function handleClickOutside(event: any) { event.stopPropagation(); - const isClickOutsideButton = buttonRef.current && !buttonRef.current.contains(event.target); - const isClickOutsideModal = wrapperRef.current && !wrapperRef.current.contains(event.target); + const isClickOutsideButton = + buttonRef.current && !buttonRef.current.contains(event.target); + const isClickOutsideModal = + wrapperRef.current && !wrapperRef.current.contains(event.target); if (isClickOutsideModal && isClickOutsideButton) { close(); } @@ -69,9 +71,8 @@ const AssignDriverModal = ({ close(); }; - useOutsideAlerter(wrapperRef, buttonRef); - + return ( <> {isOpen && ( diff --git a/frontend/src/components/UserTables/RidesTable.tsx b/frontend/src/components/UserTables/RidesTable.tsx index 81f683aa..ace0dea3 100644 --- a/frontend/src/components/UserTables/RidesTable.tsx +++ b/frontend/src/components/UserTables/RidesTable.tsx @@ -1,4 +1,4 @@ -import React, { useState }from 'react'; +import React, { useState } from 'react'; import { Ride } from '../../types/index'; import { Row, Table } from '../TableComponents/TableComponents'; import { Button } from '../FormElements/FormElements'; @@ -94,14 +94,13 @@ const RidesTable = ({ rides, hasButtons }: RidesTableProps) => { ), }; - const assignButton = (shouldReassign: boolean) => ( - ); }; @@ -270,7 +282,7 @@ const EmployeeDetail = () => { if (employee) { const isAdmin = employee.isDriver !== undefined; - const isBoth = employee.isDriver ?? false; // isDriver is only for admins + also driver if true + const isBoth = employee.isDriver ?? false; const availToString = (acc: string, [day, timeRange]: string[]) => `${acc + day}: ${timeRange} • `; const parsedAvail = employee.availability @@ -325,7 +337,6 @@ const EmployeeDetail = () => { )} - {/* */} ); diff --git a/frontend/src/components/UserDetail/RiderDetail.tsx b/frontend/src/components/UserDetail/RiderDetail.tsx index 520a1bfa..d1a964c6 100644 --- a/frontend/src/components/UserDetail/RiderDetail.tsx +++ b/frontend/src/components/UserDetail/RiderDetail.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import moment from 'moment'; -import { useParams, Link } from 'react-router-dom'; +import { useParams, useNavigate } from 'react-router-dom'; import UserDetail, { UserContactInfo } from './UserDetail'; import { phone, home, calendar } from '../../icons/userInfo/index'; import PastRides from './PastRides'; @@ -10,23 +10,30 @@ import { useRiders } from '../../context/RidersContext'; import { chevronLeft } from '../../icons/other'; import axios from '../../util/axios'; -const Header = () => { +const Header = ({ onBack }: { onBack: () => void }) => { return (
- - + Back Students - +
); }; const RiderDetail = () => { + const navigate = useNavigate(); const { id: riderId } = useParams<{ id: string }>(); const { riders } = useRiders(); const [rider, setRider] = useState( @@ -34,6 +41,11 @@ const RiderDetail = () => { ); const [rides, setRides] = useState([]); const netid = rider?.email.split('@')[0]; + + const handleBack = () => { + navigate('/admin/riders'); + }; + const compRides = (a: Ride, b: Ride) => { const x = new Date(a.startTime); const y = new Date(b.startTime); @@ -41,6 +53,7 @@ const RiderDetail = () => { if (x > y) return 1; return 0; }; + const formatDate = (date: string): string => moment(date).format('MM/DD/YYYY'); @@ -70,7 +83,7 @@ const RiderDetail = () => { return rider ? (
-
+
{ + const navigate = useNavigate(); const colSizes = [1, 0.75, 0.75, 1, 1.25, 1, 1, 1]; const headers = [ 'Name / NetId', @@ -33,6 +33,10 @@ const StudentsTable = ({ students }: StudentsTableProps) => { const formatDate = (date: string): string => moment(date).format('MM/DD/YYYY'); + const handleRowClick = (id: string) => { + navigate(`/admin/riders/${id}`); + }; + return ( @@ -71,33 +75,26 @@ const StudentsTable = ({ students }: StudentsTableProps) => { const shortAddress = address.split(',')[0]; const joinEndDate = `${formatDate(joinDate)} - ${formatDate(endDate)}`; const isActive = active ? 'Active' : 'Inactive'; - const location = { - pathname: `/riders/${r.id}`, - }; const data = [ nameNetId, phone, shortAddress, joinEndDate, - '0 Rides / 0 No Shows', // You can add real usage data here + '0 Rides / 0 No Shows', disability, isActive, 'Edit', ]; return ( - handleRowClick(id)} + style={{ cursor: 'pointer' }} > - + ); })}
diff --git a/frontend/src/pages/Admin/Routes.tsx b/frontend/src/pages/Admin/Routes.tsx index 993b9d6b..25d80677 100644 --- a/frontend/src/pages/Admin/Routes.tsx +++ b/frontend/src/pages/Admin/Routes.tsx @@ -35,10 +35,8 @@ const RoutesComponent = () => { } /> } /> } /> - }> - } /> - } /> - + } /> + } /> } /> } />