Skip to content

Commit

Permalink
Fix ReportCollection undefined mapIds wrong named prop
Browse files Browse the repository at this point in the history
Make mapId required for ReportMap
  • Loading branch information
cemalettin-work committed Nov 18, 2020
1 parent ec84168 commit 77a0a1f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client/src/components/ReportMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const ReportMap = ({
return (
<ReportsMapWidget
values={reports}
mapId={mapId}
widgetId={mapId}
width={width}
height={height}
marginBottom={marginBottom}
Expand All @@ -74,10 +74,14 @@ ReportMap.propTypes = {
pageDispatchers: PageDispatchersPropType,
queryParams: PropTypes.object,
setTotalCount: PropTypes.func,
mapId: PropTypes.string, // pass this when you have more than one map on a page
// pass mapId explicitly when you have more than one map on a page (else the default is fine):
mapId: PropTypes.string.isRequired,
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
marginBottom: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
}

ReportMap.defaultProps = {
mapId: "reports"
}
export default connect(null, mapPageDispatchersToProps)(ReportMap)

0 comments on commit 77a0a1f

Please sign in to comment.