@@ -4,19 +4,16 @@ import ProjectStatusChangeConfirmation from './ProjectStatusChangeConfirmation'
44import cn from 'classnames'
55import _ from 'lodash'
66import enhanceDropdown from 'appirio-tech-react-components/components/Dropdown/enhanceDropdown'
7- import Tooltip from 'appirio-tech-react-components/components/Tooltip/Tooltip'
87import {
98 PROJECT_STATUS ,
10- PROJECT_STATUS_ACTIVE ,
119 PROJECT_STATUS_COMPLETED ,
1210 PROJECT_STATUS_CANCELLED ,
13- TOOLTIP_DEFAULT_DELAY ,
1411 PROJECT_STATUS_DRAFT
1512} from '../../config/constants'
1613import CarretDownNormal9px from '../../assets/icons/arrow-9px-carret-down-normal.svg'
1714
1815
19- const hocStatusDropdown = ( CompositeComponent , statusList , projectCanBeActive ) => {
16+ const hocStatusDropdown = ( CompositeComponent , statusList ) => {
2017 class StatusDropdown extends Component {
2118 shouldDropdownUp ( ) {
2219 if ( this . refs . dropdown ) {
@@ -36,12 +33,6 @@ const hocStatusDropdown = (CompositeComponent, statusList, projectCanBeActive) =
3633 return null
3734 }
3835
39- const activestatusList = statusList . map ( ( status ) => ( {
40- ...status ,
41- disabled : ! projectCanBeActive && status . value === PROJECT_STATUS_ACTIVE ,
42- toolTipMessage : ( ! projectCanBeActive && status . value === PROJECT_STATUS_ACTIVE ) ? 'To activate project there should be at least one phase in "Planned" status. Please, check "Project Plan" tab.' : null ,
43- } ) )
44-
4536 this . shouldDropdownUp ( )
4637 return (
4738 < div className = "project-status-dropdown" ref = "dropdown" >
@@ -64,28 +55,8 @@ const hocStatusDropdown = (CompositeComponent, statusList, projectCanBeActive) =
6455 < div className = "status-header" > Project Status</ div >
6556 < ul >
6657 {
67- activestatusList . sort ( ( a , b ) => a . order - b . order ) . map ( ( item ) =>
68- item . toolTipMessage ? (
69- < Tooltip key = { item . value } theme = "light" tooltipDelay = { TOOLTIP_DEFAULT_DELAY } >
70- < div className = "tooltip-target" >
71- < li >
72- < a
73- href = "javascript:"
74- className = { cn ( 'status-option' , 'status-' + item . value , { active : item . value === status , disabled : item . disabled } ) }
75- onClick = { ( e ) => {
76- if ( ! item . disabled )
77- onItemSelect ( item . value , e )
78- } }
79- >
80- < CompositeComponent status = { item } showText />
81- </ a >
82- </ li >
83- </ div >
84- < div className = "tooltip-body" >
85- { item . toolTipMessage }
86- </ div >
87- </ Tooltip >
88- ) : (
58+ statusList . sort ( ( a , b ) => a . order - b . order ) . map ( ( item ) =>
59+ (
8960 < div key = { item . value } className = "tooltip-target" >
9061 < li >
9162 < a
@@ -169,11 +140,11 @@ const editableProjectStatus = (CompositeComponent) => class extends Component {
169140
170141 render ( ) {
171142 const { showStatusChangeDialog, newStatus, statusChangeReason } = this . state
172- const { canEdit, projectCanBeActive , status } = this . props
143+ const { canEdit, status } = this . props
173144 const PROJECT_STATUS_VALUES = this . getProjectStatusDropdownValues ( status )
174145 const StatusDropdown = canEdit
175- ? enhanceDropdown ( hocStatusDropdown ( CompositeComponent , PROJECT_STATUS_VALUES , projectCanBeActive ) )
176- : hocStatusDropdown ( CompositeComponent , PROJECT_STATUS_VALUES , projectCanBeActive )
146+ ? enhanceDropdown ( hocStatusDropdown ( CompositeComponent , PROJECT_STATUS_VALUES ) )
147+ : hocStatusDropdown ( CompositeComponent , PROJECT_STATUS_VALUES )
177148 return (
178149 < div className = { cn ( 'EditableProjectStatus' , { 'modal-active' : showStatusChangeDialog } ) } >
179150 < div className = "modal-overlay" onClick = { this . hideStatusChangeDialog } />
@@ -197,10 +168,6 @@ editableProjectStatus.propTypes = {
197168 * Boolean flag to control editability of the project status. It does not render the dropdown if it is not editable.
198169 */
199170 canEdit : PropTypes . bool ,
200- /**
201- * Boolean flag to control if project status can be switched to active.
202- */
203- projectCanBeActive : PropTypes . bool ,
204171 /**
205172 * String representing project status
206173 */
0 commit comments