Skip to content

[ENG-111] Clicking on an inventory item should display all supply deliveries - #16533

Open
navaspavil wants to merge 29 commits into
developfrom
ENG-111-clicking-on-an-inventory-item-should-display-all-supply-deliveries
Open

[ENG-111] Clicking on an inventory item should display all supply deliveries#16533
navaspavil wants to merge 29 commits into
developfrom
ENG-111-clicking-on-an-inventory-item-should-display-all-supply-deliveries

Conversation

@navaspavil

@navaspavil navaspavil commented Jul 9, 2026

Copy link
Copy Markdown
Member

Proposed Changes

Allow users to view all deliveries for a product from inventory list page.

New Feature: Product Deliveries Drawer

  • Added a drawer to the inventory list (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

  • Improved button styling in ResourceDefinitionCategoryPicker.tsx for better appearance and usability, including conditional border radius and height adjustments.
image

ENG-111

Tagging: @ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate the bug or test the new feature.
  • Update product documentation.
  • Ensure that UI text is placed in I18n files.
  • Prepare a screenshot or demo video for the changelog entry and attach it to the issue.
  • Request peer reviews.
  • Complete QA on mobile devices.
  • Complete QA on desktop devices.
  • Add or update Playwright tests for related changes

Summary by CodeRabbit

  • New Features
    • Added an “All Deliveries” drawer in inventory with product filtering, pagination, and an empty state.
    • Enhanced delivery tables with optional origin/destination columns.
    • Added the “View product details” label and improved delivery-to-product interactions.
  • Bug Fixes
    • Refined picker and drawer controls (clear-button styling/spacing and button behavior).
    • Prevented unintended drawer opening when using the product details link.
  • Tests
    • Extended Playwright coverage for all deliveries drawer states, including pagination.

@navaspavil navaspavil self-assigned this Jul 9, 2026
Copilot AI review requested due to automatic review settings July 9, 2026 07:51
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Changes

The 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

Layer / File(s) Summary
Delivery data contracts and table rendering
src/types/inventory/..., src/pages/Facility/services/inventory/SupplyDeliveryTable.tsx
Request-order and supply-delivery types expose patient and order data; delivery tables support locations, serial offsets, and updated product selection.
Delivery query and result rendering
src/pages/Facility/services/inventory/InventoryList.tsx
Adds filtered paginated delivery queries with loading, populated, pagination, and empty-state rendering.
Inventory row and drawer wiring
src/pages/Facility/services/inventory/InventoryList.tsx, public/locale/en.json
Product knowledge buttons open the controlled deliveries drawer while the product-details link remains separate and localized.
All deliveries Playwright coverage
tests/facility/services/locations/inventory/allDeliveries.spec.ts
Authenticated tests cover populated results, empty results, and page-two requests using offset 10.

Category picker controls

Layer / File(s) Summary
Trigger and clear button styling
src/components/Common/ResourceDefinitionCategoryPicker.tsx
Mobile and desktop triggers conditionally remove right rounding, while clear buttons explicitly use button type and updated border, shadow, margin, and height classes.

Possibly related PRs

Suggested labels: needs review, needs testing

Suggested reviewers: copilot, bodhish, jacobjeevan

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: opening an inventory item's deliveries drawer.
Description check ✅ Passed The description covers the main changes, tagging, screenshot, and most checklist items, though the issue link format is not exact.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ENG-111-clicking-on-an-inventory-item-should-display-all-supply-deliveries

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

⚠️ Merge Checklist Incomplete

Thank you for your contribution! To help us review your PR efficiently, please complete the merge checklist in your PR description.

Your PR will be reviewed once you have marked the appropriate checklist items.

To update the checklist:

  • Change - [ ] to - [x] for completed items
  • Only check items that are relevant to your PR
  • Leave items unchecked if they don't apply

The checklist helps ensure code quality, testing coverage, and documentation are properly addressed.

1 similar comment
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

⚠️ Merge Checklist Incomplete

Thank you for your contribution! To help us review your PR efficiently, please complete the merge checklist in your PR description.

Your PR will be reviewed once you have marked the appropriate checklist items.

To update the checklist:

  • Change - [ ] to - [x] for completed items
  • Only check items that are relevant to your PR
  • Leave items unchecked if they don't apply

The checklist helps ensure code quality, testing coverage, and documentation are properly addressed.

@navaspavil
navaspavil force-pushed the ENG-111-clicking-on-an-inventory-item-should-display-all-supply-deliveries branch from e15ef0c to db46f8c Compare July 9, 2026 07:52
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploying care-preview with  Cloudflare Pages  Cloudflare Pages

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

View logs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 InventoryList and 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 ResourceDefinitionCategoryPicker button 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.

Comment thread src/pages/Facility/services/inventory/InventoryList.tsx Outdated
Comment thread src/pages/Facility/services/inventory/InventoryList.tsx
Comment thread src/pages/Facility/services/inventory/InventoryList.tsx
Comment thread src/pages/Facility/services/inventory/InventoryList.tsx Outdated
Copilot AI review requested due to automatic review settings July 9, 2026 07:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

Comment thread src/pages/Facility/services/inventory/InventoryList.tsx Outdated
Comment thread src/pages/Facility/services/inventory/InventoryList.tsx Outdated
Comment thread src/pages/Facility/services/inventory/InventoryList.tsx
Comment thread src/pages/Facility/services/inventory/InventoryList.tsx
Comment thread src/components/Common/ResourceDefinitionCategoryPicker.tsx
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🎭 Playwright Test Results

Status: ✅ Passed
Test Shards: 3

Metric Count
Total Tests 337
✅ Passed 336
❌ Failed 0
⏭️ Skipped 1

📊 Detailed results are available in the playwright-final-report artifact.

Run: #10435

Copilot AI review requested due to automatic review settings July 9, 2026 10:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

Comment thread src/pages/Facility/services/inventory/InventoryList.tsx
Comment thread src/pages/Facility/services/inventory/InventoryList.tsx
Comment thread src/pages/Facility/services/inventory/InventoryList.tsx
Comment thread src/components/Common/ResourceDefinitionCategoryPicker.tsx
Copilot AI review requested due to automatic review settings July 9, 2026 12:09
@navaspavil
navaspavil marked this pull request as ready for review July 9, 2026 12:12
@navaspavil
navaspavil requested review from a team July 9, 2026 12:12
Copilot AI review requested due to automatic review settings July 14, 2026 12:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Comment thread src/types/inventory/supplyDelivery/supplyDelivery.ts
Comment thread src/types/inventory/requestOrder/requestOrder.ts
Comment thread src/pages/Facility/services/inventory/InventoryList.tsx

@nihal467 nihal467 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot AI review requested due to automatic review settings July 17, 2026 10:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread src/pages/Facility/services/inventory/SupplyDeliveryTable.tsx
Copilot AI review requested due to automatic review settings July 17, 2026 10:36
@navaspavil
navaspavil force-pushed the ENG-111-clicking-on-an-inventory-item-should-display-all-supply-deliveries branch from 993e326 to 079cc54 Compare July 17, 2026 10:36

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Localize 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 win

Do not treat failed delivery requests as empty results.

When the query errors, deliveries is undefined and this branch renders the “no deliveries found” state. Handle isError with 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

📥 Commits

Reviewing files that changed from the base of the PR and between f762adc and 079cc54.

📒 Files selected for processing (2)
  • src/pages/Facility/services/inventory/InventoryList.tsx
  • src/pages/Facility/services/inventory/SupplyDeliveryTable.tsx

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread src/pages/Facility/services/inventory/InventoryList.tsx
Copilot AI review requested due to automatic review settings July 27, 2026 07:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review Tested Type Changes Contains changes in typescript types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants