Commit Graph

7747 Commits

Author SHA1 Message Date
Harminder Virk 98bf8c9006 test: add tests for self relationships (#10071)
Initially I thought that we will have to add special checks to allow relationships referencing itself. However, it turned out that not to be the case. Instead, it had more to do with how self relationships are defined in Mikro ORM.

In case of `belongsTo` relationship we have to define the other side as well either as a `hasMany` or `hasOne`. For example:

** The following code will fail, because no children are defined for the parent**
```ts
const user = model.define("user", {
  id: model.number(),
  username: model.text(),
  parent: model.belongsTo(() => user)
})
```

** Addition of children relationship will make things work**
```ts
const user = model.define("user", {
  id: model.number(),
  username: model.text(),
  parent: model.belongsTo(() => user, { mappedBy: "children" }),
  children: model.hasMany(() => user, { mappedBy: "parent" }),
})
```

We can see the similar setup here with our `ProductCategory` MikroORM entity. https://github.com/medusajs/medusa/blob/develop/packages/modules/product/src/models/product-category.ts#L87-L94

@adrien2p Correct me if I am wrong. But I have added the tests for now so that we know the behavior of self relationships
2024-11-13 17:20:27 +00:00
Shahed Nasser 0ea57659e8 docs: improv version detection + fix breadcrumbs (#10083) 2024-11-13 18:20:05 +02:00
Shahed Nasser c054f47872 docs-utils: make reference table of content in alphabetical order (#10084) 2024-11-13 18:10:20 +02:00
Shahed Nasser 662b096a46 docs: fix oneOf design hiding more than three items (#10077)
* docs: fix oneOf design hiding more than three items

* fix lint errors

* fix eslint
2024-11-13 17:41:49 +02:00
Shahed Nasser 938f3bd934 docs: update to next 15 + eslint 9 (#9839)
* update next

* updated react

* update eslint

* finish updating eslint

* fix content lint errors

* fix docs test

* fix vale action

* fix installation errors
2024-11-13 17:03:17 +02:00
Shahed Nasser 6f7467f071 docs: added + updated build and deployment guides (#10019) 2024-11-13 14:44:36 +02:00
Shahed Nasser b6775f894a docs: fix types of injection zone props (#10074)
Closes DX-1065
2024-11-13 14:32:55 +02:00
Harminder Virk d9d4e575f6 fix: do not update the .env.template file with the database name (#10073)
Fixes FRMW-2775
2024-11-13 12:28:13 +00:00
Shahed Nasser f151fb32aa docs: add emit events + types documentation (#10026)
* docs: add emit events + types documentation

* vale fixes
2024-11-13 14:17:14 +02:00
Shahed Nasser 7a26e123bb docs: fix outdated links (#10040) 2024-11-13 11:02:01 +02:00
Shahed Nasser 2d469ba587 docs: added note about test timeout (#10041) 2024-11-13 11:01:47 +02:00
Shahed Nasser 5fec006371 docs-util: fix helper step settings (#10045) 2024-11-13 11:01:14 +02:00
Shahed Nasser 868b1c190f docs: change useRemoteQueryStep to useQueryGraphStep (#10051)
* docs: change useRemoteQueryStep to useQueryGraphStep

* fix lint errors
2024-11-13 11:00:55 +02:00
Shahed Nasser 823552ecd9 docs: document multiple steps usage in a workflow (#10053) 2024-11-13 11:00:37 +02:00
Shahed Nasser 1fbe1d4ee9 docs: update event module guide (#10056) 2024-11-13 11:00:22 +02:00
Shahed Nasser 3962c2c88f docs: fix link to medusa configuration guide (#10059) 2024-11-13 11:00:04 +02:00
Shahed Nasser 690c352993 docs: add documentation on validateAndTransformQuery (#10060)
* docs: add documentation on validateAndTransformQuery

* fix vale error
2024-11-13 10:59:46 +02:00
Shahed Nasser 1d87459951 docs: remove duplicate buttons in code actions (#10061) 2024-11-13 10:59:14 +02:00
Shahed Nasser e10fb34eb9 docs: fix slugs pointing to admin rather than store routes (#10063) 2024-11-13 10:42:58 +02:00
Hadi Abdalla c341f961ce Fix Typo in Documentation (#9989)
This PR fixes a typo in the documentation
2024-11-13 08:20:43 +00:00
Mohsen 4f0726311a Fix grammar issue in the doc (#10064)
added "in" to fix a grammar issue
2024-11-13 07:57:06 +00:00
Carlos R. L. Rodrigues fc5d2b5fca feat(core-flows): order add quantity diff (#10065) 2024-11-12 16:49:58 -03:00
Karl Hofmann ffa3a15ba1 Feat: add german language support (#9892)
**What**
Added German language json file. 

**Why**
To be able to choose german language.

**How**
The File is translated with Google Translate, some human checks and corrections. I'm sure it's not perfect, but it is a good starting point. First the en.json was duplicated (as de.json) to be able to see the changes made and if the structure is still the same.

**Testing**
As mentioned in How, i checked if the structure is still the same.

Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
2024-11-12 13:46:43 +00:00
Carlos R. L. Rodrigues 2344012d1c fix(core-flows): capture before order created (#9980)
What:
 When `autocapture` is enabled, the webhook is processed before the order was created.
 The payment processing workflows were merged into a single one
 
FIXES: SUP-118, SUP-9

https://github.com/medusajs/medusa/issues/9998
2024-11-12 13:43:48 +00:00
github-actions[bot] 9e40f34ba8 chore(docs): Updated API Reference (automated) (#10047)
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-12 10:32:44 +00:00
github-actions[bot] c3a0123958 chore(docs): Generated References (automated) (#10046)
Generated the following references:
- `core_flows`
- `js_sdk`
- `modules`
- `product`
- `types`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-11-12 10:30:09 +00:00
github-actions[bot] 15da46a026 chore(docs): Update version in documentation (automated) (#10044)
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>
2024-11-12 10:27:45 +00:00
Carlos R. L. Rodrigues 1eef324af3 fix(orchestration): fix set step failure (#10031)
What:
 - copy data before saving checkpoint
 - removed unused data format function
 - properly handle registerStepFailure to not throw
 - emit onFinish event even when execution failed
2024-11-12 10:06:36 +00:00
olivermrbl 7794faf49e chore: Release 2024-11-12 10:12:48 +01:00
olivermrbl d5605656ae chore: Version packages 2024-11-12 10:10:07 +01:00
Shahed Nasser bbc47dc5df docs: fix missing hooks property (#10008) 2024-11-12 09:53:12 +01:00
Kasper Fabricius Kristensen 904f0926f1 fix(dashboard): Load product variant edit page and fix product detail query key (#10029)
**What**
- Fixes Edit Variant form so it properly loads the product variant
- Fixes the query key for product details to prevent the cache from being shared between queries for the same ID but with different params.

Resolves CMRC-685

Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>
2024-11-12 08:40:08 +00:00
Frane Polić 81208b6e1d fix(dashboard): handle deleted products/variants in the order domain (#9841)
* fix: optional variants and products

* fix: more cases with inventory

* fix: fulfillment creation modal

* fix: move create fulfillment actions to footer

* refactor: use properties of the LineItem

* fix: remove N/A

* fix: remove ||

* fix: show confirmed status properly

* fix: pick needed product props

* fix: typo
2024-11-12 09:05:11 +01:00
Shahed Nasser 713e428ec2 docs: fix cart completion in subscriptions recipe (#10021) 2024-11-11 20:37:26 +02:00
Shahed Nasser a131a4468d docs: improve getting started chapters (#10014) 2024-11-11 20:35:57 +02:00
Frane Polić fb05ca2b8a fix(medusa, types): filter product by external_id (#10010) 2024-11-11 19:31:41 +01:00
Kasper Fabricius Kristensen 34f4f695c0 fix(types): Add AdminBatchUpdateProductVariant type (#10009) 2024-11-11 19:30:44 +01:00
Shahed Nasser 5e1ccba06d docs: fix link to testing tools (#10030) 2024-11-11 18:24:55 +00:00
Shahed Nasser c4183a5cb7 docs: improve transform docs (#10023) 2024-11-11 19:21:53 +01:00
Shahed Nasser 0ef92cce28 chore(medusa): show success message after user is created (#10027) 2024-11-11 20:16:14 +02:00
github-actions[bot] 82fd93da17 chore(docs): Updated API Reference (automated) (#10017)
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-11 12:30:22 +00:00
Harminder Virk bc2d556c2c docs: add changeset for #10011 (#10018)
Missed changeset in this PR https://github.com/medusajs/medusa/pull/10011.

Trying to get into the habit of creating one 🙏
2024-11-11 12:15:48 +00:00
Harminder Virk e228088f8d fix: pluralize type helper to account for uncountable nouns and special rules (#10011) 2024-11-11 17:18:23 +05:30
github-actions[bot] 1cab15b209 chore(docs): Generated References (automated) (#10016)
Generated the following references:
- `api_key`
- `auth`
- `cart`
- `core_flows`
- `currency`
- `customer`
- `fulfillment`
- `inventory_next`
- `js_sdk`
- `modules`
- `modules_sdk`
- `order`
- `payment`
- `pricing`
- `product`
- `promotion`
- `region`
- `sales_channel`
- `stock_location_next`
- `store`
- `tax`
- `types`
- `user`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-11-11 11:12:13 +00:00
github-actions[bot] 1d2efb5ae3 chore(docs): Update version in documentation (automated) (#10015)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2024-11-11 11:54:29 +01:00
Paweł Romanowski 5c22c57cb8 feat: add Polish language support (#9770)
Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
2024-11-11 10:07:28 +00:00
Mohsen a151865d0a Enhance Documentation for authenticate Middleware Function (#9898)
Clarified usage of allowUnauthenticated and allowUnregistered options, explaining their roles in controlling access for unauthenticated and unregistered users.
2024-11-11 10:06:05 +00:00
olivermrbl af51bd755b chore: Release 2024-11-11 11:02:15 +01:00
olivermrbl ecece05b72 chore: Version packages 2024-11-11 10:58:20 +01:00
Shahed Nasser 94fb420434 docs: fix server worker mode in railway deployment (#9842)
* docs: fix server worker mode in railway deployment

* fix DISABLE_MEDUSA_ADMIN
2024-11-11 09:44:21 +01:00