-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #829 from osmlab/prerelease
v3.3.3 release
- Loading branch information
Showing
117 changed files
with
8,053 additions
and
4,454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" | ||
integrity="sha512-07I2e+7D8p6he1SIM+1twR5TIrhUQn9+I6yjqD53JQjFiMf8EtC93ty0/5vJTZGF8aAocvHYNEDJajGdNx1IsQ==" | ||
crossorigin=""/> | ||
<link href='https://unpkg.com/[email protected]/dist/mapillary.min.css' rel='stylesheet' /> | ||
|
||
<!-- | ||
Notice the use of %PUBLIC_URL% in the tags above. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/components/AdminPane/HOCs/WithChallengeReviewMetrics/WithChallengeReviewMetrics.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React, { Component } from 'react' | ||
import { connect } from 'react-redux' | ||
import _omit from 'lodash/omit' | ||
import _get from 'lodash/get' | ||
import { fetchReviewMetrics, ReviewTasksType } | ||
from '../../../../services/Task/TaskReview/TaskReview' | ||
import WithCurrentUser from '../../../HOCs/WithCurrentUser/WithCurrentUser' | ||
|
||
/** | ||
* WithChallengeReviewMetrics retrieves review metrics for the challenge tasks | ||
* | ||
* @author [Kelli Rotstan](https://github.com/krotstan) | ||
*/ | ||
export const WithChallengeReviewMetrics = function(WrappedComponent) { | ||
return class extends Component { | ||
state = { | ||
loading: false | ||
} | ||
|
||
updateMetrics(props) { | ||
this.setState({loading: true}) | ||
|
||
props.updateReviewMetrics(_get(props.user, 'id'), _get(props.challenge, 'id')).then(() => { | ||
this.setState({loading: false}) | ||
}) | ||
} | ||
|
||
componentDidMount() { | ||
this.updateMetrics(this.props) | ||
} | ||
|
||
componentDidUpdate(prevProps) { | ||
if (_get(prevProps.challenge, 'id') !== _get(this.props.challenge, 'id')) { | ||
this.updateMetrics(this.props) | ||
} | ||
} | ||
|
||
render() { | ||
return ( | ||
<WrappedComponent reviewMetrics = {this.props.reviewMetrics} | ||
loading={this.state.loading} | ||
{..._omit(this.props, ['updateReviewMetrics'])} />) | ||
} | ||
} | ||
} | ||
|
||
const mapStateToProps = state => ({ reviewMetrics: _get(state, 'currentReviewTasks.metrics') }) | ||
|
||
const mapDispatchToProps = (dispatch, ownProps) => ({ | ||
updateReviewMetrics: (userId, challengeId) => { | ||
return dispatch(fetchReviewMetrics(userId, ReviewTasksType.allReviewedTasks, {filters:{challengeId}})) | ||
}, | ||
}) | ||
|
||
export default WrappedComponent => | ||
connect(mapStateToProps, mapDispatchToProps)(WithCurrentUser(WithChallengeReviewMetrics(WrappedComponent))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.