Highlights
[Experimental] Customizable columns in Medusa Admin tables
In previous versions, tables that list Orders, Products, etc., had hard-coded columns that couldn’t be modified. However, columns have different relevance between businesses. The only way to get tables to show additional columns was to introduce admin extensions that duplicated the original table’s behavior. This was tedious and clunky.
In this release, we are rolling out experimental support for View Configurations, which allow you to change which columns are displayed in the Orders and Products tables. Click the columns dropdown to see the available columns and add the ones you want. The available columns are computed using Medusa’s module graph, meaning any custom data models linked to Orders or Products can also be included in your table config.
With the View Configurations feature, we also enable saved views so you can have the right view at hand for your workflow. Saved views hold both your column configurations and any filters you have applied.
To try View Configurations turn on the feature flag in your medusa-config.ts
module.exports = defineConfig({
...
featureFlags: {
view_configurations: true
}
})
Shipping options context hook
This release introduces a hook to customize the context used to list shipping options, allowing you to leverage custom rules for shipping options more easily.
The hook can be used like so:
import { listShippingOptionsForCartWithPricingWorkflow } from "@medusajs/medusa/core-flows"
import { StepResponse } from "@medusajs/workflows-sdk"
listShippingOptionsForCartWithPricingWorkflow.hooks.setShippingOptionsContext(
async ({ cart }, { container }) => {
if (cart.customer_id) {
return new StepResponse({
customer_id: cart.customer_id,
})
}
const query = container.resolve("query")
const { data: carts } = await query.graph({
entity: "cart",
filters: {
id: cart.id,
},
fields: ["customer_id"],
})
return new StepResponse({
customer_id: carts[0].customer_id,
})
}
)
In the example above, we add customer_id
to the context along with the fixed properties is_return
and enabled_in_store
. This means that if a shipping option rule includes a customer_id
attribute, the shipping option will be included in the result set.
The hook has been introduced in the following workflows:
listShippingOptionsForCartWithPricingWorkflow
listShippingOptionsForCartWorkflow
Please make sure to register the hook in both, since they are used for shipping option validation across workflows.
Features
- feat(medusa): allow filtering by id for collections by @willbouch in #13495
- feat(dashboard): reusable config datatable by @srindom in #13389
- feat(core-flows): hook to set shipping opt context when listing by @willbouch in #13468
- Feat(): promo prefilter top level rules in db by @adrien2p in #13524
- feat(dashboard): configurable product views by @srindom in #13408
Bugs
- fix(): pipeline missing suites by @adrien2p in #13457
- fix(types): cart item totals optional by @willbouch in #13509
- fix(types): pluralize words ending in s like status by @willbouch in #13461
- fix(medusa): Use the correct boolean validator by @adrien2p in #13510
- fix(core-flows, medusa): don't allow negative line item quantity by @fPolic in #13508
- fix(utils,core-flows): subtotal calculation and returns location by @carlos-r-l-rodrigues in #13497
Documentation
- chore(docs): Generated References (automated) by @github-actions[bot] in #13492
- docs: add manage promotions in cart storefront guide by @shahednasser in #13483
- chore: update API reference for 2.10.2 by @shahednasser in #13499
- docs: general improvements and updates by @shahednasser in #13485
- docs: regenerate core-flows reference to pick up locking steps by @shahednasser in #13502
- docs: documentation updates for v2.10.2 by @shahednasser in #13500
- docs: fix issues in product builder tutorial by @shahednasser in #13505
- docs: add clarification for set cart's customer API route by @shahednasser in #13506
- docs: add section on retrieve totals for cart items and shipping methods in storefront by @shahednasser in #13513
- docs: general improvements and fixes by @shahednasser in #13515
- docs: small update to invoice generator introduction by @shahednasser in #13519
- docs: add Next.js starter guides to llms-full.txt by @shahednasser in #13523
- docs: fixes to JS SDK + auth provider guides by @shahednasser in #13526
- docs: general improvements by @shahednasser in #13530
- docs: improve third-party auth in storefront guide by @shahednasser in #13534
Chores
- chore(docs): Updated UI Reference (automated) by @github-actions[bot] in #13491
- chore(docs): Update version in documentation (automated) by @github-actions[bot] in #13490
- chore(js-sdk): add ignore tag to views by @shahednasser in #13503
- chore: update TSDocs of JS SDK store methods to clarify required auth by @shahednasser in #13507
- chore(core-flows): use directory convention for locking steps by @shahednasser in #13501
- chore: add a link to the storefront docs for cart item totals type by @shahednasser in #13514
- test(): test dynamic max workers and improve CI by @adrien2p in #13516
- chore(): Shard unit tests jobs by @adrien2p in #13525
- fix(core-flows): Lock cart on shipping + taxes update by @olivermrbl in #13535
- chore: add tsdocs for latest changes by @shahednasser in #13539
- fix(): Prevent promotion filtering to exceed psql limits by @adrien2p in #13540
Other Changes
- fix(js-sdk): skip null values in query qs.stringify by @leobenzol in #13460
- feat(dashboard): update display of tracking/label URLs on order details by @docloulou in #11613
- fix(dashboard): added missing currencies by @tehaulp in #13214
- test(): Try to reproduce automatic promotion adjustments being applied twice by @adrien2p in #13533
Full Changelog: v2.10.2...v2.10.3