Skip to content

Commit

Permalink
Merge pull request #911 from AI4Bharat/tempBranch1
Browse files Browse the repository at this point in the history
fixed autosave in LSF
  • Loading branch information
ishvindersethi22 authored Feb 9, 2024
2 parents da4c011 + 971c163 commit 8246aa6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/redux/actions/api/LSFAPI/LSFAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const postReview = async (


const patchAnnotation = async (
taskId,
result,
annotationID,
load_time,
Expand All @@ -113,6 +114,7 @@ const patchAnnotation = async (
lead_time: (new Date() - load_time) / 1000 + Number(lead_time ?? 0),
annotation_status: annotation_status,
}),
task_id: taskId,
annotation_notes: notes,
...(autoSave && { auto_save: true }),
});
Expand All @@ -123,6 +125,7 @@ const patchAnnotation = async (
};

const patchReview = async (
taskId,
annotationID,
load_time,
lead_time,
Expand All @@ -137,6 +140,7 @@ const patchReview = async (
lead_time: (new Date() - load_time) / 1000 + Number(lead_time ?? 0),
annotation_status: review_status,
result: result,
task_id: taskId,
review_notes: reviewnotes,
...((review_status === "to_be_revised" ||
review_status === "accepted" ||
Expand All @@ -162,6 +166,7 @@ const patchReview = async (


const patchSuperChecker = async (
taskId,
annotationID,
load_time,
lead_time,
Expand All @@ -176,6 +181,7 @@ const patchSuperChecker = async (
await axiosInstance.patch(`/annotation/${annotationID}/`, {
lead_time: (new Date() - load_time) / 1000 + Number(lead_time ?? 0),
annotation_status: review_status,
task_id: taskId,
result: result,
parent_annotation: parentAnnotation,
supercheck_notes: superchecknotes,
Expand Down
1 change: 1 addition & 0 deletions src/ui/pages/container/Label-Studio/LSF.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@ const LabelStudioWrapper = ({
}
}
patchAnnotation(
taskId,
temp,
annotations[i].id,
load_time.current,
Expand Down
1 change: 1 addition & 0 deletions src/ui/pages/container/Label-Studio/ReviewLSF.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,7 @@ const LabelStudioWrapper = ({
(annotation) => annotation.annotation_type === 2
)[0];
patchReview(
taskId,
review.id,
load_time.current,
review.lead_time,
Expand Down
1 change: 1 addition & 0 deletions src/ui/pages/container/Label-Studio/SuperCheckerLSF.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,7 @@ const LabelStudioWrapper = ({
(value) => value.annotation_type === 3
)[0];
patchSuperChecker(
taskId,
superChecker.id,
load_time.current,
superChecker.lead_time,
Expand Down

0 comments on commit 8246aa6

Please sign in to comment.