Skip to content

Commit

Permalink
fix: LEAP-856: Prevent submitting empty annotation by hotkeys (#5663)
Browse files Browse the repository at this point in the history
* fix: LEAP-856: Prevent submitting empty annotation by hotkeys

* ci: Build frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/8538222335

* fix: LEAP-856: Prevent submitting empty annotation by hotkeys

* ci: Build frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/8538878701

---------

Co-authored-by: robot-ci-heartex <[email protected]>
Co-authored-by: Gondragos <[email protected]>
  • Loading branch information
3 people authored Apr 4, 2024
1 parent f9f103e commit 24f9ebc
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
8 changes: 4 additions & 4 deletions web/dist/apps/labelstudio/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{

Check notice on line 1 in web/dist/apps/labelstudio/version.json

View workflow job for this annotation

GitHub Actions / merge

Merge Conflict automatically resolved web/dist/apps/labelstudio/version.json

Check notice on line 1 in web/dist/apps/labelstudio/version.json

View workflow job for this annotation

GitHub Actions / merge

Merge Conflict automatically resolved web/dist/apps/labelstudio/version.json
"message": "Merge remote-tracking branch 'origin/develop' into fb-optic-591",
"commit": "1dcdd169df8071f971df1be05d557c1f18f83804",
"date": "2024-04-03T21:07:25.000Z",
"branch": "fb-optic-591"
"message": "Merge branch 'fb-leap-856/deny-empty' of ssh://github.com/heartexlabs/label-studio into fb-leap-856/deny-empty",
"commit": "f101a29d79597af4df007cac70f34d7ed36f90be",
"date": "2024-04-03T12:41:08.000Z",
"branch": "fb-leap-856/deny-empty"
}
8 changes: 4 additions & 4 deletions web/dist/libs/datamanager/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{

Check notice on line 1 in web/dist/libs/datamanager/version.json

View workflow job for this annotation

GitHub Actions / merge

Merge Conflict automatically resolved web/dist/libs/datamanager/version.json

Check notice on line 1 in web/dist/libs/datamanager/version.json

View workflow job for this annotation

GitHub Actions / merge

Merge Conflict automatically resolved web/dist/libs/datamanager/version.json
"message": "Merge remote-tracking branch 'origin/develop' into fb-optic-591",
"commit": "1dcdd169df8071f971df1be05d557c1f18f83804",
"date": "2024-04-03T21:07:25.000Z",
"branch": "fb-optic-591"
"message": "Merge branch 'fb-leap-856/deny-empty' of ssh://github.com/heartexlabs/label-studio into fb-leap-856/deny-empty",
"commit": "f101a29d79597af4df007cac70f34d7ed36f90be",
"date": "2024-04-03T12:41:08.000Z",
"branch": "fb-leap-856/deny-empty"
}
2 changes: 1 addition & 1 deletion web/dist/libs/editor/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/dist/libs/editor/main.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions web/dist/libs/editor/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{

Check notice on line 1 in web/dist/libs/editor/version.json

View workflow job for this annotation

GitHub Actions / merge

Merge Conflict automatically resolved web/dist/libs/editor/version.json

Check notice on line 1 in web/dist/libs/editor/version.json

View workflow job for this annotation

GitHub Actions / merge

Merge Conflict automatically resolved web/dist/libs/editor/version.json
"message": "Merge remote-tracking branch 'origin/develop' into fb-optic-591",
"commit": "1dcdd169df8071f971df1be05d557c1f18f83804",
"date": "2024-04-03T21:07:25.000Z",
"branch": "fb-optic-591"
"message": "Merge branch 'fb-leap-856/deny-empty' of ssh://github.com/heartexlabs/label-studio into fb-leap-856/deny-empty",
"commit": "f101a29d79597af4df007cac70f34d7ed36f90be",
"date": "2024-04-03T12:41:08.000Z",
"branch": "fb-leap-856/deny-empty"
}
6 changes: 4 additions & 2 deletions web/libs/editor/src/stores/AppStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,13 @@ export default types
if (self.hasInterface('submit', 'update', 'review')) {
hotkeys.addNamed('annotation:submit', () => {
const annotationStore = self.annotationStore;
const shouldDenyEmptyAnnotation = self.hasInterface('annotations:deny-empty');
const entity = annotationStore.selected;
const areResultsEmpty = entity.results.length === 0;

if (shouldDenyEmptyAnnotation && areResultsEmpty) return;
if (annotationStore.viewingAll) return;

const entity = annotationStore.selected;

entity?.submissionInProgress();

if (self.hasInterface('review')) {
Expand Down

0 comments on commit 24f9ebc

Please sign in to comment.