From 69d5c4a8f609c92055348f9e918def312eec55ed Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Wed, 23 Oct 2024 14:33:48 +0300 Subject: [PATCH] Allow users to start auto-annotation again if the previous request fails Currently, if an auto-annotation request fails, the UI doesn't re-enable the "Automatic annotation" menu item. This seems like a mistake, since at that point there's no reason why a new request could not be started - in fact, it's possible to do if you just refresh the page. Fix this by only disabling the menu item if the current AR is still in progress. --- changelog.d/20241023_144231_roman_aa_after_fail.md | 5 +++++ cvat-ui/package.json | 2 +- cvat-ui/src/containers/actions-menu/actions-menu.tsx | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 changelog.d/20241023_144231_roman_aa_after_fail.md diff --git a/changelog.d/20241023_144231_roman_aa_after_fail.md b/changelog.d/20241023_144231_roman_aa_after_fail.md new file mode 100644 index 000000000000..0d7bf8752df8 --- /dev/null +++ b/changelog.d/20241023_144231_roman_aa_after_fail.md @@ -0,0 +1,5 @@ +### Fixed + +- UI now allows the user to start automatic annotation again + if the previous request fails + () diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 81b392eb7e54..2c43904a3fb9 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.66.1", + "version": "1.66.2", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": { diff --git a/cvat-ui/src/containers/actions-menu/actions-menu.tsx b/cvat-ui/src/containers/actions-menu/actions-menu.tsx index e9773c2b9051..3c200feb58a0 100644 --- a/cvat-ui/src/containers/actions-menu/actions-menu.tsx +++ b/cvat-ui/src/containers/actions-menu/actions-menu.tsx @@ -17,6 +17,7 @@ import { } from 'actions/tasks-actions'; import { exportActions } from 'actions/export-actions'; import { importActions } from 'actions/import-actions'; +import { RQStatus } from 'cvat-core-wrapper'; interface OwnProps { taskInstance: any; @@ -46,9 +47,12 @@ function mapStateToProps(state: CombinedState, own: OwnProps): StateToProps { formats: { annotationFormats }, } = state; + const inference = state.models.inferences[tid]; + return { annotationFormats, - inferenceIsActive: tid in state.models.inferences, + inferenceIsActive: inference && + ![RQStatus.FAILED, RQStatus.FINISHED].includes(inference.status), }; }