Skip to content

Commit

Permalink
Merge pull request #618 from AI4Bharat/SN-780
Browse files Browse the repository at this point in the history
disable autosave for managers
  • Loading branch information
aparna-aa authored Jul 19, 2023
2 parents bae1f13 + cea7ccc commit e7053de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ui/pages/container/Label-Studio/LSF.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ const filterAnnotations = (
}
} else if([4, 5, 6].includes(user.role)) {
filteredAnnotations = annotations.filter((a) => a.annotation_type === 1);
disable = true;
setDisableBtns(true);
disableSkip = true;
}
return [filteredAnnotations, disable, disableSkip];
};
Expand Down Expand Up @@ -321,7 +324,8 @@ const LabelStudioWrapper = ({
];
}

if(disableLSFControls) setAutoSave(false);
if(disableLSFControls || !taskData?.annotation_users?.some(
(user) => user === userData.id)) setAutoSave(false);

if (rootRef.current) {
if (lsfRef.current) {
Expand Down
2 changes: 2 additions & 0 deletions src/ui/pages/container/Label-Studio/ReviewLSF.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ const filterAnnotations = (
}
} else if([4, 5, 6].includes(user.role)) {
filteredAnnotations = annotations.filter((a) => a.annotation_type === 2);
disable = true;
setDisableBtns(true);
disableSkip = true;
}
return [filteredAnnotations, disable, disableSkip];
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 @@ -225,6 +225,7 @@ const LabelStudioWrapper = ({
let interfaces = [];
if (predictions == null) predictions = [];
const [filteredAnnotations, disableSkip] = filterAnnotations(annotations, userData, taskData);
if(disableSkip) setAutoSave(false);

if (taskData.task_status === "freezed") {
interfaces = [
Expand Down

0 comments on commit e7053de

Please sign in to comment.