From fa43b346f094f4cdc5a84ada56804d44b304e342 Mon Sep 17 00:00:00 2001 From: Olga Lavtar Date: Thu, 10 Oct 2024 09:10:14 -0700 Subject: [PATCH] fix: RHOAIENG-13937 - set the max number of accelerators to 999 Signed-off-by: Olga Lavtar --- .../screens/server/AcceleratorProfileSelectField.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/notebookController/screens/server/AcceleratorProfileSelectField.tsx b/frontend/src/pages/notebookController/screens/server/AcceleratorProfileSelectField.tsx index e4400b2608..453683b1ca 100644 --- a/frontend/src/pages/notebookController/screens/server/AcceleratorProfileSelectField.tsx +++ b/frontend/src/pages/notebookController/screens/server/AcceleratorProfileSelectField.tsx @@ -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'; @@ -243,12 +243,13 @@ const AcceleratorProfileSelectField: React.FC 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)); } }} />