Skip to content

Enhance ResourceList and ResourceTable to use provisioning-api - #1223

Merged
malessani merged 2 commits into
mainfrom
feat/enhance-resource-table-with-provisioning
Sep 3, 2026
Merged

Enhance ResourceList and ResourceTable to use provisioning-api#1223
malessani merged 2 commits into
mainfrom
feat/enhance-resource-table-with-provisioning

Conversation

@malessani

Copy link
Copy Markdown
Contributor

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:

  • Introduced a new apiFlavour.ts module that defines the ApiFlavour type, 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.
  • Updated the main resource list fetcher (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.
  • Updated imports and usage in metricsApiClient.ts to use the new AnyListableResourceType abstraction, removing now-unnecessary imports.

UI Component and API Changes:

  • Modified resource list and table components (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:

  • Improved the CodeBlock and Overlay components 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

  • 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

netlify Bot commented Sep 3, 2026

Copy link
Copy Markdown

Deploy Preview for commercelayer-app-elements ready!

Name Link
🔨 Latest commit c026a61
🔍 Latest deploy log https://app.netlify.com/projects/commercelayer-app-elements/deploys/6a99307eaf11650008d9c9f2
😎 Deploy Preview https://deploy-preview-1223--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.

@malessani malessani self-assigned this Sep 3, 2026
@malessani malessani added the enhancement New feature or request label Sep 3, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 3, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/commercelayer/app-elements/@commercelayer/app-elements@1223

commit: c026a61

@malessani
malessani disabled auto-merge September 3, 2026 13:32
@malessani
malessani merged commit 04c1d2f into main Sep 3, 2026
11 checks passed
@malessani
malessani deleted the feat/enhance-resource-table-with-provisioning branch September 3, 2026 13:33
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.

Add support to ResourceList and ResourceTable to provisioning-api

3 participants