From 329eb029e5623899fdfd3da1c04d64c5f8713721 Mon Sep 17 00:00:00 2001 From: Nursoltan Saipolda Date: Mon, 27 Sep 2021 19:28:46 +0800 Subject: [PATCH 1/3] fix issue 4495 --- .../SimplePlan/CreateSimplePlan/CreateSimplePlan.jsx | 7 ++++++- .../SimplePlan/ManageMilestones/ManageMilestones.jsx | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/projects/detail/components/SimplePlan/CreateSimplePlan/CreateSimplePlan.jsx b/src/projects/detail/components/SimplePlan/CreateSimplePlan/CreateSimplePlan.jsx index c96add512..112ab8f67 100644 --- a/src/projects/detail/components/SimplePlan/CreateSimplePlan/CreateSimplePlan.jsx +++ b/src/projects/detail/components/SimplePlan/CreateSimplePlan/CreateSimplePlan.jsx @@ -10,6 +10,7 @@ import * as milestoneHelper from '../components/helpers/milestone' import styles from './CreateSimplePlan.scss' import MilestonesApprovalNotification from '../components/MilestonesApprovalNotification' +import { PHASE_STATUS_IN_REVIEW } from '../../../../../config/constants' const createTabs = ({ onClick } ) => ([ { @@ -47,6 +48,10 @@ class CreateSimplePlan extends React.Component { } = this.props const onClickMilestonesTab = () => {} + const isUpdatable = + isCustomer ? project.status === PHASE_STATUS_IN_REVIEW + : isProjectLive + if (milestones.length === 0) { return isCustomer ? null : (
@@ -83,7 +88,7 @@ class CreateSimplePlan extends React.Component { onApproveMilestones={onApproveMilestones} projectMembers={project.members} project={project} - isUpdatable={isProjectLive && !isCustomer} + isUpdatable={isUpdatable} isCustomer={isCustomer} />
diff --git a/src/projects/detail/components/SimplePlan/ManageMilestones/ManageMilestones.jsx b/src/projects/detail/components/SimplePlan/ManageMilestones/ManageMilestones.jsx index 0fd2b913b..0b8af69ed 100644 --- a/src/projects/detail/components/SimplePlan/ManageMilestones/ManageMilestones.jsx +++ b/src/projects/detail/components/SimplePlan/ManageMilestones/ManageMilestones.jsx @@ -338,13 +338,13 @@ class ManageMilestones extends React.Component { {/* END DATE */} {/* STATUS */} {/* COPILOTS */} - {(isUpdatable || isCustomer) && ()}{/* ACTION */} + {(isUpdatable) && ()}{/* ACTION */} From 4c79edee7c60522e8710c5b520c795d715240c8c Mon Sep 17 00:00:00 2001 From: Nursoltan Saipolda Date: Mon, 27 Sep 2021 21:42:27 +0800 Subject: [PATCH 2/3] customer row issue --- .../SimplePlan/components/MilestoneRow/MilestoneRow.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/projects/detail/components/SimplePlan/components/MilestoneRow/MilestoneRow.jsx b/src/projects/detail/components/SimplePlan/components/MilestoneRow/MilestoneRow.jsx index f14a3c4c5..eb29facf0 100644 --- a/src/projects/detail/components/SimplePlan/components/MilestoneRow/MilestoneRow.jsx +++ b/src/projects/detail/components/SimplePlan/components/MilestoneRow/MilestoneRow.jsx @@ -356,7 +356,7 @@ function MilestoneRow({ )} { - isCustomer && ( + (isCustomer && isUpdatable) && (
{ From 0cdffc9eaf343473a2e0117b73f73255f3a760ec Mon Sep 17 00:00:00 2001 From: Nursoltan Saipolda Date: Tue, 28 Sep 2021 09:48:59 +0800 Subject: [PATCH 3/3] fix customer issue --- .../SimplePlan/CreateSimplePlan/CreateSimplePlan.jsx | 7 ++++--- .../SimplePlan/ManageMilestones/ManageMilestones.jsx | 7 +++++-- .../SimplePlan/components/MilestoneRow/MilestoneRow.jsx | 6 ++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/projects/detail/components/SimplePlan/CreateSimplePlan/CreateSimplePlan.jsx b/src/projects/detail/components/SimplePlan/CreateSimplePlan/CreateSimplePlan.jsx index 112ab8f67..34d0c65e3 100644 --- a/src/projects/detail/components/SimplePlan/CreateSimplePlan/CreateSimplePlan.jsx +++ b/src/projects/detail/components/SimplePlan/CreateSimplePlan/CreateSimplePlan.jsx @@ -48,8 +48,8 @@ class CreateSimplePlan extends React.Component { } = this.props const onClickMilestonesTab = () => {} - const isUpdatable = - isCustomer ? project.status === PHASE_STATUS_IN_REVIEW + const isInReview = + isCustomer ? (milestones.filter( x => x.status === PHASE_STATUS_IN_REVIEW).length > 0 && isProjectLive) : isProjectLive if (milestones.length === 0) { @@ -88,7 +88,8 @@ class CreateSimplePlan extends React.Component { onApproveMilestones={onApproveMilestones} projectMembers={project.members} project={project} - isUpdatable={isUpdatable} + isUpdatable={isProjectLive && !isCustomer} + isInReview={isInReview} isCustomer={isCustomer} />
diff --git a/src/projects/detail/components/SimplePlan/ManageMilestones/ManageMilestones.jsx b/src/projects/detail/components/SimplePlan/ManageMilestones/ManageMilestones.jsx index 0b8af69ed..97c52277f 100644 --- a/src/projects/detail/components/SimplePlan/ManageMilestones/ManageMilestones.jsx +++ b/src/projects/detail/components/SimplePlan/ManageMilestones/ManageMilestones.jsx @@ -259,6 +259,7 @@ class ManageMilestones extends React.Component { onChangeMilestones, isUpdatable, isCustomer, + isInReview, project, } = this.props @@ -338,13 +339,13 @@ class ManageMilestones extends React.Component { {/* END DATE */} {/* STATUS */} {/* COPILOTS */} - {(isUpdatable) && ()}{/* ACTION */} + {(isUpdatable || isInReview) && ()}{/* ACTION */} @@ -373,6 +374,7 @@ class ManageMilestones extends React.Component { phaseMembers={milestone.members} isApproving={milestonesInApproval.indexOf(milestone.id) !== -1} hideCheckbox={hideCheckbox} + isInReview={isInReview} />, ...this.renderChallengeTable(milestone) ] @@ -397,6 +399,7 @@ ManageMilestones.propTypes = { projectMembers: PT.arrayOf(PT.shape()), isUpdatable: PT.bool, isCustomer: PT.bool, + isInReview: PT.bool, project: PT.shape() } diff --git a/src/projects/detail/components/SimplePlan/components/MilestoneRow/MilestoneRow.jsx b/src/projects/detail/components/SimplePlan/components/MilestoneRow/MilestoneRow.jsx index eb29facf0..93024fb94 100644 --- a/src/projects/detail/components/SimplePlan/components/MilestoneRow/MilestoneRow.jsx +++ b/src/projects/detail/components/SimplePlan/components/MilestoneRow/MilestoneRow.jsx @@ -46,7 +46,8 @@ function MilestoneRow({ disableDeleteAction, isCustomer, isApproving, - hideCheckbox + hideCheckbox, + isInReview }) { const isNeedApproval = milestone.status === PHASE_STATUS_IN_REVIEW const showApproval = isCustomer && isNeedApproval @@ -356,7 +357,7 @@ function MilestoneRow({ )} { - (isCustomer && isUpdatable) && ( + (isCustomer && isInReview) && (
{ @@ -405,6 +406,7 @@ MilestoneRow.propTypes = { isCustomer: PT.bool, members: PT.object, hideCheckbox: PT.bool, + isInReview: PT.bool, } export default MilestoneRow