Skip to content

Commit

Permalink
Merge branch 'develop' into fix/workflow-step-failure
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-r-l-rodrigues authored Nov 12, 2024
2 parents e4e0fdb + 7794faf commit ddd97dd
Show file tree
Hide file tree
Showing 170 changed files with 973 additions and 657 deletions.
5 changes: 0 additions & 5 deletions .changeset/calm-bats-tell.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/real-gifts-grow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/silly-spiders-draw.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wet-cows-share.md

This file was deleted.

28 changes: 28 additions & 0 deletions integration-tests/http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# integration-tests-http

## 1.0.3

### Patch Changes

- Updated dependencies [[`0ef92cce2848ed447028434c43e4041f094cb402`](https://github.com/medusajs/medusa/commit/0ef92cce2848ed447028434c43e4041f094cb402)]:
- @medusajs/medusa@2.0.4
- @medusajs/core-flows@2.0.4
- @medusajs/modules-sdk@2.0.4
- @medusajs/utils@2.0.4
- @medusajs/test-utils@2.0.4
- @medusajs/api-key@2.0.4
- @medusajs/auth@2.0.4
- @medusajs/cache-inmemory@2.0.4
- @medusajs/customer@2.0.4
- @medusajs/event-bus-local@2.0.4
- @medusajs/fulfillment@2.0.4
- @medusajs/inventory@2.0.4
- @medusajs/pricing@2.0.4
- @medusajs/product@2.0.4
- @medusajs/promotion@2.0.4
- @medusajs/fulfillment-manual@2.0.4
- @medusajs/region@2.0.4
- @medusajs/stock-location@2.0.4
- @medusajs/store@2.0.4
- @medusajs/tax@2.0.4
- @medusajs/user@2.0.4
- @medusajs/workflow-engine-inmemory@2.0.4

## 1.0.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/http/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "integration-tests-http",
"version": "1.0.2",
"version": "1.0.3",
"main": "index.js",
"license": "MIT",
"private": true,
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.0.4

### Patch Changes

- Updated dependencies [[`904f0926f16737abe0a51a4fce8e5b0b8a377321`](https://github.com/medusajs/medusa/commit/904f0926f16737abe0a51a4fce8e5b0b8a377321), [`5c22c57cb8f549c9b16829ab313eb954339b1f6a`](https://github.com/medusajs/medusa/commit/5c22c57cb8f549c9b16829ab313eb954339b1f6a)]:
- @medusajs/dashboard@2.0.4
- @medusajs/admin-shared@2.0.4
- @medusajs/admin-vite-plugin@2.0.4

## 2.0.3

### 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.3",
"version": "2.0.4",
"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.3",
"@medusajs/types": "^2.0.4",
"@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.3",
"@medusajs/admin-vite-plugin": "2.0.3",
"@medusajs/dashboard": "2.0.3",
"@medusajs/admin-shared": "2.0.4",
"@medusajs/admin-vite-plugin": "2.0.4",
"@medusajs/dashboard": "2.0.4",
"@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.0.4

### Patch Changes

- Updated dependencies []:
- @medusajs/admin-shared@2.0.4

## 2.0.3

### 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.3",
"version": "2.0.4",
"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.3"
"@medusajs/admin-shared": "^2.0.4"
},
"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.0.4

## 2.0.3

## 2.0.2
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.3",
"version": "2.0.4",
"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.0.4

### Patch Changes

- Updated dependencies []:
- @medusajs/admin-shared@2.0.4

## 2.0.3

### 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.3",
"version": "2.0.4",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"@babel/parser": "7.25.6",
"@babel/traverse": "7.25.6",
"@medusajs/admin-shared": "2.0.3",
"@medusajs/admin-shared": "2.0.4",
"chokidar": "3.5.3",
"fdir": "6.1.1",
"magic-string": "0.30.5",
Expand Down
13 changes: 13 additions & 0 deletions packages/admin/dashboard/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @medusajs/dashboard

## 2.0.4

### Patch Changes

- [#10029](https://github.com/medusajs/medusa/pull/10029) [`904f0926f16737abe0a51a4fce8e5b0b8a377321`](https://github.com/medusajs/medusa/commit/904f0926f16737abe0a51a4fce8e5b0b8a377321) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - fix(dashboard): Fix query key for product details and load product variant data correctly

- [#9770](https://github.com/medusajs/medusa/pull/9770) [`5c22c57cb8f549c9b16829ab313eb954339b1f6a`](https://github.com/medusajs/medusa/commit/5c22c57cb8f549c9b16829ab313eb954339b1f6a) Thanks [@nexthis](https://github.com/nexthis)! - feat(dashboard): Add Polish translation of admin dashboard

- Updated dependencies []:
- @medusajs/admin-shared@2.0.4
- @medusajs/js-sdk@2.0.4
- @medusajs/icons@2.0.4

## 2.0.3

### Patch Changes
Expand Down
16 changes: 8 additions & 8 deletions packages/admin/dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@medusajs/dashboard",
"version": "2.0.3",
"version": "2.0.4",
"scripts": {
"generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
"dev": "vite",
Expand Down Expand Up @@ -45,9 +45,9 @@
"@dnd-kit/sortable": "^8.0.0",
"@hookform/error-message": "^2.0.1",
"@hookform/resolvers": "3.4.2",
"@medusajs/admin-shared": "2.0.3",
"@medusajs/icons": "2.0.3",
"@medusajs/js-sdk": "2.0.3",
"@medusajs/admin-shared": "2.0.4",
"@medusajs/icons": "2.0.4",
"@medusajs/js-sdk": "2.0.4",
"@medusajs/ui": "4.0.1",
"@radix-ui/react-collapsible": "1.1.0",
"@tanstack/react-query": "^5.28.14",
Expand Down Expand Up @@ -75,10 +75,10 @@
"zod": "3.22.4"
},
"devDependencies": {
"@medusajs/admin-shared": "^2.0.3",
"@medusajs/admin-vite-plugin": "2.0.3",
"@medusajs/types": "2.0.3",
"@medusajs/ui-preset": "2.0.3",
"@medusajs/admin-shared": "^2.0.4",
"@medusajs/admin-vite-plugin": "2.0.4",
"@medusajs/types": "2.0.4",
"@medusajs/ui-preset": "2.0.4",
"@types/node": "^20.11.15",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { Thumbnail } from "../../../../common/thumbnail"
import { HttpTypes } from "@medusajs/types"

type ProductCellProps = {
product: HttpTypes.AdminProduct
product: Pick<HttpTypes.AdminProduct, "thumbnail" | "title">
}

export const ProductCell = ({ product }: ProductCellProps) => {
return (
<div className="flex h-full w-full items-center gap-x-3 overflow-hidden max-w-[250px]">
<div className="flex h-full w-full max-w-[250px] items-center gap-x-3 overflow-hidden">
<div className="w-fit flex-shrink-0">
<Thumbnail src={product.thumbnail} />
</div>
Expand Down
13 changes: 9 additions & 4 deletions packages/admin/dashboard/src/hooks/api/products.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,21 @@ export const useDeleteProductOption = (
export const useProductVariant = (
productId: string,
variantId: string,
query?: Record<string, any>,
query?: HttpTypes.AdminProductVariantParams,
options?: Omit<
UseQueryOptions<any, FetchError, any, QueryKey>,
UseQueryOptions<
HttpTypes.AdminProductVariantResponse,
FetchError,
HttpTypes.AdminProductVariantResponse,
QueryKey
>,
"queryFn" | "queryKey"
>
) => {
const { data, ...rest } = useQuery({
queryFn: () =>
sdk.admin.product.retrieveVariant(productId, variantId, query),
queryKey: variantsQueryKeys.detail(variantId),
queryKey: variantsQueryKeys.detail(variantId, query),
...options,
})

Expand Down Expand Up @@ -238,7 +243,7 @@ export const useProduct = (
) => {
const { data, ...rest } = useQuery({
queryFn: () => sdk.admin.product.retrieve(id, query),
queryKey: productsQueryKeys.detail(id),
queryKey: productsQueryKeys.detail(id, query),
...options,
})

Expand Down
25 changes: 12 additions & 13 deletions packages/admin/dashboard/src/lib/query-key-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@ export type TQueryKey<TKey, TListQuery = any, TDetailQuery = string> = {
lists: () => readonly [...TQueryKey<TKey>["all"], "list"]
list: (
query?: TListQuery
) => readonly [
...ReturnType<TQueryKey<TKey>["lists"]>,
{ query: TListQuery | undefined },
]
) => readonly [...ReturnType<TQueryKey<TKey>["lists"]>, { query: TListQuery }]
details: () => readonly [...TQueryKey<TKey>["all"], "detail"]
detail: (
id: TDetailQuery,
query?: TListQuery
) => readonly [
...ReturnType<TQueryKey<TKey>["details"]>,
TDetailQuery,
{ query: TListQuery | undefined },
{ query: TListQuery }
]
}

Expand All @@ -26,7 +23,7 @@ export type UseQueryOptionsWrapper<
// Type thrown in case the queryFn rejects
E = Error,
// Query key type
TQueryKey extends QueryKey = QueryKey,
TQueryKey extends QueryKey = QueryKey
> = Omit<
UseQueryOptions<TQueryFn, E, TQueryFn, TQueryKey>,
"queryKey" | "queryFn"
Expand All @@ -35,20 +32,22 @@ export type UseQueryOptionsWrapper<
export const queryKeysFactory = <
T,
TListQueryType = any,
TDetailQueryType = string,
TDetailQueryType = string
>(
globalKey: T
) => {
const queryKeyFactory: TQueryKey<T, TListQueryType, TDetailQueryType> = {
all: [globalKey],
lists: () => [...queryKeyFactory.all, "list"],
list: (query?: TListQueryType) => [...queryKeyFactory.lists(), { query }],
list: (query?: TListQueryType) =>
[...queryKeyFactory.lists(), query ? { query } : undefined].filter(
(k) => !!k
),
details: () => [...queryKeyFactory.all, "detail"],
detail: (id: TDetailQueryType, query?: TListQueryType) => [
...queryKeyFactory.details(),
id,
{ query },
],
detail: (id: TDetailQueryType, query?: TListQueryType) =>
[...queryKeyFactory.details(), id, query ? { query } : undefined].filter(
(k) => !!k
),
}
return queryKeyFactory
}
Loading

0 comments on commit ddd97dd

Please sign in to comment.