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

Problems with GeoStory map configurations merge process #10489

Closed
1 of 3 tasks
allyoucanmap opened this issue Jul 24, 2024 · 2 comments · Fixed by #10438, #10516 or #10539
Closed
1 of 3 tasks

Problems with GeoStory map configurations merge process #10489

allyoucanmap opened this issue Jul 24, 2024 · 2 comments · Fixed by #10438, #10516 or #10539

Comments

@allyoucanmap
Copy link
Contributor

Description

Legacy geostories used following configuration to store the difference between original resources and changes made to a map in a specific section:

original map resource

{
    "groups": [
        {
            "id": "group-02",
            "title": "over",
            "expanded": false
        },
        {
            "id": "group-01",
            "title": "base",
            "expanded": true
        }
    ],
    "layers": [
        {
            "id": "layer-01",
            "group": "group-01",
            "source": "osm",
            "name": "mapnik",
            "title": "Open Street Map",
            "type": "osm",
            "visibility": true
        },
        {
            "id": "layer-02",
            "format": "image/jpeg",
            "group": "group-02",
            "name": "workspace:layer",
            "opacity": 1,
            "title": "Layer",
            "type": "wms",
            "url": "/geoserver/wms",
            "visibility": false
        }
    ]
}

diff section map configuration

{
    "groups": [
        null,
        {
            "expanded": false
        }
    ],
    "layers": [
        null,
        {
            "visibility": true
        }
    ]
}

The merging process of these two configuration has two steps:

  • the diff configuration was cleaned by replacing null layers with undefined
  • then the createMapObject method was merging the two configuration so layers and groups array items were merged by index

This process had a problem in the step 1 because only null layers were converted but not group layers.

With the introduction of the new TOC the diff configuration for layers and groups was removed and this two field are cloned as soon there is a modification in the section. This introduced another problem described in this comment:

#10426 (comment)

In conclusin we need to solve the issues described above:

  • legacy geostory diff configuration should work also when groups are null
  • new geostory diff configuration should not use the merge method for layers and groups becouse this two field are cloned using the new TOC

How to reproduce

Expected Result

The geostory should be visible and working

Current Result

The application show the error message on full screen

  • 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

@tdipisa
Copy link
Member

tdipisa commented Jul 29, 2024

@mahmoudadel54 this issue need to be evaluated and estimates. Then a fix provided directly within the connected PR here.

@tdipisa
Copy link
Member

tdipisa commented Jul 30, 2024

@mahmoudadel54 you can proceed with this by updating the connected PR as requested.

@ElenaGallo ElenaGallo self-assigned this Aug 16, 2024
@geosolutions-it geosolutions-it deleted a comment from ElenaGallo Aug 19, 2024
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Aug 21, 2024
…ry map configurations merge process

Description:
- fix issue of crash app in geostory if user edit layer properties of existing geostory
- add unit tests due to changes
@tdipisa tdipisa removed the Accepted label Aug 21, 2024
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Aug 28, 2024
…ry map configurations merge process

Description:
- implament new approach in onChange for Editor in MapEditor file to fix the app crash issue if user edit layer properties of existing geostory
- remove the prev implemented approach
- remove unused unit tests
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Aug 28, 2024
…ry map configurations merge process

Description:
- remove unused unit tests
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Sep 5, 2024
…ry map configurations merge process

Description:
- fix issue of crash app in geostory if user edit layer properties of existing geostory
- add unit tests due to changes
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Sep 5, 2024
…ry map configurations merge process

Description:
- implament new approach in onChange for Editor in MapEditor file to fix the app crash issue if user edit layer properties of existing geostory
- remove the prev implemented approach
- remove unused unit tests
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Sep 5, 2024
…ry map configurations merge process

Description:
- remove unused unit tests
@tdipisa tdipisa added the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Sep 5, 2024
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue Sep 11, 2024
@tdipisa tdipisa removed the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment