feat: add browse shelves page to inventory track section#443
feat: add browse shelves page to inventory track section#443udayjain26 wants to merge 3 commits intocrbnos:mainfrom
Conversation
Add a new "Shelves" page under the Track section that allows users to browse items by shelf. Features include: - Browse all shelves with item counts and total quantities - Search shelves by name or by items they contain - Click on a shelf to see all items stored on it - Click on an item to navigate to its inventory details - Added link from item inventory details back to the shelf Builds crbnos#391
Replace blue underlined text links with external link icons that appear on row hover for consistency with rest of the app. Builds crbnos#391
|
@udayjain26 is attempting to deploy a commit to the Carbon Team on Vercel. A member of the Team first needs to authorize it. |
|
@crudmachine @barbinbrad Happy Tuesday, guys. I've laid out the basic page for browsing shelves and looking at items within a shelf and navigating between items and shelves. A couple things tho:
lmk how to proceed, thanks |
|
@udayjain26 Great work! For 2. Yes, Location column could be removed. |
| const allShelvesQuery = client | ||
| .from("shelf") | ||
| .select("id, name, locationId, active, createdAt, updatedAt") | ||
| .eq("companyId", companyId) | ||
| .eq("locationId", locationId) | ||
| .eq("active", true) | ||
| .order("name", { ascending: true }); | ||
|
|
||
| const allShelves = await allShelvesQuery; |
There was a problem hiding this comment.
We should be applying the generic queries and search here so that we get paginated results for shelves.
| locationId: string; | ||
| }; | ||
|
|
||
| const BrowseShelvesTable = memo( |
There was a problem hiding this comment.
Can you rename these folder/files/component/types/routes to ShelvesTable.tsx, instead of BrowseShelvesTables.tsx -- the convention in the repo is just to use [Noun][Component] instead of [Verb][Noun][Component]
apps/erp/app/utils/path.ts
Outdated
| batchPropertyOrder: (itemId: string) => | ||
| generatePath(`${x}/inventory/batch-property/${itemId}/property/order`), | ||
| billing: `${x}/settings/billing`, | ||
| browseShelf: (id: string) => |
There was a problem hiding this comment.
same here, this should just be shelf:
|
hey @barbinbrad there is a slight conflict with naming:
Can I go with ShelfInventory type naming to avoid this? |
- Apply DB-level pagination using setGenericQueryFilters - Rename BrowseShelves to ShelfInventory (avoids conflict with existing Shelves folder) - Rename routes from browse-shelves to shelf-inventories - Remove redundant Location column from table - Update search placeholder to "Search shelf or item..." - Restore item name search while maintaining DB-level pagination
|
@crudmachine @barbinbrad I have refactored the code based on feedback, thank you |
|
@barbinbrad, any feedback for me on this? |
Summary
Test plan
Mandatory Tasks (DO NOT REMOVE)
Screen.Recording.2026-01-20.at.13.09.07.mov
Builds #391