[ENG-111] Clicking on an inventory item should display all supply deliveries - #16533
[ENG-111] Clicking on an inventory item should display all supply deliveries#16533navaspavil wants to merge 29 commits into
Conversation
WalkthroughChangesThe PR adds a product-filtered, paginated “All Deliveries” drawer to inventory summaries, extends delivery data and table rendering, adds Playwright coverage, updates localization, and adjusts category-picker button behavior and styling. Inventory deliveries
Category picker controls
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
1 similar comment
|
…nventory item is clicked
e15ef0c to
db46f8c
Compare
Deploying care-preview with
|
| Latest commit: |
f3c02d0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://024fe5dc.care-preview-a7w.pages.dev |
| Branch Preview URL: | https://eng-111-clicking-on-an-inven.care-preview-a7w.pages.dev |
There was a problem hiding this comment.
Pull request overview
Adds a new “Product Deliveries” drawer to the facility inventory list so users can click an inventory item and view its related supply deliveries, and includes small UI refinements to the category picker’s clear-button styling.
Changes:
- Add a deliveries drawer to
InventoryListand open it by clicking a product name in the inventory table. - Fetch and render supply deliveries in the drawer using
SupplyDeliveryTable(with an empty state when none exist). - Refine
ResourceDefinitionCategoryPickerbutton border-radius/height behavior when the clear button is present.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/pages/Facility/services/inventory/InventoryList.tsx |
Adds clickable product rows that open a drawer and show supply deliveries for the selected product. |
src/components/Common/ResourceDefinitionCategoryPicker.tsx |
Adjusts button rounding and clear-button styling for improved visual alignment. |
🎭 Playwright Test ResultsStatus: ✅ Passed
📊 Detailed results are available in the playwright-final-report artifact. Run: #10435 |
…efinitionCategoryPicker
…finitionCategoryPicker for mobile
nihal467
left a comment
There was a problem hiding this comment.
993e326 to
079cc54
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/pages/Facility/services/inventory/SupplyDeliveryTable.tsx (1)
302-314: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winLocalize the missing-value placeholders.
The new
"-"fallbacks for origin and destination are user-visible literals. Use the existing i18next key for the repository’s missing-value placeholder instead.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/Facility/services/inventory/SupplyDeliveryTable.tsx` around lines 302 - 314, Replace the literal "-" fallbacks in the origin and destination cells of SupplyDeliveryTable with the existing i18next key used for the repository’s localized missing-value placeholder, preserving the current value precedence and showLocations condition.Source: Coding guidelines
src/pages/Facility/services/inventory/InventoryList.tsx (1)
74-121: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winDo not treat failed delivery requests as empty results.
When the query errors,
deliveriesis undefined and this branch renders the “no deliveries found” state. HandleisErrorwith the project’s standard error/retry UI, reserving the empty state for successful responses with zero results.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/Facility/services/inventory/InventoryList.tsx` around lines 74 - 121, The delivery query rendering in InventoryList must distinguish request failures from successful empty responses. Capture isError (and the project-standard retry mechanism if required) from useQuery, render the standard error/retry UI before the deliveries empty-state condition, and reserve EmptyState for successful responses with zero results.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/pages/Facility/services/inventory/InventoryList.tsx`:
- Around line 74-121: The delivery query rendering in InventoryList must
distinguish request failures from successful empty responses. Capture isError
(and the project-standard retry mechanism if required) from useQuery, render the
standard error/retry UI before the deliveries empty-state condition, and reserve
EmptyState for successful responses with zero results.
In `@src/pages/Facility/services/inventory/SupplyDeliveryTable.tsx`:
- Around line 302-314: Replace the literal "-" fallbacks in the origin and
destination cells of SupplyDeliveryTable with the existing i18next key used for
the repository’s localized missing-value placeholder, preserving the current
value precedence and showLocations condition.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 49e12de0-35d5-48d2-9471-574f98b055a6
📒 Files selected for processing (2)
src/pages/Facility/services/inventory/InventoryList.tsxsrc/pages/Facility/services/inventory/SupplyDeliveryTable.tsx


Proposed Changes
Allow users to view all deliveries for a product from inventory list page.
New Feature: Product Deliveries Drawer
InventoryList.tsx) that displays all deliveries for a selected product. Users can open this drawer by clicking on a product name in the inventory table.UI/UX Improvements
ResourceDefinitionCategoryPicker.tsxfor better appearance and usability, including conditional border radius and height adjustments.ENG-111
Tagging: @ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit