Skip to content

Commit

Permalink
Merge pull request #1007 from osmlab/prerelease
Browse files Browse the repository at this point in the history
v3.5
  • Loading branch information
nrotstan authored Dec 6, 2019
2 parents dd4254d + e013788 commit af175fa
Show file tree
Hide file tree
Showing 60 changed files with 937 additions and 3,196 deletions.
3 changes: 1 addition & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ REACT_APP_TITLE='MapRoulette'

# Features flags. Set each to 'enabled' or 'disabled'.
REACT_APP_FEATURE_SOCIAL_SHARING='enabled'
REACT_APP_FEATURE_BOUNDED_TASK_BROWSING='disabled'
REACT_APP_FEATURE_LEADERBOARD='enabled'
REACT_APP_FEATURE_CHALLENGE_ANALYSIS_TABLE='disabled'
REACT_APP_FEATURE_MOBILE_DEVICES='disabled'
Expand Down Expand Up @@ -45,7 +44,7 @@ REACT_APP_NEARBY_LATITUDE_LENGTH=0.75
# box in order for map-bounded task browsing to become available on the locator
# map. The larger this value, the greater the load put on the server when users
# are browsing map-bounded tasks.
REACT_APP_BOUNDED_TASKS_MAX_DIMENSION=2.5
REACT_APP_BOUNDED_TASKS_MAX_DIMENSION=70

# Default time, in hours, until a newly-created virtual challenge expires.
REACT_APP_VIRTUAL_CHALLENGE_DURATION=36
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ The format is based on
This project adheres to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [v3.5] - 2019-12-06
### Added
- Task browsing at much lower zoom levels on Find Challenges page
- Overlay on Find Challenges map with "Near Me" option and nominatum search
- Relocated location filters on Find Challenges page above search results
- Automatic refreshing of task locks while mapper is actively working on a task
- New option to explictly "unlock" (abandon) a task on task-completion page

### Fixed
- Potential wrong timezone on origin/sourcing date recorded for task data
- Occasional incorrect challenge-completion status resulting from stale checks
- Incorrect OSM entity ids sometimes sent to iD and JOSM editors

### Removed
- "Within Map Bounds" filter now that task browsing is offered at lower zoom


## [v3.4.6] - 2019-11-14
### Added
- Option to change task data source date when rebuilding tasks
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.4.6",
"version": "3.5",
"private": true,
"dependencies": {
"@mapbox/geo-viewport": "^0.4.0",
Expand Down
2 changes: 2 additions & 0 deletions src/PersistedStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { virtualChallengeEntities }
from './services/VirtualChallenge/VirtualChallenge'
import { taskEntities } from './services/Task/Task'
import { currentClusteredTasks } from './services/Task/ClusteredTask'
import { currentTaskClusters } from './services/Task/TaskClusters'
import { currentBoundedTasks } from './services/Task/BoundedTask'
import { currentReviewTasks } from './services/Task/TaskReview/TaskReview'
import { commentEntities } from './services/Comment/Comment'
Expand Down Expand Up @@ -55,6 +56,7 @@ export const initializeStore = function() {
adminContext,
currentPreferences,
currentClusteredTasks,
currentTaskClusters,
currentBoundedTasks,
currentReviewTasks,
entities,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import { addError } from '../../../../services/Error/Error'
import AppErrors from '../../../../services/Error/AppErrors'
import AsManageableChallenge
from '../../../../interactions/Challenge/AsManageableChallenge'
import { isUsableChallengeStatus }
from '../../../../services/Challenge/ChallengeStatus/ChallengeStatus'
import WithClusteredTasks
from '../../../HOCs/WithClusteredTasks/WithClusteredTasks'
import WithChallengeManagement
Expand All @@ -27,12 +25,10 @@ import WithChallengeManagement
*
* @author [Neil Rotstan](https://github.com/nrotstan)
*/
const WithCurrentChallenge = function(WrappedComponent,
includeTasks=false) {
const WithCurrentChallenge = function(WrappedComponent) {
return class extends Component {
state = {
loadingChallenge: true,
loadingTasks: includeTasks,
}

currentChallengeId = () =>
Expand All @@ -53,24 +49,10 @@ const WithCurrentChallenge = function(WrappedComponent,
this.props.fetchChallengeActivity(challengeId, new Date(challenge.created)),
this.props.fetchChallengeActions(challengeId),
]).then(() => this.setState({loadingChallenge: false}))

if (includeTasks) {
// Only fetch tasks if the challenge is in a usable status. Otherwise
// we risk errors if the tasks are still building or failed to build.
if (isUsableChallengeStatus(challenge.status, true)) {
this.setState({loadingTasks: true})
this.props.fetchClusteredTasks(challengeId).then(() =>
this.setState({loadingTasks: false})
)
}
else {
this.setState({loadingTasks: false})
}
}
})
}
else {
this.setState({loadingChallenge: false, loadingTasks: false})
this.setState({loadingChallenge: false})
}
}

Expand All @@ -89,23 +71,16 @@ const WithCurrentChallenge = function(WrappedComponent,
challengeDenormalizationSchema(),
this.props.entities)
)

if (includeTasks &&
_get(this.props, 'clusteredTasks.challengeId') === challengeId) {
clusteredTasks = this.props.clusteredTasks
}
}

return <WrappedComponent key={challengeId}
challenge={challenge}
clusteredTasks={clusteredTasks}
loadingChallenge={this.state.loadingChallenge}
loadingTasks={this.state.loadingTasks}
refreshChallenge={this.loadChallenge}
{..._omit(this.props, ['entities',
'fetchChallenge',
'fetchChallengeComments',
'fetchClusteredTasks',
'clusteredTasks',
'fetchChallengeActivity'])} />
}
Expand Down Expand Up @@ -143,11 +118,11 @@ const mapDispatchToProps = (dispatch, ownProps) => ({
},
})

export default (WrappedComponent, includeTasks) =>
export default (WrappedComponent) =>
connect(mapStateToProps, mapDispatchToProps)(
WithClusteredTasks(
WithChallengeManagement(
WithCurrentChallenge(WrappedComponent, includeTasks)
WithCurrentChallenge(WrappedComponent)
)
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,7 @@ WithManageableProjects(
WidgetDataTarget.challenge,
DASHBOARD_NAME,
defaultDashboardSetup
),
false
)
),
'challengeOwner'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { TaskStatus,
from '../../../../services/Task/TaskStatus/TaskStatus'
import { messagesByPriority }
from '../../../../services/Task/TaskPriority/TaskPriority'
import { toLatLngBounds } from '../../../../services/MapBounds/MapBounds'
import AsManager from '../../../../interactions/User/AsManager'
import WithBoundedTasks
from '../../../HOCs/WithBoundedTasks/WithBoundedTasks'
Expand Down Expand Up @@ -47,6 +48,7 @@ const ClusterMap = WithChallengeTaskClusters(
export class ViewChallengeTasks extends Component {
state = {
bulkUpdating: false,
boundsReset: false,
}

takeTaskSelectionAction = action => {
Expand Down Expand Up @@ -81,12 +83,14 @@ export class ViewChallengeTasks extends Component {
}

resetMapBounds = () => {
this.setState({boundsReset: true})
this.props.clearMapBounds(this.props.searchGroup)
}

mapBoundsUpdated = (challengeId, bounds, zoom) => {
this.props.setChallengeOwnerMapBounds(challengeId, bounds, zoom)
this.props.updateTaskFilterBounds(bounds, zoom)
this.setState({boundsReset: false})
}

showMarkerPopup = markerData => {
Expand Down Expand Up @@ -156,9 +160,12 @@ export class ViewChallengeTasks extends Component {
loadingTasks={this.props.loadingTasks}
showMarkerPopup={this.showMarkerPopup}
allowClusterToggle
initialBounds={this.state.boundsReset ?
toLatLngBounds(_get(this.props, 'criteria.boundingBox')) : null}
{...this.props}
/>

this.boundsReset = false
return (
<div className='admin__manage-tasks'>
<GeographicIndexingNotice challenge={this.props.challenge} />
Expand Down
187 changes: 0 additions & 187 deletions src/components/ChallengeBrowseMap/ChallengeBrowseMap.js

This file was deleted.

Loading

0 comments on commit af175fa

Please sign in to comment.