-
Notifications
You must be signed in to change notification settings - Fork 2
Add helper to identify async captures and remove them from timeline #937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for commercelayer-app-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a helper function to identify asynchronous capture transactions and updates the order timeline logic to omit timeline events for async captures until the async job completes.
- Added a new function (orderTransactionIsAnAsyncCapture) in the transactions helper.
- Updated the order timeline reducer to skip async capture events.
- Updated locale files (Italian and English) to include messages for pending async captures.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/app-elements/src/ui/resources/ResourceOrderTimeline.tsx | Added check to skip timeline events for async captures. |
packages/app-elements/src/main.ts | Re-exported the async capture helper for external use. |
packages/app-elements/src/locales/it.ts | Added new Italian locale string for pending async capture. |
packages/app-elements/src/locales/en.ts | Added new English locale string for pending async capture. |
packages/app-elements/src/helpers/transactions.ts | Introduced the helper function to determine async capture transactions. |
packages/app-elements/src/helpers/transactions.test.ts | Provided unit tests for the new async capture helper function. |
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a helper function to identify asynchronous capture transactions and updates the timeline so that async captures are removed and handled later. Key changes include:
- Importing and using the helper function in the timeline reducer to skip async capture events.
- Exporting the new helper from the main entry point.
- Updating locale files with new translation strings for async capture statuses.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/app-elements/src/ui/resources/ResourceOrderTimeline.tsx | Uses the helper function to filter out async capture events from the timeline. |
packages/app-elements/src/main.ts | Exports the new async capture helper for global usage. |
packages/app-elements/src/locales/it.ts and en.ts | Adds new translations for pending async capture status. |
packages/app-elements/src/helpers/transactions.ts | Implements the helper to determine async capture transactions. |
packages/app-elements/src/helpers/transactions.test.ts | Provides tests ensuring the helper correctly identifies async captures. |
What I did
Add an helper to identify async captures.
I've also removed the order timeline event in case the capture is async.
It will be shown as succeeded or failed once the async job is completed.
How to test
Checklist