Main goal of this PR is to add the checkbox that allows the user to acknowledge an alert when he has clicked on the marker and looks at the associated popup.
This PR also brings two small fixes:
Rewording of historic fire markers;
Changing the required version of dash-leaflet from ">=0.1.4" to "==0.1.4". My guess is that the Heroku machine was pip installing the "0.1.12" version which does not support the dlx.choropleth object anymore, so that the "Niveaux de risque" map could not be displayed.
Main changes
Addition of the checkbox object in the popup of the alert marker
Creation of the callback that erases the checkbox once it is checked and changes the related message
Modification of the last callback that disables the dcc.Interval() component
The interval component is now disabled as soon as the user clicks on the alert marker
Goal is to avoid the alert to be reloaded after the user has checked the acknowledgement checkbox
Screenshots
The user clicks on the alert marker (NB: interval component is disabled from this point on)
The user checks the box to acknowledge the reception of the alert
The user clicks on other buttons (any button on the "Alertes" map)
The user can click again on the alert marker and the checkbox is not accessible anymore
Question
With this preliminary solution, if the user acknowledges the alert, moves to the "Niveaux de Risques" dashboard and comes back to the "Alertes" map, the alert data is reloaded and the acknowledgement checkbox can again be checked. I think it is because we are re-instantiating the interval component as part of the "Alertes" map.
I guess we will be able to bring a more solid solution to this issue once we can add an if statement in the callback that verifies whether the is_acknowledge field has already been changed to True or not. But at the moment, I am not sure to see a good solution to this problem without making the API call, etc.
Do we agree to move forward with this imperfect solution for the demo-day and come back to it with a proper use of the client in the callback later on?
Goal of the PR
Main goal of this PR is to add the checkbox that allows the user to acknowledge an alert when he has clicked on the marker and looks at the associated popup.
This PR also brings two small fixes:
dash-leaflet
from ">=0.1.4" to "==0.1.4". My guess is that the Heroku machine was pip installing the "0.1.12" version which does not support thedlx.choropleth
object anymore, so that the "Niveaux de risque" map could not be displayed.Main changes
Addition of the checkbox object in the popup of the alert marker
Creation of the callback that erases the checkbox once it is checked and changes the related message
Modification of the last callback that disables the
dcc.Interval()
componentScreenshots
Question
With this preliminary solution, if the user acknowledges the alert, moves to the "Niveaux de Risques" dashboard and comes back to the "Alertes" map, the alert data is reloaded and the acknowledgement checkbox can again be checked. I think it is because we are re-instantiating the interval component as part of the "Alertes" map.
I guess we will be able to bring a more solid solution to this issue once we can add an
if
statement in the callback that verifies whether theis_acknowledge
field has already been changed to True or not. But at the moment, I am not sure to see a good solution to this problem without making the API call, etc.Do we agree to move forward with this imperfect solution for the demo-day and come back to it with a proper use of the client in the callback later on?
cc @Akilditu @frgfm