Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ const SubmissionFormCOR = (props: {
typeof updatedLoaderParams.rotation_angles === "string" ||
!updatedLoaderParams.rotation_angles ||
!updatedLoaderParams.rotation_angles.data_path ||
updatedLoaderParams.rotation_angles.data_path.trim() === "" ||
updatedLoaderParams.rotation_angles.data_path === "auto"
updatedLoaderParams.rotation_angles.data_path.trim() === ""
) {
updatedLoaderParams.rotation_angles = { data_path: null };
}
Expand All @@ -149,8 +148,7 @@ const SubmissionFormCOR = (props: {
delete updatedLoaderParams.image_key_path;
} else if (
!updatedLoaderParams.image_key_path ||
updatedLoaderParams.image_key_path.trim() === "" ||
updatedLoaderParams.image_key_path === "auto"
updatedLoaderParams.image_key_path.trim() === ""
) {
updatedLoaderParams.image_key_path = null;
}
Expand Down Expand Up @@ -220,6 +218,10 @@ const SubmissionFormCOR = (props: {
return; // Stop submission
}

if (errorMessages.length > 0) {
setErrorMessages([]);
}

// Build final submission payload (config as string)
const finalParams = {
...validationObject,
Expand Down Expand Up @@ -287,13 +289,6 @@ const SubmissionFormCOR = (props: {
/>
)}

{!isContextValid() && (
<Alert severity="info">
Some Loader fields are empty. They will be auto-filled with default
values during submission.
</Alert>
)}

<Divider />

<Typography variant="h6">Parameter Sweep Configuration</Typography>
Expand Down
11 changes: 3 additions & 8 deletions frontend/src/contexts/LoaderContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,13 @@ export const LoaderProvider: React.FC<{ children: ReactNode }> = ({

// Add this function to validate the loader context
const isContextValid = (): boolean => {
// Replace 'auto' with null for validation
const hasDataPath =
parameters.data_path !== null &&
parameters.data_path.trim() !== "" &&
parameters.data_path !== "auto";
parameters.data_path !== null && parameters.data_path.trim() !== "";

const hasRotationAnglesPath =
typeof parameters.rotation_angles === "object" &&
parameters.rotation_angles?.data_path &&
parameters.rotation_angles.data_path.trim() !== "" &&
parameters.rotation_angles.data_path !== "auto";
parameters.rotation_angles.data_path.trim() !== "";

const hasUserDefinedAngles =
typeof parameters.rotation_angles === "object" &&
Expand All @@ -189,8 +185,7 @@ export const LoaderProvider: React.FC<{ children: ReactNode }> = ({
const hasImageKeyPath =
parameters.image_key_path !== undefined &&
parameters.image_key_path !== null &&
parameters.image_key_path.trim() !== "" &&
parameters.image_key_path !== "auto";
parameters.image_key_path.trim() !== "";

const hasDarks =
parameters.darks !== undefined &&
Expand Down