fix(dashboard): tax regions UI polish (#12437)
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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} />}
|
||||
|
||||
Reference in New Issue
Block a user