Skip to content

Commit

Permalink
Fix lock explorative annotations (#7847)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
MichaelBuessemeyer committed May 31, 2024
1 parent 5818b61 commit e76b238
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 33 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,6 @@ coverage-ts
temp-webknossos-schema**
conf/application.conf-e
.env
.bloop
.metals
metals.sbt
65 changes: 32 additions & 33 deletions frontend/javascripts/dashboard/explorative_annotations_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,41 +309,40 @@ class ExplorativeAnnotationsView extends React.PureComponent<Props, State> {
>
Download
</AsyncLink>
<br />
{this.isTracingEditable(tracing) ? (
<AsyncLink
href="#"
onClick={() => this.finishOrReopenAnnotation("finish", tracing)}
icon={<InboxOutlined key="inbox" className="icon-margin-right" />}
disabled={tracing.isLockedByOwner}
title={tracing.isLockedByOwner ? "Locked annotations cannot be archived." : undefined}
>
Archive
</AsyncLink>
<>
<br />
<AsyncLink
href="#"
onClick={() => this.finishOrReopenAnnotation("finish", tracing)}
icon={<InboxOutlined key="inbox" className="icon-margin-right" />}
disabled={tracing.isLockedByOwner}
title={
tracing.isLockedByOwner ? "Locked annotations cannot be archived." : undefined
}
>
Archive
</AsyncLink>
</>
) : null}
{isActiveUserOwner ? (
<>
<br />
<AsyncLink
href="#"
onClick={() => this.setLockedState(tracing, !tracing.isLockedByOwner)}
icon={
tracing.isLockedByOwner ? (
<LockOutlined key="lock" className="icon-margin-right" />
) : (
<UnlockOutlined key="unlock" className="icon-margin-right" />
)
}
>
{tracing.isLockedByOwner ? "Unlock" : "Lock"}
</AsyncLink>
</>
) : null}
<br />
<AsyncLink
href="#"
title={
!isActiveUserOwner
? `Only the owner can ${
tracing.isLockedByOwner ? "unlock" : "lock"
} this annotation.`
: undefined
}
disabled={!isActiveUserOwner}
onClick={() => this.setLockedState(tracing, !tracing.isLockedByOwner)}
icon={
tracing.isLockedByOwner ? (
<LockOutlined key="lock" className="icon-margin-right" />
) : (
<UnlockOutlined key="unlock" className="icon-margin-right" />
)
}
>
{tracing.isLockedByOwner ? "Unlock" : "Lock"}
</AsyncLink>
<br />
</div>
);
} else {
Expand Down

0 comments on commit e76b238

Please sign in to comment.