@@ -56,19 +56,33 @@ enum PosmStateEnum {
56
56
'detecting_conflicts' ,
57
57
'creating_geojsons' ,
58
58
59
- 'conflicts' ,
60
- 'resolved' ,
59
+ 'resolving_conflicts' ,
61
60
'pushing_conflicts' ,
62
- 'pushed_upstream' ,
63
61
}
64
62
65
63
const AOI_POLL_TIME = 3000 ;
66
64
67
65
const isNotStarted = ( state : PosmStateEnum ) => state <= PosmStateEnum . not_triggered ;
68
- const isConflicted = ( state : PosmStateEnum ) => state === PosmStateEnum . conflicts ;
69
- const isResolved = ( state : PosmStateEnum ) => state === PosmStateEnum . resolved ;
70
- const isPushing = ( state : PosmStateEnum ) => state === PosmStateEnum . pushing_conflicts ;
71
- const isPushed = ( state : PosmStateEnum ) => state === PosmStateEnum . pushed_upstream ;
66
+
67
+ const isConflicted = (
68
+ state : PosmStateEnum ,
69
+ isCurrentStateComplete ?: boolean ,
70
+ ) => state === PosmStateEnum . resolving_conflicts && ! isCurrentStateComplete ;
71
+
72
+ const isResolved = (
73
+ state : PosmStateEnum ,
74
+ isCurrentStateComplete ?: boolean ,
75
+ ) => state === PosmStateEnum . resolving_conflicts && isCurrentStateComplete ;
76
+
77
+ const isPushing = (
78
+ state : PosmStateEnum ,
79
+ isCurrentStateComplete ?: boolean ,
80
+ ) => state === PosmStateEnum . pushing_conflicts && ! isCurrentStateComplete ;
81
+
82
+ const isPushed = (
83
+ state : PosmStateEnum ,
84
+ isCurrentStateComplete ?: boolean ,
85
+ ) => state === PosmStateEnum . pushing_conflicts && isCurrentStateComplete ;
72
86
73
87
interface PosmState {
74
88
id : PosmStateEnum ;
@@ -337,10 +351,8 @@ class Dashboard extends React.PureComponent<Props, State> {
337
351
{ id : PosmStateEnum . extracting_local_aoi , name : 'Extracting Local AOI' } ,
338
352
{ id : PosmStateEnum . detecting_conflicts , name : 'Identifying conflicts' } ,
339
353
{ id : PosmStateEnum . creating_geojsons , name : 'Creating GeoJSONs' } ,
340
- { id : PosmStateEnum . conflicts , name : 'Resolving conflicts' , inanimate : true } ,
341
- { id : PosmStateEnum . resolved , name : 'Resolved conflicts' , hidden : true } ,
354
+ { id : PosmStateEnum . resolving_conflicts , name : 'Resolving conflicts' } ,
342
355
{ id : PosmStateEnum . pushing_conflicts , name : 'Pushing resolved data to OSM' } ,
343
- { id : PosmStateEnum . pushed_upstream , name : 'Resolved data pushed to OSM' , hidden : true } ,
344
356
] ,
345
357
alreadyLoaded : false ,
346
358
} ;
@@ -518,10 +530,10 @@ class Dashboard extends React.PureComponent<Props, State> {
518
530
} = this . state ;
519
531
520
532
const notStartedStep = isNotStarted ( posmStatus . state ) ;
521
- const conflictedStep = isConflicted ( posmStatus . state ) ;
522
- const resolvedStep = isResolved ( posmStatus . state ) ;
523
- const pushingStep = isPushing ( posmStatus . state ) ;
524
- const pushedStep = isPushed ( posmStatus . state ) ;
533
+ const conflictedStep = isConflicted ( posmStatus . state , posmStatus . isCurrentStateComplete ) ;
534
+ const resolvedStep = isResolved ( posmStatus . state , posmStatus . isCurrentStateComplete ) ;
535
+ const pushingStep = isPushing ( posmStatus . state , posmStatus . isCurrentStateComplete ) ;
536
+ const pushedStep = isPushed ( posmStatus . state , posmStatus . isCurrentStateComplete ) ;
525
537
526
538
let conflictProgress = 0 ;
527
539
if ( totalResolvedElements && totalConflictingElements ) {
@@ -750,7 +762,7 @@ class Dashboard extends React.PureComponent<Props, State> {
750
762
{ ( ( conflictedStep || resolvedStep ) && ! posmStatus . hasErrored ) && (
751
763
< div className = { styles . checkboxesContainer } >
752
764
< Checkbox
753
- label = "Show Conflicts in Map "
765
+ label = "Show conflicted elements "
754
766
value = { conflictsVisibility }
755
767
onChange = { this . handleShowConflictsButtonClick }
756
768
/>
0 commit comments