This commit is contained in:
Nicolas Mowen 2025-10-22 14:34:33 -06:00
parent 7f093d81a9
commit f3b1769dd8
2 changed files with 5 additions and 11 deletions

View File

@ -19,14 +19,12 @@ import { isDesktop } from "react-device-detect";
const OBJECT_STEPS = [
"wizard.steps.nameAndDefine",
"wizard.steps.chooseExamples",
"wizard.steps.train",
];
const STATE_STEPS = [
"wizard.steps.nameAndDefine",
"wizard.steps.stateArea",
"wizard.steps.chooseExamples",
"wizard.steps.train",
];
type ClassificationModelWizardDialogProps = {
@ -116,10 +114,6 @@ export default function ClassificationModelWizardDialog({
dispatch({ type: "SET_STEP_2", payload: data });
};
const handleStep3Next = (data: Step3FormData) => {
dispatch({ type: "SET_STEP_3", payload: data });
};
const handleBack = () => {
dispatch({ type: "PREVIOUS_STEP" });
};
@ -185,7 +179,7 @@ export default function ClassificationModelWizardDialog({
step1Data={wizardState.step1Data}
step2Data={wizardState.step2Data}
initialData={wizardState.step3Data}
onNext={handleStep3Next}
onClose={onClose}
onBack={handleBack}
/>
)}

View File

@ -25,7 +25,7 @@ type Step3ChooseExamplesProps = {
step1Data: Step1FormData;
step2Data?: Step2FormData;
initialData?: Partial<Step3FormData>;
onNext: (data: Step3FormData) => void;
onClose: () => void;
onBack: () => void;
};
@ -33,7 +33,7 @@ export default function Step3ChooseExamples({
step1Data,
step2Data,
initialData,
onNext,
onClose,
onBack,
}: Step3ChooseExamplesProps) {
const { t } = useTranslation(["views/classificationModel"]);
@ -202,7 +202,7 @@ export default function Step3ChooseExamples({
await axios.post(`/classification/${step1Data.modelName}/train`);
toast.success(t("wizard.step3.trainingStarted"));
onNext({ examplesGenerated: true, imageClassifications });
onClose();
} catch (error) {
const axiosError = error as {
response?: { data?: { message?: string; detail?: string } };
@ -218,7 +218,7 @@ export default function Step3ChooseExamples({
t("wizard.step3.errors.classifyFailed", { error: errorMessage }),
);
}
}, [onNext, imageClassifications, step1Data, step2Data, t]);
}, [onClose, imageClassifications, step1Data, step2Data, t]);
const allImagesClassified = useMemo(() => {
if (!unknownImages || unknownImages.length === 0) return false;