g3w-suite / g3w-admin

Server module for G3W-SUITE
https://g3w-suite.readthedocs.io/en/latest/g3wsuite_administration.html
Mozilla Public License 2.0
40 stars 34 forks source link

'suggest' parameter in combination with 'fformatter' parameter #811

Closed wlorenzetti closed 5 months ago

wlorenzetti commented 5 months ago

Closes: #810

With this PR now is possible apply suggest parameter for /vector/api/data API REST in combination with 'fformatter' parameter.

The suggest parameter will contain the fformatter field name.

wlorenzetti commented 5 months ago

https://github.com/g3w-suite/g3w-admin/pull/811#pullrequestreview-1997248331

id_buildings doesn't exists inside buildings_2f43dc1d_6725_42d2_a09b_dd446220104a. In this case is the SuggestFilterBackend tha fails. It works with related layers in example buildings_rating_3d535fae_fd04_4df6_b6ff_8cbd13df078f as reported int the issue #810

Raruto commented 5 months ago

@wlorenzetti I couldn't say why the search widget requested a wrong layer.

Now the building relation search works properly:

image

Can you test the autocomplete address search as well?

It should return something, but instead I get no results:

image

wlorenzetti commented 5 months ago

@Raruto I'm checking this issue, it's very strange, it seems to be due to qgis-server but I have to investigate further.

wlorenzetti commented 5 months ago

@Raruto what version of qgis-server are you using?

Raruto commented 5 months ago

what version of qgis-server are you using?

@wlorenzetti 3.28.5-Firenze

image

wlorenzetti commented 5 months ago

Ok @Raruto I understand the problem address has a Value Relation widget so suggest param workd on origin address values (A101, A103,...). I think this is is a case not implemented at now.

Raruto commented 5 months ago

Yes, that case was not handled in v37 either.

Just to remind you, you should test your API changes against the JS code that comes from this PR https://github.com/g3w-suite/g3w-admin/pull/787, which depends entirely on the fformatter parameter. *

* ie. that always performs the same kind of HTTP call (regardless of widget type), thus making the overall logic much simpler 😉.

wlorenzetti commented 5 months ago

@Raruto I just speak with @leolami and @volterra79, this feature didn't work at now. So I'll remove the AutoCompleteBox choose when the field has a ValueRelation widget.

Raruto commented 5 months ago

As far as I'm concerned this PR is fine for fix https://github.com/g3w-suite/g3w-admin/issues/810 (a RelationReference search).

I'll remove the AutoCompleteBox choose when the field has a ValueRelation widget.

Quite brutal solution, but ok.