Skip to content

Commit 807e534

Browse files
committed
added bid time and regular time to form, and admin panel as well as date to admin panel
1 parent 79e40b5 commit 807e534

8 files changed

Lines changed: 138 additions & 17 deletions

File tree

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/dist/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<link rel="icon" type="image/svg+xml" href="/Money.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Spiff Tracker</title>
8-
<script type="module" crossorigin src="/assets/index-UwzAdyJa.js"></script>
9-
<link rel="stylesheet" crossorigin href="/assets/index-lS8XbySw.css">
8+
<script type="module" crossorigin src="/assets/index-C0L9rs-o.js"></script>
9+
<link rel="stylesheet" crossorigin href="/assets/index-5SN2AoX2.css">
1010
</head>
1111
<body>
1212
<div id="root"></div>

client/src/components/AdminPanel.jsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ const AdminPanel = () => {
152152
<table className="w-full text-sm">
153153
<thead>
154154
<tr className="border-b hover:bg-muted/50 data-[state=selected]:bg-muted">
155+
<th className="h-14 px-4 text-left font-medium text-muted-foreground">
156+
Date of Sale
157+
</th>
155158
<th className="h-14 px-4 text-left font-medium text-muted-foreground">
156159
Employee Name
157160
</th>
@@ -167,6 +170,12 @@ const AdminPanel = () => {
167170
<th className="h-14 px-4 text-left font-medium text-muted-foreground">
168171
Commission
169172
</th>
173+
<th className="h-14 px-4 text-left font-medium text-muted-foreground">
174+
Regular Hours
175+
</th>
176+
<th className="h-14 px-4 text-left font-medium text-muted-foreground">
177+
Bid Hours
178+
</th>
170179
</tr>
171180
</thead>
172181

client/src/components/Record.jsx

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export default function Record() {
5151
saleDescription: "",
5252
saleAmount: "",
5353
expectedCommission: "",
54+
regularHours: "",
55+
bidTime: ""
5456
});
5557
const [isNew, setIsNew] = useState(true);
5658
const params = useParams();
@@ -124,7 +126,9 @@ export default function Record() {
124126
workOrder: "",
125127
saleDescription: "",
126128
saleAmount: "",
127-
expectedCommission: ""
129+
expectedCommission: "",
130+
regularHours: "",
131+
bidTime: ""
128132
});
129133
if (loggedIn) {
130134
navigate("/admin");
@@ -156,7 +160,7 @@ export default function Record() {
156160
}
157161
<form
158162
onSubmit={onSubmit}
159-
className="flex flex-col p-6 border rounded-lg overflow-hidden w-full sm:w-3/4 md:w-1/2 lg:w-1/4 items-center justify-center bg-white bg-opacity-25 backdrop-blur-lg drop-shadow-lg "
163+
className="flex flex-col p-8 border rounded-lg overflow-hidden w-full sm:w-3/4 md:w-1/2 lg:w-1/4 items-center justify-center bg-white bg-opacity-25 backdrop-blur-lg drop-shadow-lg "
160164
>
161165
<div className="flex w-full grid-cols-1 gap-x-8 gap-y-10 pb-2 justify-center items-center ">
162166
<div className="flex-col w-full grid-cols-1 gap-x-4 gap-y-6 ">
@@ -395,6 +399,66 @@ export default function Record() {
395399
</div>
396400
</div>
397401
</motion.div>
402+
{/* REGULAR HOURS*/}
403+
<motion.div variants={item}>
404+
<div className="sm:col-span-4">
405+
<label
406+
htmlFor="regularHours"
407+
className="block text-sm font-medium leading-6 text-slate-900"
408+
>
409+
Regular Hours
410+
</label>
411+
<div className="mt-2">
412+
<div className="flex rounded-md shadow-sm ring-1 ring-inset ring-slate-300 focus-within:ring-2 focus-within:ring-inset focus-within:ring-indigo-400 sm:max-w-md">
413+
<input
414+
type="text"
415+
name="regularHours"
416+
id="regularHours"
417+
required
418+
className="block w-full rounded-md border-0 py-1.5 pl-1 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"
419+
placeholder="Regular Hours"
420+
value={form.regularHours}
421+
onChange={(e) => {
422+
const value = e.target.value;
423+
if (!isNaN(value)) {
424+
updateForm({ regularHours: value });
425+
}
426+
}}
427+
/>
428+
</div>
429+
</div>
430+
</div>
431+
</motion.div>
432+
{/* BID TIME */}
433+
<motion.div variants={item}>
434+
<div className="sm:col-span-4">
435+
<label
436+
htmlFor="bidTime"
437+
className="block text-sm font-medium leading-6 text-slate-900"
438+
>
439+
Bid Time
440+
</label>
441+
<div className="mt-2">
442+
<div className="flex rounded-md shadow-sm ring-1 ring-inset ring-slate-300 focus-within:ring-2 focus-within:ring-inset focus-within:ring-indigo-400 sm:max-w-md">
443+
<input
444+
type="text"
445+
name="bidTime"
446+
id="bidTime"
447+
required
448+
className="block w-full rounded-md border-0 py-1.5 pl-1 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"
449+
placeholder="Bid Time"
450+
value={form.bidTime}
451+
onChange={(e) => {
452+
const value = e.target.value;
453+
if (!isNaN(value)) {
454+
updateForm({ bidTime: value });
455+
}
456+
}}
457+
/>
458+
</div>
459+
</div>
460+
</div>
461+
</motion.div>
398462
</div>
399463
</div>
400464
{/* SUBMIT BUTTON */}

client/src/components/RecordList.jsx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,21 @@ const Record = ({ record, updateRecord, deleteRecord }) => {
7575
className="border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"
7676
>
7777

78+
<motion.td
79+
variants={item}
80+
className="px-4 py-4 align-middle text-sm font-medium text-muted-foreground">
81+
{isEditing ? (
82+
<input
83+
className="bg-background border border-muted/50 rounded-md px-2 h-9"
84+
type="text"
85+
name="jobCompleted"
86+
value={editedRecord.jobCompleted}
87+
onChange={handleInputChange}
88+
/>
89+
) : (
90+
record.jobCompleted
91+
)}
92+
</motion.td>
7893
<motion.td
7994
variants={item}
8095
className="px-4 py-4 align-middle text-sm font-medium text-muted-foreground">
@@ -152,6 +167,36 @@ const Record = ({ record, updateRecord, deleteRecord }) => {
152167
</motion.td>
153168
<motion.td
154169
variants={item}
170+
className="px-4 py-4 align-middle text-sm font-medium text-muted-foreground">
171+
{isEditing ? (
172+
<input
173+
className="bg-background border border-muted/50 rounded-md px-3 h-9"
174+
type="text"
175+
name="regularHours"
176+
value={editedRecord.regularHours}
177+
onChange={handleInputChange}
178+
/>
179+
) : (
180+
record.regularHours
181+
)}
182+
</motion.td>
183+
<motion.td
184+
variants={item}
185+
className="px-4 py-4 align-middle text-sm font-medium text-muted-foreground">
186+
{isEditing ? (
187+
<input
188+
className="bg-background border border-muted/50 rounded-md px-3 h-9"
189+
type="text"
190+
name="bidTime"
191+
value={editedRecord.bidTime}
192+
onChange={handleInputChange}
193+
/>
194+
) : (
195+
record.bidTime
196+
)}
197+
</motion.td>
198+
<motion.td
199+
variants={item}
155200
className="px-4 py-4 align-middle text-sm font-medium text-muted-foreground">
156201
<div className="flex space-x-2">
157202
{isEditing ? (

server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import express from "express";
22
import cors from "cors";
33
import records from "./server/routes/sales.js";
44
import users from "./server/routes/users.js";
5-
import path from "path";
65

76
const PORT = process.env.PORT || "";
87
const app = express();

server/routes/sales.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ router.post("/", async (req, res) => {
2828
saleDescription: req.body.saleDescription,
2929
saleAmount: req.body.saleAmount,
3030
expectedCommission: req.body.expectedCommission,
31+
regularHours: req.body.regularHours,
32+
bidTime: req.body.bidTime
3133
};
3234

3335
let existingCompany = await db.collection("users").findOne({ companyId: req.body.companyId });
@@ -66,6 +68,8 @@ router.patch("/:id", authenticateToken, async (req, res) => {
6668
saleDescription: req.body.saleDescription,
6769
saleAmount: req.body.saleAmount,
6870
expectedCommission: req.body.expectedCommission,
71+
regularHours: req.body.regularHours,
72+
bidTime: req.body.bidTime
6973
},
7074
};
7175

0 commit comments

Comments
 (0)