Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
mahmoudadel54 opened this issue Oct 23, 2024 · 0 comments · Fixed by #10623, #10629 or #10630
Closed
1 task done

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

mahmoudadel54 opened this issue Oct 23, 2024 · 0 comments · Fixed by #10623, #10629 or #10630

Comments

@mahmoudadel54
Copy link
Contributor

mahmoudadel54 commented Oct 23, 2024

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

@mahmoudadel54 mahmoudadel54 self-assigned this Oct 23, 2024
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Oct 23, 2024
…cript error

Description:
- fix the issue of not remove widget from map in case of existing other widgets has dependenciesMap prop = empty object
- add unit test
@mahmoudadel54 mahmoudadel54 added this to the 2024.02.01 milestone Oct 23, 2024
MV88 pushed a commit that referenced this issue Oct 24, 2024
…0623)

Description:
- fix the issue of not remove widget from map in case of existing other widgets has dependenciesMap prop = empty object
- add unit test
@ElenaGallo ElenaGallo added the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Oct 25, 2024
@ElenaGallo ElenaGallo self-assigned this Oct 25, 2024
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Oct 25, 2024
…cript error (geosolutions-it#10623)

Description:
- fix the issue of not remove widget from map in case of existing other widgets has dependenciesMap prop = empty object
- add unit test
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Oct 25, 2024
…cript error (geosolutions-it#10623)

Description:
- fix the issue of not remove widget from map in case of existing other widgets has dependenciesMap prop = empty object
- add unit test
MV88 pushed a commit that referenced this issue Oct 25, 2024
…0623) (#10629)

Description:
- fix the issue of not remove widget from map in case of existing other widgets has dependenciesMap prop = empty object
- add unit test
@tdipisa tdipisa removed the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Oct 25, 2024
rmelarab-ngs pushed a commit to ngsllc/MapStore2 that referenced this issue Nov 5, 2024
…cript error (geosolutions-it#10623)

Description:
- fix the issue of not remove widget from map in case of existing other widgets has dependenciesMap prop = empty object
- add unit test
MV88 added a commit that referenced this issue Nov 6, 2024
…om Map - JavaScript error (#10623) (#10630)

* #10622: Not possible to remove widget from Map - JavaScript error (#10623)

Description:
- fix the issue of not remove widget from map in case of existing other widgets has dependenciesMap prop = empty object
- add unit test

* tentative fix for the test

---------

Co-authored-by: MV88 <[email protected]>
ale-cristofori pushed a commit to ale-cristofori/MapStore2 that referenced this issue Nov 25, 2024
…ons-it#274 remove widget (geosolutions-it#275)

* Fix geosolutions-it#271 AutoResourceUpdate implementation

* Update context as well and others

* updating epics logic for ignoring execution based on options

* Update pr with changes to plugin config

* update revision including fix for geosolutions-it#10622
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment