Skip to content

Commit

Permalink
Merge pull request #299 from developmentseed/disallow-way-conflict-ov…
Browse files Browse the repository at this point in the history
…erwrite

show way conflict message
  • Loading branch information
geohacker authored Jun 9, 2020
2 parents 386ec52 + 372e129 commit 1594db4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/components/Conflict.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ export default class Conflict extends React.Component {
</PageWrapper>
)
}

featureIsAWay () {
return (
<PageWrapper>
<Text>
Overwriting a conflicting line or area is not currently supported. Discard this edit and fetch latest data.
</Text>
</PageWrapper>
)
}

renderDiff (prop) {
let Fields
if (prop.newValue) {
Expand Down Expand Up @@ -217,6 +228,9 @@ export default class Conflict extends React.Component {
if (updatedFeature.isDeleted) {
return this.upstreamDeleted()
}
if (originalEdit.newFeature.wayEditingHistory) {
return this.featureIsAWay()
}
if (originalEdit.type === 'delete') {
return this.featureDeleted()
}
Expand Down
12 changes: 12 additions & 0 deletions app/screens/UserContributions/UserContributionsItemScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,19 @@ class UserContributionsItemScreen extends React.Component {
]
}

getWayConflictActions () {
return [
{
name: 'trash-bin',
onPress: this.discardEdit
}
]
}

getHeaderActions (edit) {
if (edit.newFeature.wayEditingHistory) {
return this.getWayConflictActions()
}
if (edit.status === 'success') {
return this.getUploadedActions()
}
Expand Down

0 comments on commit 1594db4

Please sign in to comment.