@@ -47,7 +47,6 @@ import {
4747 PHASE_DIRTY ,
4848 PHASE_DIRTY_UNDO ,
4949 PROJECT_STATUS_IN_REVIEW ,
50- PHASE_STATUS_REVIEWED ,
5150 PROJECT_STATUS_REVIEWED ,
5251 PROJECT_STATUS_ACTIVE ,
5352 EXPAND_PROJECT_PHASE ,
@@ -74,6 +73,8 @@ import {
7473 updateProductTimeline
7574} from './productsTimelines'
7675import { delay } from '../../helpers/utils'
76+ import { hasPermission } from '../../helpers/permissions'
77+ import { PERMISSIONS } from '../../config/permissions'
7778
7879/**
7980 * Expand phase and optionaly expand particular tab
@@ -505,24 +506,12 @@ export function updatePhase(projectId, phaseId, updatedProps, phaseIndex) {
505506 } ) . then ( ( ) => {
506507 const project = state . projectState . project
507508
508- // if one phase moved to REVIEWED status, make project IN_REVIEW too
509- if (
510- _ . includes ( [ PROJECT_STATUS_DRAFT ] , project . status ) &&
511- phase . status !== PHASE_STATUS_REVIEWED &&
512- updatedProps . status === PHASE_STATUS_REVIEWED
513- ) {
514- dispatch (
515- updateProject ( projectId , {
516- status : PHASE_STATUS_REVIEWED
517- } , true )
518- )
519- }
520-
521509 // if one phase moved to ACTIVE status, make project ACTIVE too
522510 if (
523511 _ . includes ( [ PROJECT_STATUS_DRAFT , PROJECT_STATUS_IN_REVIEW , PROJECT_STATUS_REVIEWED ] , project . status ) &&
524512 phase . status !== PHASE_STATUS_ACTIVE &&
525- updatedProps . status === PHASE_STATUS_ACTIVE
513+ updatedProps . status === PHASE_STATUS_ACTIVE &&
514+ hasPermission ( PERMISSIONS . EDIT_PROJECT_STATUS_TO_ACTIVE )
526515 ) {
527516 dispatch (
528517 updateProject ( projectId , {
0 commit comments