Skip to content

Add stock transfer cancelled message in ResourceListItem > shipment#1080

Merged
gciotola merged 2 commits intomainfrom
i537-stock-transfer-cancelled
Apr 15, 2026
Merged

Add stock transfer cancelled message in ResourceListItem > shipment#1080
gciotola merged 2 commits intomainfrom
i537-stock-transfer-cancelled

Conversation

@gciotola
Copy link
Copy Markdown
Contributor

@gciotola gciotola commented Apr 14, 2026

What I did

We now show a "Stock transfer cancelled" message in the shipment list item when it has stock transfers and all of them are in status cancelled.

I've also added an exported helper isAllStockTransfersCancelled(shipment) to be used in the shipments app details page.

image

How to test

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests).
  • Make sure to add/update documentation regarding your changes.
  • You are NOT deprecating/removing a feature.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 14, 2026

Deploy Preview for commercelayer-app-elements ready!

Name Link
🔨 Latest commit ec64ba5
🔍 Latest deploy log https://app.netlify.com/projects/commercelayer-app-elements/deploys/69de51018acf3e0008a866e0
😎 Deploy Preview https://deploy-preview-1080--commercelayer-app-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gciotola gciotola self-assigned this Apr 14, 2026
@gciotola gciotola added the enhancement New feature or request label Apr 14, 2026
@gciotola gciotola marked this pull request as draft April 14, 2026 12:52
@gciotola gciotola force-pushed the i537-stock-transfer-cancelled branch from 1c77c5b to ae536ed Compare April 14, 2026 13:06
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 14, 2026

npm i https://pkg.pr.new/commercelayer/app-elements/@commercelayer/app-elements@1080

commit: ec64ba5

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a UI indicator for shipments whose associated stock transfers are all cancelled, and introduces a reusable helper for checking that condition.

Changes:

  • Introduced isAllStockTransfersCancelled(shipment) helper and exported it from the package entrypoint.
  • Updated shipment ResourceListItem transformer to display a “Stock transfer(s) cancelled” suffix when applicable.
  • Added EN/IT i18n strings and unit tests for the new helper, plus a new mock fixture.

Reviewed changes

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

Show a summary per file
File Description
packages/app-elements/src/ui/resources/ResourceListItem/transformers/shipments.tsx Adds conditional additionalSuffix message for cancelled stock transfers.
packages/app-elements/src/ui/resources/ResourceListItem/ResourceListItem.mocks.ts Adds a new shipment fixture with cancelled stock transfers; modifies an existing fixture.
packages/app-elements/src/main.ts Re-exports the new helper as part of the public API surface.
packages/app-elements/src/locales/it.ts Adds Italian translations + plural form for the new message.
packages/app-elements/src/locales/en.ts Adds English translations + plural form for the new message.
packages/app-elements/src/helpers/shipments.ts Adds isAllStockTransfersCancelled helper.
packages/app-elements/src/helpers/shipments.test.ts Adds unit tests covering helper behavior across key edge cases.
event.json Adds a new JSON file (appears unrelated to the PR’s stated purpose).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/app-elements/src/helpers/shipments.test.ts Outdated
@gciotola gciotola force-pushed the i537-stock-transfer-cancelled branch from 0cbce8d to eb53531 Compare April 14, 2026 14:27
@commercelayer commercelayer deleted a comment from Copilot AI Apr 14, 2026
@gciotola gciotola marked this pull request as ready for review April 14, 2026 14:28
malessani
malessani previously approved these changes Apr 14, 2026
@gciotola gciotola merged commit 6df75f0 into main Apr 15, 2026
7 checks passed
@gciotola gciotola deleted the i537-stock-transfer-cancelled branch April 15, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants