Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3b29f13
fix: ts errors - unused data
sylwia-werner Oct 15, 2025
0b5a999
fix: icon component props issues
sylwia-werner Oct 15, 2025
78db9c9
fix: remove incorrect generic type parameter
sylwia-werner Oct 15, 2025
7284fa5
fix: generic forward ref type issue
sylwia-werner Oct 15, 2025
c0ab356
fix: claims api response type mismatches
sylwia-werner Oct 15, 2025
e3253be
fix: exchanges api response type mismatches
sylwia-werner Oct 15, 2025
30b089c
fix: order edits api response type mismatches
sylwia-werner Oct 15, 2025
98944ed
fix: price preferences api type mismatches
sylwia-werner Oct 15, 2025
58a82e8
fix: regions and tax rates type mismatches
sylwia-werner Oct 15, 2025
d0d19ab
fix: type mismatches metadata form
sylwia-werner Oct 15, 2025
631c1df
fix: shipping profile return type mismatch
sylwia-werner Oct 15, 2025
c1701f2
fix: toast remove not existing dismissLabel property
sylwia-werner Oct 15, 2025
c368eed
fix: tax override and region tables type mismatches
sylwia-werner Oct 15, 2025
8e53ff4
fix: remove unused file and imports for tax regions
sylwia-werner Oct 15, 2025
26cfe3a
fix: story currencies section folder typo
sylwia-werner Oct 15, 2025
8e894dc
fix: unused vars, translations, type mismatches
sylwia-werner Oct 16, 2025
afd83aa
fix: type mismatches
sylwia-werner Oct 16, 2025
48818bf
fix: PR fixes - enhance types for reusable create campaign form fields
sylwia-werner Oct 17, 2025
c9f04b5
fix: pr fixes, remove conditional hook calls
sylwia-werner Oct 17, 2025
1683968
fix: pr fixes
sylwia-werner Oct 17, 2025
6e06d8a
fix: PR fixes - create helper function to enhance types when providin…
sylwia-werner Oct 17, 2025
5abd5e4
fix: lock files conflicts
sylwia-werner Oct 17, 2025
11678d8
Merge branch 'test' into fix/mm2-1209/fix-ts-errors
sylwia-werner Oct 17, 2025
174539d
fix: PR fixes
sylwia-werner Oct 21, 2025
227f4f1
Merge branch 'test' into fix/mm2-1209/fix-ts-errors
sylwia-werner Oct 21, 2025
e8e60b5
fix: pr fixes - remove unused code and regions props
sylwia-werner Oct 21, 2025
517b038
fix: pr fixes - remove unnecessary or operator
sylwia-werner Oct 21, 2025
342af18
fix: PR fixes - simplify reset form value
sylwia-werner Oct 21, 2025
ede554f
fix: PR fixes - simplify conditional logic for form with fieldScope a…
sylwia-werner Oct 21, 2025
db04f90
fix: PR fixes - make check for region country field to be more restri…
sylwia-werner Oct 21, 2025
54c7c50
fix: PR fixes - remove unnecessary type casting
sylwia-werner Oct 21, 2025
7c70e52
Merge branch 'test' into fix/mm2-1209/fix-ts-errors
sylwia-werner Oct 26, 2025
ecdf528
Merge branch 'test' into fix/mm2-1209/fix-ts-errors
sylwia-werner Nov 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 23 additions & 13 deletions src/components/common/calendar/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as React from "react"
import { DayPicker } from "react-day-picker"

import { ChevronLeft, ChevronRight } from "@medusajs/icons"
import { clx } from "@medusajs/ui"
import { clx, IconButton } from "@medusajs/ui"

import "react-day-picker/src/style.css"

Expand Down Expand Up @@ -59,18 +59,28 @@ function Calendar({
...classNames,
}}
components={{
PreviousMonthButton: ({ className, ...props }) => (
<ChevronLeft
className={clx("absolute left-2 top-5", className)}
{...props}
/>
),
NextMonthButton: ({ className, ...props }) => (
<ChevronRight
className={clx("absolute right-2 top-5", className)}
{...props}
/>
),
PreviousMonthButton: ({ className, ...props }) => {
return (
<IconButton
className={clx("absolute left-0 top-2.5", className)}
variant="transparent"
{...props}
>
<ChevronLeft />
</IconButton>
)
},
NextMonthButton: ({ className, ...props }) => {
return (
<IconButton
className={clx("absolute right-0 top-2.5", className)}
variant="transparent"
{...props}
>
<ChevronRight />
</IconButton>
)
},
}}
{...props}
/>
Expand Down
10 changes: 3 additions & 7 deletions src/components/common/stars-rating/stars-rating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ import { Star, StarSolid } from "@medusajs/icons"
export const StarsRating = ({ rate }: { rate: number }) => {
return (
<div className="flex gap-1">
{[
...Array(5)
.keys()
.map((key: number) => {
return key < rate ? <StarSolid key={key} /> : <Star key={key} />
}),
]}
{Array.from({ length: 5 }, (_, key) => {
return key < rate ? <StarSolid key={key} /> : <Star key={key} />
})}
</div>
)
}
4 changes: 2 additions & 2 deletions src/components/data-grid/components/data-grid-root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,10 @@ const DataGridCell = <TData,>({
type DataGridRowProps<TData> = {
row: Row<TData>
rowIndex: number
virtualRow: VirtualItem<Element>
virtualRow: VirtualItem
virtualPaddingLeft?: number
virtualPaddingRight?: number
virtualColumns: VirtualItem<Element>[]
virtualColumns: VirtualItem[]
flatColumns: Column<TData, unknown>[]
anchor: DataGridCoordinates | null
onDragToFillStart: (e: React.MouseEvent<HTMLElement>) => void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ type CreateDataGridPriceColumnsProps<
TFieldValues extends FieldValues,
> = {
currencies?: string[]
regions?: HttpTypes.AdminRegion[]
pricePreferences?: HttpTypes.AdminPricePreference[]
isReadyOnly?: (context: FieldContext<TData>) => boolean
getFieldName: (
Expand All @@ -30,7 +29,6 @@ export const createDataGridPriceColumns = <
TFieldValues extends FieldValues,
>({
currencies,
regions,
pricePreferences,
isReadyOnly,
getFieldName,
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/main-layout/main-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
ListCheckbox,
ChatBubbleLeftRight,
} from "@medusajs/icons"
import { Avatar, Divider, Text, clx } from "@medusajs/ui"
import { Divider, Text, clx } from "@medusajs/ui"
import { Collapsible as RadixCollapsible } from "radix-ui"
import { useTranslation } from "react-i18next"

Expand Down
15 changes: 0 additions & 15 deletions src/components/layout/settings-layout/settings-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,6 @@ const useSettingRoutes = (): INavItem[] => {
)
}

const useDeveloperRoutes = (): INavItem[] => {
const { t } = useTranslation()

return useMemo(
() => [
{
label: t("apiKeyManagement.domain.secret"),
to: "/settings/secret-api-keys",
},
],
[t]
)
}

const useMyAccountRoutes = (): INavItem[] => {
const { t } = useTranslation()

Expand Down Expand Up @@ -93,7 +79,6 @@ const SettingsSidebar = () => {
const { getMenu } = useDashboardExtension()

const routes = useSettingRoutes()
const developerRoutes = useDeveloperRoutes()
const myAccountRoutes = useMyAccountRoutes()
const extensionRoutes = getMenu("settingsExtensions")

Expand Down
4 changes: 0 additions & 4 deletions src/components/search/use-search-results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { TFunction } from "i18next"
import { useCallback, useEffect, useMemo, useState } from "react"
import { useTranslation } from "react-i18next"
import {
useApiKeys,
useCampaigns,
useCollections,
useCustomerGroups,
Expand All @@ -21,11 +20,8 @@ import {
useSalesChannels,
useShippingProfiles,
useStockLocations,
useTaxRegions,
useUsers,
useVariants,
} from "../../hooks/api"
import { useReturnReasons } from "../../hooks/api/return-reasons"
import { Shortcut, ShortcutType } from "../../providers/keybind-provider"
import { useGlobalShortcuts } from "../../providers/keybind-provider/hooks"
import { DynamicSearchResult, SearchArea } from "./types"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { ReactNode, Ref, RefAttributes, forwardRef } from "react"
export function genericForwardRef<T, P = {}>(
render: (props: P, ref: Ref<T>) => ReactNode
): (props: P & RefAttributes<T>) => ReactNode {
return forwardRef(render) as any
return forwardRef(render as any) as any
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove anys

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving it for task to remove any

}
18 changes: 9 additions & 9 deletions src/hooks/api/claims.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export const useUpdateClaimInboundItem = (
id: string,
orderId: string,
options?: UseMutationOptions<
HttpTypes.AdminClaimResponse,
HttpTypes.AdminClaimReturnPreviewResponse,
FetchError,
HttpTypes.AdminUpdateClaimInboundItem & { actionId: string }
>
Expand Down Expand Up @@ -264,7 +264,7 @@ export const useUpdateClaimInboundItem = (
export const useRemoveClaimInboundItem = (
id: string,
orderId: string,
options?: UseMutationOptions<HttpTypes.AdminClaimResponse, FetchError, string>
options?: UseMutationOptions<HttpTypes.AdminClaimReturnPreviewResponse, FetchError, string>
) => {
return useMutation({
mutationFn: (actionId: string) =>
Expand Down Expand Up @@ -292,7 +292,7 @@ export const useAddClaimInboundShipping = (
id: string,
orderId: string,
options?: UseMutationOptions<
HttpTypes.AdminClaimResponse,
HttpTypes.AdminClaimReturnPreviewResponse,
FetchError,
HttpTypes.AdminClaimAddInboundShipping
>
Expand All @@ -319,9 +319,9 @@ export const useUpdateClaimInboundShipping = (
id: string,
orderId: string,
options?: UseMutationOptions<
HttpTypes.AdminClaimResponse,
HttpTypes.AdminClaimPreviewResponse,
FetchError,
HttpTypes.AdminClaimUpdateInboundShipping
HttpTypes.AdminClaimUpdateInboundShipping & { actionId: string }
>
) => {
return useMutation({
Expand All @@ -348,7 +348,7 @@ export const useUpdateClaimInboundShipping = (
export const useDeleteClaimInboundShipping = (
id: string,
orderId: string,
options?: UseMutationOptions<HttpTypes.AdminClaimResponse, FetchError, string>
options?: UseMutationOptions<HttpTypes.AdminClaimReturnPreviewResponse, FetchError, string>
) => {
return useMutation({
mutationFn: (actionId: string) =>
Expand Down Expand Up @@ -480,9 +480,9 @@ export const useUpdateClaimOutboundShipping = (
id: string,
orderId: string,
options?: UseMutationOptions<
HttpTypes.AdminClaimResponse,
HttpTypes.AdminClaimPreviewResponse,
FetchError,
HttpTypes.AdminClaimUpdateOutboundShipping
HttpTypes.AdminClaimUpdateOutboundShipping & { actionId: string }
>
) => {
return useMutation({
Expand Down Expand Up @@ -567,7 +567,7 @@ export const useClaimConfirmRequest = (
export const useCancelClaimRequest = (
id: string,
orderId: string,
options?: UseMutationOptions<HttpTypes.AdminClaimResponse, FetchError>
options?: UseMutationOptions<HttpTypes.AdminClaimDeleteResponse, FetchError>
) => {
return useMutation({
mutationFn: () => sdk.admin.claim.cancelRequest(id),
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/api/customer-groups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
useMutation,
useQuery,
} from "@tanstack/react-query"
import { fetchQuery, sdk } from "../../lib/client"
import { fetchQuery } from "../../lib/client"
import { queryClient } from "../../lib/query-client"
import { queryKeysFactory } from "../../lib/query-key-factory"
import { customersQueryKeys } from "./customers"
Expand Down
22 changes: 11 additions & 11 deletions src/hooks/api/exchanges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const useExchanges = (
query?: HttpTypes.AdminExchangeListParams,
options?: Omit<
UseQueryOptions<
HttpTypes.AdminExchangeListParams,
HttpTypes.AdminExchangeListResponse,
FetchError,
HttpTypes.AdminExchangeListResponse,
QueryKey
Expand Down Expand Up @@ -122,7 +122,7 @@ export const useAddExchangeInboundItems = (
id: string,
orderId: string,
options?: UseMutationOptions<
HttpTypes.AdminExchangeResponse,
HttpTypes.AdminExchangeReturnResponse,
FetchError,
HttpTypes.AdminAddExchangeInboundItems
>
Expand All @@ -144,7 +144,7 @@ export const useUpdateExchangeInboundItem = (
id: string,
orderId: string,
options?: UseMutationOptions<
HttpTypes.AdminExchangeResponse,
HttpTypes.AdminExchangeReturnResponse,
FetchError,
HttpTypes.AdminUpdateExchangeInboundItem & { actionId: string }
>
Expand All @@ -170,7 +170,7 @@ export const useRemoveExchangeInboundItem = (
id: string,
orderId: string,
options?: UseMutationOptions<
HttpTypes.AdminExchangeResponse,
HttpTypes.AdminExchangeReturnResponse,
FetchError,
string
>
Expand Down Expand Up @@ -201,7 +201,7 @@ export const useAddExchangeInboundShipping = (
id: string,
orderId: string,
options?: UseMutationOptions<
HttpTypes.AdminExchangeResponse,
HttpTypes.AdminExchangeReturnResponse,
FetchError,
HttpTypes.AdminExchangeAddInboundShipping
>
Expand All @@ -223,9 +223,9 @@ export const useUpdateExchangeInboundShipping = (
id: string,
orderId: string,
options?: UseMutationOptions<
HttpTypes.AdminExchangeResponse,
HttpTypes.AdminExchangeReturnResponse,
FetchError,
HttpTypes.AdminExchangeUpdateInboundShipping
HttpTypes.AdminExchangeUpdateInboundShipping & { actionId: string }
>
) => {
return useMutation({
Expand All @@ -248,7 +248,7 @@ export const useDeleteExchangeInboundShipping = (
id: string,
orderId: string,
options?: UseMutationOptions<
HttpTypes.AdminExchangeResponse,
HttpTypes.AdminExchangeReturnResponse,
FetchError,
string
>
Expand Down Expand Up @@ -368,9 +368,9 @@ export const useUpdateExchangeOutboundShipping = (
id: string,
orderId: string,
options?: UseMutationOptions<
HttpTypes.AdminExchangeResponse,
HttpTypes.AdminExchangePreviewResponse,
FetchError,
HttpTypes.AdminExchangeUpdateOutboundShipping
HttpTypes.AdminExchangeUpdateOutboundShipping & { actionId: string }
>
) => {
return useMutation({
Expand Down Expand Up @@ -449,7 +449,7 @@ export const useExchangeConfirmRequest = (
export const useCancelExchangeRequest = (
id: string,
orderId: string,
options?: UseMutationOptions<HttpTypes.AdminExchangeResponse, FetchError>
options?: UseMutationOptions<HttpTypes.AdminExchangeDeleteResponse, FetchError>
) => {
return useMutation({
mutationFn: () => sdk.admin.exchange.cancelRequest(id),
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/api/order-edits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { inventoryItemsQueryKeys } from "./inventory.tsx"
export const useCreateOrderEdit = (
orderId: string,
options?: UseMutationOptions<
HttpTypes.AdminOrderEditPreviewResponse,
HttpTypes.AdminOrderEditResponse,
FetchError,
HttpTypes.AdminInitiateOrderEditRequest
>
Expand Down Expand Up @@ -131,7 +131,7 @@ export const useCancelOrderEdit = (
})

queryClient.invalidateQueries({
queryKey: ordersQueryKeys.lineItems(id),
queryKey: ordersQueryKeys.lineItems(orderId),
})
options?.onSuccess?.(data, variables, context)
},
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/api/price-preferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ export const useUpsertPricePreference = (
>
) => {
return useMutation({
mutationFn: (payload) => {
mutationFn: (payload: HttpTypes.AdminUpdatePricePreference | HttpTypes.AdminCreatePricePreference) => {
if (id) {
return sdk.admin.pricePreference.update(id, payload, query)
return sdk.admin.pricePreference.update(id, payload as HttpTypes.AdminUpdatePricePreference, query)
}
return sdk.admin.pricePreference.create(payload, query)
return sdk.admin.pricePreference.create(payload as HttpTypes.AdminCreatePricePreference, query)
},
onSuccess: (data, variables, context) => {
queryClient.invalidateQueries({
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/api/reservations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useQuery,
} from "@tanstack/react-query"
import { HttpTypes } from "@medusajs/types"
import { fetchQuery, sdk } from "../../lib/client"
import { fetchQuery } from "../../lib/client"
import { queryClient } from "../../lib/query-client"
import { queryKeysFactory } from "../../lib/query-key-factory"
import {
Expand Down
17 changes: 10 additions & 7 deletions src/hooks/api/shipping-profiles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,17 @@ export const useShippingProfile = (
...options,
})

const shipping_profile = data?.shipping_profile
? {
...data.shipping_profile,
name: data.shipping_profile.name?.includes(":")
? data.shipping_profile.name.split(":")[1]
: data.shipping_profile.name,
}
: undefined

return {
...data,
shipping_profile: {
...data?.shipping_profile,
name: data?.shipping_profile.name.includes(":")
? data?.shipping_profile.name.split(":")[1]
: data?.shipping_profile.name,
},
shipping_profile,
...rest,
}
}
Expand Down
Loading