fix(dashboard): zero in float currency inputs (#13267)

CLOSES AI-38
This commit is contained in:
Frane Polić
2025-08-21 11:07:10 +00:00
committed by GitHub
parent 492e018957
commit 319a941d99
6 changed files with 21 additions and 16 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@medusajs/dashboard": patch
---
fix(dashboard): zero in float currency inputs
@@ -295,8 +295,8 @@ export const OrderBalanceSettlementForm = ({
value={field.value.value} value={field.value.value}
onValueChange={(_value, _name, values) => onValueChange={(_value, _name, values) =>
onChange({ onChange({
value: values?.value, value: values?.value ?? "",
float: values?.float || null, float: values?.float ?? null,
}) })
} }
autoFocus autoFocus
@@ -353,8 +353,8 @@ export const OrderBalanceSettlementForm = ({
value={field.value.value} value={field.value.value}
onValueChange={(_value, _name, values) => { onValueChange={(_value, _name, values) => {
onChange({ onChange({
value: values?.value, value: values?.value ?? "",
float: values?.float || null, float: values?.float ?? null,
}) })
}} }}
autoFocus autoFocus
@@ -916,8 +916,8 @@ export const ClaimCreateForm = ({
code={order.currency_code} code={order.currency_code}
onValueChange={(value, _name, values) => { onValueChange={(value, _name, values) => {
setCustomInboundShippingAmount({ setCustomInboundShippingAmount({
value: values?.value || "", value: values?.value ?? "",
float: values?.float || null, float: values?.float ?? null,
}) })
}} }}
value={customInboundShippingAmount.value} value={customInboundShippingAmount.value}
@@ -989,8 +989,8 @@ export const ClaimCreateForm = ({
code={order.currency_code} code={order.currency_code}
onValueChange={(value, _name, values) => { onValueChange={(value, _name, values) => {
setCustomOutboundShippingAmount({ setCustomOutboundShippingAmount({
value: values?.value || "", value: values?.value ?? "",
float: values?.float || null, float: values?.float ?? null,
}) })
}} }}
value={customOutboundShippingAmount.value} value={customOutboundShippingAmount.value}
@@ -397,8 +397,8 @@ export const ExchangeCreateForm = ({
code={order.currency_code} code={order.currency_code}
onValueChange={(value, name, values) => onValueChange={(value, name, values) =>
setCustomInboundShippingAmount({ setCustomInboundShippingAmount({
value: values?.value || "", value: values?.value ?? "",
float: values?.float || null, float: values?.float ?? null,
}) })
} }
value={customInboundShippingAmount.value} value={customInboundShippingAmount.value}
@@ -470,8 +470,8 @@ export const ExchangeCreateForm = ({
code={order.currency_code} code={order.currency_code}
onValueChange={(value, name, values) => onValueChange={(value, name, values) =>
setCustomOutboundShippingAmount({ setCustomOutboundShippingAmount({
value: values?.value || "", value: values?.value ?? "",
float: values?.float || null, float: values?.float ?? null,
}) })
} }
value={customOutboundShippingAmount.value} value={customOutboundShippingAmount.value}
@@ -191,8 +191,8 @@ export const CreateRefundForm = ({ order }: CreateRefundFormProps) => {
value={field.value.value} value={field.value.value}
onValueChange={(_value, _name, values) => onValueChange={(_value, _name, values) =>
onChange({ onChange({
value: values?.value, value: values?.value ?? "",
float: values?.float || null, float: values?.float ?? null,
}) })
} }
autoFocus autoFocus
@@ -689,8 +689,8 @@ export const ReturnCreateForm = ({
code={order.currency_code} code={order.currency_code}
onValueChange={(value, name, values) => onValueChange={(value, name, values) =>
setCustomShippingAmount({ setCustomShippingAmount({
value: values?.value || "", value: values?.value ?? "",
float: values?.float || null, float: values?.float ?? null,
}) })
} }
value={customShippingAmount.value} value={customShippingAmount.value}