-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug with unchanged label color after swap #625
Conversation
I was a little too quick with this PR. I forgot to check the video annotations. When I'm finished, I will let you know. |
There are also too many commits in this PR. Maybe you have to update your branches? |
What do you mean by this? I merged the current master into this branch. Isn't this branch updated now? |
I see 67 commits in this PR but only one implements the code changes. Somehow all newer commits from # Start fresh from master.
git checkout master
# Create a new branch with a different name.
git checkout -b lsb
# Cherry-pick the commit to the new branch.
git cherry-pick 28e448a
# Delete the old branch.
git branch -D label-swap-bug
# Rename the new branch to the old name.
git branch -m label-swap-bug
# Force push to update this PR.
git push -fu origin label-swap-bug |
Annotations were not updated because the annotation watcher was not triggered by the color change. Add a refreshAnnotation method which replaces the old annotation by the new one in the annotationSource.
Label color wasn't updated because 'refresh' event wasn't triggered. Add refreshAnnotation method and emit event to call it after successfully detaching annotation.
You can review my changes now. |
Should I do it like this every time a branch is outdated? |
In the future, you can also click on "request review" at the top right of a PR to let me know I should have a look. That should be easier for you.
No, it was only a problem because you seem to have created the branch from an outdated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does what it should but I would structure it a bit differently. This way we can fix the same issue when a label is deleted, too.
resources/assets/js/annotations/components/annotationCanvas.vue
Outdated
Show resolved
Hide resolved
resources/assets/js/videos/components/videoScreen/annotationPlayback.vue
Outdated
Show resolved
Hide resolved
Annotation should be updated after swap or label deletion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! Two lines are no longer needed. I will remove them myself.
resources/assets/js/videos/components/videoScreen/annotationPlayback.vue
Outdated
Show resolved
Hide resolved
resources/assets/js/videos/components/videoScreen/annotationPlayback.vue
Outdated
Show resolved
Hide resolved
@mzur Is this already live? Because the color does not change and the old labels are not "really" deleted, i.e. they still appear in the annotations list in the sidebar. However, if you click the delete button (the little x) sometimes an error occurs: No query results for model [Biigle\ImageAnnotationLabel] 15900345. Don't know if this is important. The annotations I want to swap were created by Lukas |
The label swapping only works for your own labels. If the annotation has a label of a different user, your label is attached and the other label is kept, too. If you want to replace labels of other users you can use Largo (with the "force" button pressed) or you have to detach the other label with the "x". I don't know why you get the error. Can you provide steps to reproduce it? |
Shouldn't this follow the same logic as Largo, with experts and admins etc.? Not sure about reproducing it but the best bet is:
|
It does. Largo has the "force" button that needs to be active so experts/admins can delete or replace labels of other users. The label swap tool doesn't have this button. We could add another button next to the label swap button (with the same icon but with a red background) that experts/admins can use to swap labels of other users. What do you think?
This would make sense. If the requests to swap the labels are still pending, you still see the labels in the sidebar. When you try to delete them, the backend eventually catches up and the old labels no longer exist, producing the error. |
Annotations were not updated because the annotation watcher was not triggered by the color change. Add a refreshAnnotation method which replaces the old annotation by the new one in the annotationSource.