georchestra / mapstore2-cadastrapp

repository for the mapstore2 version of cadastrapp
GNU General Public License v3.0
2 stars 10 forks source link

Prefixes of sections are not used #164

Closed MaelREBOUX closed 2 years ago

MaelREBOUX commented 2 years ago

Under Mapfishapp

image

Under MapStore

image

The call to the cadastrapp API : https://portail.sig.rennesmetropole.fr/cadastrapp/services/getSection?cgocommune=350206

Extract of the answer :

[{
    "cgocommune": "350206",
    "ccopre": "",
    "ccosec": "AB"
}, {
    "cgocommune": "350206",
    "ccopre": "",
    "ccosec": "AC"
}, {
    "cgocommune": "350206",
    "ccopre": "",
    "ccosec": "AD"
}, {
    "cgocommune": "350206",
    "ccopre": "073",
    "ccosec": "AB"
}, {
    "cgocommune": "350206",
    "ccopre": "073",
    "ccosec": "AC"
}, {
    "cgocommune": "350206",
    "ccopre": "073",
    "ccosec": "AD"
}, {
    "cgocommune": "350206",
    "ccopre": "073",
    "ccosec": "AT"
}]

I don't know how I could have missed this in my tests because it is well know on this municipality. But anyway : the section code must be a concatenation of ccopre and ccosec.

MaelREBOUX commented 2 years ago

I don't know where to make this concatenation. Javascript too complicated for me

Here https://github.com/georchestra/mapstore2-cadastrapp/blob/3cab1bab1a82e89f7a02eb73fcb24bea0c345b80/js/extension/api/api.js#L105-L107

Or here ? https://github.com/georchestra/mapstore2-cadastrapp/blob/ae71948e206c188fbde35417e495f103c76f58e1/js/extension/components/request/searchCombos/SectionCombo.jsx#L6-L14

landryb commented 2 years ago

can confirm that it also affects us on http://cadastre.craig.fr, look for Nonette-Orsonnette (630255) -> there's a list of sections with missing ccopre prefixes.

image

Gaetanbrl commented 2 years ago

I don't know where to make this concatenation

@MaelREBOUX @landryb

I think concat ccopre + ccosec missing here :

https://github.com/georchestra/mapstore2-cadastrapp/blob/ae71948e206c188fbde35417e495f103c76f58e1/js/extension/components/lists/ReferenceRow.jsx#L63

MaelREBOUX commented 2 years ago

Well, we have to fix 3 things :

landryb commented 2 years ago

in my testing 98960f6 wasn't enough and generated ms2 crashes about ReferenceError: ccopre is not defined.

landryb commented 2 years ago

for value in the section column in the result panel i've tried the following without success:

--- a/js/extension/components/table/PlotsSelectionTable.jsx
+++ b/js/extension/components/table/PlotsSelectionTable.jsx
@@ -10,7 +10,7 @@ const columns = [{
     name: "cadastrapp.parcelle.result.commune",
     resizable: true
 }, {
-    key: "ccosec",
+    key: "ccopre + ccosec",
     width: 80,
     sortable: true,
     name: "cadastrapp.parcelle.result.ccosec",

i guess we need another variable inside 'data' struct with ccopre+ccosec concatenated, or display another column with ccopre alone.

landryb commented 2 years ago

image

displaying a distinct column for ccopre works but is ugly.

catmorales commented 2 years ago

We have tested this functionnality just right now on portail-test and it doesn't work . Our versions are :

landryb commented 2 years ago

@catmorales please test with #174 that should fix it.

catmorales commented 2 years ago

Tested just now with https://github.com/landryb/mapstore2-cadastrapp/actions/runs/2869243862 and it works 👍 image

landryb commented 2 years ago

@catmorales with #174 the display of prefixed sections also works in the search results i suppose ?