#11353: fix - preserve cfg maxItems value when loading saved maps#11354
#11353: fix - preserve cfg maxItems value when loading saved maps#11354offtherailz merged 2 commits intogeosolutions-it:masterfrom
Conversation
- handle ensuring cfg maxItems is always used regardless of saved map settings
offtherailz
left a comment
There was a problem hiding this comment.
This works but it is quite convolute, as a workaround.
This will use maxItems configured when it is not saved, solving the problem.
But at the same time, it will ALWAYS save this configuration.maxItems on new maps, ALWAYS IGNORING it and making the configured one have priority.
If there is no configured, the one in the map wins.
Quite tricky but it works.
I think there is a simpler and more maintainable way to solve this problem:
- Store
maxItemsoutside theconfigurationon theonInitPlugin'. I see it works like this inMapStore2/web/client/components/data/identify/enhancers/identify.js` :
something like:
onInitPlugin({
enableInfoForSelectedLayers,
configuration: {
- maxItems
},
+ maxIems,
showAllResponses,
highlight: pluginCfg?.highlightEnabledFromTheStart || false
});- read this variable in the
identifyOptionsSelectorfrommapInfo?.configuration?.maxItems ?? mapInfo.maxItems ?? 10
This solution allows:
- to set a default for all maps
- to no allow override by the map, but not saving it.
Of course this may require a little refactor of tests etc... so please evaluate if it is the case.
…tify plugin outside configuration object to avoid save it with map - edit 'identifyOptionsSelector' - add/edit unit tests
|
@ElenaGallo, could you please test this on DEV ? Thank you |
|
Test passed, @mahmoudadel54 please backport to 2025.01.xx. Thanks |
Done --> #11373 |
Description
This PR handles always use cfg maxItems for Identify requests via:
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?
#11353
If user puts cfg maxItems into identify plugin with value for example 15, all new created maps will respect this value but the old ones will not.
What is the new behavior?
All maps [old and new] use the same maxItems limit from the cfg in Identify plugin if existing, providing consistent Identify request behavior across the entire application regardless of when the map was created or saved.
Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information