Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f599d7d
fix: managers should be able to accept milestones
maxceem Dec 11, 2020
64e8369
Generic Phases
yoution Dec 17, 2020
fcee870
Merge pull request #4215 from yoution/feature/generic-phases
maxceem Dec 17, 2020
aca4cbe
fix: some issue and add milestone
yoution Dec 20, 2020
52c63fc
Add New Milestone Types
Dec 21, 2020
9699e12
Merge pull request #4219 from ChanKamWo/feature/new-milestone-types
maxceem Dec 21, 2020
ab9c86a
Merge pull request #4216 from yoution/feature/generic-phases
maxceem Dec 21, 2020
d07e103
Merge branch 'feature/new-milestone-types' into feature/generic-phase…
maxceem Dec 21, 2020
7f9ddaa
Merge branch 'dev' into feature/generic-phases-with-new-milestone-types
maxceem Dec 21, 2020
6080e67
fix: merging issues
maxceem Dec 21, 2020
f27f9b6
fix: lint
maxceem Dec 21, 2020
8803633
fix: lint
maxceem Dec 21, 2020
a51cdfd
fix: delay before creating milestones in new timeline
maxceem Dec 21, 2020
10464d1
fix: "CreateMilestoneForm" folder case
maxceem Dec 21, 2020
2ce9df1
chore: deploy "feature/generic-phases-with-new-milestone-types" to DEV
maxceem Dec 21, 2020
3794d45
fix: fixed generic phase issue
yoution Dec 22, 2020
b1ed05a
Merge pull request #4223 from yoution/feature/generic-phases-with-new…
maxceem Dec 22, 2020
fc64c09
fix: lines for active milestones
maxceem Dec 22, 2020
f0ff882
fix: customer shouldn't add milestones
maxceem Dec 22, 2020
1222581
fix: publish phase message
maxceem Dec 22, 2020
0ab7c15
fix: validate start/end dates
maxceem Dec 22, 2020
a20f692
fix: fix additional issues
yoution Dec 23, 2020
503c720
Merge pull request #4224 from yoution/feature/generic-phases-with-new…
maxceem Dec 23, 2020
5986ae6
fix: typo
maxceem Dec 23, 2020
b2e2387
fix: change milestone.type to const type
yoution Dec 23, 2020
b05991f
fix: don't activate project by coilot
maxceem Dec 23, 2020
878b9eb
Merge pull request #4226 from yoution/feature/generic-phases-with-new…
maxceem Dec 23, 2020
9722d81
docs: updated permission docs
maxceem Dec 23, 2020
fbd8182
Merge branch 'dev' into feature/generic-phases-with-new-milestone-types
maxceem Dec 23, 2020
d545213
chore: set production phase product template
maxceem Dec 23, 2020
bcb5338
fix: don't allow removing active milestones
maxceem Dec 23, 2020
871099c
fix: milestone end date editing
maxceem Dec 24, 2020
8594a21
fix: phase product template id for DEV
maxceem Dec 24, 2020
1379480
feat: add milestone texts
maxceem Dec 24, 2020
673f7ed
fix: set actualStartDate during phase creation
maxceem Dec 24, 2020
8ab1852
fix: editing completed milestone
maxceem Dec 24, 2020
8f0e8c1
fix: calculating milestone duration on edit
maxceem Dec 24, 2020
ccf55e9
feat: phase status logic
maxceem Dec 24, 2020
c8b5340
Merge branch 'dev' into feature/generic-phases-with-new-milestone-types
maxceem Dec 24, 2020
43eb732
feat: show "Active" label for active phases
maxceem Dec 24, 2020
3f95c9f
fix: show Deprecated Type value
maxceem Dec 24, 2020
c073482
fix: add milestone when no milestones yet
maxceem Dec 24, 2020
754d851
feat: copilots activate projects on phase active
maxceem Dec 28, 2020
02b67c8
feat: disable special status for copilot
maxceem Dec 28, 2020
6e1075f
fix: activate project on active phase create
maxceem Dec 28, 2020
e26fe83
fix: don't change phase status to "completed"
maxceem Dec 28, 2020
a4b685f
fix: lint
maxceem Dec 28, 2020
a67c3a2
fix: use zip icon for submissions
maxceem Dec 28, 2020
b6e8c9d
fix: render submission link with protocol
maxceem Dec 28, 2020
4842ea1
fix: avoid setting todays dates for phase
maxceem Dec 28, 2020
2c6c648
fix: use no icons for submission links
maxceem Dec 28, 2020
ea184b1
refactor: remove redundant code and rename var
maxceem Dec 28, 2020
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ workflows:
- build-dev
filters:
branches:
only: ['dev']
only: ['dev', 'feature/generic-phases-with-new-milestone-types']

- deployTest01:
context : org-global
Expand Down
1 change: 1 addition & 0 deletions config/constants/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module.exports = {
PREDIX_PROGRAM_ID : 3448,
IBM_COGNITIVE_PROGRAM_ID : 3449,
HEAP_ANALYTICS_APP_ID : '4153837120',
PHASE_PRODUCT_TEMPLATE_ID : 166,

TC_NOTIFICATION_URL: 'https://api.topcoder-dev.com/v5/notifications',
CONNECT_MESSAGE_API_URL: 'https://api.topcoder-dev.com/v5',
Expand Down
1 change: 1 addition & 0 deletions config/constants/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module.exports = {
PREDIX_PROGRAM_ID : 3448,
IBM_COGNITIVE_PROGRAM_ID : 3449,
HEAP_ANALYTICS_APP_ID : '638908330',
PHASE_PRODUCT_TEMPLATE_ID : 33,

TC_NOTIFICATION_URL: 'https://api.topcoder.com/v5/notifications',
CONNECT_MESSAGE_API_URL: 'https://api.topcoder.com/v5',
Expand Down
1 change: 1 addition & 0 deletions config/constants/qa.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = {
PREDIX_PROGRAM_ID : 3448,
IBM_COGNITIVE_PROGRAM_ID : 3449,
HEAP_ANALYTICS_APP_ID : '4153837120',
PHASE_PRODUCT_TEMPLATE_ID : 166,

TC_NOTIFICATION_URL: 'https://api.topcoder-dev.com/v5/notifications',
CONNECT_MESSAGE_API_URL: 'https://api.topcoder-qa.com/v5',
Expand Down
30 changes: 30 additions & 0 deletions docs/permissions.html
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,30 @@ <h2 class="anchor-container">
</div>
</div>
</div>
<div class="row border-top">
<div class="col py-2">
<div class="permission-title anchor-container">
<a href="#EDIT_PROJECT_STATUS_TO_SPECIAL" name="EDIT_PROJECT_STATUS_TO_SPECIAL" class="anchor"></a>Edit project status to special
</div>
<div class="permission-variable"><small><code>EDIT_PROJECT_STATUS_TO_SPECIAL</code></small></div>
<div class="text-black-50 small-text">Special values are any values except of &quot;Active&quot; and &quot;Completed&quot;.</div>
</div>
<div class="col-9 py-2">
<div>
<span class="badge badge-primary" title="Allowed Project Role">manager</span>
<span class="badge badge-primary" title="Allowed Project Role">account_manager</span>
<span class="badge badge-primary" title="Allowed Project Role">account_executive</span>
<span class="badge badge-primary" title="Allowed Project Role">project_manager</span>
<span class="badge badge-primary" title="Allowed Project Role">program_manager</span>
<span class="badge badge-primary" title="Allowed Project Role">solution_architect</span>
</div>

<div>
<span class="badge badge-success" title="Allowed Topcoder Role">administrator</span>
<span class="badge badge-success" title="Allowed Topcoder Role">Connect Admin</span>
</div>
</div>
</div>
<div class="row border-top">
<div class="col py-2">
<div class="permission-title anchor-container">
Expand Down Expand Up @@ -1167,6 +1191,12 @@ <h2 class="anchor-container">
<div class="col-9 py-2">
<div>
<span class="badge badge-primary" title="Allowed Project Role">customer</span>
<span class="badge badge-primary" title="Allowed Project Role">manager</span>
<span class="badge badge-primary" title="Allowed Project Role">account_manager</span>
<span class="badge badge-primary" title="Allowed Project Role">account_executive</span>
<span class="badge badge-primary" title="Allowed Project Role">project_manager</span>
<span class="badge badge-primary" title="Allowed Project Role">program_manager</span>
<span class="badge badge-primary" title="Allowed Project Role">solution_architect</span>
</div>

<div>
Expand Down
20 changes: 0 additions & 20 deletions src/api/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,26 +184,6 @@ export function createPhaseProduct(projectId, phaseId, product) {
.then( resp => resp.data)
}

export function createProjectWithStatus(projectProps, status) {
// Phase out discussions
// TODO: Remove this once none of the active projects
// have the discussions tab enabled
projectProps.details.hideDiscussions = true

return axios.post(`${PROJECTS_API_URL}/v5/projects/`, projectProps)
.then( resp => resp.data)
.then(project => {
const updatedProps = { status }
const projectId = project.id
return axios.patch(`${PROJECTS_API_URL}/v5/projects/${projectId}/`, updatedProps)
.then(resp => resp.data)
.catch(error => { // eslint-disable-line no-unused-vars
// return created project even if status update fails to prevent error page
return project
})
})
}

export function deleteProject(projectId) {
return axios.delete(`${PROJECTS_API_URL}/v5/projects/${projectId}/`)
.then(() => {
Expand Down
3 changes: 0 additions & 3 deletions src/components/Layout/Layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,5 @@
&[data-route*='new-project'] {
background-color: $tc-gray-neutral-light;
}
&[data-route*='add-phase'] {
background-color: $tc-gray-neutral-light;
}
}
}
64 changes: 41 additions & 23 deletions src/components/ProjectStatus/ProjectStatus.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
.ProjectStatus {
position: relative;
height: $status-height;

.status-icon {
position: relative;
display: inline-block;
min-width: 4 * $base-unit;
width: 4 * $base-unit;
height: 4 * $base-unit;
// top: 3px;

i {
display: block;
width: 4 * $base-unit;
height: 4 * $base-unit;
}
}

.status-label {
position: relative;
@include tc-label-xs;
Expand All @@ -33,7 +33,7 @@
margin-left: 10px;
}
}

.EditableProjectStatus {
&.modal-active {
.modal-overlay {
Expand All @@ -59,7 +59,7 @@
.status-label {
vertical-align: top;
}

.status-header {
display: flex;
// position: absolute;
Expand All @@ -70,19 +70,19 @@
user-select: none;
border-radius: $base-unit*4;
cursor: default;

.caret {
display: none;
}

&.editable {
cursor: pointer;

&:hover {
&::after {
}
}

.caret {
// content: '';
// z-index: 3;
Expand All @@ -97,33 +97,33 @@
path {
stroke: $tc-gray-70;
}

.Icon {
width: 100%;
height: 100%;
display: block;
}
}
}


&.unified-header {
background-color: $tc-gray-40;

.status-label {
color: $tc-white;
}
}
}

.status-label {
position: relative;
@include tc-label-xs;
height: $base-unit*4;
padding-right: $base-unit;
margin-left: 10px;
}

// Stylize the dropdown elements
.status-dropdown {
min-width: 150px;
Expand All @@ -138,12 +138,12 @@
right: -10px;
z-index: 20;
transition: 250ms all;

&.dropdown-up {
top: auto;
bottom: 0;
}

.status-header {
@include roboto-medium;
font-size: $tc-label-md;
Expand All @@ -154,7 +154,7 @@
margin-bottom: 2px;
white-space: nowrap;
}

.status-option {
display: flex;
@include roboto-medium;
Expand All @@ -163,19 +163,37 @@
line-height: 30px;
padding: 0 20px;
white-space: nowrap;

&:hover {
background: $tc-dark-blue-10;
}

&.active {
background: $tc-gray-10;
}


&.disabled {
&,
&:hover,
&:active,
&:focus {
background: transparent;
cursor: default;

.status-label {
color: $tc-gray-30;
}

svg {
opacity: 0.5;
}
}
}

svg {
margin-top: 7px;
}

.status-label {
color: $tc-gray-80;
line-height: 30px;
Expand All @@ -185,4 +203,4 @@
}
}
}

74 changes: 53 additions & 21 deletions src/components/ProjectStatus/editableProjectStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ import ProjectStatusChangeConfirmation from './ProjectStatusChangeConfirmation'
import cn from 'classnames'
import _ from 'lodash'
import enhanceDropdown from 'appirio-tech-react-components/components/Dropdown/enhanceDropdown'
import Tooltip from 'appirio-tech-react-components/components/Tooltip/Tooltip'
import {
PROJECT_STATUS,
PROJECT_STATUS_COMPLETED,
PROJECT_STATUS_CANCELLED,
PROJECT_STATUS_DRAFT
PROJECT_STATUS_DRAFT,
TOOLTIP_DEFAULT_DELAY
} from '../../config/constants'
import CarretDownNormal9px from '../../assets/icons/arrow-9px-carret-down-normal.svg'
import { hasPermission } from '../../helpers/permissions'
import { PERMISSIONS } from '../../config/permissions'


const hocStatusDropdown = (CompositeComponent, statusList) => {
Expand Down Expand Up @@ -55,24 +59,33 @@ const hocStatusDropdown = (CompositeComponent, statusList) => {
<div className="status-header">Project Status</div>
<ul>
{
statusList.sort((a, b) => a.order - b.order).map((item) =>
(
<div key={item.value} className="tooltip-target">
<li>
<a
href="javascript:"
className={cn('status-option', 'status-' + item.value, { active: item.value === status, disabled: item.disabled })}
onClick={(e) => {
if (!item.disabled)
onItemSelect(item.value, e)
}}
>
<CompositeComponent status={item} showText />
</a>
</li>
</div>
statusList.sort((a, b) => a.order - b.order).map((item) => {
const selectItem = (
<li key={item.value}>
<a
href="javascript:"
className={cn('status-option', 'status-' + item.value, { active: item.value === status, disabled: item.disabled })}
onClick={(e) => {
if (!item.disabled)
onItemSelect(item.value, e)
}}
>
<CompositeComponent status={item} showText />
</a>
</li>
)
)

return item.toolTipMessage ? (
<Tooltip theme="light" tooltipDelay={TOOLTIP_DEFAULT_DELAY} key={item.value} usePortal>
<div className="tooltip-target">
{selectItem}
</div>
<div className="tooltip-body">
{item.toolTipMessage}
</div>
</Tooltip>
) : selectItem
})
}
</ul>
</div>
Expand Down Expand Up @@ -132,10 +145,29 @@ const editableProjectStatus = (CompositeComponent) => class extends Component {
}

getProjectStatusDropdownValues(status) {
if (status === PROJECT_STATUS_DRAFT) {
return [{color: 'gray', name: 'Draft', fullName: 'Project is in draft', value: PROJECT_STATUS_DRAFT, order: 2, dropDownOrder: 1 }].concat(PROJECT_STATUS)
const statusList = status === PROJECT_STATUS_DRAFT
// if current status, is "Draft" which is deprecated, then show it on the list
? [{color: 'gray', name: 'Draft', fullName: 'Project is in draft', value: PROJECT_STATUS_DRAFT, order: 2, dropDownOrder: 1 }].concat(PROJECT_STATUS)
// otherwise don't show deprecated status
: PROJECT_STATUS

if (hasPermission(PERMISSIONS.EDIT_PROJECT_STATUS_TO_SPECIAL)) {
return statusList
} else {
return statusList.map((statusOption) => {
// if option is not special anyone can choose it
// also, don't disable special option, if it's the current value
if (!statusOption.isSpecial || statusOption.value === status) {
return statusOption
}

return {
...statusOption,
disabled: true,
toolTipMessage: 'Only managers and admins can change to this status'
}
})
}
return PROJECT_STATUS
}

render() {
Expand Down
Loading