Skip to content

Commit 96876e5

Browse files
committed
Disable navigation to work-mgr for TaaS projects
1 parent 7af7b42 commit 96876e5

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

src/config/constants.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,4 +1005,10 @@ export const CONTENTFUL_NODE_TYPES = {
10051005
export const INTERNAL_PROJECT_URLS=[
10061006
'tc_internal',
10071007
'tc-internal'
1008-
]
1008+
]
1009+
1010+
1011+
/**
1012+
* Project category string
1013+
*/
1014+
export const PROJECT_CATEGORY_TAAS = 'talent-as-a-service'

src/projects/detail/containers/ProjectInfoContainer.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
PROJECT_ROLE_PROJECT_MANAGER,
2727
PROJECT_ROLE_PROGRAM_MANAGER,
2828
PROJECT_ROLE_SOLUTION_ARCHITECT,
29+
PROJECT_CATEGORY_TAAS,
2930
} from '../../../config/constants'
3031
import PERMISSIONS from '../../../config/permissions'
3132
import { hasPermission } from '../../../helpers/permissions'
@@ -426,6 +427,14 @@ class ProjectInfoContainer extends React.Component {
426427
const { showDeleteConfirm } = this.state
427428
const { project, currentMemberRole, isSuperUser, phases, hideInfo, hideMembers,
428429
productsTimelines, isProjectProcessing, notifications, projectTemplates } = this.props
430+
431+
const projectTemplateId = project.templateId
432+
const projectTemplateKey = _.get(project, 'details.products[0]')
433+
const projectTemplate = projectTemplateId
434+
? _.find(projectTemplates, pt => pt.id === projectTemplateId)
435+
: getProjectTemplateByKey(projectTemplates, projectTemplateKey)
436+
437+
const isTaaS = PROJECT_CATEGORY_TAAS === projectTemplate.category
429438
let directLinks = null
430439
// check if direct links need to be added
431440
const isMemberOrCopilot = _.indexOf([
@@ -437,7 +446,8 @@ class ProjectInfoContainer extends React.Component {
437446
], currentMemberRole) > -1
438447
if (isMemberOrCopilot || isSuperUser) {
439448
directLinks = []
440-
directLinks.push({name: 'Launch Work Manager', href: `${WORK_MANAGER_APP}/${project.id}/challenges`})
449+
if(!isTaaS)
450+
directLinks.push({name: 'Launch Work Manager', href: `${WORK_MANAGER_APP}/${project.id}/challenges`})
441451
if (project.directProjectId) {
442452
directLinks.push({name: 'Project in Topcoder Direct', href: `${DIRECT_PROJECT_URL}${project.directProjectId}`})
443453
} else {
@@ -453,12 +463,6 @@ class ProjectInfoContainer extends React.Component {
453463
const notReadPhaseNotifications = filterTopicAndPostChangedNotifications(projectNotReadNotifications, /^phase#\d+$/)
454464
const notReadAssetsNotifications = filterFileAndLinkChangedNotifications(projectNotReadNotifications)
455465

456-
const projectTemplateId = project.templateId
457-
const projectTemplateKey = _.get(project, 'details.products[0]')
458-
const projectTemplate = projectTemplateId
459-
? _.find(projectTemplates, pt => pt.id === projectTemplateId)
460-
: getProjectTemplateByKey(projectTemplates, projectTemplateKey)
461-
462466
const renderFAQs = containsFAQ(projectTemplate)
463467
const navLinks = getProjectNavLinks(project, project.id, renderFAQs).map((navLink) => {
464468
if (navLink.label === 'Messages') {

0 commit comments

Comments
 (0)