Skip to content

Commit 63938a8

Browse files
authored
Merge pull request #4509 from nursoltan-s/issue-4495
fix issue 4495 - hide action column if no review for customer
2 parents f41a005 + 0cdffc9 commit 63938a8

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import * as milestoneHelper from '../components/helpers/milestone'
1010

1111
import styles from './CreateSimplePlan.scss'
1212
import MilestonesApprovalNotification from '../components/MilestonesApprovalNotification'
13+
import { PHASE_STATUS_IN_REVIEW } from '../../../../../config/constants'
1314

1415
const createTabs = ({ onClick } ) => ([
1516
{
@@ -47,6 +48,10 @@ class CreateSimplePlan extends React.Component {
4748
} = this.props
4849
const onClickMilestonesTab = () => {}
4950

51+
const isInReview =
52+
isCustomer ? (milestones.filter( x => x.status === PHASE_STATUS_IN_REVIEW).length > 0 && isProjectLive)
53+
: isProjectLive
54+
5055
if (milestones.length === 0) {
5156
return isCustomer ? null : (
5257
<div styleName="add-new-milestone">
@@ -84,6 +89,7 @@ class CreateSimplePlan extends React.Component {
8489
projectMembers={project.members}
8590
project={project}
8691
isUpdatable={isProjectLive && !isCustomer}
92+
isInReview={isInReview}
8793
isCustomer={isCustomer}
8894
/>
8995
</div>

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ class ManageMilestones extends React.Component {
259259
onChangeMilestones,
260260
isUpdatable,
261261
isCustomer,
262+
isInReview,
262263
project,
263264
} = this.props
264265

@@ -338,13 +339,13 @@ class ManageMilestones extends React.Component {
338339
<col style={{ width: '11%' }} />{/* END DATE */}
339340
<col style={{ width: '10%' }} />{/* STATUS */}
340341
<col style={{ width: '13%' }} />{/* COPILOTS */}
341-
{(isUpdatable || isCustomer) && (<col style={{ width: '64px' }} />)}{/* ACTION */}
342+
{(isUpdatable || isInReview) && (<col style={{ width: '64px' }} />)}{/* ACTION */}
342343
</colgroup>
343344
<thead>
344345
<MilestoneHeaderRow
345346
milestones={milestones}
346347
onChangeMilestones={onChangeMilestones}
347-
isUpdatable={isUpdatable || isCustomer}
348+
isUpdatable={isUpdatable || isInReview}
348349
hideCheckbox={hideCheckbox}
349350
/>
350351
</thead>
@@ -373,6 +374,7 @@ class ManageMilestones extends React.Component {
373374
phaseMembers={milestone.members}
374375
isApproving={milestonesInApproval.indexOf(milestone.id) !== -1}
375376
hideCheckbox={hideCheckbox}
377+
isInReview={isInReview}
376378
/>,
377379
...this.renderChallengeTable(milestone)
378380
]
@@ -397,6 +399,7 @@ ManageMilestones.propTypes = {
397399
projectMembers: PT.arrayOf(PT.shape()),
398400
isUpdatable: PT.bool,
399401
isCustomer: PT.bool,
402+
isInReview: PT.bool,
400403
project: PT.shape()
401404
}
402405

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ function MilestoneRow({
4646
disableDeleteAction,
4747
isCustomer,
4848
isApproving,
49-
hideCheckbox
49+
hideCheckbox,
50+
isInReview
5051
}) {
5152
const isNeedApproval = milestone.status === PHASE_STATUS_IN_REVIEW
5253
const showApproval = isCustomer && isNeedApproval
@@ -356,7 +357,7 @@ function MilestoneRow({
356357
</td>
357358
)}
358359
{
359-
isCustomer && (
360+
(isCustomer && isInReview) && (
360361
<td styleName="action">
361362
<div styleName="inline-menu approve">
362363
{
@@ -405,6 +406,7 @@ MilestoneRow.propTypes = {
405406
isCustomer: PT.bool,
406407
members: PT.object,
407408
hideCheckbox: PT.bool,
409+
isInReview: PT.bool,
408410
}
409411

410412
export default MilestoneRow

0 commit comments

Comments
 (0)