Skip to content

Commit 9584ac6

Browse files
committed
Fix issue 2410
1 parent ceaf6b8 commit 9584ac6

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/projects/detail/components/timeline/milestones/MilestoneTypeCheckpointReview/MilestoneTypeCheckpointReview.jsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class MilestoneTypeCheckpointReview extends React.Component {
4040
this.completeReview = this.completeReview.bind(this)
4141
this.toggleRejectedSection = this.toggleRejectedSection.bind(this)
4242
this.moveToReviewingState = this.moveToReviewingState.bind(this)
43+
this.shouldActivateCompleteReviewButton = this.shouldActivateCompleteReviewButton.bind(this)
4344
}
4445

4546
showCompleteReviewConfirmation() {
@@ -170,6 +171,18 @@ class MilestoneTypeCheckpointReview extends React.Component {
170171
return milestone[`${milestone.status}Text`]
171172
}
172173

174+
shouldActivateCompleteReviewButton(links, selectedLinks) {
175+
const linksLength = links.length
176+
const selectedLinksLength = selectedLinks.length
177+
if (linksLength < 5 && selectedLinksLength === linksLength) {
178+
return false
179+
} else if (linksLength >= 5 && selectedLinksLength >= 5) {
180+
return false
181+
} else {
182+
return true
183+
}
184+
}
185+
173186
render() {
174187
const {
175188
milestone,
@@ -346,7 +359,7 @@ class MilestoneTypeCheckpointReview extends React.Component {
346359
<button
347360
className={'tc-btn tc-btn-primary'}
348361
onClick={!currentUser.isCustomer ? this.showCompleteReviewConfirmation : this.completeReview}
349-
disabled={!isInReview}
362+
disabled={this.shouldActivateCompleteReviewButton(links, selectedLinks) || !isInReview}
350363
>
351364
Complete review ({
352365
daysLeft >= 0

0 commit comments

Comments
 (0)