From 3763d6f52b89e9e81d99cc2f1acea84c8a17cad0 Mon Sep 17 00:00:00 2001 From: sethvincent Date: Thu, 4 Jun 2020 20:53:26 -0700 Subject: [PATCH 1/3] show way conflict message --- app/components/Conflict.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/components/Conflict.js b/app/components/Conflict.js index 64c8ac34e..92f221a03 100644 --- a/app/components/Conflict.js +++ b/app/components/Conflict.js @@ -100,6 +100,17 @@ export default class Conflict extends React.Component { ) } + + featureIsAWay () { + return ( + + + Overwriting a conflicting line or area is not currently supported. Discard this edit and fetch latest data. + + + ) + } + renderDiff (prop) { let Fields if (prop.newValue) { @@ -217,6 +228,9 @@ export default class Conflict extends React.Component { if (updatedFeature.isDeleted) { return this.upstreamDeleted() } + if (updatedFeature.geometry.type === 'LineString' || updatedFeature.geometry.type === 'Polygon') { + return this.featureIsAWay() + } if (originalEdit.type === 'delete') { return this.featureDeleted() } From 3cbaa0e0c5b163b5e690066f9dff66bb7ca0153f Mon Sep 17 00:00:00 2001 From: sethvincent Date: Fri, 5 Jun 2020 16:58:16 -0700 Subject: [PATCH 2/3] show only the discard edit button when there is a way conflict --- .../UserContributions/UserContributionsItemScreen.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/screens/UserContributions/UserContributionsItemScreen.js b/app/screens/UserContributions/UserContributionsItemScreen.js index 5cafca74b..ccbdbe59f 100644 --- a/app/screens/UserContributions/UserContributionsItemScreen.js +++ b/app/screens/UserContributions/UserContributionsItemScreen.js @@ -196,7 +196,19 @@ class UserContributionsItemScreen extends React.Component { ] } + getWayConflictActions () { + return [ + { + name: 'trash-bin', + onPress: this.discardEdit + } + ] + } + getHeaderActions (edit) { + if (edit.newFeature.geometry.type === 'LineString' || edit.newFeature.geometry.type === 'Polygon') { + return this.getWayConflictActions() + } if (edit.status === 'success') { return this.getUploadedActions() } From 372e1297366f2ec6c9ee24c459e3524b7eaab08b Mon Sep 17 00:00:00 2001 From: sethvincent Date: Mon, 8 Jun 2020 15:31:20 -0700 Subject: [PATCH 3/3] use edit.newFeature.wayEditingHistory to determine if conflicting feature is a way --- app/components/Conflict.js | 2 +- app/screens/UserContributions/UserContributionsItemScreen.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/Conflict.js b/app/components/Conflict.js index 92f221a03..1fb38283e 100644 --- a/app/components/Conflict.js +++ b/app/components/Conflict.js @@ -228,7 +228,7 @@ export default class Conflict extends React.Component { if (updatedFeature.isDeleted) { return this.upstreamDeleted() } - if (updatedFeature.geometry.type === 'LineString' || updatedFeature.geometry.type === 'Polygon') { + if (originalEdit.newFeature.wayEditingHistory) { return this.featureIsAWay() } if (originalEdit.type === 'delete') { diff --git a/app/screens/UserContributions/UserContributionsItemScreen.js b/app/screens/UserContributions/UserContributionsItemScreen.js index ccbdbe59f..4d23b27f9 100644 --- a/app/screens/UserContributions/UserContributionsItemScreen.js +++ b/app/screens/UserContributions/UserContributionsItemScreen.js @@ -206,7 +206,7 @@ class UserContributionsItemScreen extends React.Component { } getHeaderActions (edit) { - if (edit.newFeature.geometry.type === 'LineString' || edit.newFeature.geometry.type === 'Polygon') { + if (edit.newFeature.wayEditingHistory) { return this.getWayConflictActions() } if (edit.status === 'success') {