Commit Graph

6025 Commits

Author SHA1 Message Date
Adrien de Peretti
ee8d7221da Revert "add generated .medusa/types to local plugins (#13777)" (#14361)
This reverts commit 125694626e.
2025-12-19 11:10:38 +01:00
Adrien de Peretti
181d5fa671 feat(): Auto generated types generation upon build (#14337)
* feat(): Auto generated types generation upon build

* Create happy-steaks-cheer.md

* test(): default types true

* improvements

* improvements

* improvements

* improvements

* improvements
2025-12-19 10:13:17 +01:00
Leonardo Benini
125694626e add generated .medusa/types to local plugins (#13777)
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2025-12-19 07:01:15 +01:00
Adrien de Peretti
fb6a6b52fa fix(order): Prevent fetching all db adjustments when no items are pre… (#14351)
* fix(order): Prevent fetching all db adjustments when no items are present

* Create funny-suns-think.md
2025-12-18 15:21:32 +01:00
0xFl4g
0277062fec fix(translation): prevent duplicate locale error on server restart (#14345)
The translation module's defaults loader throws a warning on every server
restart after the first run because the upsert method uses `id` as the
unique key, but defaultLocales only contains `code` and `name`.

This causes the upsert to always attempt creation, which fails on the
unique `code` constraint with: "Locale with code: en-US, already exists."

Fix: Fetch existing locales first and map their IDs into defaultLocales
so upsert can properly identify existing records and update them.
2025-12-18 11:56:18 +01:00
Shahed Nasser
92d240d749 fix(medusa): fix type of product variant request param (#14342)
Fix type argument for requests which is necessary for generating OpenAPI specs

## Why

The `StoreVariantListRequest` type used in the `/store/product-variants` route doesn't match the convention of other routes since it doesn't accept a type parameter for the query (or body, but here that's not necessary). This makes it difficult for us to infer the query parameter type of the request.

This change would adapt the `StoreVariantListRequest` to match other conventions in our API routes so that we can generate correct OAS for docs
2025-12-17 16:20:54 +00:00
Shahed Nasser
c0ec54fc15 fix(core-flows): fix type of getTranslatedLineItemsStep (#14338)
Fix the return type of the `getTranslatedLineItemsStep`, otherwise our reference generator can't pick up the step's typing correctly
2025-12-17 15:56:38 +00:00
github-actions[bot]
cfa38871cb Version Packages (#13978)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-17 13:55:25 +01:00
Nicolas Gorga
9f8da1e2e0 fix(dashboard): Remove unused translation property (#14330)
* Remove unused translation key

* Add changeset
2025-12-17 13:53:53 +01:00
Nicolas Gorga
3d1330ebb9 feat: Translations UI (#14217)
* Add Translations route and guard it with feature flag. Empty TranslationsList main component to test route.

* Translation list component

* Add translations namespace to js-sdk

* Translations hook

* Avoid incorrectly throwing when updating and locale not included

* Translations bulk editor component v1

* Add batch method to translations namespace in js-sdk

* Protect translations edit route with feature flag

* Handle reference_id search param

* Replace entity_type entity_id for reference reference_id

* Manage translations from product detail page

* Dynamically resolve base hook for retrieving translations

* Fix navigation from outside settings/translations

* Navigation to bulk editor from product list

* Add Translations to various product module types

* Type useVariants hook

* Handle product module entities translations in bulk editor

* Fix categories issue in datagrid due to column clash

* Translations bulk navigation from remaining entities detail pages

* Add remaining bulk editor navigation for list components. Fix invalidation query for variants

* Expandable text cell v1

* Popover approach

* Add *supported_locales.locale to default fields in stores list endpoint

* Make popover more aligned to excell approach

* Correctly tie the focused cell anchor to popover

* Rework translations main component UI

* Fix link def export

* Swap axis for translations datagrid

* Add original column to translations data grid

* Remove is_default store locale from backend

* Remove ldefault locale from ui

* Type

* Add changeset

* Comments

* Remove unused import

* Add translations to admin product categories endpoint allowed fields

* Default locale removal

* Lazy loading with infinite scroll data grid

* Infinite list hook and implementation for products and variants

* Translation bulk editor lazy loaded datagrid

* Prevent scroll when forcing focus, to avoid scrollTop reset on infinite loading

* Confgiure placeholder data

* Cleanup logs and refactor

* Infinite query hooks for translatable entities

* Batch requests for translation batch endpoint

* Clean up

* Update icon

* Add query param validator in settings endpoint

* Settings endpoint param type

* JS sdk methods for translation settings and statistics

* Retrieve translatable fields and entities dynamically. Remove hardcoded information from tranlations list

* Resolve translation aggregate completion dynamically

* Format label

* Resolve bulk editor header label dynamically

* Include type and collection in translations config

* Avoid showing product option and option values in translatable entities list

* Translations

* Make translations bulk editor content columns wider

* Disable hiding Original column in translations bulk editor

* Adjust translations completion styles

* Fix translations config screen

* Locale selector switcher with conditional locale column rendering

* Batch one locale at a time

* Hooks save actions to footer buttons

* Reset dirty state on save

* Dynamic row heights for translations bulk editor. Replace expandable cell for text cell, with additional isMultiLine config

* Make columns take as much responsive width as possible and divide equally

* more padding to avoid unnecessary horizontal scrollbar

* Update statistics graphs

* Translations

* Statistics graphs translations

* Translation, text sizes and weight in stat graphs

* Conditionally show/hide column visibility dropdown in datagrid

* Allow to pass component to place in DataGrid header and use it in translations bulk editor

* Center text regardless of multiLine config

* Apply full height to datagrid cell regardles of multiSelect config

* Colors and fonts

* Handle key down for text area in text cell

* MultilineCell with special keydown handling

* Rework form schema to match new single locale edit flow

* Update created translations to include id, to avoid duplication issue on subsequent calls

* Handle space key for text cells

* Finish hooking up multiline cell with key and mouse events

* Disable remaining buttons when batch is ongoing

* Style updates

* Update style

* Refactor to make form updates and sync/comparison with server data more comprehensive and robust

* Update styles

* Bars and labels alignment

* Add languages tooltip

* Styles and translation

* Navigation update

* Disable edit translations button when no reference count

* Invert colors

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2025-12-17 13:36:50 +01:00
Adrien de Peretti
1743ed7f04 fix(): Cart translation sync (#14327) 2025-12-17 10:07:17 +00:00
Nicolas Gorga
b5edbb9940 fix(pricing,dashboard): update min_quantity/max_quantity to decimal in price model (#14045) 2025-12-16 13:38:53 -03:00
Shahed Nasser
bee86bf1d5 chore: add missing since tag for js sdk (#14325) 2025-12-16 18:26:52 +02:00
Shahed Nasser
b8c2b9607b chore: added since tag to new routes (#14322) 2025-12-16 16:04:31 +02:00
Adrien de Peretti
8c29d85f0f feat(): remove status from translatable fields (#14321)
* feat(): remove status from translatable fields

* Create tender-mugs-shave.md

* feat(): remove status from translatable fields
2025-12-16 14:57:06 +01:00
Adrien de Peretti
6815b3d7db chore(): Apply translation feature flag broaderly (#14319)
* chore(): Apply translation feature flag broaderly

* chore(): Apply translation feature flag broaderly

* Create rich-oranges-report.md
2025-12-16 12:45:37 +01:00
Shahed Nasser
88a3cf7172 chore: TSDocs for Translation Module (#14280)
* tsdocs for translation module

* fixes
2025-12-16 13:30:26 +02:00
林昌融
7b0556dd85 feat(admin): add translation for zhTW (#14124)
* chore: Add zhTW translation file

* feat(admin): add translation for zhTW

* chore(dashboard): up to date translation

---------

Co-authored-by: floatflower <floatflower1029@gmail.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2025-12-16 12:19:29 +01:00
Adrien de Peretti
f5ec359c4c fix: Readonly link feature flag conditional (#14316)
* chore(): Improve readonly link disability

* chore(): Improve readonly link disability

* Create soft-rockets-chew.md

* fix
2025-12-16 11:25:56 +01:00
Adrien de Peretti
191e647eec chore(): js-sdk set locale in server environment (#14313)
**What**
Prevent guess work in server environment and warn user when they try to set the locale on the sdk
2025-12-16 10:25:03 +00:00
Shahed Nasser
accb778039 feat(js-sdk,types,medusa): add list locales store method to JS SDK (#14314)
* feat(js-sdk,types,medusa): add list locales store method to JS SDK

* add missing locale parameter
2025-12-16 11:11:49 +01:00
Adrien de Peretti
d813fc4ff9 chore(): Migration generator fix generated import (#14315)
* chore(): Migration generator fix generated import

* Create two-olives-try.md

* feedback
2025-12-16 11:11:02 +01:00
Adrien de Peretti
c8a7122ba9 chore(): Update locale header usage (#14318)
* chore(): Update locale header usage

* Create three-kiwis-shave.md

* chore(): Update locale header usage
2025-12-16 10:39:40 +01:00
Adrien de Peretti
e94e1a4676 feat(): Add more translatable core entity (#14311)
* feat(): Add product type and collection translation support

* Create sharp-poets-give.md

* feat(): Add product type and collection translation support

* feat(): Add product type and collection translation support

* options

* options

* shipping options/type

* return reason

* fix

* leave out shipping and return reason

* leave out shipping and return reason

* leave out shipping and return reason
2025-12-15 17:13:32 +01:00
Adrien de Peretti
ba6ed8d9dd feat(): Translation statistics (#14299)
* chore(): Translation statistics

* chore(): improve statistics performances

* add end point to get statistics

* add tests

* Create spicy-games-unite.md

* feat(): add material and fix tests

* feat(): add translatable api

* feat(): add translatable api

* fix tests

* fix tests

* fix tests

* feedback
2025-12-15 14:11:49 +01:00
Adrien de Peretti
0f1566c644 feat(): Add support for store locales end point (#14307)
**What**
Add support for `store/locales` which return the configured supported locales
2025-12-15 13:10:43 +00:00
Adrien de Peretti
665b80adb1 feat(): Add support for locale to the js sdk (#14306)
* feat(): Add support for locale to the js sdk

* Create great-icons-thank.md
2025-12-15 13:36:39 +01:00
Adrien de Peretti
7b4dda5a17 chore(): apply locale middleware to all store routes (#14305)
* chore(): apply locale middleware to all store routes

* Create pink-papayas-brush.md
2025-12-15 13:36:01 +01:00
Nicolas Gorga
8964a03fa1 chore(): Remove default_locale from StoreLocale (#14300)
## Summary

**What** — What changes are introduced in this PR?

Remove `default_locale` from Store <> Locale relation

**Why** — Why are these changes relevant or necessary?  

*Please provide answer here*

**How** — How have these changes been implemented?

*Please provide answer here*

**Testing** — How have these changes been tested, or how can the reviewer test the feature?

*Please provide answer here*

---

## Examples

Provide examples or code snippets that demonstrate how this feature works, or how it can be used in practice.  
This helps with documentation and ensures maintainers can quickly understand and verify the change.

```ts
// Example usage
```

---

## Checklist

Please ensure the following before requesting a review:

- [ ] I have added a **changeset** for this PR
    - Every non-breaking change should be marked as a **patch**
    - To add a changeset, run `yarn changeset` and follow the prompts
- [ ] The changes are covered by relevant **tests**
- [ ] I have verified the code works as intended locally
- [ ] I have linked the related issue(s) if applicable

---

## Additional Context

Add any additional context, related issues, or references that might help the reviewer understand this PR.


Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-12-15 09:05:46 +00:00
Nicolas Gorga
dd3eb10b1a fix(link-modules): export store locale link definition (#14293)
## Summary

**What** — What changes are introduced in this PR?

Export missing store locale link definition.

**Why** — Why are these changes relevant or necessary?  

*Please provide answer here*

**How** — How have these changes been implemented?

*Please provide answer here*

**Testing** — How have these changes been tested, or how can the reviewer test the feature?

*Please provide answer here*

---

## Examples

Provide examples or code snippets that demonstrate how this feature works, or how it can be used in practice.  
This helps with documentation and ensures maintainers can quickly understand and verify the change.

```ts
// Example usage
```

---

## Checklist

Please ensure the following before requesting a review:

- [ ] I have added a **changeset** for this PR
    - Every non-breaking change should be marked as a **patch**
    - To add a changeset, run `yarn changeset` and follow the prompts
- [ ] The changes are covered by relevant **tests**
- [ ] I have verified the code works as intended locally
- [ ] I have linked the related issue(s) if applicable

---

## Additional Context

Add any additional context, related issues, or references that might help the reviewer understand this PR.
2025-12-14 11:15:44 +00:00
Carlos R. L. Rodrigues
9366c6d468 feat: order export and upload stream (#14243)
* feat: order export

* Merge branch 'develop' of https://github.com/medusajs/medusa into feat/order-export

* normalize status

* rm util

* serialize totals

* test

* lock

* comments

* configurable order list
2025-12-14 12:02:53 +01:00
Carlos R. L. Rodrigues
e199f1eb01 fix(index): detect enum field (#14298)
## Summary

**What** — What changes are introduced in this PR?

Fixes Enum fields detection on Index module
2025-12-13 20:35:07 +00:00
Frane Polić
a43eb11d65 chore: sync Figma resources (#14297)
* chore: sync icons

* chore: changesets

* fix: linear component
2025-12-12 17:27:02 +01:00
Carlos R. L. Rodrigues
b3cb904e9b chore(utils): currency epsilon (#14225)
* chore(utils): currency epsilon

* pending diff

* getEpsilonFromDecimalPrecision
2025-12-12 10:46:07 +01:00
Shahed Nasser
8bb2ac654c fix(types): add locale to the query parameters of product query types (#14282) 2025-12-12 11:11:44 +02:00
Shahed Nasser
31a057558c fix(types,translations): fix types for translation and locale updates (#14278)
* fix(types,translations): fix types for translation and locale updates

* remove array type
2025-12-12 10:11:01 +01:00
Shahed Nasser
a4ca4ef170 fix(translation): add index file for models (#14272) 2025-12-12 10:10:16 +01:00
olivermrbl
f2b1ba2f1f chore: Add repo config to draft order plugin 2025-12-11 18:52:41 +01:00
Adrien de Peretti
f13c23a4b7 feat(): Sync order translations (#14267)
* feat(): Sync order translations

* feat(): Sync order translations

* tests

* Create tender-melons-develop.md

* fix tests

* cleanup

* cleanup
2025-12-11 15:40:11 +01:00
Nicolas Gorga
70929ecac3 fix(dashboard,medusa,types): improve performance for price list prices retrieval (#14138)
## Summary

**What** — What changes are introduced in this PR?

Price lists prices didn't have a dedicated method to query them and instead, relied on being returned as part of price lists. This, however, introduces optimization issues that for price lists with many prices, could cause crashes. The reason being that relations are not paginated and thus, all prices linked to the price list would be returned.

This PR aims to solve this by introducing a dedicated endpoint and avoiding returning the `prices` as part of price lists by default. The idea being that it is up to the user to explicitly express this, which, for small price lists no issues will arise, but for bigger ones, they will easily recognize the performance impact.

**Why** — Why are these changes relevant or necessary?  

Users with large enough price lists would have serious performance issues or even crashes when querying the `/admin/price-lists` endpoints. This is also true when navigating to the price list section of the Admin UI since it queries this same endpoints.

**How** — How have these changes been implemented?

- Removed the `prices` relation to be part of the default fields returned by the `/admin/price-lists/` endpoints. User may still request it by passing it in `fields` query param.
- Added new `/admin/price-lists/[id]/prices` GET endpoint to be able to retrieve a price list prices with pagination.

**Testing** — How have these changes been tested, or how can the reviewer test the feature?

Integration tests.

---

## Examples

Provide examples or code snippets that demonstrate how this feature works, or how it can be used in practice.  
This helps with documentation and ensures maintainers can quickly understand and verify the change.

```ts
// Example usage
```

---

## Checklist

Please ensure the following before requesting a review:

- [x] I have added a **changeset** for this PR
    - Every non-breaking change should be marked as a **patch**
    - To add a changeset, run `yarn changeset` and follow the prompts
- [x] The changes are covered by relevant **tests**
- [x] I have verified the code works as intended locally
- [x] I have linked the related issue(s) if applicable

---

## Additional Context

The current state of the PR fixes the issue on the price list list and detail component. It still doesn't solve the issue for the following screens: Edit Prices & Add Prices

All the prices are still retrieved from the `/admin/price-lists/` endpoint for these. I want first some feedback before changing it to the new endpoint, since the current DataGrid implementation doesn't support pagination and it seems we are passing a default limit for the products to show there, an arbitrarily large number 9999 and there is also a TODO comment of changing that.

This previous point, though, could be implemented in a later PR, so we can already fix the issue in the price list list and detail pages, so at least for large price lists these screens don't explode and smaller price lists can still have its product prices edited, while only large ones will explode when trying to perform this action. @adrien2p @fPolic thoughts?

closes ENTSUP-265, CORE-1239
2025-12-11 13:13:08 +00:00
olivermrbl
237b472e73 chore: Version packages 2025-12-11 14:10:54 +01:00
Adrien de Peretti
9852a7c74d fix(): Improve store currency readonly link (#14276)
* fix(): Improve store currency readonly link

* fix(): Improve store currency readonly link

* fix(): Improve store currency readonly link

* Create wicked-rabbits-sparkle.md
2025-12-11 10:47:44 +01:00
Nicolas Gorga
d565a92f63 fix(core-flows): refresh payment collection inside updateCartPromotionsWorkflow (patch) (#14274)
* Refresh payment collection after cart promotion update

* Add missing test

* Add changeset

* Update changeset

* Add force_refresh_payment_collection to updateCartPromotionsWorkflow to conditionally refresh payment collection

* Prevent refreshing payment collection multiple times

* Fix test

* Formatting and unused vars

* Force refresh payment collection on dedicated store cart promotion endpoints

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-12-11 10:29:52 +01:00
Shahed Nasser
a78f68fa46 fix(utils,core-flows): add events constant for translations and use it in workflows (#14277) 2025-12-11 11:22:08 +02:00
Adrien de Peretti
d7398736e8 fix(): Improve store supported locale -> locale readonly link (#14269)
* fix(): store supported locales read only link

* fix(): store supported locales read only link

* Create two-books-reply.md

* remove unnecessary links

* remove unnecessary links

* remove unnecessary links

* fix(): store supported locales read only link

* fix(): store supported locales read only link

* improve link
2025-12-11 10:00:12 +01:00
Adrien de Peretti
fd3965974d feat(): Pluralized props for list readonly link (#14190)
* feat(): Pluralized props for list readonly link

* Create perfect-jeans-end.md

* handle backward compat

* Add tests case
2025-12-10 19:38:06 +01:00
Oli Juhl
bca145bdbe chore: Add locks to order edit flows (#14270) 2025-12-10 17:55:03 +01:00
Nicolas Gorga
8bd1d22765 chore(order): Remove unique index on item_id:version for order_item (#14268)
* Remove unique index

* Add changeset

* Remove previous migration file

* Remove down method
2025-12-10 13:51:08 +01:00
Adrien de Peretti
dd74ce34ba chore(): Add translations/locale integration tests and fix locale endpoint (#14266)
* chore(): Add translations/locale integration tests and fix locale end point

* Create selfish-dots-shop.md
2025-12-10 13:45:35 +01:00
Adrien de Peretti
e4877616c3 feat(): sync cart translation synced (#14226)
ref: https://github.com/medusajs/medusa/pull/14189

  **Summary**

  This PR extends the translation module to support automatic translation syncing for cart line items based on the cart's locale.

  Key changes:
  - Added locale field to the Cart model to store the cart's locale preference
  - Created new workflow steps:
    - getTranslatedLineItemsStep - Translates line items when adding to cart or creating a cart
    - updateCartItemsTranslationsStep - Re-translates all cart items when the cart's locale changes
  - Integrated translation logic into cart workflows:
    - createCartWorkflow - Applies translations to initial line items
    - addToCartWorkflow - Applies translations when adding new items
    - updateCartWorkflow - Re-translates all items when locale_code is updated
    - refreshCartItemsWorkflow - Maintains translations during cart refresh
  - Added applyTranslationsToItems utility to map variant/product/type/collection translations to line item fields (title, subtitle, description, etc.)
2025-12-10 08:37:30 +00:00