@@ -52,9 +52,9 @@ class ChallengePhaseHelper {
52
52
) ;
53
53
if (
54
54
! _ . isUndefined ( fixedStartDate ) &&
55
- moment ( scheduledStartDate ) . isBefore ( moment ( fixedStartDate ) )
55
+ moment ( scheduledStartDate ) . isSameOrBefore ( moment ( fixedStartDate ) )
56
56
) {
57
- scheduledStartDate = fixedStartDate ;
57
+ scheduledStartDate = moment ( fixedStartDate ) . add ( 5 , "minutes" ) . toDate ( ) . toISOString ( ) ;
58
58
}
59
59
phase . scheduledStartDate = moment ( scheduledStartDate ) . toDate ( ) . toISOString ( ) ;
60
60
phase . scheduledEndDate = moment ( phase . scheduledStartDate )
@@ -108,7 +108,7 @@ class ChallengePhaseHelper {
108
108
if ( updatedPhase . name === "Post-Mortem" ) {
109
109
updatedPhase . predecessor = "a93544bc-c165-4af4-b55e-18f3593b457a" ;
110
110
}
111
- if ( _ . isUndefined ( updatedPhase . actualEndDate ) && updatedPhase . name !== "Iterative Review" ) {
111
+ if ( _ . isUndefined ( updatedPhase . actualEndDate ) ) {
112
112
updatedPhase . duration = _ . defaultTo ( _ . get ( newPhase , "duration" ) , updatedPhase . duration ) ;
113
113
}
114
114
if ( _ . isUndefined ( updatedPhase . predecessor ) ) {
@@ -118,9 +118,9 @@ class ChallengePhaseHelper {
118
118
) ;
119
119
if (
120
120
! _ . isUndefined ( fixedStartDate ) &&
121
- moment ( scheduledStartDate ) . isBefore ( moment ( fixedStartDate ) )
121
+ moment ( scheduledStartDate ) . isSameOrBefore ( moment ( fixedStartDate ) )
122
122
) {
123
- scheduledStartDate = fixedStartDate ;
123
+ scheduledStartDate = moment ( fixedStartDate ) . add ( 5 , "minutes" ) . toDate ( ) . toISOString ( ) ;
124
124
}
125
125
if ( isBeingActivated && moment ( scheduledStartDate ) . isSameOrBefore ( moment ( ) ) ) {
126
126
updatedPhase . isOpen = true ;
@@ -134,7 +134,11 @@ class ChallengePhaseHelper {
134
134
. toDate ( )
135
135
. toISOString ( ) ;
136
136
}
137
- if ( ! _ . isUndefined ( newPhase ) && ! _ . isUndefined ( newPhase . constraints ) ) {
137
+ if (
138
+ _ . isUndefined ( phase . actualEndDate ) &&
139
+ ! _ . isUndefined ( newPhase ) &&
140
+ ! _ . isUndefined ( newPhase . constraints )
141
+ ) {
138
142
updatedPhase . constraints = newPhase . constraints ;
139
143
}
140
144
if ( _ . isUndefined ( fixedStartDate ) ) {
0 commit comments