mWater / mwater-forms

Forms controls for mWater
GNU Lesser General Public License v3.0
3 stars 5 forks source link

[WIP] Display calculated admin region for location question #256

Closed broncha closed 1 year ago

broncha commented 1 year ago

https://github.com/mWater/mwater-portal/issues/1604

grassick commented 1 year ago

Why is it using the code, as opposed to the _id of the response? code isn't guaranteed to be unique. This also has to work for roster items, which this code won't.

Also, it seems a bit complicated. If we're going to hit the server anyway, and we have the location, maybe just do a query to find the admin region as part of renderLocation in ResponseAnswersComponent? You already have the location there, so all you need is the datasource to do a query to find the leaf shape that intersects. You can create a data source given an apiUrl.

broncha commented 1 year ago

@grassick I have extracted the jsonql from the schema and now its using the location value directly. I have still kept the rendering logic inside ResponseDisplayComponent as ResponseAnswersComponent does not have access to apiUrl and login.

grassick commented 1 year ago

Looks good to me! Want to compile, merge, and release portal/app? Or shall I?

broncha commented 1 year ago

Ill do that