Enhance ResourceList and ResourceTable to use provisioning-api - #1223
Merged
Conversation
✅ Deploy Preview for commercelayer-app-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
commit: |
gciotola
approved these changes
Sep 3, 2026
pfferrari
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1222
What I did
This pull request introduces support for the Commerce Layer Provisioning API in the resource list components, enabling lists and tables to fetch and display data from both the Core and Provisioning APIs with type safety and minimal duplication. It achieves this by abstracting API-specific types and logic, updating fetchers to handle the new API, and making the UI components more flexible. Additionally, it includes minor UI and test improvements.
Provisioning API Support and Type Abstraction:
apiFlavour.tsmodule that defines theApiFlavourtype, per-API resource types, query types, and utility types to map resource and query types for both the Core and Provisioning SDKs, ensuring type safety across both APIs.listFetcher.ts) to support both Core and Provisioning SDK clients, using the new type abstractions and a runtime accessor to fetch resources generically. This includes changes to function signatures, merging of queries, and handling of SDK-specific response shapes.metricsApiClient.tsto use the newAnyListableResourceTypeabstraction, removing now-unnecessary imports.UI Component and API Changes:
useResourceFilters.tsx) to accept and merge filters and queries in a more type-safe way, supporting the new API flavour system and ensuring that filters are merged at the correct scope.UI and Test Improvements:
CodeBlockandOverlaycomponents to better handle background color contrast, including a new test to ensure overlays announce their surface type for correct theming.These changes collectively enable resource lists to seamlessly support both APIs, improve type safety, and enhance the UI's adaptability.
How to test
Checklist