[16.0] [ADD] [FIX] Dialog to create gemoetry when geom field is empty in records panel #354
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While I was integrating the base_geoengine module in my module that adds maps and geometry to tasks and projects i noticed that when i click on a task that has no geometry, in the geoengine view record panel, an error appears.
In the base_geoengine_demo this error doesn't appear because the records are filtered only to show the ones with geometry, but I thought what if that was not the case like in my situation.
The error appeared because in the geoengine_renderer.esm.js the function onDisplayPopupRecord checked only if the feature is undefined and not for the situations when it is null or false. I changed it so that it checks for all falsy values.
Then because it caused nothing to happen when we click on a record with no geometry I went a step further and added a Conformation dialog that asks us if we want to add geometry to the record and if we do it opens an Edit Record dialog and if we don't it just closes the dialog.
Because an error also appeared when we clicked on the zoom to button I also added another check in the zoomOnFeature function to check if the feature exists when checking if the map_view exists.