Skip to content

fix #11153: Persist Swipe Layer state after map refresh #11276

Merged
MV88 merged 2 commits intogeosolutions-it:masterfrom
mahmoudadel54:fix_issue_11153
Jul 3, 2025
Merged

fix #11153: Persist Swipe Layer state after map refresh #11276
MV88 merged 2 commits intogeosolutions-it:masterfrom
mahmoudadel54:fix_issue_11153

Conversation

@mahmoudadel54
Copy link
Copy Markdown
Contributor

@mahmoudadel54 mahmoudadel54 commented Jul 3, 2025

Description

This PR includes fixing:

  • handle storing position of swipe
  • fix issue of not reflecting the stored swipe for map in context

The issue of map context was: the swipe component was loading late after loading [context and its map] info so the swipe state not initiating until toc and swipe compoenent mount and this causes an issue of not reflecting the stored swipe on map context after map loading.

The reason: the Swipe is loaded as async plugin in this
toModulePlugin('Swipe', () => import(/* webpackChunkName: 'plugins/swipe' */ '../plugins/Swipe'))
so to fix this issue, I made it loading sync in web/client/product/plugins.js.

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

What is the current behavior?

#11153 (comment)

What is the new behavior?

The Swipe persistence is now working for map contexts and the Swipe position is persisted: when you refresh the map it is now keeping the stored position.

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

- handle storing position of swipe
- fix issue of not reflecting the stored swipe
- add unit tests
@mahmoudadel54 mahmoudadel54 added this to the 2025.01.01 milestone Jul 3, 2025
@mahmoudadel54 mahmoudadel54 requested a review from dsuren1 July 3, 2025 08:01
@mahmoudadel54 mahmoudadel54 self-assigned this Jul 3, 2025
@mahmoudadel54 mahmoudadel54 added bug BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch labels Jul 3, 2025
@mahmoudadel54 mahmoudadel54 linked an issue Jul 3, 2025 that may be closed by this pull request
1 task
@tdipisa tdipisa requested review from MV88 and removed request for dsuren1 July 3, 2025 08:16
Copy link
Copy Markdown
Contributor

@MV88 MV88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you clarify about the reason why Swipe needs to be moved as a static plugin?
Maybe add a comment in the PR and in the codebase

other then that looks fine to me

- adjust indentation in swipe reducers
@mahmoudadel54 mahmoudadel54 requested a review from MV88 July 3, 2025 09:40
@MV88 MV88 merged commit 01d5983 into geosolutions-it:master Jul 3, 2025
5 checks passed
@MV88 MV88 changed the title fix #1153: Persist Swipe Layer state after map refresh fix #11153: Persist Swipe Layer state after map refresh Jul 3, 2025
@MV88
Copy link
Copy Markdown
Contributor

MV88 commented Jul 3, 2025

@ElenaGallo please test it in DEV

@ElenaGallo
Copy link
Copy Markdown
Contributor

@mahmoudadel54 see my notes below:

1_Once tha map with swipe toll active is save (clean the cache) the swipe tool is not allogned with the layer on the viewer. See here: https://dev-mapstore.geosolutionsgroup.com/mapstore/#/viewer/58640

swipe2

2_ From a context the swiper tool is not visible for a layer on TOC, see here: https://dev-mapstore.geo
swipe_context
solutionsgroup.com/mapstore/#/context/swipe_elena

3_ From the context map the swiper tool is not visible for a layer on TOC, see here: https://dev-mapstore.geosolutionsgroup.com/mapstore/#/context/swipe_elena/58725

@ElenaGallo
Copy link
Copy Markdown
Contributor

@mahmoudadel54 point 2 and 3 work. We just need to check the first point.

@tdipisa
Copy link
Copy Markdown
Member

tdipisa commented Jul 4, 2025

@mahmoudadel54 (fyi @ElenaGallo) since we have a new PR here #11280 , can we backport this of is there some other pending thing?

@mahmoudadel54
Copy link
Copy Markdown
Contributor Author

@mahmoudadel54 (fyi @ElenaGallo) since we have a new PR here #11280 , can we backport this of is there some other pending thing?

I think we can backport both together in one backport PR

@ElenaGallo
Copy link
Copy Markdown
Contributor

Test passed, @mahmoudadel54 please backport to 2025.01.xx. Thanks

mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this pull request Jul 4, 2025
…geosolutions-it#11276)

* fix geosolutions-it#1153:
- handle storing position of swipe
- fix issue of not reflecting the stored swipe
- add unit tests

* - add comment for swipe plugin in product/plugins.js
- adjust indentation in swipe reducers
@tdipisa tdipisa removed the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Jul 4, 2025
tdipisa pushed a commit that referenced this pull request Jul 4, 2025
…after saving resource (#11276, #11280) (#11284)

* fix #1153: Persist Swipe Layer state after map refresh  (#11276)

* fix #1153:
- handle storing position of swipe
- fix issue of not reflecting the stored swipe
- add unit tests

* - add comment for swipe plugin in product/plugins.js
- adjust indentation in swipe reducers

* fix #11153 keeping swipe position after saving (#11280)
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this pull request Jul 4, 2025
…geosolutions-it#11276)

* fix geosolutions-it#1153:
- handle storing position of swipe
- fix issue of not reflecting the stored swipe
- add unit tests

* - add comment for swipe plugin in product/plugins.js
- adjust indentation in swipe reducers
tdipisa pushed a commit that referenced this pull request Jul 4, 2025
…tion after saving resource (#11276, #11280) (#11286)

* fix #1153: Persist Swipe Layer state after map refresh  (#11276)

* fix #1153:
- handle storing position of swipe
- fix issue of not reflecting the stored swipe
- add unit tests

* - add comment for swipe plugin in product/plugins.js
- adjust indentation in swipe reducers

* fix #11153 keeping swipe position after saving (#11280)
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this pull request Jul 7, 2025
geosolutions-it#11276)

* fix geosolutions-it#11153:
- handle storing position of swipe
- fix issue of not reflecting the stored swipe
- add unit tests

* - add comment for swipe plugin in product/plugins.js
- adjust indentation in swipe reducers
tdipisa pushed a commit that referenced this pull request Jul 7, 2025
…tion after saving resource (#11276, #11280)  (#11293)

* fix #11153: Persist Swipe Layer state after map refresh  (#11276)

* fix #11153:
- handle storing position of swipe
- fix issue of not reflecting the stored swipe
- add unit tests

* - add comment for swipe plugin in product/plugins.js
- adjust indentation in swipe reducers

* fix #11153 keeping swipe position after saving (#11280)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Persist Swipe Layer state after map refresh

4 participants