Commit Graph

4796 Commits

Author SHA1 Message Date
Kasper Fabricius Kristensen
a5c8cc992c fix(dashboard): Prevent language ptBR from breaking dashboard (#10422) 2024-12-04 10:44:04 +01:00
Kasper Fabricius Kristensen
e8f4f7ea2b fix(dashboard): Add default value to inventory item combobox (#10412)
**What**
- Resolves CMRC-761
- Fixes TS errors in the same file.

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-12-03 18:03:54 +00:00
Kasper Fabricius Kristensen
18583ed567 fix(dashboard): Fix broken number input in adjust inventory form (#10416) 2024-12-03 18:36:20 +01:00
Kasper Fabricius Kristensen
4e7d242a78 fix(stock-location): Fix export of StockLocation module (#10406) 2024-12-03 18:35:52 +01:00
Frane Polić
ab948b7c65 feat(core-flows,medusa,order,types): update orders (#10373)
**What**
- add order update endpoint
- add workflows and steps for updating orders
- add `registerChanges` method to Order module + workflow step

---

CLOSES CMRC-633
2024-12-03 17:15:26 +00:00
Lucien Blunk-Lallet
56ae076fd2 Fix French translation typos (#10348)
Hello,

This is just a small PR to fix a few typos with the French translation, especially with the template strings.

Best regards.
2024-12-03 11:35:37 +00:00
Marco Sannino
56e9acbed8 feat: added Italian translations (#10362) 2024-12-02 19:34:27 +01:00
Karl Hofmann
12884966e3 German language corrections (#10394) 2024-12-02 17:57:30 +01:00
Harminder Virk
3e98364bd1 feature: add support for check constraints in DML (#10391) 2024-12-02 17:59:50 +05:30
Adrien de Peretti
ac79585232 feat(user): Migrate user module to DML (#10389)
* feat(user): Migrate user module to DML

* Create rotten-tigers-worry.md

* update indexes names following conventions

* remove duplicate modifier
2024-12-02 12:36:40 +01:00
Adrien de Peretti
4ef353a7b9 feat(auth): Migrate auth module to DML (#10387)
* feat(auth): Migrate auth module to DML

* Create lazy-eagles-bow.md
2024-12-02 11:58:04 +01:00
Harminder Virk
913cf15e2b refactor: migrate pricing entities to DML models (#10335)
Fixes: FRMW-2810

## Breaking changes
There is only one breaking change

- The `min_quantity` and `max_quantity` properties are now consistently typed as numbers. Earlier, it was [typed as numbers](https://github.com/medusajs/medusa/blob/develop/integration-tests/http/__tests__/price-list/admin/price-list.spec.ts#L68-L69) in some API responses and as [string in others](https://github.com/medusajs/medusa/blob/develop/integration-tests/http/__tests__/price-list/admin/price-list.spec.ts#L186-L187). I did not go to the bottom of this inconsistency, but the tests reveals them.

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-12-02 09:44:41 +00:00
Adrien de Peretti
a1f36caaf7 chore(utils): Ensure DML name convention follow the same as the class name for simplicity (#10370)
**What**
DML class name and mikro orm entity name are different, it was ok and the idea was to accept that and do the transformation when needed. But since class name are usually upper case first we decided to re integrate that convention in the DML class name as well to simplify consumption of the dml name without having to worry about the normal case
2024-12-02 04:57:23 +00:00
Riqwan Thamir
11bd556133 feat(core-flows,framework,medusa): list shipping options pass in cart as pricing context (#10374)
* feat(core-flows,framework,medusa): list shipping options pass in cart as pricing context

* chore: add test for shipping options returning free shipping
2024-12-01 20:59:26 +01:00
Oli Juhl
eacd691951 fix: Ensure tax lines are generated for all items and shipping methods in cart (#10372)
* fix: Generate tax lines for all items in cart

* fix: Correct test
2024-12-01 14:50:38 +01:00
Kasper Fabricius Kristensen
94f6265dfc fix(ui,icons,ui-preset): Fix CodeBlock and Command components (#10369) 2024-11-29 17:30:25 +01:00
Riqwan Thamir
5719e825ca feat(core-flows,types,medusa): ability to update/create custom shipping prices (#10368) 2024-11-29 15:04:33 +01:00
Adrien de Peretti
ed11834d6e Fix(dml): DML default/nullable management (#10363)
RESOLVES FRMW-2813

**What**
Extract what we have done in the order module DML migration.
This includes all the changes we discussed around default value and nullable management

From now on, when the default is being set through the DML on a property, no default initializer will be created, this means that when a mikro orm class is being instantiated, no default will be applied at instantiation time. This fixes the issue when retrieving data and not selecting fields that have a default. The default initializer was taking the relay making you think the data was present except that it was the value of the default initializer. From now on, the default value is applied as follows
- db column default
- before flush
- on persist
The same applies for nullable properties/columns

Co-authored-by: Harminder Virk <1706381+thetutlage@users.noreply.github.com>
2024-11-29 11:46:26 +00:00
Harminder Virk
194361b95a fix: do not rely on model loading order to find an implicit owner (#10360) 2024-11-29 16:02:34 +05:30
Riqwan Thamir
324b4ab438 feat(pricing, types): add price rule operators to price calculations (#10350)
what:

- adds price rule operators when doing price calculations
- rules now accepts a key where the value can be an array of objects `({ operator: string, value: number })`
  - validation for available types of operator and value to be a number
```
await service.createPriceSets({
  prices: [
    {
      amount: 50,
      currency_code: "usd",
      rules: {
        region_id: "de",
        cart_total: [
          { operator: "gte", value: 400 },
          { operator: "lte", value: 500 },
        ]
      },
    },
  ]
})
```
- price calculations will now account for the operators - lte, gte, lt, gt when the price context is a number

RESOLVES CMRC-747
2024-11-28 20:48:00 +00:00
Frane Polić
805fe4b1db fix(order): archive order status update (#10340)
**What**
- array was passed as an id when updating order status upon archive

---

RESOLVES SUP-305
CLOSES https://github.com/medusajs/medusa/issues/10328
2024-11-28 16:51:02 +00:00
Harminder Virk
d57c739052 fix: do not initialize FKs to null (#10337) 2024-11-28 17:15:08 +05:30
Stevche Radevski
f7279f1b96 fix: Use the correct defaults for the invite token expiry (#10344) 2024-11-28 12:06:32 +01:00
Riqwan Thamir
3b1a63eca7 feat(pricing,utils,types): add operator field to price rule (#10315)
what:

- adds an operator field to price rule with specific operator fields

RESOLVES CMRC-746
2024-11-28 09:23:26 +00:00
Shahed Nasser
2838100efc fix(product): change export name of ProductImage (#10326)
Change export of `Image` to `ProductImage` to match the data model's name.
2024-11-27 17:35:06 +00:00
Shahed Nasser
ef046844cc fix(medusa): remove request body type argument from cancel order transfer routes (#10327)
Remove the request body type passed as a type argument for admin and store routes for order transfer cancelation. Since the type is empty, it leads to a generated empty request body schema in the API reference.
2024-11-27 17:07:20 +00:00
olivermrbl
e9c1b1127e chore: Version packages 2024-11-27 15:40:07 +01:00
Carlos R. L. Rodrigues
e9003c3124 fix(utils): read dir recursive (#10318)
What:
 - Using `Object.defineProperty) to avoid issues on Node versions that set this property as readonly.
2024-11-27 14:37:07 +00:00
anthid
e04c9cfb04 fix(dashboard): Correct Spain provinces in country-states.ts (#10264)
Issues Addressed:

- Missing provinces (e.g., Ceuta, Melilla).
- Incorrect inclusion of states as provinces (e.g., Andalucía).
- Inclusion of a province from another country (e.g., Nouvelle-Calédonie).

Solution:

This update provides an accurate list of Spain's provinces based on the ISO 3166-2 standard.   Reference: [ISO 3166-2:ES - Provincias](https://es.wikipedia.org/wiki/ISO_3166-2:ES#Provincias).
2024-11-27 13:31:47 +00:00
Kasper Fabricius Kristensen
0be25a7b69 chore(dashboard): Add missing keys to i18n translation files (#10260)
**What**
- Updates existing translation files with missing keys. Done using AI, so quality is debatable. Will depend on community to provide better translations if needed.
2024-11-27 13:24:59 +00:00
Kasper Fabricius Kristensen
2edc2fe19b fix(dashboard): Prevent product metadata form from throwing error (#10312)
Resolves CMRC-755
2024-11-27 13:20:12 +00:00
Vincent Cottalorda
1b55f477a6 French translation V2 (#10301)
This PR improves the French translations already submitted.
- Corrected missing translations.
- Ensured the JSON structure matches the English version.
- Verified consistency across all keys.

The file is very large and it's hard to make sure everything is right.

The previous Similar PR is [Add french trad in i18n translations #9885](https://github.com/medusajs/medusa/pull/9885)

Let me know if additional changes are needed! Happy to help :)

Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
2024-11-27 12:47:28 +00:00
Frane Polić
2ed63b1534 fix(dashboard): adjust transfer SVG for theme (#10307)
**What**
- make order transfer SVG header work on light and dark theme
2024-11-27 12:07:07 +00:00
Kasper Fabricius Kristensen
030ee87150 fix(dashboard): Align casing of fields in reset password event (#10313)
* fix(dashboard): Align casing of fields in reset password event

* update changeset
2024-11-27 13:06:04 +01:00
Carlos R. L. Rodrigues
a8eec16122 fix(core-flows): aggregate payment status (#10278) 2024-11-26 12:23:53 -03:00
Harminder Virk
9f204817b0 feat: convert MikroORM entities to DML entities (#10043)
* feat: convert MikroORM entities to DML entities

* feat: wip on repository changes

* continue repositories and types rework

* fix order repository usage

* continue to update product category repository

* Add foreign key as part of the inferred DML type

* ../../core/types/src/dml/index.ts

* ../../core/types/src/dml/index.ts

* fix: relationships mapping

* handle nullable foreign keys types

* handle nullable foreign keys types

* handle nullable foreign keys types

* continue to update product category repository

* fix all product category repositories issues

* fix product category service types

* fix product module service types

* fix product module service types

* fix repository template type

* refactor: use a singleton DMLToMikroORM factory instance

Since the MikroORM MetadataStorage is global, we will also have to turn DML
to MikroORM entities conversion use a global bucket as well

* refactor: update product module to use DML in tests

* wip: tests

* WIP product linkable fixes

* continue type fixing and start test fixing

* test: fix more tests

* fix repository

* fix pivot table computaion + fix mikro orm repository

* fix many to many management and configuration

* fix many to many management and configuration

* fix many to many management and configuration

* update product tag relation configuration

* Introduce experimental dml hooks to fix some issues with categories

* more fixes

* fix product tests

* add missing id prefixes

* fix product category handle management

* test: fix more failing tests

* test: make it all green

* test: fix breaking tests

* fix: build issues

* fix: build issues

* fix: more breaking tests

* refactor: fix issues after merge

* refactor: fix issues after merge

* refactor: surpress types error

* test: fix DML failing tests

* improve many to many inference + tests

* Wip fix columns from product entity

* remove product model before create hook and manage handle validation and transformation at the service level

* test: fix breaking unit tests

* fix: product module service to not update handle on product update

* fix define link and joiner config

* test: fix joiner config test

* test: fix joiner config test

* fix joiner config primary keys

* Fix joiner config builder

* Fix joiner config builder

* test: remove only modifier from test

* refactor: remove hooks usage from product collection

* refactor: remove hooks usage from product-option

* refactor: remove hooks usage for computing category handle

* refactor: remove hooks usage from productCategory model

* refactor: remove hooks from DML

* refactor: remove cruft

* cleanup

* re add foerign key indexes

* chore: remove unused types

* refactor: cleanup

* migration and models configuration adjustments

* cleanup

* fix random ordering

* fix

* test: fix product-category tests

* test: update breaking DML tests

* test: array assertion to not care about ordering

* fix: temporarily apply id ordering for products

* fix ordering

* fix ordering remove logs

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-11-26 20:01:02 +05:30
Kasper Fabricius Kristensen
da536aba24 fix(dashboard): Truncate long product organization tags (#10261)
Resolves CMRC-736
2024-11-26 12:00:25 +00:00
Frane Polić
1bf60c7a7d feat(dashboard, js-sdk): customer page transfer order + cancel request in timeline (#10250)
**What**
- request order transfer from admin customers details page
- cancel transfer request from order timeline

---

CLOSES CMRC-730
2024-11-26 11:42:47 +00:00
Kasper Fabricius Kristensen
344a6c9ea0 fix(dashboard): Add Metadata form to variant page (#10285)
Adds Metadata form to the Product Variant details page.
2024-11-26 11:40:07 +00:00
Oli Juhl
cb2b06fab9 fix: Inventory module schema (#10262)
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-11-26 09:02:37 +01:00
github-actions[bot]
7865909891 chore(docs): Updated API Reference (automated) (#10258)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2024-11-25 14:33:22 +00:00
Kasper Fabricius Kristensen
3ab056e572 feat(dashboard): Allow setting a tooltip for disabled action items (#10234)
**What**
- Allow passing a `disabledTooltip` for actions in a `ActionMenu`. Useful for providing context for the user why a option is disabled. E.g. `{ disabled: sales_channel.is_default, disabledTooltip: "Deleting the default Sales Channel is not allowed. Please assign a different default Sales Channel for your store". }`
2024-11-25 13:01:26 +00:00
Dos
1bd82a9b13 feat: add Thai language support (#10249) 2024-11-25 12:59:26 +00:00
Danilo Silva
ade1545207 feat: add ptBR (Brazilian Portuguese) in translations (#10188)
**Changelog**

- Add translation in Portuguese (Brazil)
- Updates test suites that validate translations (*.json) and corresponding $schema.json.

Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
2024-11-25 12:27:23 +00:00
olivermrbl
ccf4e801f3 chore: Version packages 2024-11-25 12:14:36 +01:00
Kasper Fabricius Kristensen
c28d0db164 fix(product, dashboard): manual cleanup of uploaded images (#10254)
* manual cleanup

* add changeset

* remove thumbnail on deletion
2024-11-25 11:44:22 +01:00
olivermrbl
4245312d8d chore: Version packages 2024-11-25 09:57:00 +01:00
Oli Juhl
29ce10b09e fix(product): Update images before adding not null constraint (#10248) 2024-11-25 08:39:43 +00:00
Kasper Fabricius Kristensen
1659c9be5d feat(product,dashboard): Allow re-ordering images (#10187)
* migration

* fix snapshot

* primarykey

* init work on dnd

* progress

* dnd

* undo changes

* undo changes

* undo changes

* undo changes

* fix firefox issue

* lint

* lint

* lint

* add changeset

* undo changes to product module

* set activator node

* init work on service layer

* alternative

* switch to OneToMany

* add tests

* progress

* update migration

* update approach and remove all references to images in product.ts tests

* handle delete images on empty array

* fix config and order type

* update changeset

* rm flag

* export type and fix type in test

* fix type

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-11-25 09:03:10 +01:00
Frane Polić
b12408dbd8 feat(medusa,core-flows,types,js-sdk): decline / cancel order transfer (#10202)
**What**
- **core-flows**: 
  - cancel transfer
  - decline transfer
- **API**:
  - admin cancel transfer
  - store decline transfer 
  - store cancel transfer
- **js-sdk**:
  - add methods for store endpoints 

---

CLOSES CMRC-726
2024-11-25 07:44:31 +00:00