feat(medusa,dashboard): Tax settings pages and fixes to list tax rates endpoint (#6606)

**What**
- Adds pages for managing tax settings and tax rates for regions.
- Fixes `list` tax rates endpoint, which was missing pagination, search, order, and filters.

**Note**
The fix to the tax rate list endpoint is very rough, as I have had to reimplement most of the logic from our transformQuery middleware. This is because this endpoints does not follow normal convention for fields and expand and uses string arrays instead of strings separated by commas. Our middleware does not support this, and changing the endpoint to align with other endpoints on the expand and fields params would be a breaking change. Since this is very temporary until 2.0 I think it's okay for the time being.

CLOSES CORE-1654
This commit is contained in:
Kasper Fabricius Kristensen
2024-03-09 14:19:29 +01:00
committed by GitHub
parent 7109969874
commit c2d56ca12b
88 changed files with 3659 additions and 489 deletions

View File

@@ -0,0 +1 @@
export * from "./percentage-input"

View File

@@ -0,0 +1,32 @@
import { Input, Text } from "@medusajs/ui"
import { ComponentProps, ElementRef, forwardRef } from "react"
export const PercentageInput = forwardRef<
ElementRef<typeof Input>,
Omit<ComponentProps<typeof Input>, "type">
>(({ min = 0, max = 100, step = 0.0001, ...props }, ref) => {
return (
<div className="relative">
<div className="absolute inset-y-0 left-0 z-10 flex w-8 items-center justify-center border-r">
<Text
className="text-ui-fg-muted"
size="small"
leading="compact"
weight="plus"
>
%
</Text>
</div>
<Input
ref={ref}
type="number"
min={min}
max={max}
step={step}
{...props}
className="pl-10"
/>
</div>
)
})
PercentageInput.displayName = "HandleInput"