diff --git a/web/client/components/data/identify/enhancers/identify.js b/web/client/components/data/identify/enhancers/identify.js index c027f8e899..19c3b1cf90 100644 --- a/web/client/components/data/identify/enhancers/identify.js +++ b/web/client/components/data/identify/enhancers/identify.js @@ -70,6 +70,7 @@ export const identifyLifecycle = compose( const { enabled, showInMapPopup, + maxItems, changeMousePointer = () => {}, disableCenterToMarker, enableInfoForSelectedLayers = true, @@ -80,7 +81,12 @@ export const identifyLifecycle = compose( } = this.props; // Initialize plugin configuration - onInitPlugin({enableInfoForSelectedLayers}); + onInitPlugin({ + enableInfoForSelectedLayers, + configuration: { + maxItems + } + }); if (enabled || showInMapPopup) { changeMousePointer('pointer'); diff --git a/web/client/plugins/Identify.jsx b/web/client/plugins/Identify.jsx index 14529c72fc..47282b38e4 100644 --- a/web/client/plugins/Identify.jsx +++ b/web/client/plugins/Identify.jsx @@ -201,6 +201,7 @@ const identifyDefaultProps = defaultProps({ * @prop cfg.disableCenterToMarker {bool} disable zoom to marker action * @prop cfg.zIndex {number} component z index order * @prop cfg.showInMapPopup {boolean} if true show the identify as popup + * @prop cfg.maxItems {number} the number of features returned by this tool * @prop cfg.showMoreInfo {boolean} if true shows the more info icon which allow user to show/hide Geocode viewer as popup (true by default) * @prop cfg.showEdit {boolean} if true, and when the FeatureEditor plugin is present, shows and edit button to edit the current feature(s) clicked in the grid. * @prop cfg.enableInfoForSelectedLayers {boolean} if true, if some layer is selected in the TOC, the feature info is performed only on the selected ones. if false, the info is queried for all the layers, independently from selection. (default is true). diff --git a/web/client/reducers/__tests__/mapInfo-test.js b/web/client/reducers/__tests__/mapInfo-test.js index 5f807b5a3f..13b93da3ef 100644 --- a/web/client/reducers/__tests__/mapInfo-test.js +++ b/web/client/reducers/__tests__/mapInfo-test.js @@ -917,7 +917,8 @@ describe('Test the mapInfo reducer', () => { }); it('onInitPlugin', () => { const initialState = { configuration: {} }; - const state = mapInfo(initialState, onInitPlugin({cfg1: "test"})); - expect(state.cfg1).toBe("test"); + const state = mapInfo(initialState, onInitPlugin({cfg1: "test", configuration: {maxItems: 3}})); + expect(state.cfg1).toEqual("test"); + expect(state.configuration).toEqual({maxItems: 3}); }); }); diff --git a/web/client/reducers/mapInfo.js b/web/client/reducers/mapInfo.js index 2f66efec11..7999e720cd 100644 --- a/web/client/reducers/mapInfo.js +++ b/web/client/reducers/mapInfo.js @@ -480,7 +480,14 @@ function mapInfo(state = initState, action) { return state; } case INIT_PLUGIN: { - return { ...state, ...action.cfg }; + return { + ...state, + ...action.cfg, + configuration: { + ...state.configuration, + ...(action.cfg?.configuration) + } + }; } default: return state;