Skip to content

Commit

Permalink
Merge branch 'develop' into fix/display-date-cell
Browse files Browse the repository at this point in the history
  • Loading branch information
fPolic authored Mar 10, 2025
2 parents 2733dd9 + bd4428c commit d4efae8
Show file tree
Hide file tree
Showing 284 changed files with 52,107 additions and 48,309 deletions.
7 changes: 7 additions & 0 deletions .changeset/afraid-hotels-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@medusajs/core-flows": patch
"@medusajs/cart": patch
"@medusajs/types": patch
---

chore: improve tax lines
7 changes: 7 additions & 0 deletions .changeset/heavy-items-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@medusajs/product": patch
"@medusajs/framework": patch
"@medusajs/medusa": patch
---

chore(product): Improve product normalization
5 changes: 5 additions & 0 deletions .changeset/many-cycles-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/core-flows": patch
---

fix(core-flows): fulfillment reservation check
62 changes: 62 additions & 0 deletions .changeset/metal-dryers-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
"@medusajs/notification-sendgrid": patch
"@medusajs/fulfillment-manual": patch
"@medusajs/notification-local": patch
"@medusajs/locking-postgres": patch
"@medusajs/auth-emailpass": patch
"@medusajs/payment-stripe": patch
"@medusajs/workflow-engine-inmemory": patch
"@medusajs/locking-redis": patch
"@medusajs/auth-github": patch
"@medusajs/auth-google": patch
"@medusajs/workflow-engine-redis": patch
"@medusajs/file-local": patch
"@medusajs/file-s3": patch
"@medusajs/ui-preset": patch
"@medusajs/event-bus-local": patch
"@medusajs/event-bus-redis": patch
"@medusajs/medusa-oas-cli": patch
"@medusajs/cache-inmemory": patch
"@medusajs/stock-location": patch
"create-medusa-app": patch
"@medusajs/sales-channel": patch
"@medusajs/link-modules": patch
"@medusajs/notification": patch
"@medusajs/admin-bundler": patch
"@medusajs/icons": patch
"@medusajs/cache-redis": patch
"@medusajs/fulfillment": patch
"@medusajs/orchestration": patch
"@medusajs/workflows-sdk": patch
"@medusajs/test-utils": patch
"@medusajs/inventory": patch
"@medusajs/promotion": patch
"@medusajs/modules-sdk": patch
"@medusajs/ui": patch
"@medusajs/currency": patch
"@medusajs/customer": patch
"@medusajs/admin-sdk": patch
"@medusajs/dashboard": patch
"@medusajs/core-flows": patch
"@medusajs/api-key": patch
"@medusajs/locking": patch
"@medusajs/payment": patch
"@medusajs/pricing": patch
"@medusajs/product": patch
"@medusajs/cli": patch
"@medusajs/framework": patch
"@medusajs/region": patch
"@medusajs/index": patch
"@medusajs/order": patch
"@medusajs/store": patch
"@medusajs/auth": patch
"@medusajs/cart": patch
"@medusajs/file": patch
"@medusajs/user": patch
"@medusajs/js-sdk": patch
"@medusajs/tax": patch
"@medusajs/utils": patch
"@medusajs/medusa": patch
---

chore: Remove ranges on Medusa packages
5 changes: 5 additions & 0 deletions .changeset/odd-cycles-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/framework": patch
---

Fix(framework): http cors middleware order and options
6 changes: 6 additions & 0 deletions .changeset/rich-drinks-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@medusajs/core-flows": patch
"@medusajs/workflows-sdk": patch
---

feat(workflows-sdk): Allow when then in parallelize
5 changes: 5 additions & 0 deletions .changeset/sharp-poems-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---

chore: pin swc to 1.5.7
5 changes: 5 additions & 0 deletions .changeset/tender-horses-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/pricing": patch
---

fix(pricing): emit events
5 changes: 5 additions & 0 deletions .changeset/thick-steaks-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/workflow-engine-redis": patch
---

fix(workflow-engine-redis): Split the queues and respect worker mode for job executions
10 changes: 5 additions & 5 deletions .github/workflows/docs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Get Directories to Scan
if: ${{ steps.pr-files.outputs.files_lt_threshold == 'true' }}
working-directory: www/vale
run: ./get-files.sh book app
run: ./get-files.sh book/app/learn resources
id: directories

- name: Vale Linter
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:

- name: Get Directories to Scan
working-directory: www/vale
run: ./get-files.sh resources app contribution-guidelines usage
run: ./get-files.sh resources/app
id: directories

- name: Vale Linter
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:

- name: Get Directories to Scan
working-directory: www/vale
run: ./get-files.sh user-guide app
run: ./get-files.sh user-guide/app
id: directories

- name: Vale Linter
Expand Down Expand Up @@ -260,7 +260,7 @@ jobs:
- name: Get Directories to Scan
if: ${{ steps.pr-files.outputs.files_lt_threshold == 'true' }}
working-directory: www/vale
run: ./get-files.sh ui src/content/docs
run: ./get-files.sh ui/src/content/docs
id: directories

- name: Vale Linter
Expand Down Expand Up @@ -318,7 +318,7 @@ jobs:
- name: Get Directories to Scan
if: ${{ steps.pr-files.outputs.files_lt_threshold == 'true' }}
working-directory: www/vale
run: ./get-files.sh api-reference markdown
run: ./get-files.sh api-reference/markdown
id: directories

- name: Vale Linter
Expand Down
11 changes: 11 additions & 0 deletions integration-tests/http/__tests__/claims/claims.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,17 @@ medusaIntegrationTestRunner({
},
])

// create reservation for inventory item that is initially on the order
const inventoryModule = container.resolve(Modules.INVENTORY)
await inventoryModule.createReservationItems([
{
inventory_item_id: inventoryItem.id,
location_id: location.id,
quantity: 2,
line_item_id: order.items[0].id,
},
])

const shippingOptionPayload = {
name: "Return shipping",
service_zone_id: fulfillmentSet.service_zones[0].id,
Expand Down
11 changes: 11 additions & 0 deletions integration-tests/http/__tests__/exchanges/exchanges.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,17 @@ medusaIntegrationTestRunner({
},
])

// create reservation for inventory item that is initially on the order
const inventoryModule = container.resolve(Modules.INVENTORY)
await inventoryModule.createReservationItems([
{
inventory_item_id: inventoryItem.id,
location_id: location.id,
quantity: 2,
line_item_id: order.items[0].id,
},
])

const shippingOptionPayload = {
name: "Return shipping",
service_zone_id: fulfillmentSet.service_zones[0].id,
Expand Down
14 changes: 12 additions & 2 deletions integration-tests/http/__tests__/order/admin/rma-flows.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ medusaIntegrationTestRunner({
let location
let item
let returnShippingOption
let outboundShippingOption
const shippingProviderId = "manual_test-provider"

beforeEach(async () => {
Expand Down Expand Up @@ -135,7 +136,7 @@ medusaIntegrationTestRunner({
prices: [
{
currency_code: "usd",
amount: 20,
amount: 0, // Free shipping
},
],
rules: [
Expand All @@ -160,7 +161,7 @@ medusaIntegrationTestRunner({
)
).data.shipping_option

const outboundShippingOption = (
outboundShippingOption = (
await api.post(
"/admin/shipping-options",
outboundShippingOptionPayload,
Expand Down Expand Up @@ -289,6 +290,15 @@ medusaIntegrationTestRunner({
adminHeaders
)

// If claim has outbound items, we need to set the outbound shipping method for reservation to be created
// TODO: change condition in confirm workfow to crate reservation depending on shipping since we can have
// reservations for inventory items that don't require shipping
await api.post(
`/admin/claims/${singleOutboundClaim.id}/outbound/shipping-method`,
{ shipping_option_id: outboundShippingOption.id },
adminHeaders
)

await api.post(
`/admin/claims/${singleOutboundClaim.id}/request`,
{},
Expand Down
19 changes: 19 additions & 0 deletions integration-tests/http/__tests__/product/admin/product.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3100,6 +3100,25 @@ medusaIntegrationTestRunner({
)
})

it("should successfully delete products", async () => {
const response = await api.post(
"/admin/products/batch",
{ delete: [baseProduct.id] },
adminHeaders
)

expect(response.status).toEqual(200)
expect(response.data.created).toHaveLength(0)
expect(response.data.updated).toHaveLength(0)
expect(response.data.deleted.ids).toHaveLength(1)

expect(response.data.created).toEqual([])
expect(response.data.updated).toEqual([])
expect(response.data.deleted).toEqual(
expect.objectContaining({ ids: [baseProduct.id] })
)
})

it("successfully creates, updates, and deletes product variants", async () => {
const productWithMultipleVariants = getProductFixture({
title: "Test batch variants",
Expand Down
17 changes: 15 additions & 2 deletions integration-tests/http/__tests__/returns/returns.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,17 @@ medusaIntegrationTestRunner({
},
])

// create reservation for inventory item that is initially on the order
const inventoryModule = container.resolve(Modules.INVENTORY)
await inventoryModule.createReservationItems([
{
inventory_item_id: inventoryItem.id,
location_id: location.id,
quantity: 2,
line_item_id: order.items[0].id,
},
])

const shippingOptionPayload = {
name: "Return shipping",
service_zone_id: fulfillmentSet.service_zones[0].id,
Expand Down Expand Up @@ -866,7 +877,9 @@ medusaIntegrationTestRunner({
adminHeaders
)
).data.inventory_levels
expect(inventoryLevel[0].stocked_quantity).toEqual(2)

// we had 2 items in stock that were reserved for the order and then fulfilled
expect(inventoryLevel[0].stocked_quantity).toEqual(0)

let result = await api.post(
`/admin/returns/${returnId}/receive`,
Expand Down Expand Up @@ -987,7 +1000,7 @@ medusaIntegrationTestRunner({
adminHeaders
)
).data.inventory_levels
expect(inventoryLevel[0].stocked_quantity).toEqual(3)
expect(inventoryLevel[0].stocked_quantity).toEqual(1)
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,14 +486,17 @@ medusaIntegrationTestRunner({
it("should revert an order fulfillment when it fails and recreate it when tried again", async () => {
const order = await createOrderFixture({ container, product, location })

const itemId = order.items?.find((i) => i.title === "Custom Item 2")!
.id as string

// Create a fulfillment
const createOrderFulfillmentData: OrderWorkflow.CreateOrderFulfillmentWorkflowInput =
{
order_id: order.id,
created_by: "user_1",
items: [
{
id: order.items![0].id,
id: itemId,
quantity: 1,
},
],
Expand Down Expand Up @@ -540,12 +543,14 @@ medusaIntegrationTestRunner({

const [orderFulfill] = await remoteQuery(remoteQueryObject)

const fulfilledItem = orderFulfill.items?.find((i) => i.id === itemId)

expect(orderFulfill.fulfillments).toHaveLength(1)
expect(orderFulfill.items[0].detail.fulfilled_quantity).toEqual(1)
expect(fulfilledItem?.detail.fulfilled_quantity).toEqual(1)

const inventoryModule = container.resolve(Modules.INVENTORY)
const reservation = await inventoryModule.listReservationItems({
line_item_id: order.items![0].id,
line_item_id: itemId,
})
expect(reservation).toHaveLength(0)

Expand Down
2 changes: 1 addition & 1 deletion packages/admin/admin-bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"package.json"
],
"devDependencies": {
"@medusajs/types": "^2.6.0",
"@medusajs/types": "2.6.0",
"@types/compression": "^1.7.5",
"copyfiles": "^2.4.1",
"express": "^4.21.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/admin-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@medusajs/admin-shared": "^2.6.0",
"@medusajs/admin-shared": "2.6.0",
"zod": "3.22.4"
},
"packageManager": "[email protected]"
Expand Down
16 changes: 8 additions & 8 deletions packages/admin/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
"@dnd-kit/sortable": "^8.0.0",
"@hookform/error-message": "^2.0.1",
"@hookform/resolvers": "3.4.2",
"@medusajs/admin-shared": "^2.6.0",
"@medusajs/icons": "^2.6.0",
"@medusajs/js-sdk": "^2.6.0",
"@medusajs/ui": "~4.0.6",
"@medusajs/admin-shared": "2.6.0",
"@medusajs/icons": "2.6.0",
"@medusajs/js-sdk": "2.6.0",
"@medusajs/ui": "4.0.6",
"@tanstack/react-query": "5.64.2",
"@tanstack/react-table": "8.20.5",
"@tanstack/react-virtual": "^3.8.3",
Expand All @@ -75,10 +75,10 @@
"zod": "3.22.4"
},
"devDependencies": {
"@medusajs/admin-shared": "^2.6.0",
"@medusajs/admin-vite-plugin": "^2.6.0",
"@medusajs/types": "^2.6.0",
"@medusajs/ui-preset": "^2.6.0",
"@medusajs/admin-shared": "2.6.0",
"@medusajs/admin-vite-plugin": "2.6.0",
"@medusajs/types": "2.6.0",
"@medusajs/ui-preset": "2.6.0",
"@types/node": "^20.11.15",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
Expand Down
Loading

0 comments on commit d4efae8

Please sign in to comment.