Skip to content

Commit

Permalink
fix: RHOAIENG-13937 - set the max number of accelerators to 999
Browse files Browse the repository at this point in the history
Signed-off-by: Olga Lavtar <[email protected]>
  • Loading branch information
olavtar committed Oct 10, 2024
1 parent 65ddbb9 commit fa43b34
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));

Check warning on line 252 in frontend/src/pages/notebookController/screens/server/AcceleratorProfileSelectField.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/pages/notebookController/screens/server/AcceleratorProfileSelectField.tsx#L252

Added line #L252 was not covered by tests
}
}}
/>
Expand Down

0 comments on commit fa43b34

Please sign in to comment.