fix #11153: Persist Swipe Layer state after map refresh #11276
fix #11153: Persist Swipe Layer state after map refresh #11276MV88 merged 2 commits intogeosolutions-it:masterfrom
Conversation
- handle storing position of swipe - fix issue of not reflecting the stored swipe - add unit tests
MV88
left a comment
There was a problem hiding this comment.
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
|
@ElenaGallo please test it in DEV |
|
@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 2_ From a context the swiper tool is not visible for a layer on TOC, see here: https://dev-mapstore.geo 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 |
|
@mahmoudadel54 point 2 and 3 work. We just need to check the first point. |
|
@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 |
|
Test passed, @mahmoudadel54 please backport to 2025.01.xx. Thanks |
…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
…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)
…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
…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)
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
…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)


Description
This PR includes fixing:
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)
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)
Other useful information