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

feat(dashboard): 3.0 product collection #6120

Merged
merged 9 commits into from
Jan 18, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/metal-turtles-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/ui": patch
---

fix(ui): Fix broken responsive style of Drawer between `sm` and `md`.
2 changes: 2 additions & 0 deletions packages/admin-next/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"package.json"
],
"dependencies": {
"@headlessui/react": "^1.7.18",
"@headlessui/tailwindcss": "^0.2.0",
"@hookform/resolvers": "3.3.2",
"@medusajs/icons": "workspace:^",
"@medusajs/ui": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,16 @@
}
},
"collections": {
"domain": "Collections"
"domain": "Collections",
"createCollection": "Create Collection",
"createCollectionHint": "Create a new collection to organize your products.",
"editCollection": "Edit Collection",
"handleTooltip": "The handle is used to reference the collection in your storefront. If not specified, the handle will be generated from the collection title.",
"deleteWarning_one": "You are about to delete {{count}} collection. This action cannot be undone.",
"deleteWarning_other": "You are about to delete {{count}} collections. This action cannot be undone.",
"removeSingleProductWarning": "You are about to remove the product {{title}} from the collection. This action cannot be undone.",
"removeProductsWarning_one": "You are about to remove {{count}} product from the collection. This action cannot be undone.",
"removeProductsWarning_other": "You are about to remove {{count}} products from the collection. This action cannot be undone."
},
"categories": {
"domain": "Categories"
Expand All @@ -78,7 +87,8 @@
"changePasswordPromptDescription": "You are about to change the password for {{email}}. Make sure that you have communicated the new password to the customer before proceeding.",
"guest": "Guest",
"registered": "Registered",
"firstSeen": "First seen"
"firstSeen": "First seen",
"viewOrder": "View order"
},
"customerGroups": {
"domain": "Customer Groups",
Expand Down Expand Up @@ -138,10 +148,13 @@
"regions": {
"domain": "Regions",
"createRegion": "Create Region",
"createRegionHint": "Manage tax rates and providers for a set of countries.",
"editRegion": "Edit Region",
"deleteRegionWarning": "You are about to delete the region {{name}}. This action cannot be undone.",
"taxInclusiveHint": "When enabled all prices in the region will be tax inclusive.",
"providersHint": "The providers that are available in the region."
"providersHint": "The providers that are available in the region.",
"shippingOptions": "Shipping Options",
"returnShippingOptions": "Return Shipping Options"
},
"locations": {
"domain": "Locations",
Expand All @@ -150,7 +163,9 @@
"addSalesChannels": "Add sales channels",
"detailsHint": "Specify the details of the location.",
"noLocationsFound": "No locations found",
"deleteLocationWarning": "You are about to delete the location {{name}}. This action cannot be undone."
"deleteLocationWarning": "You are about to delete the location {{name}}. This action cannot be undone.",
"removeSalesChannelsWarning_one": "You are about to remove {{count}} sales channel from the location.",
"removeSalesChannelsWarning_other": "You are about to remove {{count}} sales channels from the location."
},
"salesChannels": {
"domain": "Sales Channels",
Expand Down Expand Up @@ -215,6 +230,7 @@
"phone": "Phone",
"metadata": "Metadata",
"selectCountry": "Select country",
"products": "Products",
"variants": "Variants",
"orders": "Orders",
"account": "Account",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { DropdownMenu, IconButton } from "@medusajs/ui"
import { ReactNode } from "react"
import { Link } from "react-router-dom"

type TableRowAction = {
type Action = {
icon: ReactNode
label: string
} & (
Expand All @@ -17,15 +17,15 @@ type TableRowAction = {
}
)

type TableRowActionGroup = {
actions: TableRowAction[]
type ActionGroup = {
actions: Action[]
}

type TableRowActionsProps = {
groups: TableRowActionGroup[]
type ActionMenuProps = {
groups: ActionGroup[]
}

export const TableRowActions = ({ groups }: TableRowActionsProps) => {
export const ActionMenu = ({ groups }: ActionMenuProps) => {
return (
<DropdownMenu>
<DropdownMenu.Trigger asChild>
Expand All @@ -42,7 +42,7 @@ export const TableRowActions = ({ groups }: TableRowActionsProps) => {
const isLast = index === groups.length - 1

return (
<div className="flex flex-col gap-y-1">
<DropdownMenu.Group key={index}>
{group.actions.map((action, index) => {
if (action.onClick) {
return (
Expand All @@ -61,21 +61,18 @@ export const TableRowActions = ({ groups }: TableRowActionsProps) => {
}

return (
<Link to={action.to} key={index}>
<DropdownMenu.Item
onClick={(e) => {
e.stopPropagation()
}}
className="[&_svg]:text-ui-fg-subtle flex items-center gap-x-2"
>
{action.icon}
<span>{action.label}</span>
</DropdownMenu.Item>
</Link>
<div key={index}>
<Link to={action.to} onClick={(e) => e.stopPropagation()}>
<DropdownMenu.Item className="[&_svg]:text-ui-fg-subtle flex items-center gap-x-2">
{action.icon}
<span>{action.label}</span>
</DropdownMenu.Item>
</Link>
</div>
)
})}
{!isLast && <DropdownMenu.Separator />}
</div>
</DropdownMenu.Group>
)
})}
</DropdownMenu.Content>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./action-menu"
Loading