18 - Allow setting allocation value after type change
This commit is contained in:
parent
aca9644c5b
commit
52ec8bb2ac
1 changed files with 4 additions and 4 deletions
|
|
@ -342,17 +342,17 @@ export default function Show({ scenario, buckets, streams = { data: [] }, stream
|
||||||
<div className="mt-2">
|
<div className="mt-2">
|
||||||
<span className="text-sm text-gray-600">
|
<span className="text-sm text-gray-600">
|
||||||
Allocation:{' '}
|
Allocation:{' '}
|
||||||
{bucket.allocation_type === 'fixed_limit' && bucket.allocation_value !== null ? (
|
{bucket.allocation_type === 'fixed_limit' ? (
|
||||||
<InlineEditInput
|
<InlineEditInput
|
||||||
value={centsToDollars(bucket.allocation_value)}
|
value={centsToDollars(bucket.allocation_value ?? 0)}
|
||||||
onSave={(val) => patchBucket(bucket.id, { allocation_value: dollarsToCents(val) })}
|
onSave={(val) => patchBucket(bucket.id, { allocation_value: dollarsToCents(val) })}
|
||||||
formatDisplay={(v) => `$${v.toFixed(2)}`}
|
formatDisplay={(v) => `$${v.toFixed(2)}`}
|
||||||
min={0}
|
min={0}
|
||||||
step="0.01"
|
step="0.01"
|
||||||
/>
|
/>
|
||||||
) : bucket.allocation_type === 'percentage' && bucket.allocation_value !== null ? (
|
) : bucket.allocation_type === 'percentage' ? (
|
||||||
<InlineEditInput
|
<InlineEditInput
|
||||||
value={basisPointsToPercent(bucket.allocation_value)}
|
value={basisPointsToPercent(bucket.allocation_value ?? 0)}
|
||||||
onSave={(val) => patchBucket(bucket.id, { allocation_value: percentToBasisPoints(val) })}
|
onSave={(val) => patchBucket(bucket.id, { allocation_value: percentToBasisPoints(val) })}
|
||||||
formatDisplay={(v) => `${v.toFixed(2)}%`}
|
formatDisplay={(v) => `${v.toFixed(2)}%`}
|
||||||
min={0}
|
min={0}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue