ome / omero-mapr

An OMERO.web app allowing to browse the data through attributes linked to the image
https://pypi.org/project/omero-mapr/
GNU Affero General Public License v3.0
5 stars 12 forks source link

Use active_user.id instead of object in autocomplete REST data #50

Closed will-moore closed 4 years ago

will-moore commented 5 years ago

Noticed while comparing URLs with those from IDR gallery.

Previously URLs to load auto-complete data looked like e.g.

http://localhost:4080/mapr/api/autocomplete/gene/?... ..experimenter_id%5Bid%5D=-1&experimenter_id%5BfullName%5D=

since the whole WEBCLIENT.active_user object was being serialised to the query. With this fix, it should now look like experimenter_id=-1 (inspect XHR requests in devtools).

To test:

will-moore commented 4 years ago

NB: when this is deployed on IDR, the autocomplete URLs will be uncached. But I don't know if any cache population is needed (lots of combinations possible for auto-complete). cc @sbesson @manics.

mtbc commented 4 years ago

I found that I seemed to get something useful if I logged in and added some map annotations then searched for those values.

As user-1 on merge-ci the request URL does include experimenter_id=452 so I think this test passes? That is indeed the user's ID.

Not quite sure what to make of what happens next. I pick a valid search result from the list of values but I don't then see the image in the tree, it just twitches a bit then goes back to how it was. Perhaps that's expected and/or outwith this PR.

mtbc commented 4 years ago

(Ah, if I put the KVP on an image that's in the dataset then I at least get a dataset count even if I still can't navigate to it. Again, maybe outwith this PR.)

sbesson commented 4 years ago

Thanks @will-moore. In the case of a cached deployment like IDR, my suspicion is that the old autocomplete cache will become stale and new URLs with the fixed experiment parameter will be generated.

Given the positive review, merging and releasing as 0.3.2. We will investigate the impact into test71 and come back to this repository if necessary.