Skip to content

Commit

Permalink
Merge pull request #2 from perseidesjs/feat/update-to-medusa-v-1-20-10
Browse files Browse the repository at this point in the history
feat: Updated to Medusa UI v1.20.10
  • Loading branch information
adevinwild authored Oct 17, 2024
2 parents ce0195c + a5c04d8 commit 5bd6fc9
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 58 deletions.
48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
"@babel/traverse": "7.22.5",
"@hookform/error-message": "^2.0.1",
"@hookform/resolvers": "^3.3.1",
"@medusajs/icons": "^1.1.0",
"@medusajs/ui": "^2.4.0",
"@medusajs/icons": "^1.2.2",
"@medusajs/medusa": "^1.7.7",
"@medusajs/ui-preset": "^1.1.1",
"@medusajs/ui": "^3.0.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@radix-ui/react-accordion": "^1.0.1",
"@radix-ui/react-avatar": "^1.0.1",
Expand All @@ -32,43 +33,51 @@
"@segment/analytics-next": "^1.51.1",
"@svgr/webpack": "^8.0.1",
"@swc/core": "^1.3.61",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/line-clamp": "^0.3.1",
"@tanstack/react-query": "4.22.0",
"@tanstack/react-table": "^8.7.9",
"autoprefixer": "^10.4.13",
"autoprefixer": "^10.4.19",
"axios": "^1.1.3",
"chokidar": "^3.5.3",
"clsx": "^1.2.1",
"confetti-js": "^0.0.18",
"copy-to-clipboard": "^3.3.1",
"copy-webpack-plugin": "^11.0.0",
"crypto-browserify": "^3.12.0",
"css-loader": "^6.8.1",
"emoji-picker-react": "^4.4.3",
"framer-motion": "^9.1.6",
"html-webpack-plugin": "^5.5.1",
"i18next": "^22.5.0",
"i18next-browser-languagedetector": "^7.0.1",
"i18next-http-backend": "^2.2.1",
"i18next": "^22.5.0",
"immutability-helper": "^3.1.1",
"iso8601-duration": "^1.3.0",
"lodash": "^4.17.21",
"md5": "^2.3.0",
"medusa-react": "^9.0.13",
"medusa-react": "^9.0.18",
"mini-css-extract-plugin": "^2.7.6",
"moment": "^2.29.4",
"path-browserify": "^1.0.1",
"pluralize": "^8.0.0",
"postcss": "^8.4.21",
"postcss-loader": "^7.3.2",
"postcss-preset-env": "^8.4.1",
"postcss": "^8.4.38",
"prism-react-renderer": "^2.0.4",
"process": "^0.11.10",
"query-string": "^8.1.0",
"react": "^18.2.0",
"randomatic": "^3.1.1",
"react-collapsible": "^2.8.3",
"react-country-flag": "^3.0.2",
"react-currency-input-field": "^3.6.8",
"react-datepicker": "^4.8.0",
"react-dev-utils": "^12.0.1",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dnd": "^16.0.1",
"react-dom": "^18.2.0",
"react-helmet-async": "^1.3.0",
"react-helmet": "^6.0.0",
"react-highlight-words": "^0.18.0",
"react-hook-form": "7.38.0",
"react-hot-toast": "2.4.0",
Expand All @@ -81,29 +90,20 @@
"react-router-dom": "6.8.0",
"react-select": "^5.5.4",
"react-table": "^7.7.0",
"react": "^18.2.0",
"stream-browserify": "^3.0.0",
"style-loader": "^3.3.3",
"swc-loader": "^0.2.3",
"swc-minify-webpack-plugin": "^2.1.1",
"tailwindcss": "3.2.2",
"tailwindcss-radix": "^2.7.0",
"tailwindcss": "^3.4.3",
"ts-dedent": "^2.2.0",
"type-fest": "^3.6.0",
"webpack": "^5.84.1",
"uuid": "^8.3.2",
"webpack-dev-server": "4.15.0",
"webpack": "^5.84.1",
"webpackbar": "^5.0.2",
"zod": "^3.22.2",
"@medusajs/medusa": "^1.7.7",
"@tailwindcss/line-clamp": "^0.3.1",
"axios": "^1.1.3",
"confetti-js": "^0.0.18",
"crypto-browserify": "^3.12.0",
"immutability-helper": "^3.1.1",
"iso8601-duration": "^1.3.0",
"lodash": "^4.17.21",
"randomatic": "^3.1.1",
"react-helmet": "^6.0.0",
"stream-browserify": "^3.0.0",
"uuid": "^8.3.2"
"zod": "^3.22.2"
},
"devDependencies": {
"@babel/types": "7.22.5",
Expand Down
54 changes: 28 additions & 26 deletions src/components/molecules/actionables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,34 @@ const Actionables: React.FC<ActionablesProps> = ({
)}
</DropdownMenu.Trigger>

<DropdownMenu.Content
sideOffset={5}
className="bg-grey-0 border-grey-20 rounded-rounded shadow-dropdown p-xsmall z-30 min-w-[200px] border"
>
{actions.map((action, i) => {
return (
<DropdownMenu.Item className="mb-1 last:mb-0" key={i}>
{
<Button
variant="ghost"
size="small"
className={clsx("flex w-full justify-start", {
"text-rose-50": action?.variant === "danger",
"pointer-events-none select-none opacity-50":
action?.disabled,
})}
onClick={action?.onClick}
>
{action.icon}
{action.label}
</Button>
}
</DropdownMenu.Item>
)
})}
</DropdownMenu.Content>
<DropdownMenu.Portal>
<DropdownMenu.Content
sideOffset={5}
className="bg-grey-0 border-grey-20 rounded-rounded shadow-dropdown p-xsmall z-50 min-w-[200px] border"
>
{actions.map((action, i) => {
return (
<DropdownMenu.Item className="mb-1 last:mb-0" key={i}>
{
<Button
variant="ghost"
size="small"
className={clsx("flex w-full justify-start", {
"text-rose-50": action?.variant === "danger",
"pointer-events-none select-none opacity-50":
action?.disabled,
})}
onClick={action?.onClick}
>
{action.icon}
{action.label}
</Button>
}
</DropdownMenu.Item>
)
})}
</DropdownMenu.Content>
</DropdownMenu.Portal>
</DropdownMenu.Root>
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion src/domain/discounts/details/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Edit = () => {

const { discount, isLoading, error } = useAdminDiscount(
id!,
{ expand: "rule,rule.conditions" },
{ expand: "rule,rule.conditions,regions" },
{
enabled: !!id,
}
Expand Down
7 changes: 3 additions & 4 deletions src/domain/orders/details/returns/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {
AdminGetVariantsVariantInventoryRes,
AdminPostOrdersOrderReturnsReq,
InventoryLevelDTO,
LevelWithAvailability,
Order,
LineItem as RawLineItem,
StockLocationDTO,
} from "@medusajs/medusa"
import LayeredModal, {
LayeredModalContext,
Expand Down Expand Up @@ -100,7 +99,7 @@ const ReturnMenu: React.FC<ReturnMenuProps> = ({ order, onDismiss }) => {
}, [order.items])

const [inventoryMap, setInventoryMap] = useState<
Map<string, InventoryLevelDTO[]>
Map<string, LevelWithAvailability[]>
>(new Map())

React.useEffect(() => {
Expand All @@ -122,7 +121,7 @@ const ReturnMenu: React.FC<ReturnMenuProps> = ({ order, onDismiss }) => {
.filter((it) => !!it)
.map((item) => {
const { variant } = item as AdminGetVariantsVariantInventoryRes
return [variant.id, variant.inventory[0].location_levels]
return [variant.id, variant.inventory[0]?.location_levels]
})
)
}
Expand Down
6 changes: 3 additions & 3 deletions src/domain/product-categories/utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ export const getDefaultCategoryValues = (t: TFunction, category?: ProductCategor
),
},
is_active: {
value: category?.is_active ? (category?.is_active ? CategoryStatus.Active : CategoryStatus.Inactive) : CategoryStatus.Active,
value: category?.is_active ? CategoryStatus.Active : CategoryStatus.Inactive,
label: category?.is_active
? t("modals-active", "Public") as string
? t("modals-active", "Active") as string
: t("modals-inactive", "Inactive") as string,
},
is_public: {
value: category?.is_internal ? (category?.is_internal ? CategoryVisibility.Private : CategoryVisibility.Public) : CategoryVisibility.Public,
value: category?.is_internal ? CategoryVisibility.Private : CategoryVisibility.Public,
label: category?.is_internal
? t("modals-private", "Private") as string
: t("modals-public", "Public") as string,
Expand Down

0 comments on commit 5bd6fc9

Please sign in to comment.