-
Notifications
You must be signed in to change notification settings - Fork 31
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
"Others" annotation display tweaks #530
Conversation
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.
From a code perspective, the changes proposed here make sense to me. The name
attribute has been introduced on all annotations in OMERO 5.1.0 (and specifically ome/openmicroscopy#3362), so I suspect the code had simply never been updated accordingly.
Adding a few ListAnnotation
objects using
omero obj new DatasetAnnotationLink parent=<Object>:<id> child=$(omero obj new ListAnnotation name=<name> ns=<ns>)
the UI now displays the new elements with the name populated
Thanks for the background @sbesson, I guess that does raise whether it's worth also adding the "name" field to tooltips for other annotation types? For this PR I only updated the "custom annotation" template. |
omeroweb/webclient/static/webclient/javascript/ome.right_panel_customanns_pane.js
Outdated
Show resolved
Hide resolved
There are a bunch of tests failing at https://merge-ci.openmicroscopy.org/jenkins/job/OMERO-test-integration/349/ due to the addition of Need to update the expected JSON values at e.g. https://github.com/ome/openmicroscopy/blob/develop/components/tools/OmeroWeb/test/integration/test_tree_annotations.py#L307 |
Yes, you'll need a companion PR for tests. Legacy of omero-web once being in the openmicroscopy repo. |
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.
I think the tests didn't run last night but should be fixed...
Lately we've been experimenting with ListAnnotation objects as a means to group other annotations together. Within OMERO.web's right panel these are apparently displayed under the "Others" section when populating the annotation list.
My understanding is that this section is intended to provide a basic display of miscellaneous or custom annotation types. The display attempts to show an entry for each with the format "Type: Value".
However, for ListAnnotations specifically there is no actual value field associated with them. The end result is this:
To further complicate things, the tooltips providing more details are bound to the value field, meaning that the user cannot see any further details about these annotations. Attach 10 ListAnnotation objects and you'll just see the word "List" 10 times.
To attempt to improve this I've modified the code that handles this to fall back to using the 'name' field if no other value fields are present. This field is common to all annotation types (though optional) and might be a sensible thing to display in the absence of anything else. The result would be:
Having some data in the name field also then restores the ability to view tooltips.
Unfortunately the webclient json API for annotations currently seems to return everything except for the name field, I'm not sure why. For the sake of this PR I've added that field to the returned results. Hope that doesn't break anything.
Testing: Create ListAnnotations with name/description/namespace info and attach them to an object. Without PR: OMERO.web right panel only shows "List" for each. With PR: Right panel shows "List: [name]". Other BasicAnnotation subtypes should still display their respective values, though their tooltips will now include the "name" field.