Skip to content

Commit c83a9d6

Browse files
committed
Final Fixes - new milestone concept
1 parent 9631c2e commit c83a9d6

File tree

28 files changed

+538
-272
lines changed

28 files changed

+538
-272
lines changed
Lines changed: 1 addition & 1 deletion
Loading

src/assets/icons/icon-dots.svg

Lines changed: 3 additions & 3 deletions
Loading
Lines changed: 5 additions & 5 deletions
Loading
Lines changed: 3 additions & 3 deletions
Loading

src/assets/icons/x-mark-thin.svg

Lines changed: 3 additions & 3 deletions
Loading

src/components/ProjectProgress/ProjectProgress.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const Themes = {
1818

1919
const ProjectProgress = ({type, percent, children, viewType=ViewTypes.HBAR }) => (
2020
<div className="project-progress">
21-
{ viewType === ViewTypes.HBAR &&
21+
{ viewType === ViewTypes.HBAR &&
2222
<div className="progress-bar">
2323
<div className={cn('progress', type)} style={{width: percent + '%'}} />
2424
</div>
@@ -35,14 +35,13 @@ ProjectProgress.ViewTypes = ViewTypes
3535
ProjectProgress.Themes = Themes
3636

3737
ProjectProgress.defaultProps = {
38-
type: Themes.BLUE
38+
type: Themes.BLUE
3939
}
4040

4141
ProjectProgress.propTypes = {
42-
title: PropTypes.string.isRequired,
4342
type: PropTypes.oneOf(_.values(Themes)),
4443
percent: PropTypes.number.isRequired,
45-
children: PropTypes.any.isRequired
44+
children: PropTypes.any
4645
}
4746

4847
export default ProjectProgress

src/components/TwoColsLayout/TwoColsLayout.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ TwoColsLayout.Sidebar = ({ children, wrapperClass }) => (
2727

2828
TwoColsLayout.Content = ({ children }) => (
2929
<div styleName="content">
30-
<div styleName="content-inner">
30+
<div styleName="content-inner" className="twoColsLayout-contentInner">
3131
{children}
3232
</div>
3333
</div>

src/config/constants.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,16 @@ export const PHASE_STATUS = [
632632
// {color: 'red', name: 'Paused', fullName: 'Phase is paused', value: PHASE_STATUS_PAUSED, order: 7, dropDownOrder: 7 }
633633
]
634634

635+
export const PHASE_STATUS_OPTIONS = [
636+
{ label: 'Draft', value: PHASE_STATUS_DRAFT },
637+
{ label: 'In Review', value: PHASE_STATUS_IN_REVIEW },
638+
{ label: 'Reviewed', value: PHASE_STATUS_REVIEWED },
639+
{ label: 'Active', value: PHASE_STATUS_ACTIVE },
640+
{ label: 'Completed', value: PHASE_STATUS_COMPLETED },
641+
{ label: 'Cancelled', value: PHASE_STATUS_CANCELLED },
642+
{ label: 'Phased', value: PHASE_STATUS_PAUSED },
643+
]
644+
635645
// this defines default criteria to filter projects for projects list
636646
export const PROJECT_LIST_DEFAULT_CRITERIA = {
637647
sort: 'lastActivityAt desc'
@@ -1228,4 +1238,4 @@ export const DEFAULT_NDA_UUID = process.env.DEFAULT_NDA_UUID
12281238
/**
12291239
* The minimal duration of a TaaS Job in weeks
12301240
*/
1231-
export const TAAS_MIN_JOB_DURATION = 4
1241+
export const TAAS_MIN_JOB_DURATION = 4

src/projects/detail/components/ProjectPlanEmpty/ProjectPlanEmpty.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ import { hasPermission } from '../../../../helpers/permissions'
77

88
import './ProjectPlanEmpty.scss'
99

10-
const ProjectPlanEmpty = () => {
10+
const ProjectPlanEmpty = ({ version }) => {
1111
return hasPermission(PERMISSIONS.MANAGE_PROJECT_PLAN) ? (
1212
<div styleName="container">
1313
<h2>Build Your Project Plan</h2>
14-
<p>Build your project plan in Connect to reflect delivery progress to the customer. Begin by clicking the "Add Phase" button, select the template that best matches your need, and modify the phase title and milestone dates prior to publishing to the customer.</p>
14+
{version === 'v4' ? (
15+
<p>Build your project plan in Connect to reflect delivery progress to the customer. Begin by clicking the "Add Milestone" button, and modify the milestone attributes prior to publishing to the customer.</p>
16+
) : (
17+
<p>Build your project plan in Connect to reflect delivery progress to the customer. Begin by clicking the "Add Phase" button, select the template that best matches your need, and modify the phase title and milestone dates prior to publishing to the customer.</p>
18+
)}
1519
<p><b>Important Note:</b> To move the project into <i>'Active'</i> status, you must set at least one phase in Connect's Project Plan to be in 'Planned' status, which signifies to customers that delivery planning and execution has begun.</p>
1620
<p>If you feel like you have more things to send over, or want to reach out to us, please drop us a line at support@topcoder.com. Thanks!</p>
1721
</div>

src/projects/detail/components/simpleplan/CreateSimpleplan/CreateSimpleplan.jsx

Lines changed: 80 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
*/
44
import React from 'react'
55
import PT from 'prop-types'
6+
import _ from 'lodash'
67
import GenericMenu from '../../../../../components/GenericMenu'
78
import ProjectDetailsWidget from '../ProjectDetailsWidget'
89
import ManageMilestones from '../ManageMilestones'
10+
import * as milestoneHelper from '../components/helpers/milestone'
911

10-
import './CreateSimpleplan.scss'
12+
import styles from './CreateSimplePlan.scss'
1113

1214
const createTabs = ({ onClick } ) => ([
1315
{
@@ -17,44 +19,92 @@ const createTabs = ({ onClick } ) => ([
1719
}
1820
])
1921

20-
function CreateSimpleplan({
21-
project,
22-
phases,
23-
milestones,
24-
onChangeMilestones,
25-
onSaveMilestone,
26-
onRemoveMilestone,
27-
isProjectLive
28-
}) {
29-
const onClickMilestonesTab = () => {}
30-
31-
return (
32-
<div styleName="container">
33-
<ProjectDetailsWidget project={project} phases={phases} />
34-
<div styleName="milestones-container">
35-
<div styleName="tabs-header">
36-
<GenericMenu navLinks={createTabs(onClickMilestonesTab)} />
22+
class CreateSimplePlan extends React.Component {
23+
componentDidMount() {
24+
const { project, milestones, loadMembers } = this.props
25+
26+
let copilotIds = []
27+
milestones.forEach((milestone) => {
28+
copilotIds = copilotIds.concat(_.get(milestone, 'details.copilots', []))
29+
})
30+
31+
const projectMemberIds = project.members.map(member => member.userId)
32+
const missingMemberIds = _.difference(copilotIds, projectMemberIds)
33+
if (missingMemberIds.length) {
34+
loadMembers(missingMemberIds)
35+
}
36+
37+
const contentInnerElement = document.querySelector('.twoColsLayout-contentInner')
38+
contentInnerElement.classList.add(styles['twoColsLayout-contentInner'])
39+
}
40+
41+
componentWillUnmount() {
42+
const contentInnerElement = document.querySelector('.twoColsLayout-contentInner')
43+
contentInnerElement.classList.remove(styles['twoColsLayout-contentInner'])
44+
}
45+
46+
render () {
47+
const {
48+
project,
49+
phases,
50+
milestones,
51+
onChangeMilestones,
52+
onSaveMilestone,
53+
onRemoveMilestone,
54+
isProjectLive,
55+
members,
56+
isCustomer,
57+
} = this.props
58+
const onClickMilestonesTab = () => {}
59+
60+
if (milestones.length === 0) {
61+
return isCustomer ? null : (
62+
<div styleName="add-new-milestone">
63+
<button
64+
className="tc-btn tc-btn-primary tc-btn-sm action-btn"
65+
onClick={() => {
66+
const newMilestone = milestoneHelper.createEmptyMilestone(new Date())
67+
newMilestone.edit = true
68+
onChangeMilestones([newMilestone])
69+
}}
70+
>
71+
Add New Milestone
72+
</button>
73+
</div>
74+
)
75+
}
76+
77+
return (
78+
<div>
79+
<ProjectDetailsWidget project={project} phases={phases} />
80+
<div styleName="milestones-container">
81+
<div styleName="tabs-header">
82+
<GenericMenu navLinks={createTabs(onClickMilestonesTab)} />
83+
</div>
84+
<ManageMilestones
85+
milestones={milestones}
86+
onChangeMilestones={onChangeMilestones}
87+
onSaveMilestone={onSaveMilestone}
88+
onRemoveMilestone={onRemoveMilestone}
89+
projectMembers={project.members}
90+
isUpdatable={isProjectLive && !isCustomer}
91+
members={members}
92+
/>
3793
</div>
38-
<ManageMilestones
39-
milestones={milestones}
40-
onChangeMilestones={onChangeMilestones}
41-
onSaveMilestone={onSaveMilestone}
42-
onRemoveMilestone={onRemoveMilestone}
43-
projectMembers={project.members}
44-
isProjectLive={isProjectLive}
45-
/>
4694
</div>
47-
</div>
48-
)
95+
)
96+
}
4997
}
5098

51-
CreateSimpleplan.propTypes = {
99+
CreateSimplePlan.propTypes = {
52100
project: PT.shape(),
53101
phases: PT.arrayOf(PT.shape()),
54102
milestones: PT.arrayOf(PT.shape()),
55103
onChangeMilestones: PT.func,
56104
onSaveMilestone: PT.func,
57105
onRemoveMilestone: PT.func,
106+
members: PT.object,
107+
isCustomer: PT.bool,
58108
}
59109

60-
export default CreateSimpleplan
110+
export default CreateSimplePlan

0 commit comments

Comments
 (0)