Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] develop from medusajs:develop #6

Merged
merged 12 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .changeset/cold-dragons-lie.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/cuddly-news-battle.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/five-crews-rest.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/hip-suns-sort.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/kind-moons-attack.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/lazy-eagles-bow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/nasty-tigers-cross.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/nice-tools-sell.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/odd-lamps-invite.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/purple-maps-bow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/rotten-spoons-brake.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/rotten-tigers-worry.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/spicy-beds-rescue.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/strange-trainers-watch.md

This file was deleted.

154 changes: 154 additions & 0 deletions integration-tests/modules/__tests__/cart/store/cart.workflows.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1957,6 +1957,160 @@ medusaIntegrationTestRunner({
])
})

it("should exclude return shipping options for cart by default", async () => {
const salesChannel = await scModuleService.createSalesChannels({
name: "Webshop",
})

const location = await stockLocationModule.createStockLocations({
name: "Europe",
})

let cart = await cartModuleService.createCarts({
currency_code: "usd",
region_id: region.id,
sales_channel_id: salesChannel.id,
shipping_address: {
city: "CPH",
province: "Sjaelland",
country_code: "dk",
},
})

const shippingProfile =
await fulfillmentModule.createShippingProfiles({
name: "Test",
type: "default",
})

const fulfillmentSet = await fulfillmentModule.createFulfillmentSets({
name: "Test",
type: "test-type",
service_zones: [
{
name: "Test",
geo_zones: [
{
type: "country",
country_code: "dk",
},
],
},
],
})

const shippingOption = await fulfillmentModule.createShippingOptions([
{
name: "Return shipping option",
service_zone_id: fulfillmentSet.service_zones[0].id,
shipping_profile_id: shippingProfile.id,
provider_id: "manual_test-provider",
rules: [
{
operator: RuleOperator.EQ,
attribute: "is_return",
value: "true",
},
],
price_type: "flat",
type: {
label: "Test type",
description: "Test description",
code: "test-code",
},
},
{
name: "Test shipping option",
service_zone_id: fulfillmentSet.service_zones[0].id,
shipping_profile_id: shippingProfile.id,
provider_id: "manual_test-provider",
price_type: "flat",
type: {
label: "Test type",
description: "Test description",
code: "test-code",
},
},
])

const priceSet = await pricingModule.createPriceSets({
prices: [
{
amount: 3000,
currency_code: "usd",
},
],
})

const priceSetTwo = await pricingModule.createPriceSets({
prices: [
{
amount: 3000,
currency_code: "usd",
},
],
})

await remoteLink.create([
{
[Modules.SALES_CHANNEL]: {
sales_channel_id: salesChannel.id,
},
[Modules.STOCK_LOCATION]: {
stock_location_id: location.id,
},
},
{
[Modules.STOCK_LOCATION]: {
stock_location_id: location.id,
},
[Modules.FULFILLMENT]: {
fulfillment_set_id: fulfillmentSet.id,
},
},
{
[Modules.FULFILLMENT]: {
shipping_option_id: shippingOption.find(
(o) => o.name === "Test shipping option"
)?.id,
},
[Modules.PRICING]: {
price_set_id: priceSet.id,
},
},
{
[Modules.FULFILLMENT]: {
shipping_option_id: shippingOption.find(
(o) => o.name === "Return shipping option"
)?.id,
},
[Modules.PRICING]: {
price_set_id: priceSetTwo.id,
},
},
])

cart = await cartModuleService.retrieveCart(cart.id, {
select: ["id"],
relations: ["shipping_address"],
})

const { result } = await listShippingOptionsForCartWorkflow(
appContainer
).run({
input: {
cart_id: cart.id,
},
})

expect(result.length).toEqual(1)
expect(result).toEqual([
expect.objectContaining({
name: "Test shipping option",
}),
])
})

it("should list no shipping options for cart, if sales channel is not associated with location", async () => {
const salesChannel = await scModuleService.createSalesChannels({
name: "Webshop",
Expand Down
9 changes: 9 additions & 0 deletions packages/admin/admin-bundler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @medusajs/admin-bundler

## 2.1.0

### Patch Changes

- Updated dependencies [[`18583ed56725b1faa8b19f7e46e8bc0a59dec33c`](https://github.com/medusajs/medusa/commit/18583ed56725b1faa8b19f7e46e8bc0a59dec33c), [`e8f4f7ea2ba33a747a61a13537e073c82a56d29e`](https://github.com/medusajs/medusa/commit/e8f4f7ea2ba33a747a61a13537e073c82a56d29e), [`a5c8cc992ce9f1dbed6b30048f99fa5bae4af05a`](https://github.com/medusajs/medusa/commit/a5c8cc992ce9f1dbed6b30048f99fa5bae4af05a), [`3d5ca155e303548853ba5ca9e6b3d37ce477823f`](https://github.com/medusajs/medusa/commit/3d5ca155e303548853ba5ca9e6b3d37ce477823f), [`c6f955f0b51a795b4f6a1aeaa1de36205d2d32e5`](https://github.com/medusajs/medusa/commit/c6f955f0b51a795b4f6a1aeaa1de36205d2d32e5)]:
- @medusajs/[email protected]
- @medusajs/[email protected]
- @medusajs/[email protected]

## 2.0.7

### Patch Changes
Expand Down
10 changes: 5 additions & 5 deletions packages/admin/admin-bundler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@medusajs/admin-bundler",
"version": "2.0.7",
"version": "2.1.0",
"description": "Bundler for the Medusa admin dashboard.",
"author": "Kasper Kristensen <[email protected]>",
"scripts": {
Expand All @@ -18,17 +18,17 @@
"package.json"
],
"devDependencies": {
"@medusajs/types": "^2.0.7",
"@medusajs/types": "^2.1.0",
"@types/compression": "^1.7.5",
"copyfiles": "^2.4.1",
"express": "^4.21.0",
"tsup": "^8.0.1",
"typescript": "^5.3.3"
},
"dependencies": {
"@medusajs/admin-shared": "2.0.7",
"@medusajs/admin-vite-plugin": "2.0.7",
"@medusajs/dashboard": "2.0.7",
"@medusajs/admin-shared": "2.1.0",
"@medusajs/admin-vite-plugin": "2.1.0",
"@medusajs/dashboard": "2.1.0",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.16",
"compression": "^1.7.4",
Expand Down
7 changes: 7 additions & 0 deletions packages/admin/admin-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @medusajs/admin-sdk

## 2.1.0

### Patch Changes

- Updated dependencies []:
- @medusajs/[email protected]

## 2.0.7

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/admin/admin-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@medusajs/admin-sdk",
"description": "SDK for building extension for the Medusa admin dashboard.",
"version": "2.0.7",
"version": "2.1.0",
"author": "Kasper Kristensen <[email protected]>",
"types": "dist/index.d.ts",
"main": "dist/index.js",
Expand All @@ -25,7 +25,7 @@
"zod": "^3.22"
},
"dependencies": {
"@medusajs/admin-shared": "^2.0.7"
"@medusajs/admin-shared": "^2.1.0"
},
"peerDependencies": {
"zod": "^3.22"
Expand Down
2 changes: 2 additions & 0 deletions packages/admin/admin-shared/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @medusajs/admin-shared

## 2.1.0

## 2.0.7

## 2.0.6
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/admin-shared/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@medusajs/admin-shared",
"description": "Shared code for Medusa admin packages.",
"version": "2.0.7",
"version": "2.1.0",
"author": "Kasper Kristensen <[email protected]>",
"types": "dist/index.d.ts",
"main": "dist/index.js",
Expand Down
7 changes: 7 additions & 0 deletions packages/admin/admin-vite-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @medusajs/admin-vite-plugin

## 2.1.0

### Patch Changes

- Updated dependencies []:
- @medusajs/[email protected]

## 2.0.7

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/admin/admin-vite-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@medusajs/admin-vite-plugin",
"version": "2.0.7",
"version": "2.1.0",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -40,7 +40,7 @@
"@babel/parser": "7.25.6",
"@babel/traverse": "7.25.6",
"@babel/types": "7.25.6",
"@medusajs/admin-shared": "2.0.7",
"@medusajs/admin-shared": "2.1.0",
"chokidar": "3.5.3",
"fdir": "6.1.1",
"magic-string": "0.30.5",
Expand Down
19 changes: 19 additions & 0 deletions packages/admin/dashboard/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# @medusajs/dashboard

## 2.1.0

### Patch Changes

- [#10416](https://github.com/medusajs/medusa/pull/10416) [`18583ed56725b1faa8b19f7e46e8bc0a59dec33c`](https://github.com/medusajs/medusa/commit/18583ed56725b1faa8b19f7e46e8bc0a59dec33c) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - fix(dashboard): Fix broken number input in adjust inventory form

- [#10412](https://github.com/medusajs/medusa/pull/10412) [`e8f4f7ea2ba33a747a61a13537e073c82a56d29e`](https://github.com/medusajs/medusa/commit/e8f4f7ea2ba33a747a61a13537e073c82a56d29e) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - fix(dashboard): Add default value to inventory item combobox

- [#10422](https://github.com/medusajs/medusa/pull/10422) [`a5c8cc992ce9f1dbed6b30048f99fa5bae4af05a`](https://github.com/medusajs/medusa/commit/a5c8cc992ce9f1dbed6b30048f99fa5bae4af05a) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - fix(dashboard): Prevent language ptBR from breaking dashboard

- [#10431](https://github.com/medusajs/medusa/pull/10431) [`3d5ca155e303548853ba5ca9e6b3d37ce477823f`](https://github.com/medusajs/medusa/commit/3d5ca155e303548853ba5ca9e6b3d37ce477823f) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - fix(dashboard): Prevent order details page from crashing on no region

- [#10430](https://github.com/medusajs/medusa/pull/10430) [`c6f955f0b51a795b4f6a1aeaa1de36205d2d32e5`](https://github.com/medusajs/medusa/commit/c6f955f0b51a795b4f6a1aeaa1de36205d2d32e5) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - fix(dashboard): Add Shipping Profile metadata route

- Updated dependencies [[`94f6265dfc074969f2f141a19f2fc33a6ab96af1`](https://github.com/medusajs/medusa/commit/94f6265dfc074969f2f141a19f2fc33a6ab96af1)]:
- @medusajs/[email protected]
- @medusajs/[email protected]
- @medusajs/[email protected]

## 2.0.7

### Patch Changes
Expand Down
Loading
Loading