georchestra / mapstore2-cadastrapp

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

disable export button when no plot is selected #114

Closed landryb closed 3 years ago

landryb commented 3 years ago

found by @stous when testing, if you do a selection via point/line/polygon, no plot is selected in the result/list, but the 'export' button is enabled, so clicking on it sends a zero-bytes unknown file with a mimetype of application/x-unknown-content-type, which is confusing.

You only get a csv file with content once you've selected a plot in the list.

maybe the export button should be disabled/greyed out (like when you open a new empty tab/selection) until a plot is selected.

dsuren1 commented 3 years ago

Hi @landryb I'm unable to reproduce the issue in the dev instance of Cadastrapp. Have attached gif of behavior tested. So kindly let me know if I'm missing something. Thanks! Plotselection_1

landryb commented 3 years ago

running 1.0.0-rc7, i can reproduce on https://ids.craig.fr/mapstore/#/context/cadastre, unless i'm missing a recent commit... i get it that in the gif you select/deselect all/one plots, but by default right after doing a plot selection by point, no plot are checked in the selection result tab, but the export csv button is not greyed out here.

dsuren1 commented 3 years ago

Hi @landryb Attached gif, just to clarify the default behavior when plot selection by point, works as expected in our dev instance. Plotselection_3

Could you check if you are seeing any console error in the chrome developer tools when reproducing this issue?

landryb commented 3 years ago

i dont see errors in the firefox browser console. what's also strange is that selecting/deselecting entries in the plot selection result never greys out the export selection button like i see it does on your capture.

a chrome vs firefox behaviour change ?

dsuren1 commented 3 years ago

Works fine in firefox as well, for me. Plotselection_firefox

You can try these,

MaelREBOUX commented 3 years ago

Hello @dsuren1 Same behaviour here than @landryb under FireFox and with the last build : https://github.com/georchestra/mapstore2-cadastrapp/suites/2379569218/artifacts/50518522

ms2_cadastrapp__unknown_txt

tdipisa commented 3 years ago

I'm sorry @landryb and @MaelREBOUX, I'm also not able to reproduce this on our DEV (I'm using FF 85.0.2 (64-bit)) but I can reproduce here: https://ids.craig.fr/mapstore/#/context/cadastre

@MaelREBOUX where have you reproduced that issue? In portail-test?

tdipisa commented 3 years ago

@MaelREBOUX yes, I've reproduced it in portail test here: https://portail-test.sig.rennesmetropole.fr/mapstore/#/context/master-cadastre

Just to be sure, can you please try to remove some other custom plugin installed like Tabou2?

@landryb do you have some other custom plugin installed in your instance?

I'm just wondering what can be the cause since we are not able to reproduce both locally and in GeoSolutions DEV.

tdipisa commented 3 years ago

@landryb @MaelREBOUX please let me know for the above. in your instances I've reproduced also using chrome, so it doesn't seems browser related.

landryb commented 3 years ago

cadastrapp is the only 'external' plugin we have in our installation.

MaelREBOUX commented 3 years ago

please try to remove some other custom plugin

In the context "cadastre" or for the whole mapstore2 ? in the second case : I cannot do that --> @catmorales

But as @landryb said I don't think it is related because the CRAIG has only cadastrapp as plugin.

dsuren1 commented 3 years ago

@MaelREBOUX @landryb @tdipisa I think I found the cause, I believe this happens when accessing user is not authorized, in other words user who has limited access to the plugin's feature

Reason, it works fine for us is because we access the plugin with authenticated users. That's why this confusion. I will create a fix soon.

MaelREBOUX commented 3 years ago

I confirm @dsuren1 !

left : user with non CNIL right | right : my account with CNIL2

image

tdipisa commented 3 years ago

Thank you so much @dsuren1

MaelREBOUX commented 3 years ago

nice. waiting for https://github.com/georchestra/mapstore2-cadastrapp/actions/runs/813743353 to test

MaelREBOUX commented 3 years ago

image

solved !

MaelREBOUX commented 3 years ago

oups : I let @landryb close after confirmation on its infra

landryb commented 3 years ago

tested by deploying 1.0.0-rc9 on our testing/dev infra, problem fixed - thanks @dsuren1 !