From e76b238bc835c2c867519107c7e8c8da1da0ff72 Mon Sep 17 00:00:00 2001 From: MichaelBuessemeyer <39529669+MichaelBuessemeyer@users.noreply.github.com> Date: Fri, 31 May 2024 14:07:39 +0200 Subject: [PATCH] Fix lock explorative annotations (#7847) * only show locking option in explorative annoations table incase the user is the owner & remove double newline * ignore files of vscode metals (for scala) addon * remove accidental inverted logic --- .gitignore | 3 + .../explorative_annotations_view.tsx | 65 +++++++++---------- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index 3a03c1c3996..fe734fe1bc8 100755 --- a/.gitignore +++ b/.gitignore @@ -77,3 +77,6 @@ coverage-ts temp-webknossos-schema** conf/application.conf-e .env +.bloop +.metals +metals.sbt diff --git a/frontend/javascripts/dashboard/explorative_annotations_view.tsx b/frontend/javascripts/dashboard/explorative_annotations_view.tsx index b6f94373426..357a2e98ad2 100644 --- a/frontend/javascripts/dashboard/explorative_annotations_view.tsx +++ b/frontend/javascripts/dashboard/explorative_annotations_view.tsx @@ -309,41 +309,40 @@ class ExplorativeAnnotationsView extends React.PureComponent { > Download -
{this.isTracingEditable(tracing) ? ( - this.finishOrReopenAnnotation("finish", tracing)} - icon={} - disabled={tracing.isLockedByOwner} - title={tracing.isLockedByOwner ? "Locked annotations cannot be archived." : undefined} - > - Archive - + <> +
+ this.finishOrReopenAnnotation("finish", tracing)} + icon={} + disabled={tracing.isLockedByOwner} + title={ + tracing.isLockedByOwner ? "Locked annotations cannot be archived." : undefined + } + > + Archive + + + ) : null} + {isActiveUserOwner ? ( + <> +
+ this.setLockedState(tracing, !tracing.isLockedByOwner)} + icon={ + tracing.isLockedByOwner ? ( + + ) : ( + + ) + } + > + {tracing.isLockedByOwner ? "Unlock" : "Lock"} + + ) : null} -
- this.setLockedState(tracing, !tracing.isLockedByOwner)} - icon={ - tracing.isLockedByOwner ? ( - - ) : ( - - ) - } - > - {tracing.isLockedByOwner ? "Unlock" : "Lock"} - -
); } else {