Skip to content

Commit

Permalink
See #2211. Unsupported message also for geometry collection (#2300)
Browse files Browse the repository at this point in the history
  • Loading branch information
offtherailz committed Oct 18, 2017
1 parent 9090ed8 commit 276c679
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions web/client/selectors/__tests__/featuregrid-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,5 +433,12 @@ describe('Test featuregrid selectors', () => {
initialStateWithGmlGeometry.query.featureTypes['editing:polygons'].original.featureTypes[0].properties[1].type = 'gml:Geometry';
initialStateWithGmlGeometry.query.featureTypes['editing:polygons'].original.featureTypes[0].properties[1].localType = 'Geometry';
expect(hasSupportedGeometry(initialStateWithGmlGeometry)).toBe(false);
initialStateWithGmlGeometry.query.featureTypes['editing:polygons'].original.featureTypes[0].properties[1].type = 'gml:GeometryCollection';
initialStateWithGmlGeometry.query.featureTypes['editing:polygons'].original.featureTypes[0].properties[1].localType = 'GeometryCollection';
expect(hasSupportedGeometry(initialStateWithGmlGeometry)).toBe(false);
initialStateWithGmlGeometry.query.featureTypes['editing:polygons'].original.featureTypes[0].properties[1].type = 'gml:Polygon';
initialStateWithGmlGeometry.query.featureTypes['editing:polygons'].original.featureTypes[0].properties[1].localType = 'Polygon';
expect(hasSupportedGeometry(initialStateWithGmlGeometry)).toBe(true);

});
});
2 changes: 1 addition & 1 deletion web/client/selectors/featuregrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const hasGeometrySelectedFeature = (state) => {
return false;
};

const notSupportedGeometries = ['Geometry'];
const notSupportedGeometries = ['Geometry', 'GeometryCollection'];

const hasSupportedGeometry = state => head(notSupportedGeometries.filter(g => geomTypeSelectedFeatureSelector(state) === g)) ? false : true;
const hasChangesSelector = state => changesSelector(state) && changesSelector(state).length > 0;
Expand Down

0 comments on commit 276c679

Please sign in to comment.