-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #951 from IkkiOcean/admin-dashboard
Implement Return Panel for Managing Return and Refund Requests
- Loading branch information
Showing
9 changed files
with
394 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { useState } from "react"; | ||
import ReturnHeader from "./components/ReturnHeader"; | ||
import ReturnFilter from "./components/ReturnFilter"; | ||
import ReturnProductCard from "./components/ReturnProductCard"; | ||
import ReturnModal from "./components/ReturnModal"; | ||
import ReturnHistory from "./components/ReturnHistory"; | ||
import ReturnHeader from "./components/ReturnAdminHeader"; | ||
import ReturnFilter from "./components/ReturnAdminFilter"; | ||
import ReturnProductCard from "./components/ReturnAdminProductCard"; | ||
import ReturnModal from "./components/ReturnAdminModal"; | ||
import ReturnHistory from "./components/ReturnAdminHistory"; | ||
|
||
export default function ReturnPage() { | ||
const [products, setProducts] = useState(dummyProducts); | ||
|
@@ -34,16 +34,18 @@ export default function ReturnPage() { | |
setComment(""); | ||
setHistory([ | ||
...history, | ||
{ ...selectedProduct, returnDate: new Date().toLocaleString(), comment } | ||
{ ...selectedProduct, returnDate: new Date().toLocaleString(), comment }, | ||
]); | ||
}; | ||
|
||
const handleSort = (option) => { | ||
setSortOption(option); | ||
const sortedProducts = [...products].sort((a, b) => { | ||
if (option === "Name") return a.name.localeCompare(b.name); | ||
if (option === "Start Date") return new Date(a.startDate) - new Date(b.startDate); | ||
if (option === "End Date") return new Date(a.endDate) - new Date(b.endDate); | ||
if (option === "Start Date") | ||
return new Date(a.startDate) - new Date(b.startDate); | ||
if (option === "End Date") | ||
return new Date(a.endDate) - new Date(b.endDate); | ||
return 0; | ||
}); | ||
setProducts(sortedProducts); | ||
|
@@ -104,60 +106,43 @@ export default function ReturnPage() { | |
); | ||
} | ||
|
||
|
||
const dummyProducts = [ | ||
{ | ||
id: 1, | ||
name: "Tractor", | ||
model: "John Deere 5075E", | ||
startDate: "2023-05-01", | ||
endDate: "2023-05-31", | ||
status: "Eligible", | ||
image: "https://www.tafetribe.com/pub/media/catalog/product/cache/343ef2803f1a27d8d77b5e62acabb37c/m/f/mf-dynatrak_toy_tractor.jpg", | ||
user: { name: "John Doe", email: "[email protected]", phone: "+1234567890" }, | ||
orderId: "ORD-001", | ||
product: { name: "Organic Fertilizer", quantity: 2, price: 29.99 }, | ||
reason: "Received wrong product", | ||
submissionDate: "2023-06-01", | ||
status: "pending", | ||
comments: [], | ||
}, | ||
{ | ||
id: 2, | ||
name: "Harvester", | ||
model: "Case IH 250", | ||
startDate: "2023-04-15", | ||
endDate: "2023-05-15", | ||
status: "Pending", | ||
image: "https://s3.toolsvilla.com/products-minipetrolharvester/1708773710976/1708773724856-watmrkA.webp", | ||
user: { | ||
name: "Jane Smith", | ||
email: "[email protected]", | ||
phone: "+1987654321", | ||
}, | ||
orderId: "ORD-002", | ||
product: { name: "Heirloom Tomato Seeds", quantity: 1, price: 14.99 }, | ||
reason: "Product damaged during shipping", | ||
submissionDate: "2023-05-28", | ||
status: "approved", | ||
comments: ["Approved for return. Please send return label to customer."], | ||
}, | ||
{ | ||
id: 3, | ||
name: "Seeder", | ||
model: "Kinze 3600", | ||
startDate: "2023-05-10", | ||
endDate: "2023-06-10", | ||
status: "Eligible", | ||
image: "https://pre-live-admin.balwaan.com/uploads/media/2023/1_(4)1.jpg", | ||
}, | ||
{ | ||
id: 4, | ||
name: "Sprayer", | ||
model: "John Deere R4045", | ||
startDate: "2023-03-01", | ||
endDate: "2023-04-01", | ||
status: "Returned", | ||
image: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSPWYzHIpFSFN_mUgVWV_Ubc1Id1AaUifhlwg&s", | ||
}, | ||
{ | ||
id: 5, | ||
name: "Plow", | ||
model: "Kuhn Multi-Leader", | ||
startDate: "2023-05-05", | ||
endDate: "2023-06-05", | ||
status: "Eligible", | ||
image: "https://www.shutterstock.com/image-photo/hand-plow-on-field-plowing-600nw-1075430750.jpg", | ||
}, | ||
{ | ||
id: 6, | ||
name: "Cultivator", | ||
model: "Case IH Tiger-Mate 255", | ||
startDate: "2023-04-20", | ||
endDate: "2023-05-20", | ||
status: "Eligible", | ||
image: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBw8PDw0NDw0NDw0PDw0PDg0ODQ8ODg8OFxEWFhUVFRMYHigsGholHhUWITEjJSorLi4uGSAzOT8sNygtMCsBCgoKDg0OGhAQGi0lICYtLS0rKy8tLy0wKystLS0tKystLS0tLS0tKy0tLS0tLy0tLS0tLS0tLS8tLS0tLS0tLf/AABEIAOEA4QMBEQACEQEDEQH/xAAcAAEBAQADAQEBAAAAAAAAAAAAAQIFBgcEAwj/xAA/EAACAgIABAMGAwYEBAcBAAABAgADBBEFEiExBhNBByJRYXGBIzKRFEJigqGxUnKi0RUkM7JDY3ODweHwF//EABoBAQADAQEBAAAAAAAAAAAAAAABAgMEBQb/xAAyEQEAAgIBAgMGBQQCAwAAAAAAAQIDEQQSITFBUQUTYXGRsSIyQoHRI6Hh8FLBFCQz/9oADAMBAAIRAxEAPwD2CEEBAQEBAQEBAQECwGoDUBqA1AQJAQEBAQEBAQEBAQEBAQEBAQEBAQLqBdQk1AuoDUBqA1AagNQJqA1AmoQkBAQEBAQEBAQEBAQEBAQLAuoSsBqBdQLqA1AagNQGoDUCagTUBAmoE1CEgICAgICAgICAgICBQIFAhK6gXUDWoDUC6gNQLqAgTUBqA1AmoE1AzqBNQIRAkIICAgICAgICAgUCBoCErqBQIGtQEC6gWAgICAgIE1AQJqBkiBNQJAyRAkIICAgICAgIFAgaEJUQNAQLA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CQggICAgICAgICAgIFgXcJWBdwG4F3AbgXcBuBNwG4E3AbgSBCYEhCQEBAQEBAQEBAQEBAQEBAu4Su4DcCwG4DcBuA3AbgTcBuBNwJCCAgICAgICAgICAgICAgICAgIDcC7hJuA3AbgNwG4E3CCAgICAgICAgICAgICAgICAgICAgICAgDAQEAICAgICAgICAgICAgICB/9k=", | ||
user: { | ||
name: "Bob Johnson", | ||
email: "[email protected]", | ||
phone: "+1122334455", | ||
}, | ||
orderId: "ORD-003", | ||
product: { name: "Drip Irrigation Kit", quantity: 1, price: 89.99 }, | ||
reason: "Changed mind", | ||
submissionDate: "2023-05-25", | ||
status: "rejected", | ||
comments: ["Return window has expired."], | ||
}, | ||
]; |
22 changes: 22 additions & 0 deletions
22
frontend/src/AgroShopAI/components/Pages/components/ReturnAdminFilter.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from "react"; | ||
|
||
export default function ReturnFilter({ filter, setFilter }) { | ||
return ( | ||
<div className="flex items-center"> | ||
<label htmlFor="filter" className="mr-4 text-green-700"> | ||
Filter by Status: | ||
</label> | ||
<select | ||
id="filter" | ||
value={filter} | ||
onChange={(e) => setFilter(e.target.value)} | ||
className="p-2 border rounded" | ||
> | ||
<option value="All">All</option> | ||
<option value="Eligible">Eligible</option> | ||
<option value="Pending">Pending</option> | ||
<option value="Returned">Returned</option> | ||
</select> | ||
</div> | ||
); | ||
} |
9 changes: 9 additions & 0 deletions
9
frontend/src/AgroShopAI/components/Pages/components/ReturnAdminHeader.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from "react"; | ||
|
||
export default function ReturnHeader() { | ||
return ( | ||
<header className="bg-green-700 text-white p-4"> | ||
<h1 className="text-3xl font-bold">Return Rented Equipment</h1> | ||
</header> | ||
); | ||
} |
26 changes: 26 additions & 0 deletions
26
frontend/src/AgroShopAI/components/Pages/components/ReturnAdminHistory.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from "react"; | ||
|
||
export default function ReturnHistory({ history }) { | ||
return ( | ||
<div className="mt-8"> | ||
<h3 className="text-2xl font-semibold text-green-800 mb-4"> | ||
Return History | ||
</h3> | ||
<ul> | ||
{history.map((item, index) => ( | ||
<li | ||
key={index} | ||
className="mb-4 p-4 border rounded bg-white shadow-md" | ||
> | ||
<p className="font-semibold">{item.name}</p> | ||
<p className="text-sm text-gray-600"> | ||
Returned on: {item.returnDate} | ||
</p> | ||
<p className="text-sm text-gray-600">Condition: {item.condition}</p> | ||
<p className="text-sm text-gray-600">Comment: {item.comment}</p> | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
); | ||
} |
81 changes: 81 additions & 0 deletions
81
frontend/src/AgroShopAI/components/Pages/components/ReturnAdminModal.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import React from "react"; | ||
|
||
export default function ReturnModal({ | ||
isModalOpen, | ||
setIsModalOpen, | ||
selectedProduct, | ||
handleSubmitReturn, | ||
returnDate, | ||
setReturnDate, | ||
condition, | ||
setCondition, | ||
comment, | ||
setComment, | ||
}) { | ||
if (!isModalOpen || !selectedProduct) return null; | ||
|
||
return ( | ||
<div className="fixed inset-0 flex items-center justify-center bg-gray-700 bg-opacity-50"> | ||
<div className="bg-white p-6 rounded shadow-lg max-w-md w-full"> | ||
<h2 className="text-xl font-semibold mb-4"> | ||
Return {selectedProduct.name} | ||
</h2> | ||
<form onSubmit={handleSubmitReturn}> | ||
<div className="mb-4"> | ||
<label htmlFor="returnDate" className="block text-sm text-gray-700"> | ||
Return Date: | ||
</label> | ||
<input | ||
type="date" | ||
id="returnDate" | ||
value={returnDate} | ||
onChange={(e) => setReturnDate(e.target.value)} | ||
className="w-full p-2 border rounded" | ||
/> | ||
</div> | ||
<div className="mb-4"> | ||
<label htmlFor="condition" className="block text-sm text-gray-700"> | ||
Condition: | ||
</label> | ||
<select | ||
id="condition" | ||
value={condition} | ||
onChange={(e) => setCondition(e.target.value)} | ||
className="w-full p-2 border rounded" | ||
> | ||
<option value="Good">Good</option> | ||
<option value="Damaged">Damaged</option> | ||
<option value="Broken">Broken</option> | ||
</select> | ||
</div> | ||
<div className="mb-4"> | ||
<label htmlFor="comment" className="block text-sm text-gray-700"> | ||
Comment: | ||
</label> | ||
<textarea | ||
id="comment" | ||
value={comment} | ||
onChange={(e) => setComment(e.target.value)} | ||
className="w-full p-2 border rounded" | ||
/> | ||
</div> | ||
<div className="flex justify-between"> | ||
<button | ||
type="button" | ||
onClick={() => setIsModalOpen(false)} | ||
className="px-4 py-2 bg-gray-500 text-white rounded" | ||
> | ||
Cancel | ||
</button> | ||
<button | ||
type="submit" | ||
className="px-4 py-2 bg-green-600 text-white rounded" | ||
> | ||
Submit Return | ||
</button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
); | ||
} |
20 changes: 20 additions & 0 deletions
20
frontend/src/AgroShopAI/components/Pages/components/ReturnAdminProductCard.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from "react"; | ||
|
||
export default function ReturnProductCard({ product, handleReturn }) { | ||
return ( | ||
<div className="border p-4 rounded shadow-lg bg-white"> | ||
<img src={product.image} alt={product.name} className="w-full h-32 object-cover mb-4" /> | ||
<h3 className="text-xl font-semibold">{product.name}</h3> | ||
<p className="text-sm text-gray-600">{product.model}</p> | ||
<div className="mt-4 flex justify-between"> | ||
<span className="text-sm text-gray-500">Status: {product.status}</span> | ||
<button | ||
onClick={() => handleReturn(product)} | ||
className="px-4 py-2 bg-green-600 text-white rounded" | ||
> | ||
Return | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.