Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix - SubmitInterface #301

Merged
merged 3 commits into from
Sep 5, 2024
Merged
Changes from 1 commit
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
24 changes: 12 additions & 12 deletions frontends/web/src/containers/SubmitInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ const SubmitInterface = (props) => {
props.history.push(
"/login?&src=" +
encodeURIComponent(
`/tasks/${params.taskId}/submit_${state.submission_type}`
)
`/tasks/${params.taskId}/submit_${state.submission_type}`,
),
);
}

setState((prevState) => ({ ...prevState, taskId: params.taskId }));
!setSendCallDatasets && params.taskId && handleGetTask(params.taskId);
!sendCallDatasets && params.taskId && handleGetTask(params.taskId);
};

fetchData();
Expand Down Expand Up @@ -121,7 +121,7 @@ const SubmitInterface = (props) => {
return false;
}
const answer = await get(
`/task/allow_update_dynalab_submissions/${task_id}/${user_id}`
`/task/allow_update_dynalab_submissions/${task_id}/${user_id}`,
);
if (answer) {
return true;
Expand Down Expand Up @@ -154,7 +154,7 @@ const SubmitInterface = (props) => {

const handleSubmit = async (
values,
{ setFieldValue, setSubmitting, resetForm, setFieldError }
{ setFieldValue, setSubmitting, resetForm, setFieldError },
) => {
const files = {};
for (const dataset of state.datasets) {
Expand All @@ -166,7 +166,7 @@ const SubmitInterface = (props) => {
const result = await context.api.uploadPredictions(
state.task.id,
values.modelName,
files
files,
);
values.modelName = "";
for (const [fname, _] of Object.entries(files)) {
Expand All @@ -179,7 +179,7 @@ const SubmitInterface = (props) => {
console.log(error);
setFieldError(
"accept",
"Predictions could not be added (" + error.error + ")"
"Predictions could not be added (" + error.error + ")",
);
setSubmitting(false);
}
Expand All @@ -188,8 +188,8 @@ const SubmitInterface = (props) => {
props.history.push(
"/login?&src=" +
encodeURIComponent(
`/tasks/${props.match.params.taskId}/submit_${state.submission_type}`
)
`/tasks/${props.match.params.taskId}/submit_${state.submission_type}`,
),
);
} else {
context.api.uploadTrainFiles(state.task.id, values.modelName, files);
Expand All @@ -201,7 +201,7 @@ const SubmitInterface = (props) => {
setSubmitting(false);
setFieldError(
"accept",
"Thank you. You will soon receive an email about the status of your submission."
"Thank you. You will soon receive an email about the status of your submission.",
);
}
}
Expand Down Expand Up @@ -298,7 +298,7 @@ const SubmitInterface = (props) => {
...prevState,
showModals: state.showModals.map(
(obj, obj_index) =>
index === obj_index ? !obj : obj
index === obj_index ? !obj : obj,
),
}))
}
Expand Down Expand Up @@ -333,7 +333,7 @@ const SubmitInterface = (props) => {
...prevState,
showModals: state.showModals.map(
(obj, obj_index) =>
index === obj_index ? !obj : obj
index === obj_index ? !obj : obj,
),
}))
}
Expand Down
Loading