Skip to content

Commit

Permalink
fix: RHOAIENG-14037 - added another line of helper text and removed '…
Browse files Browse the repository at this point in the history
…Mi' option

Signed-off-by: Olga Lavtar <[email protected]>
  • Loading branch information
olavtar committed Oct 9, 2024
1 parent c8d7822 commit ef66506
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { HelperText, HelperTextItem, StackItem } from '@patternfly/react-core';
import PVSizeField from '~/pages/projects/components/PVSizeField';
import { MEMORY_UNITS_FOR_SELECTION } from '~/utilities/valueUnits';

type NIMPVCSizeSectionProps = {
pvcSize: string;
Expand All @@ -14,12 +15,16 @@ const NIMPVCSizeSection: React.FC<NIMPVCSizeSectionProps> = ({ pvcSize, setPvcSi
size={pvcSize}
setSize={(value: string) => setPvcSize(value)}
label="NVIDIA NIM storage size"
options={MEMORY_UNITS_FOR_SELECTION.filter((option) => option.unit !== 'Mi')} // Filtering out 'Mi'
/>
<HelperText>
<HelperTextItem>
Specify the size of the cluster storage instance that will be created to store the
downloaded NVIDIA NIM.
</HelperTextItem>
<HelperTextItem>
Make sure your storage size is greater than the NIM size specified by NVIDIA.
</HelperTextItem>
</HelperText>
</StackItem>
);
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/pages/projects/components/PVSizeField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { FormGroup, FormHelperText, HelperText, HelperTextItem } from '@patternfly/react-core';
import { ExclamationTriangleIcon } from '@patternfly/react-icons';
import ValueUnitField from '~/components/ValueUnitField';
import { MEMORY_UNITS_FOR_SELECTION } from '~/utilities/valueUnits';
import { MEMORY_UNITS_FOR_SELECTION, UnitOption } from '~/utilities/valueUnits';

type PVSizeFieldProps = {
fieldID: string;
Expand All @@ -11,6 +11,7 @@ type PVSizeFieldProps = {
setSize: (size: string) => void;
currentSize?: string;
label?: string;
options?: UnitOption[];
};

const PVSizeField: React.FC<PVSizeFieldProps> = ({
Expand All @@ -20,6 +21,7 @@ const PVSizeField: React.FC<PVSizeFieldProps> = ({
setSize,
currentSize,
label = 'Persistent storage size',
options = MEMORY_UNITS_FOR_SELECTION,
}) => (
<FormGroup label={label} fieldId={fieldID} data-testid={fieldID}>
<ValueUnitField
Expand All @@ -28,7 +30,7 @@ const PVSizeField: React.FC<PVSizeFieldProps> = ({
menuAppendTo={menuAppendTo}
onChange={(value) => setSize(value)}
validated={currentSize ? 'warning' : 'default'}
options={MEMORY_UNITS_FOR_SELECTION}
options={options}
value={size}
/>
{currentSize && (
Expand Down

0 comments on commit ef66506

Please sign in to comment.