From 0a3c635cd69308cc73d20485b05594a75655e419 Mon Sep 17 00:00:00 2001 From: RishiRaj Date: Tue, 21 Jul 2020 22:04:01 +0530 Subject: [PATCH 1/3] Removed dependency on phaseStatus to change projectStatus gitIssue#4048 --- .circleci/config.yml | 2 +- src/components/ProjectInfo/ProjectInfo.jsx | 9 +--- .../ProjectStatus/ProjectStatus.scss | 16 ------- .../ProjectStatus/editableProjectStatus.js | 42 +++---------------- .../projectsCard/ProjectCardBody.jsx | 4 +- 5 files changed, 9 insertions(+), 64 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 105dcca28..c213d067e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -128,7 +128,7 @@ workflows: - build-dev filters: branches: - only: ['dev'] + only: ['dev', 'feature/removed_dependency_on_phaseStatus_to_change_projectStatus'] - deployTest01: context : org-global diff --git a/src/components/ProjectInfo/ProjectInfo.jsx b/src/components/ProjectInfo/ProjectInfo.jsx index 7786145a9..7228815a4 100644 --- a/src/components/ProjectInfo/ProjectInfo.jsx +++ b/src/components/ProjectInfo/ProjectInfo.jsx @@ -7,7 +7,7 @@ import DeleteProjectModal from './DeleteProjectModal' import ProjectCardBody from '../../projects/components/projectsCard/ProjectCardBody' import MobileExpandable from '../MobileExpandable/MobileExpandable' import MediaQuery from 'react-responsive' -import { SCREEN_BREAKPOINT_MD, PROJECT_STATUS_ACTIVE, PHASE_STATUS_ACTIVE, PHASE_STATUS_REVIEWED, PROJECT_ROLE_OWNER, PROJECT_ROLE_CUSTOMER } from '../../config/constants' +import { SCREEN_BREAKPOINT_MD, PROJECT_ROLE_OWNER, PROJECT_ROLE_CUSTOMER } from '../../config/constants' import ReviewProjectButton from '../../projects/detail/components/ReviewProjectButton' import Tooltip from 'appirio-tech-react-components/components/Tooltip/Tooltip' import { TOOLTIP_DEFAULT_DELAY } from '../../config/constants' @@ -29,12 +29,6 @@ class ProjectInfo extends Component { const code = _.get(project, 'details.utm.code', '') - const hasReviewedOrActivePhases = !!_.find(phases, (phase) => _.includes([PHASE_STATUS_REVIEWED, PHASE_STATUS_ACTIVE], phase.status)) - const isProjectActive = project.status === PROJECT_STATUS_ACTIVE - const isV3Project = project.version === 'v3' - const projectCanBeActive = !isV3Project || (!isProjectActive && hasReviewedOrActivePhases) || isProjectActive - - // prepare review button const showReviewBtn = project.status === 'draft' && _.indexOf([PROJECT_ROLE_OWNER, PROJECT_ROLE_CUSTOMER], currentMemberRole) > -1 @@ -108,7 +102,6 @@ class ProjectInfo extends Component { {matches => ( { +const hocStatusDropdown = (CompositeComponent, statusList) => { class StatusDropdown extends Component { shouldDropdownUp() { if (this.refs.dropdown) { @@ -36,12 +36,6 @@ const hocStatusDropdown = (CompositeComponent, statusList, projectCanBeActive) = return null } - const activestatusList = statusList.map((status) => ({ - ...status, - disabled: !projectCanBeActive && status.value === PROJECT_STATUS_ACTIVE, - 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, - })) - this.shouldDropdownUp() return (
@@ -64,28 +58,8 @@ const hocStatusDropdown = (CompositeComponent, statusList, projectCanBeActive) =
Project Status