nens / lizard-catalogue

Lizard Catalogue
https://demo.lizard.net/catalogue/
0 stars 0 forks source link

Referral from Catalogue to filters/groundwaterstations portal incorrect (nested asset issue) #232

Closed lisannewapstra closed 3 years ago

lisannewapstra commented 3 years ago

Topdesk 2012 0010 Re: catalogus dingetjes - Evert Wielsma 1 december

Hi, The referral to Lizard portal from Lizard Catalogue does not work for timeseries that are connected to filters. This is because it is a nested asset. Filters are linked to groundwaterstations.

For example https://utrecht.lizard.net/catalogue/?data=Timeseries&uuid=a41fda67-72c8-4114-a15b-9022626a35cf

If you select the filters, you see nothing.

https://utrecht.lizard.net/nl/charts/topography/multi-point/filter$121830/@52.0480,5.0640,14/-1Days12Hours-0Days12Hours should be https://utrecht.lizard.net/nl/charts/topography/multi-point/groundwaterstation$83371/@52.0480,5.0640,14/-1Days12Hours-0Days12Hours

EDIT Lex: Same goes for pumps and pumpstations. The parent asset should in these cases be looked up with an additional request to the nested asset endpoint.

Might be tricky, but should be fixed.

Kind regards, Lisanne

joeriverheijden commented 3 years ago

@Derryrover @lexvand kan deze eerstvolgende sprint opgepakt worden?

hoanphungt commented 3 years ago

@lexvand I can pick it up during this sprint

lexvand commented 3 years ago

@hoanphungt That's great. Can you first give an estimate?

hoanphungt commented 3 years ago

@lexvand Hi Lex,

I don't really understand this part:

EDIT Lex: Same goes for pumps and pumpstations. The parent asset should in these cases be looked up with an additional request to the nested asset endpoint.

Could you elaborate a bit more on this or give me an example?

Thanks!

lexvand commented 3 years ago

Groundwaterstations and pumpstations are the objects that are drawn on the map and can be referred to when building a Lizard portal URL. Filters and pumps are nested assets for which this referral doesn't work. They have a foreign key relation to their "parent" asset.

The location information contains the id of the nested asset. So we should lookup these nested assets in the API to find the related parent, from which we can use the id to build the URL.

Checking this in API v3 surprises me: the related object is not in the API response. This should first be added before we can make it work in the frontend. Blocked for now.

hoanphungt commented 3 years ago

@Derryrover Hi Tom,

Could you review this PR: https://github.com/nens/lizard-catalogue/issues/242?

Kr, Hoan

Derryrover commented 3 years ago

@hoanphungt

Hi Hoan,

The code looks good. But I cannot reproduce the problem this is solving, therefore I cannot test. Or maybe I understand it wrong. How did you reproduce the problem on dev?

I think this url should select a monitoring network, but seems I do not have the rights: https://utrecht.lizard.net/catalogue/?data=Timeseries&uuid=a41fda67-72c8-4114-a15b-9022626a35cf

kr Tom

hoanphungt commented 3 years ago

@Derryrover Steps to reproduce the bug:

  1. Select "Large N&S sample" in the Monitoring Network list
  2. In the Timeseries selection modal, type "Dummy" in the search bar
  3. Select the location on the map
  4. Click on open in portal
Derryrover commented 3 years ago

@hoanphungt

Yes works for the testing steps as mentioned above. Ready to merge