Skip to content

Not possible to remove widget from Map - JavaScript error #10622

@mahmoudadel54

Description

@mahmoudadel54

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:

const [, dependentWidgetId] = WIDGETS_REGEX.exec((Object.values(m.dependenciesMap) || [])[0]);

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))
   
  • 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

Other useful information

Metadata

Metadata

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions