Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 } ) => ([
{
Expand Down Expand Up @@ -47,6 +48,10 @@ class CreateSimplePlan extends React.Component {
} = this.props
const onClickMilestonesTab = () => {}

const isInReview =
isCustomer ? (milestones.filter( x => x.status === PHASE_STATUS_IN_REVIEW).length > 0 && isProjectLive)
: isProjectLive

if (milestones.length === 0) {
return isCustomer ? null : (
<div styleName="add-new-milestone">
Expand Down Expand Up @@ -84,6 +89,7 @@ class CreateSimplePlan extends React.Component {
projectMembers={project.members}
project={project}
isUpdatable={isProjectLive && !isCustomer}
isInReview={isInReview}
isCustomer={isCustomer}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ class ManageMilestones extends React.Component {
onChangeMilestones,
isUpdatable,
isCustomer,
isInReview,
project,
} = this.props

Expand Down Expand Up @@ -338,13 +339,13 @@ class ManageMilestones extends React.Component {
<col style={{ width: '11%' }} />{/* END DATE */}
<col style={{ width: '10%' }} />{/* STATUS */}
<col style={{ width: '13%' }} />{/* COPILOTS */}
{(isUpdatable || isCustomer) && (<col style={{ width: '64px' }} />)}{/* ACTION */}
{(isUpdatable || isInReview) && (<col style={{ width: '64px' }} />)}{/* ACTION */}
</colgroup>
<thead>
<MilestoneHeaderRow
milestones={milestones}
onChangeMilestones={onChangeMilestones}
isUpdatable={isUpdatable || isCustomer}
isUpdatable={isUpdatable || isInReview}
hideCheckbox={hideCheckbox}
/>
</thead>
Expand Down Expand Up @@ -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)
]
Expand All @@ -397,6 +399,7 @@ ManageMilestones.propTypes = {
projectMembers: PT.arrayOf(PT.shape()),
isUpdatable: PT.bool,
isCustomer: PT.bool,
isInReview: PT.bool,
project: PT.shape()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ function MilestoneRow({
disableDeleteAction,
isCustomer,
isApproving,
hideCheckbox
hideCheckbox,
isInReview
}) {
const isNeedApproval = milestone.status === PHASE_STATUS_IN_REVIEW
const showApproval = isCustomer && isNeedApproval
Expand Down Expand Up @@ -356,7 +357,7 @@ function MilestoneRow({
</td>
)}
{
isCustomer && (
(isCustomer && isInReview) && (
<td styleName="action">
<div styleName="inline-menu approve">
{
Expand Down Expand Up @@ -405,6 +406,7 @@ MilestoneRow.propTypes = {
isCustomer: PT.bool,
members: PT.object,
hideCheckbox: PT.bool,
isInReview: PT.bool,
}

export default MilestoneRow