Skip to content

Commit

Permalink
Fallback to displaying annotation name when showing custom annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidStirling committed Feb 6, 2024
1 parent 9841167 commit 0ce8da5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ var CustomAnnsPane = function CustomAnnsPane($element, opts) {
ann.addedBy = [ann.link.owner.id];
// convert 'class' to 'type' E.g. XmlAnnotationI to Xml
ann.type = ann.class.replace('AnnotationI', '');
var attrs = ['textValue', 'timeValue', 'termValue', 'longValue', 'doubleValue', 'boolValue'];
var attrs = ['name', 'textValue', 'timeValue', 'termValue', 'longValue', 'doubleValue', 'boolValue'];
attrs.forEach(function(a){
if (ann[a] !== undefined){
ann.value = ann[a];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

<span class="tooltip_html" style='display:none'>
<b>ID:</b> {{ ann.id }}<br />
{% if ann.name %}<b>Name:</b> {{ ann.name }}<br />{% endif %}
{% if ann.ns %}<b>Namespace:</b> {{ ann.ns }}<br />{% endif %}
{% if ann.description %}<b>Description:</b> {{ ann.description }}<br />{% endif %}
<b>Owner:</b> {{ ann.getOwner.getFullName }}<br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<span class="tooltip_html" style='display:none'>
<b>ID:</b> <%- ann.id %><br />
<% if (ann.ns) { %><b>Namespace:</b> <%- ann.ns %><br /><% } %>
<% if (ann.name) { %><b>Name:</b> <%- ann.name %><br /><% } %>
<% if (ann.description) { %><b>Description:</b> <%- ann.description %><br /><% } %>
<b>Owner:</b> <%- ann.owner.firstName %> <%- ann.owner.lastName %><br />
<b>Date:</b> <% print(OME.formatDate(ann.date)) %>
Expand Down
1 change: 1 addition & 0 deletions omeroweb/webclient/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1885,6 +1885,7 @@ def _marshal_annotation(conn, annotation, link=None):
ownerId = annotation.details.owner.id.val
ann["id"] = annotation.id.val
ann["ns"] = unwrap(annotation.ns)
ann["name"] = unwrap(annotation.name)
ann["description"] = unwrap(annotation.description)
ann["owner"] = {"id": ownerId}
creation = annotation.details.creationEvent._time
Expand Down

0 comments on commit 0ce8da5

Please sign in to comment.