fix(dashboard): tax regions UI polish (#12437)

This commit is contained in:
Frane Polić
2025-05-11 16:06:11 +02:00
committed by GitHub
parent fcee6003d8
commit e4d196e522
5 changed files with 39 additions and 31 deletions

View File

@@ -1589,6 +1589,11 @@ export function getRouteMap({
}
},
children: [
{
path: "edit",
lazy: () =>
import("../../routes/tax-regions/tax-region-edit"),
},
{
path: "provinces/create",
lazy: () =>
@@ -1626,11 +1631,6 @@ export function getRouteMap({
},
],
},
{
path: "edit",
lazy: () =>
import("../../routes/tax-regions/tax-region-edit"),
},
{
path: "provinces/:province_id",
lazy: async () => {

View File

@@ -6482,11 +6482,17 @@
"edit": {
"type": "object",
"properties": {
"header": {
"type": "string"
},
"hint": {
"type": "string"
},
"successToast": {
"type": "string"
}
},
"required": ["successToast"],
"required": ["header", "hint", "successToast"],
"additionalProperties": false
},
"province": {

View File

@@ -1724,6 +1724,8 @@
"successToast": "The tax region was successfully created."
},
"edit": {
"header": "Edit Tax Region",
"hint": "Edit the tax region details.",
"successToast": "The tax region was successfully updated."
},
"province": {

View File

@@ -129,6 +129,29 @@ export const TaxRegionCreateForm = ({ parentId }: TaxRegionCreateFormProps) => {
)
}}
/>
<Form.Field
control={form.control}
name="provider_id"
render={({ field }) => (
<Form.Item>
<Form.Label>
{t("taxRegions.fields.taxProvider")}
</Form.Label>
<Form.Control>
<Combobox
{...field}
options={taxProviders.options}
searchValue={taxProviders.searchValue}
onSearchValueChange={
taxProviders.onSearchValueChange
}
fetchNextPage={taxProviders.fetchNextPage}
/>
</Form.Control>
<Form.ErrorMessage />
</Form.Item>
)}
/>
</div>
</div>
<div className="flex flex-col gap-4">
@@ -209,29 +232,6 @@ export const TaxRegionCreateForm = ({ parentId }: TaxRegionCreateFormProps) => {
)
}}
/>
<Form.Field
control={form.control}
name="provider_id"
render={({ field }) => (
<Form.Item>
<Form.Label>
{t("taxRegions.fields.taxProvider")}
</Form.Label>
<Form.Control>
<Combobox
{...field}
options={taxProviders.options}
searchValue={taxProviders.searchValue}
onSearchValueChange={
taxProviders.onSearchValueChange
}
fetchNextPage={taxProviders.fetchNextPage}
/>
</Form.Control>
<Form.ErrorMessage />
</Form.Item>
)}
/>
</div>
</div>
</div>

View File

@@ -21,10 +21,10 @@ export const TaxRegionEdit = () => {
<RouteDrawer>
<RouteDrawer.Header>
<RouteDrawer.Title asChild>
<Heading>{t("taxRegions.taxRates.edit.header")}</Heading>
<Heading>{t("taxRegions.edit.header")}</Heading>
</RouteDrawer.Title>
<RouteDrawer.Description className="sr-only">
{t("taxRegions.taxRates.edit.hint")}
{t("taxRegions.edit.hint")}
</RouteDrawer.Description>
</RouteDrawer.Header>
{ready && <TaxRegionEditForm taxRegion={tax_region} />}