diff --git a/apps/forge/src/components/signin/actions/ToolSelectionInput/TrainingSelectionList.tsx b/apps/forge/src/components/signin/actions/ToolSelectionInput/TrainingSelectionList.tsx index 4d83afa..b294fdd 100644 --- a/apps/forge/src/components/signin/actions/ToolSelectionInput/TrainingSelectionList.tsx +++ b/apps/forge/src/components/signin/actions/ToolSelectionInput/TrainingSelectionList.tsx @@ -13,6 +13,7 @@ interface ToolSelectionListProps { title: string; toolTipContent: string; selectable?: boolean; + userHasCompulsoryTraining?: boolean; onTrainingSelect?: (selectedTrainings: Training[]) => void; } @@ -21,6 +22,7 @@ const TrainingSelectionList: React.FC = ({ title, toolTipContent, selectable, + userHasCompulsoryTraining, onTrainingSelect, }) => { const [selectedTrainings, setSelectedTrainings] = useState([]); @@ -69,6 +71,12 @@ const TrainingSelectionList: React.FC = ({ Warning No training available to select. + ) : userHasCompulsoryTraining === true ? ( + + + Warning + Compulsory trainings have not been completed. + ) : ( trainings.map((training) => ( diff --git a/apps/forge/src/components/signin/actions/ToolSelectionInput/index.tsx b/apps/forge/src/components/signin/actions/ToolSelectionInput/index.tsx index a4ffbad..d3c7402 100644 --- a/apps/forge/src/components/signin/actions/ToolSelectionInput/index.tsx +++ b/apps/forge/src/components/signin/actions/ToolSelectionInput/index.tsx @@ -1,3 +1,4 @@ +import { errorDisplay } from "@/components/errors/ErrorDisplay"; import { FlowStepComponent } from "@/components/signin/actions/SignInManager/types.ts"; import { SelectedTrainingPipDisplay } from "@/components/signin/actions/ToolSelectionInput/SelectedTrainingPipDisplay.tsx"; import ToolSelectionList from "@/components/signin/actions/ToolSelectionInput/TrainingSelectionList.tsx"; @@ -13,7 +14,6 @@ import { Loader } from "@ui/components/ui/loader.tsx"; import { ChevronsDownUp, ChevronsUpDown } from "lucide-react"; import { useEffect, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; -import { errorDisplay } from "@/components/errors/ErrorDisplay"; /* three categories of tools that can be selected: @@ -133,6 +133,8 @@ const ToolSelectionInput: FlowStepComponent = ({ onSecondary, onPrimary }) => { } }; + const userHasCompulsoryTraining = trainingMap.DISABLED.some((training) => training.compulsory); + const toolSelectionDisplay = ( <> @@ -149,6 +151,7 @@ const ToolSelectionInput: FlowStepComponent = ({ onSecondary, onPrimary }) => { title="Selectable Training" trainings={trainingMap.SELECTABLE} selectable={true} + userHasRequiredTraining={userHasCompulsoryTraining} onTrainingSelect={handleOnTrainingSelect} toolTipContent="Tools that the user has training for, and reps are trained on the tool" />