From d77ff684d4ed3200cba2076fa87fc5caa94e0868 Mon Sep 17 00:00:00 2001 From: Ahmad Alkhawaja Date: Tue, 14 Sep 2021 20:51:57 +0400 Subject: [PATCH] show milestone approved modals disregard if there is any pending approvals --- .../MilestonesApprovalNotification.jsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/projects/detail/components/SimplePlan/components/MilestonesApprovalNotification/MilestonesApprovalNotification.jsx b/src/projects/detail/components/SimplePlan/components/MilestonesApprovalNotification/MilestonesApprovalNotification.jsx index dcab3a518..690bb4bbb 100644 --- a/src/projects/detail/components/SimplePlan/components/MilestonesApprovalNotification/MilestonesApprovalNotification.jsx +++ b/src/projects/detail/components/SimplePlan/components/MilestonesApprovalNotification/MilestonesApprovalNotification.jsx @@ -50,16 +50,13 @@ class MilestonesApprovalNotification extends React.Component { const { milestones } = this.props console.log('milestones', milestones) - - const inReviews = milestones.find( - (ms) => ms.status === PHASE_STATUS_IN_REVIEW - ) + const revieweds = milestones.filter( (ms) => ms.status === PHASE_STATUS_REVIEWED ).map( ms => {ms.currentApproval = this.findLatest(ms.approvals); return ms}) const showAllApproved = - !inReviews && revieweds.length > 0 && + revieweds.length > 0 && !revieweds.find( (rd) => !!(