Closed diegoTech14 closed 4 weeks ago
The changes introduce a new ProductSearchBar
component to the product catalog, enabling users to search for products. This component is integrated with form management and validation libraries, allowing for input validation and dynamic updates of the product list based on user queries. Additionally, a new API procedure for searching products is added, and the UI package is updated to include the new search bar component. Various components are modified to support these features, including adjustments for input handling and state management.
File Path | Change Summary |
---|---|
apps/web/src/app/_components/features/ProductCatalog.tsx |
Added ProductSearchBar component for product searching functionality. |
apps/web/src/app/_components/features/searchProduct.tsx |
Introduced ProductSearchBar with form management and validation, handling search queries and results. |
apps/web/src/server/api/routers/product.ts |
Added searchProductCatalog procedure for querying products based on a name input. |
packages/ui/package.json |
Updated to include new export for searchBar component while retaining existing exports. |
packages/ui/src/form/inputField.tsx |
Modified InputField to include an onChange prop for external change detection. |
packages/ui/src/searchBar.tsx |
Created ProductSearchBar with validation schema and input handling for product searches. |
sequenceDiagram
participant User
participant ProductSearchBar
participant ProductCatalog
participant API
User->>ProductSearchBar: Enter search query
ProductSearchBar->>API: Fetch products based on query
API-->>ProductSearchBar: Return filtered products
ProductSearchBar->>ProductCatalog: Update displayed products
🐇 In the catalog where products gleam,
A search bar now fulfills the dream.
With every query, results appear,
A joyful hop, the finds are near!
So type away, let your wishes flow,
For treasures await, just give it a go! ✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@diegoTech14 please consider using comments only when necessary. The code should be self-explanatory so let's use comments when the code is complex.
Also make sure to use enlish only.
@diegoTech14 please consider using comments only when necessary. The code should be self-explanatory so let's use comments when the code is complex.
Also make sure to use enlish only.
Got it sir, I'm on it
@diegoTech14 I see several migration files, please consider just pushing the necessary files.
Description
This PR implements the product search bar UI, fetching product data from Mocked data and displaying them in the product list
productRouter
I have added a new method to view products by name.Checklist
Type of Change
Testing
Manual Testing
Automated Tests
Additional Notes
Summary by CodeRabbit
New Features
ProductSearchBar
component for enhanced product searching within theProductCatalog
.Bug Fixes
Documentation
searchBar
component.Chores