Skip to content

Commit

Permalink
Merge pull request #1219 from osmlab/prerelease
Browse files Browse the repository at this point in the history
v3.6.1
  • Loading branch information
nrotstan authored Apr 28, 2020
2 parents 52de58e + bd0dd30 commit 289e1ee
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 7 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ This project adheres to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).


## [v3.6.1] - 2020-04-28
### Added
- Links to review tasks on Browse Challenge and Browse Project pages

### Fixed
- User metrics failing to load
- Remove limit when fetching lists of challenges and projects for review


## [v3.6.0] - 2020-04-23
### Added
- Cooperative challenges
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "maproulette3",
"version": "3.6.0",
"version": "3.6.1",
"private": true,
"dependencies": {
"@mapbox/geo-viewport": "^0.4.0",
Expand Down
15 changes: 14 additions & 1 deletion src/components/ChallengeDetail/ChallengeDetail.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from 'react'
import { Link } from 'react-router-dom'
import { FormattedMessage, FormattedRelative, injectIntl } from 'react-intl'
import classNames from 'classnames'
import _isObject from 'lodash/isObject'
import _get from 'lodash/get'
import _findIndex from 'lodash/findIndex'
Expand Down Expand Up @@ -225,7 +226,19 @@ export class ChallengeDetail extends Component {
{unsaveControl}
</li>
)}
{manageControl && <li>{manageControl}</li>}
<li>
{_get(this.props.user, 'settings.isReviewer') &&
<Link
className={classNames(
"mr-text-green-lighter hover:mr-text-white mr-mr-4 mr-leading-none",
{"mr-border-r-2 mr-border-white-10 mr-pr-4 mr-mr-4": manageControl})}
to={`/review?challengeId=${challenge.id}&challengeName=${challenge.name}`}
>
<FormattedMessage {...messages.viewReviews} />
</Link>
}
{manageControl}
</li>
</ul>
</div>
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/components/ChallengeDetail/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,9 @@ export default defineMessages({
defaultMessage: "View Leaderboard",
},

viewReviews: {
id: "ChallengeDetails.fields.viewReviews.label",
defaultMessage: "Review",
},

})
5 changes: 5 additions & 0 deletions src/components/ProjectDetail/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,9 @@ export default defineMessages({
id: "ProjectDetails.fields.viewLeaderboard.label",
defaultMessage: "View Leaderboard",
},

viewReviews: {
id: "ProjectDetails.fields.viewReviews.label",
defaultMessage: "Review",
},
})
17 changes: 15 additions & 2 deletions src/components/ProjectDetail/ProjectDetail.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { Component } from 'react'
import { Link } from 'react-router-dom'
import classNames from 'classnames'
import { FormattedMessage, FormattedRelative, injectIntl } from 'react-intl'
import _isObject from 'lodash/isObject'
import _get from 'lodash/get'
Expand Down Expand Up @@ -124,8 +125,20 @@ export class ProjectDetail extends Component {

<ProjectProgress className="mr-my-4" {...this.props} />

<ul className="mr-card-challenge__actions">
{manageControl && <li>{manageControl}</li>}
<ul className="mr-card-challenge__actions mr-mt-4 mr-leading-none mr-text-base">
<li>
{_get(this.props.user, 'settings.isReviewer') &&
<Link
className={classNames(
"mr-text-green-lighter hover:mr-text-white mr-mr-4",
{"mr-border-r-2 mr-border-white-10 mr-pr-4 mr-mr-4": manageControl})}
to={`/review?projectId=${project.id}&projectName=${project.displayName}`}
>
<FormattedMessage {...messages.viewReviews} />
</Link>
}
{manageControl}
</li>
</ul>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/lang/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
"ChallengeDetails.fields.lastChallengeDetails.TaskRefresh.label": "Tasks From",
"ChallengeDetails.fields.lastChallengeDetails.DataOriginDate.label": "Tasks built on {refreshDate} from data sourced on {sourceDate}.",
"ChallengeDetails.fields.viewLeaderboard.label": "View Leaderboard",
"ChallengeDetails.fields.viewReviews.label": "Review",
"ChallengeEndModal.header": "Challenge End",
"ChallengeEndModal.primaryMessage": "You have marked all remaining tasks in this challenge as either skipped or too hard.",
"ChallengeEndModal.control.dismiss.label": "Continue",
Expand Down Expand Up @@ -613,6 +614,7 @@
"ProjectDetails.fields.created.label": "Created",
"ProjectDetails.fields.modified.label": "Modified",
"ProjectDetails.fields.viewLeaderboard.label": "View Leaderboard",
"ProjectDetails.fields.viewReviews.label": "Review",
"Admin.TaskReview.controls.updateReviewStatusTask.label": "Update Review Status",
"Admin.TaskReview.controls.currentTaskStatus.label": "Task Status:",
"Admin.TaskReview.controls.currentReviewStatus.label": "Review Status:",
Expand Down Expand Up @@ -1021,7 +1023,7 @@
"Review.Dashboard.myReviewTasks": "My Reviewed Tasks",
"Review.Dashboard.allReviewedTasks": "All Review-related Tasks",
"Review.Dashboard.volunteerAsReviewer.label": "Volunteer as a Reviewer",
"Review.Dashboard.goBack.label": "Go Back",
"Review.Dashboard.goBack.label": "Reconfigure Reviews",
"ReviewStatus.metrics.title": "Review Status",
"ReviewStatus.metrics.awaitingReview": "Tasks awaiting review",
"ReviewStatus.metrics.approvedReview": "Review tasks that passed",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Review/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ export default defineMessages({

goBack: {
id: "Review.Dashboard.goBack.label",
defaultMessage: "Go Back",
defaultMessage: "Reconfigure Reviews",
}
})
19 changes: 19 additions & 0 deletions src/pages/Review/Review.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import PropTypes from 'prop-types'
import { Link } from 'react-router-dom'
import { injectIntl } from 'react-intl'
import MediaQuery from 'react-responsive'
import queryString from 'query-string'
import classNames from 'classnames'
import _cloneDeep from 'lodash/cloneDeep'
import _get from 'lodash/get'
import _isFinite from 'lodash/isFinite'
import _parseInt from 'lodash/parseInt'
import _isUndefined from 'lodash/isUndefined'
import AsEndUser from '../../interactions/User/AsEndUser'
import WithCurrentUser from '../../components/HOCs/WithCurrentUser/WithCurrentUser'
Expand Down Expand Up @@ -63,6 +66,19 @@ export class ReviewTasksDashboard extends Component {
}

componentDidUpdate(prevProps) {
if (!this.state.filterSelected[this.state.showType] &&
_get(this.props.history, 'location.search')) {
const urlParams = queryString.parse(_get(this.props, 'location.search'))
if (_isFinite(_parseInt(urlParams.challengeId))) {
this.setSelectedChallenge(urlParams.challengeId, urlParams.challengeName)
return
}
else if (_isFinite(_parseInt(urlParams.projectId))) {
this.setSelectedProject(urlParams.projectId, urlParams.projectName)
return
}
}

if (this.props.location.pathname !== prevProps.location.pathname &&
this.props.location.search !== prevProps.location.search) {
window.scrollTo(0, 0)
Expand Down Expand Up @@ -103,6 +119,9 @@ export class ReviewTasksDashboard extends Component {
const filterSelected = _cloneDeep(this.state.filterSelected)
filterSelected[this.state.showType] = null
this.setState({filterSelected})
this.props.history.push({
pathname: `/review/${this.state.showType}`
})
}

changeTab = (tab) => {
Expand Down
3 changes: 2 additions & 1 deletion src/services/Task/TaskReview/TaskReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ export const fetchReviewChallenges = function(reviewTasksType,
return new Endpoint(
api.challenges.withReviewTasks,
{schema: [challengeSchema()],
params:{reviewTasksType: type, excludeOtherReviewers, tStatus}}
params:{reviewTasksType: type, excludeOtherReviewers, tStatus,
limit: -1}}
).execute().then(normalizedResults => {
dispatch(receiveReviewChallenges(normalizedResults.entities.challenges, RequestStatus.success))
dispatch(receiveReviewProjects(normalizedResults.entities.projects, RequestStatus.success))
Expand Down

0 comments on commit 289e1ee

Please sign in to comment.