Skip to content

Commit 82bb40a

Browse files
authored
Merge pull request #4463 from appirio-tech/hotfix/milestone_management_challenge_status
[PROD][HOTFIX] milestone management challenge status
2 parents 9d53191 + 75a3c7b commit 82bb40a

File tree

2 files changed

+6
-29
lines changed

2 files changed

+6
-29
lines changed

src/projects/detail/components/SimplePlan/components/MilestoneChallengeRow/MilestoneChallengeRow.jsx

+2-19
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import {
1010

1111
import './MilestoneChallengeRow.scss'
1212

13-
const STALLED_MSG = 'Stalled'
14-
const DRAFT_MSG = 'Draft'
15-
1613
function MilestoneChallengeRow({challenge, isEmpty, isLoading, isUpdatable}) {
1714

1815
if (isEmpty) {
@@ -43,32 +40,18 @@ function MilestoneChallengeRow({challenge, isEmpty, isLoading, isUpdatable}) {
4340
name,
4441
status,
4542
track,
46-
type,
4743
startDate,
48-
phases: allPhases,
4944
endDate
5045
} = challenge
5146

52-
let statusPhase = allPhases
53-
.filter(p => p.name !== 'Registration' && p.isOpen)
54-
.sort((a, b) => moment(a.scheduledEndDate).diff(b.scheduledEndDate))[0]
55-
56-
if (!statusPhase && type === 'First2Finish' && allPhases.length) {
57-
statusPhase = _.clone(allPhases[0])
58-
statusPhase.name = 'Submission'
59-
}
60-
61-
let phaseMessage = STALLED_MSG
62-
if (statusPhase) phaseMessage = statusPhase.name
63-
else if (status === 'Draft') phaseMessage = DRAFT_MSG
64-
47+
const statusLabel = status.indexOf('Cancelled') === 0 ? 'Cancelled': status
6548

6649
return (
6750
<tr styleName="challenge-table-row-wrap">
6851
<td colSpan={isUpdatable? '9': '8'}>
6952
<div styleName="challenge-table-row">
7053
<div styleName="title"><a href={`${CHALLENGE_DETAIL_APP}/${id}`}>{name}</a></div>
71-
<div styleName="status"><div styleName={phaseMessage.split(' ').join('')}>{phaseMessage}</div></div>
54+
<div styleName="status"><div styleName={statusLabel}>{statusLabel}</div></div>
7255
<div styleName="type"><div styleName={track.split(' ').join('')}>{track}</div></div>
7356
<div styleName="start-date">{moment(startDate).format('MM-DD-YYYY')}</div>
7457
<div styleName="end-date">{moment(endDate).format('MM-DD-YYYY')}</div>

src/projects/detail/components/SimplePlan/components/MilestoneChallengeRow/MilestoneChallengeRow.scss

+4-10
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,11 @@
2929
padding: 4px 0;
3030
text-align: center;
3131
color: #fff;
32-
&.Submission { background-color: $tc-light-blue-100; }
33-
&.IterativeReview { background-color: $tc-green-100; }
34-
&.Registration { background-color: $tc-orange-100; }
35-
&.Appeals { background-color: $tc-orange-100; }
36-
&.AppealsResponse { background-color: $tc-orange-100; }
37-
&.Post-Mortem { background-color: $tc-orange-100; }
32+
&.New { background-color: $tc-yellow-100; }
33+
&.Active { background-color: $tc-green-100; }
3834
&.Draft { background-color: $tc-gray-20; }
39-
&.Stalled { background-color: $tc-gray-20; }
40-
&.Completed { background-color: $tc-green-100; }
41-
&.Review { background-color: $tc-orange-100; }
42-
&.CheckpointReview { background-color: $tc-orange-100; }
35+
&.Completed { background-color: $tc-dark-blue-100; }
36+
&.Cancelled { background-color: $tc-gray-100; }
4337
}
4438

4539
}

0 commit comments

Comments
 (0)