diff --git a/public/locales/en.json b/public/locales/en.json index dd5c315b..e24cb086 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -90,6 +90,9 @@ "menuDownload": "Download", "menuCopy": "Copy to clipboard" }, + "ComponentsSelection": { + "chooseVersion": "Please select version" + }, "IllustratedBanner": { "titleMessage": "No Managed Control Planes found", "subtitleMessage": "Get started by creating your first Managed Control Plane.", diff --git a/src/components/ComponentsSelection/ComponentsSelection.tsx b/src/components/ComponentsSelection/ComponentsSelection.tsx index 602602e3..b08fbbec 100644 --- a/src/components/ComponentsSelection/ComponentsSelection.tsx +++ b/src/components/ComponentsSelection/ComponentsSelection.tsx @@ -22,13 +22,19 @@ import { Infobox } from '../Ui/Infobox/Infobox.tsx'; import { useTranslation } from 'react-i18next'; import { ComponentsListItem } from '../../lib/api/types/crate/createManagedControlPlane.ts'; import { getSelectedComponents } from './ComponentsSelectionContainer.tsx'; +import IllustratedError from '../Shared/IllustratedError.tsx'; export interface ComponentsSelectionProps { componentsList: ComponentsListItem[]; setComponentsList: (components: ComponentsListItem[]) => void; + templateDefaultsError?: string; } -export const ComponentsSelection: React.FC = ({ componentsList, setComponentsList }) => { +export const ComponentsSelection: React.FC = ({ + componentsList, + setComponentsList, + templateDefaultsError, +}) => { const [searchTerm, setSearchTerm] = useState(''); const { t } = useTranslation(); @@ -132,8 +138,19 @@ export const ComponentsSelection: React.FC = ({ compon value={component.selectedVersion} disabled={!component.isSelected || providerDisabled} aria-label={`${component.name} version`} + valueState={component.isSelected && !component.selectedVersion ? 'Negative' : 'None'} + valueStateMessage={ + component.isSelected && !component.selectedVersion ? ( + {t('ComponentsSelection.chooseVersion')} + ) : undefined + } onChange={handleVersionChange} > + {!component.selectedVersion && ( + + )} {component.versions.map((version) => (