diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b3cb726d1b..b6da511ceac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md). [Commits](https://github.com/scalableminds/webknossos/compare/19.09.0...HEAD) ### Added +- Reset to base is now also allowed for volume tasks. [#4276](https://github.com/scalableminds/webknossos/pull/4276) ### Changed diff --git a/app/models/annotation/AnnotationService.scala b/app/models/annotation/AnnotationService.scala index fd1ff16ed89..748c8c2251a 100755 --- a/app/models/annotation/AnnotationService.scala +++ b/app/models/annotation/AnnotationService.scala @@ -559,12 +559,12 @@ class AnnotationService @Inject()(annotationInformationProvider: AnnotationInfor def resetToBase(annotation: Annotation)(implicit ctx: DBAccessContext, m: MessagesProvider) = annotation.typ match { case AnnotationType.Explorational => - Fox.failure("annotation.revert.skeletonOnly") - case AnnotationType.Task if annotation.skeletonTracingId.isDefined => + Fox.failure("annotation.revert.tasksOnly") + case AnnotationType.Task => for { task <- taskFor(annotation) _ = logger.warn( - s"Resetting annotation ${annotation._id} to base, discarding skeleton tracing ${annotation.skeletonTracingId}") + s"Resetting annotation ${annotation._id} to base, discarding skeleton tracing ${annotation.skeletonTracingId} and/or volume tracing ${annotation.volumeTracingId}") annotationBase <- baseForTask(task._id) dataSet <- dataSetDAO.findOne(annotationBase._dataSet)(GlobalAccessContext) ?~> "dataSet.nonExistent" (newSkeletonIdOpt, newVolumeIdOpt) <- tracingFromBase(annotationBase, dataSet) @@ -575,8 +575,6 @@ class AnnotationService @Inject()(annotationInformationProvider: AnnotationInfor _ <- Fox.runOptional(newVolumeIdOpt)(newVolumeId => annotationDAO.updateVolumeTracingId(annotation._id, newVolumeId)) } yield () - case _ if !annotation.skeletonTracingId.isDefined => - Fox.failure("annotation.revert.skeletonOnly") } private def settingsFor(annotation: Annotation)(implicit ctx: DBAccessContext) = diff --git a/conf/messages b/conf/messages index 0b4625334a6..4026006f1d8 100644 --- a/conf/messages +++ b/conf/messages @@ -190,7 +190,7 @@ annotation.edit.failed=Updating the annotation failed annotation.finish.confirm=Are you sure you want to permanently finish this tracing? annotation.finish.failed=Finishing the annotation failed annotation.reset.success=Annotation was successfully reset -annotation.revert.skeletonOnly=Reverting an annotation is only implemented for skeleton tracings of tasks +annotation.revert.tasksOnly=Reverting an annotation is only implemented for tasks annotation.download.notAllowed=You can’t download this tracing annotation.notPossible=Couldn’t access annotation annotation.notActive=The tracing is not active and can’t be finished