Skip to content

Commit

Permalink
fix: RHOAIENG-13937 - set the max number of accelerators to 999 (open…
Browse files Browse the repository at this point in the history
…datahub-io#3322)

Signed-off-by: Olga Lavtar <[email protected]>
  • Loading branch information
olavtar authored Oct 11, 2024
1 parent dd41ed9 commit 6ec1b1b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import {
Alert,
AlertVariant,
FormGroup,
Icon,
InputGroup,
Label,
NumberInput,
Popover,
Split,
SplitItem,
Stack,
StackItem,
Popover,
Icon,
} from '@patternfly/react-core';
import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons';
import { isHTMLInputElement } from '~/utilities/utils';
Expand Down Expand Up @@ -243,12 +243,13 @@ const AcceleratorProfileSelectField: React.FC<AcceleratorProfileSelectFieldProps
value={selectedAcceleratorProfile.count}
validated={acceleratorCountWarning ? 'warning' : 'default'}
min={1}
max={999}
onPlus={() => onStep(1)}
onMinus={() => onStep(-1)}
onChange={(event) => {
if (isHTMLInputElement(event.target)) {
const newSize = Number(event.target.value);
setSelectedAcceleratorProfile('count', Math.max(newSize, 1));
setSelectedAcceleratorProfile('count', Math.max(Math.min(newSize, 999), 1));
}
}}
/>
Expand Down

0 comments on commit 6ec1b1b

Please sign in to comment.