Skip to content

Commit

Permalink
Identify maxItems cfg option removed #4238 (#6066)
Browse files Browse the repository at this point in the history
* Identify maxItems cfg option removed #4238
  • Loading branch information
myrdstom authored Oct 22, 2020
1 parent c787d67 commit 881ed17
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 2 deletions.
48 changes: 48 additions & 0 deletions web/client/epics/__tests__/identify-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,54 @@ describe('identify Epics', () => {
}
}, state);
});
it('getFeatureInfoOnFeatureInfoClick WMS with maxItems for configuration set', (done) => {
// remove previous hook
registerHook('RESOLUTION_HOOK', undefined);
const state = {
map: TEST_MAP_STATE,
mapInfo: {
clickPoint: { latlng: { lat: 36.95, lng: -79.84 } },
disabledAlwaysOn: false,
configuration: {
showEmptyMessageGFI: false,
infoFormat: "text/plain",
maxItems: 50
}
},
layers: {
flat: [{
id: "TEST",
title: "TITLE",
type: "wms",
visibility: true,
url: 'base/web/client/test-resources/featureInfo-response.json'
},
{
id: "TEST2",
name: "TEST2",
title: "TITLE2",
type: "wms",
visibility: true,
url: 'base/web/client/test-resources/featureInfo-response.json'
}]
}
};
const sentActions = [featureInfoClick({ latlng: { lat: 36.95, lng: -79.84 } })];
const NUM_ACTIONS = 5;
testEpic(getFeatureInfoOnFeatureInfoClick, NUM_ACTIONS, sentActions, (actions) => {
try {
const [a0, a1, a2, a3, a4] = actions;
expect(a0).toBeTruthy();
expect(a1).toBeTruthy();
expect(a2).toBeTruthy();
expect(a3.requestParams.feature_count).toBe(50);
expect(a4).toBeTruthy();
done();
} catch (ex) {
done(ex);
}
}, state);
});
it('getFeatureInfoOnFeatureInfoClick WMS with filteredList and override params', (done) => {
// remove previous hook
registerHook('RESOLUTION_HOOK', undefined);
Expand Down
4 changes: 2 additions & 2 deletions web/client/selectors/mapInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ export const identifyOptionsSelector = createStructuredSelector({
format: generalInfoFormatSelector,
map: mapSelector,
point: clickPointSelector,
currentLocale: currentLocaleSelector
currentLocale: currentLocaleSelector,
maxItems: (state) => get(state, "mapInfo.configuration.maxItems")
});

export const isHighlightEnabledSelector = (state = {}) => state.mapInfo && state.mapInfo.highlight;
Expand Down Expand Up @@ -200,4 +201,3 @@ export const mapTriggerSelector = state => {
}
return state.mapInfo.configuration.trigger;
};

0 comments on commit 881ed17

Please sign in to comment.