Skip to content

Commit

Permalink
Remove decimal support
Browse files Browse the repository at this point in the history
  • Loading branch information
jmealo committed Nov 29, 2024
1 parent fb96bc8 commit 61b0d0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/common/components/configurationForm/totalMemoryInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const TotalMemoryInput = ({ tooltip }) => {
required="required"
min={1}
max={MAX_NUMERIC_VALUE}
step="any"
pattern="[0-9]+([.][0-9]+)?"
step={1}
pattern="[0-9]{1,6}"
placeholder="Memory size (RAM, required)"
/>
<Field
Expand Down
5 changes: 2 additions & 3 deletions src/common/components/configurationForm/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ export const validationSchema = Yup.object().shape({
.oneOf([SIZE_UNIT_MB, SIZE_UNIT_GB], 'Unsupported unit'),
totalMemory: Yup.number()
.required('Required')
.integer('Must be an integer')
.when('totalMemoryUnit', (totalMemoryUnit, schema) => {
if (totalMemoryUnit === SIZE_UNIT_MB) {
return schema
.min(MIN_MB_MEMORY, `Must be greater than or equal to ${MIN_MB_MEMORY} MB`)
.integer()
return schema.min(MIN_MB_MEMORY, `Must be greater than or equal to ${MIN_MB_MEMORY} MB`)
}
return schema.min(1, 'Must be greater than zero')
})
Expand Down

0 comments on commit 61b0d0b

Please sign in to comment.