MapStore2
MapStore2 copied to clipboard
Not possible to remove widget from Map - JavaScript error
Description
In a map with a lot of widgets added it is not possible to remove the widgets from the map.
The issue iat this line in code: https://github.com/geosolutions-it/MapStore2/blob/08772cd25a7746e941ed4a33265e3ddee40237f0/web/client/reducers/widgets.js#L185
const [, dependentWidgetId] = WIDGETS_REGEX.exec((Object.values(m.dependenciesMap) || [])[0]);
if dependenciesMap = {} so this line doesn't handle this case specifically and raises an error
WIDGETS_REGEX.exec([])[0] ---> null
so trying to destructure null throws an error object null is not iterable
How to reproduce
- Open this map
- Try to delete a widget [counter widget or bar chart widget] not the pie chart one
- The dialog window shows up with the delete confirm message
- Click on Delete
Expected Result The widget should be removed from the map and the dialog window close automatically
Current Result The confirmation dialog window remains open and the widget is not removed from the map. A JavaScript console error pops up
Uncaught TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))
- [x] Not browser related
Browser info
(use this site: https://www.whatsmybrowser.org/ for non expert users)Browser Affected | Version |
---|---|
Internet Explorer | |
Edge | |
Chrome | |
Firefox | |
Safari |