Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/projects/actions/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,12 @@ function createProductsTimelineAndMilestone(project) {
*
* @return {Promise} project
*/
export function createProjectPhaseAndProduct(project, productTemplate, status = PHASE_STATUS_DRAFT, startDate, endDate, createTimeline = true, budget) {
export function createProjectPhaseAndProduct(project, productTemplate, status = PHASE_STATUS_DRAFT, startDate, endDate, createTimeline = true) {
const param = {
status,
name: productTemplate.name,
description: productTemplate.description,
productTemplateId: productTemplate.id,
budget,
}
if (startDate) {
param['startDate'] = startDate.format('YYYY-MM-DD')
Expand Down Expand Up @@ -358,12 +357,12 @@ function createPhaseAndMilestonesRequest(project, productTemplate, status = PHAS
* @param {*} startDate
* @param {*} endDate
*/
export function createPhaseWithoutTimeline(project, productTemplate, status, startDate, endDate, budget) {
export function createPhaseWithoutTimeline(project, productTemplate, status, startDate, endDate) {
return (dispatch) => {
console.log(CREATE_PROJECT_PHASE)
return dispatch({
type: CREATE_PROJECT_PHASE,
payload: createProjectPhaseAndProduct(project, productTemplate, status, startDate, endDate, false, budget)
payload: createProjectPhaseAndProduct(project, productTemplate, status, startDate, endDate, false)
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ class ManageMilestones extends React.Component {
<col style={{ width: '12%' }} />{/* START DATE */}
<col style={{ width: '11%' }} />{/* END DATE */}
<col style={{ width: '10%' }} />{/* STATUS */}
<col style={{ width: '12%' }} />{/* BUDGET */}
<col style={{ width: '13%' }} />{/* COPILOTS */}
{isUpdatable && (<col style={{ width: '80px' }} />)}{/* ACTION */}
{isUpdatable && (<col style={{ width: '64px' }} />)}{/* ACTION */}
</colgroup>
<thead>
<MilestoneHeaderRow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,8 @@
&:nth-child(5) { padding-left: 15px; }
// status
&:nth-child(6) { padding-left: 20px; }
// budget
&:nth-child(7) {
padding-left: 20px;
:global(.milestone-budget-prefix-icon) { left: 25px; }
}
// copilot
&:nth-child(8) { padding-left: 25px; }
&:nth-child(7) { padding-left: 25px; }
}

:global(.edit-milestone-row) {
Expand All @@ -89,21 +84,8 @@
&:nth-child(5) { padding-left: 5px; }
// status
&:nth-child(6) { padding-left: 10px; }
// budget
&:nth-child(7) {
padding-left: 10px;
:global {
.milestone-budget-prefix-icon {
left: 15px;
}
.tc-file-field__inputs {
min-width: 64px;
padding-left: 10px;
}
}
}
// copilot
&:nth-child(8) { padding-left: 15px; }
&:nth-child(7) { padding-left: 15px; }
}

:global(.edit-milestone-row) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ function AddCopilotsSidebar({
const projectMemberOptions = projectMembers.map(projectMember => ({
label: projectMember.handle,
value: projectMember
})).filter(option => copilots.indexOf(option.value) === -1 && option.value.role === PROJECT_ROLE_COPILOT)

})).filter(
// check if project member was not added
option => copilots.findIndex(copilot => copilot.userId === option.value.userId) === -1 &&
// check if project member role is copilot
option.value.role === PROJECT_ROLE_COPILOT
)

return (
<aside styleName="add-copilots-sidebar">
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function MilestoneHeaderRow ({ milestones, onChangeMilestones, isUpdatable }) {
<th>START DATE</th>
<th>END DATE</th>
<th>STATUS</th>
<th>BUDGET</th>
<th>COPILOTS</th>
{isUpdatable && (<th>ACTION</th>)}
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { isValidStartEndDates } from '../../../../../../helpers/utils'
import FormsySelect from '../../../../../../components/Select/FormsySelect'
import MilestoneCopilots from '../MilestoneCopilots'
import MilestoneStatus from '../MilestoneStatus'
import MilestoneBudget from '../MilestoneBudget'
import MilestoneDeleteButton from '../MilestoneDeleteButton'
import { PHASE_STATUS_OPTIONS } from '../../../../../../config/constants'
import IconCheck from '../../../../../../assets/icons/icon-check-thin.svg'
Expand Down Expand Up @@ -44,7 +43,6 @@ function MilestoneRow({
let milestoneRef
let startDateRef
let endDateRef
let budgetRef

return edit ? (
<tr styleName="milestone-row" className="edit-milestone-row">
Expand Down Expand Up @@ -187,33 +185,6 @@ function MilestoneRow({
}}
/>
</td>
<td styleName="budget">
<span styleName="prefix-icon" className="milestone-budget-prefix-icon">$</span>
<TCFormFields.TextInput
validations={{
isRequired: true,
isPositive(values) {
return !(values[`budget-${rowId}`] < 0)
}
}}
validationError={'Please, enter budget'}
validationErrors={{
isPositive: 'Budget cannot be negative'
}}
required
type="number"
name={`budget-${rowId}`}
value={milestone.budget || 0}
onChange={(_, value) => {
if (!milestone.origin) {
milestone.origin = {...milestone}
}
onChange({...milestone, budget: value })
}}
wrapperClass={styles.textInput}
innerRef={ref => budgetRef = ref}
/>
</td>
<td styleName="copilots">
<MilestoneCopilots
edit
Expand Down Expand Up @@ -249,7 +220,6 @@ function MilestoneRow({
if (milestoneRef.props.isValid()
&& startDateRef.props.isValid()
&& endDateRef.props.isValid()
&& budgetRef.props.isValid()
) {
onSave(milestone.id)
}
Expand Down Expand Up @@ -300,9 +270,6 @@ function MilestoneRow({
<td styleName="status">
<MilestoneStatus status={milestone.status} />
</td>
<td styleName="budget">
<MilestoneBudget spent={milestone.spentBudget} budget={milestone.budget} />
</td>
<td styleName="copilots">
<MilestoneCopilots copilots={copilots} />
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
white-space: nowrap;
}

.budget {
padding-right: 10px;
.copilots {
&:not(:last-child) {
padding-right: 10px;
}
}

.copilots {}

.action {}
}

Expand Down Expand Up @@ -141,24 +141,6 @@
}
}

.budget {
position: relative;

.prefix-icon {
position: absolute;
left: 0;
top: calc(50% - 6px);
z-index: 1;
}

:global {
.tc-file-field__inputs {
padding-right: 0;
padding-left: 20px;
}
}
}

.action {
.inline-menu {
display: flex;
Expand Down
Loading