Img data json parents#4486
Conversation
| 'datasetDescription': ds and ds.description or '', | ||
| 'wellSampleId': wellsample and wellsample.id or '', | ||
| 'wellId': well and well.id.val or '', | ||
| 'datasetName': ds and ds['name'] or 'Multiple', |
There was a problem hiding this comment.
could you change to a if test else b, https://www.python.org/dev/peps/pep-0308/
|
@will-moore could you flake8 |
|
@will-moore: we will need to indicate in documentation of |
|
There is no test coverage for the |
|
Follow up card for 5.3: https://trello.com/c/H1xBtuBh/21-imgdata-json-parents-cleanup |
|
There is added problem of assumptions over who owns and the subsequent set of operations that are acceptable via the permissions system across all the parents. This is of particular interest for our use of parents when working with the metadata that this API presents. I would not suggest us dealing with this here but rather consider keeping the scope of the changes in this PR narrow. We can then expand the API with a new fully featured, possibly using omero-marshal, set of image metadata available via JSON in the future. |
|
Something that just came up in discussing the use of this is that we probably really need to add some context to the full viewer URL and view. This would be so that the viewer at least has the option of being reactive to the container that was open when the viewer itself was launched. Otherwise we are guessing. Maybe /cc @joshmoore, @knabar, @emilroz |
|
Works as expected: orphaned I couldsn;t put image in multiple plate as Script says Success |
|
With the follow up trello card for 5.3 this is good to merge, |
|
Issues of context available to the full viewer and integration test coverage should be resolved before merging. |
|
@chris-allan Maybe you could give more details of how the image viewer should handle different contexts? Currently the only context it knows about is for the Prev and Next buttons for moving through Dataset images or Search results. This is looked-up simply by using the parent opener window and using jQuery to find thumbnails matching the current image ID, then finding the prev/next in the DOM. I'll add Well context to the integration tests. |
|
I'm not suggesting that we change what the full image viewer does currently or that we add anything to it in this PR. All that a full image viewer has to go on at this point is the information it receives via the URL, its parameters, and the What I am proposing is that we establish a defined and documented entry point, via the opening URL, by which the full image viewer could then do something with the parent which has been provided in an authoritative manner. This is especially important with #4480 merged in and in use both for proof of concept work and plugins in combination with this PR. It is also of low cost and immense benefit to establish. We have a very small number of locations where the full image viewer is started via Interrogating the parent window's DOM to try and find this out is not an extension point that I would suggest anyone use. Certainly not in any sort of backwards or forwards compatible way. |
|
@chris-allan Agreed that all you suggest should be done, but not for 5.2.2 since we are past "feature freeze". Even though the javascript changes might be relatively trivial, it is still a bit of new code to write, add tests for, manually test etc. |
|
All accepted. We should just be mindful that opening the full viewer up to multiple parents is a pretty significant can of worms. I'm almost of the opinion that we leave this particular PR out for now until we can get a handle both from a workflow and development perspective on the impact. Tough call. |
|
I'm happy to leave this PR out of 5.2.2. |
|
The issue I am trying to raise is that the change is not just scoped to fixing display of bulk annotations when the image is also in a Dataset within the current full viewer. You can see an example of this in the JCB DataViewer full image viewer here: This PR changes what each would display in situations of multiple parents and I'm cool with that in principal. What I'm concerned about are the implications on users of doing so and what corners we back ourselves into when we have a lack of context available to full image viewer implementations. We can certainly argue the utility and correctness of not showing anything vs. the possibility if showing something incorrect or unexpected separately. I would really like to avoid instituting hacks in our own APIs that could be avoided if we do things properly and thoroughly from the start. |
|
Marking this PR onhold since it will not be considered for 5.2.2 |
|
@jburel @chris-allan Are we ready to continue / restart the discussion on this PR? |
|
As mentioned, I think we should move the discussion to design. |
|
After discussing in web meeting today, decision is that we will not add or change what we have now in imgData json. We can already query |

As suggested by @chris-allan in #4446 (comment), this fixes the handling of multiple parents (Datasets & Wells) by
marshalImage().NB: I haven't changed handling of Projects yet.
@chris-allan suggested the "first" of multiple parents be used for keys such as "datasetId", although I'm not sure how we want to sort datasets before picking the first?
To test:
webgateway/imgData/3731/You should see under the
metasection adatasetslist like this:and also
datasetName,datasetIdanddatasetDescriptionbased on the first dataset.Now check that you see multiple
wellsin themetaas above.