From 9a9886db5387a0f9087f8e30f8c3813917a0c028 Mon Sep 17 00:00:00 2001 From: Chris Lindelof Date: Tue, 27 Aug 2024 13:13:13 -0400 Subject: [PATCH] seperate fuel purchase modal into class of it own. begin stubbing out api --- back-end/app/dependencies.py | 0 back-end/app/main.py | 3 + back-end/app/routers/__init__.py | 0 back-end/app/routers/vehicleInformation.py | 9 ++ .../FleetManager-Components/FuelPurchases.js | 148 ++++++++++-------- 5 files changed, 98 insertions(+), 62 deletions(-) create mode 100644 back-end/app/dependencies.py create mode 100644 back-end/app/routers/__init__.py create mode 100644 back-end/app/routers/vehicleInformation.py diff --git a/back-end/app/dependencies.py b/back-end/app/dependencies.py new file mode 100644 index 0000000..e69de29 diff --git a/back-end/app/main.py b/back-end/app/main.py index 2f90c82..d567a3c 100644 --- a/back-end/app/main.py +++ b/back-end/app/main.py @@ -1,7 +1,10 @@ from fastapi import FastAPI +from routers import vehicleInformation app = FastAPI() +app.include_router(vehicleInformation.router) + @app.get("/") async def root(): return {"message": "Hello World!"} \ No newline at end of file diff --git a/back-end/app/routers/__init__.py b/back-end/app/routers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/back-end/app/routers/vehicleInformation.py b/back-end/app/routers/vehicleInformation.py new file mode 100644 index 0000000..4f4aa8e --- /dev/null +++ b/back-end/app/routers/vehicleInformation.py @@ -0,0 +1,9 @@ +from fastapi import APIRouter + +router = APIRouter( + prefix="/vehicle" +) + +@router.get('/{vehicleId}/vin') +async def get_vehicle_vin(vehicleId: str): + return "" \ No newline at end of file diff --git a/front-end/src/components/FleetManager-Components/FuelPurchases.js b/front-end/src/components/FleetManager-Components/FuelPurchases.js index 6257b9e..ad39ea5 100644 --- a/front-end/src/components/FleetManager-Components/FuelPurchases.js +++ b/front-end/src/components/FleetManager-Components/FuelPurchases.js @@ -9,7 +9,7 @@ export default class FuelPurchases extends Component { this.state = { expanded: false, - showModal: true + showModal: true, } } @@ -43,68 +43,92 @@ export default class FuelPurchases extends Component { { (this.state.showModal) - ? ( - <> -
-
- {/*content*/} -
- {/*header*/} -
-

- Add Fuel Purchase -

- -
- {/*body*/} -
-
- -
Date
-
-
- - Fuel Purchased -
-
- - Total Cost -
-
- {/*footer*/} -
- - -
-
-
-
-
- - ) : null + ? : null } ) } -} \ No newline at end of file +} + +class FuelPurchaseModal extends Component { + + constructor(props) { + super(props) + + this.state = { + date: '', + amount: 0.000, + cost: 0.00 + } + } + + handleChange = (event) => { + this.setState({ + [event.target.id]: event.target.value + }) + } + + render() { + + return ( + <> +
+
+ {/*content*/} +
+ {/*header*/} +
+

+ Add Fuel Purchase +

+ +
+ {/*body*/} +
+
+ +
Date
+
+
+ + Fuel Purchased +
+
+ + Total Cost +
+
+ {/*footer*/} +
+ + +
+
+
+
+
+ + ) + } +} \ No newline at end of file