Skip to content

Commit 25fcd20

Browse files
author
vikasrohit
authored
Merge pull request #2376 from appirio-tech/issue-2361
issue #2361 - Two types of `checkpoint-review` and `final-designs` milestones
2 parents c48592b + 8bfa2e7 commit 25fcd20

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/projects/actions/productsTimelines.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export function completeProductMilestone(productId, timelineId, milestoneId, upd
173173
details: {
174174
...nextMilestone.details,
175175
prevMilestoneContent: completedMilestone.details.content,
176+
prevMilestoneType: completedMilestone.type,
176177
}
177178
// always return completedMilestone for COMPLETE_PRODUCT_MILESTONE
178179
}).then(() => completedMilestone)
@@ -336,9 +337,14 @@ export function completeFinalFixesMilestone(productId, timelineId, milestoneId,
336337
details: {
337338
...nextMilestone.details,
338339
prevMilestoneContent: completedMilestone.details.content,
340+
prevMilestoneType: completedMilestone.type,
339341
},
340342
status: MILESTONE_STATUS.COMPLETED,
341-
})
343+
// always return completedMilestone for COMPLETE_PRODUCT_MILESTONE
344+
}).then(() => completedMilestone)
345+
} else {
346+
// always return completedMilestone for COMPLETE_PRODUCT_MILESTONE
347+
return completedMilestone
342348
}
343349
})
344350
]
@@ -352,7 +358,6 @@ export function completeFinalFixesMilestone(productId, timelineId, milestoneId,
352358
}
353359
}).then(() => {
354360
if (timeline) {
355-
356361
const phaseIndex = _.findIndex(state.projectState.phases, p => p.products[0].id === productId)
357362
const phase = state.projectState.phases[phaseIndex]
358363
dispatch(updatePhase(state.projectState.project.id, phase.id, {status: PHASE_STATUS_COMPLETED}, phaseIndex))

src/projects/detail/components/timeline/Milestone/Milestone.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ class Milestone extends React.Component {
282282
!isUpdating &&
283283
milestone.type === 'checkpoint-review' &&
284284
// old type 'checkpoint-review' which let user add links
285-
_.get(milestone, 'details.prevMilestoneContent.links[0].type') !== 'marvelapp' &&
285+
_.get(milestone, 'details.prevMilestoneType') !== 'add-links' &&
286286
(
287287
<MilestoneTypeCheckpointReview
288288
milestone={milestone}
@@ -297,8 +297,8 @@ class Milestone extends React.Component {
297297
!isEditing &&
298298
!isUpdating &&
299299
milestone.type === 'checkpoint-review' &&
300-
// new type 'checkpoint-review' which gets list of links from previous milestone
301-
_.get(milestone, 'details.prevMilestoneContent.links[0].type') === 'marvelapp' &&
300+
// new type 'checkpoint-review' which gets list of links from previous `add-links` milestone
301+
_.get(milestone, 'details.prevMilestoneType') === 'add-links' &&
302302
(
303303
<MilestoneTypeCheckpointReviewOnly
304304
milestone={milestone}
@@ -321,7 +321,7 @@ class Milestone extends React.Component {
321321

322322
{!isEditing && !isUpdating && milestone.type === 'final-designs' &&
323323
// old type 'final-designs' which let user add links
324-
_.get(milestone, 'details.prevMilestoneContent.links[0].type') !== 'marvelapp' &&
324+
_.get(milestone, 'details.prevMilestoneType') !== 'add-links' &&
325325
(
326326
<MilestoneTypeFinalDesigns
327327
milestone={milestone}
@@ -333,8 +333,8 @@ class Milestone extends React.Component {
333333
)}
334334

335335
{!isEditing && !isUpdating && milestone.type === 'final-designs' &&
336-
// new type 'final-designs' which gets list of links from previous milestone
337-
_.get(milestone, 'details.prevMilestoneContent.links[0].type') === 'marvelapp' &&
336+
// new type 'final-designs' which gets list of links from previous `add-links` milestone
337+
_.get(milestone, 'details.prevMilestoneType') === 'add-links' &&
338338
(
339339
<MilestoneTypeFinalDesignsSelectionOnly
340340
milestone={milestone}

0 commit comments

Comments
 (0)