Skip to content

Commit be3a830

Browse files
authored
Merge pull request #4110 from appirio-tech/dev
Connect Release 2.11.1
2 parents 03fdd77 + 3b7814b commit be3a830

15 files changed

+1270
-355
lines changed

package-lock.json

+560-340
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
"redux-thunk": "^2.1.0",
150150
"remarkable": "^1.7.1",
151151
"svg-react-loader": "^0.4.5",
152-
"tc-accounts": "git+https://github.com/appirio-tech/accounts-app.git#0.0.11",
152+
"tc-accounts": "git+https://github.com/appirio-tech/accounts-app.git#v1.0.4",
153153
"tc-ui": "git+https://github.com/appirio-tech/tc-ui.git#feature/connectv2",
154154
"tlds": "^1.191.0",
155155
"topcoder-react-utils": "0.0.39",

src/assets/icons/ui-rocket-white.svg

+10
Loading

src/components/ProjectTypeIcon.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import IconSalesforceImplementation from '../assets/icons/v.2.5/project-types/sa
2929
import IconSolutions from '../assets/icons/v.2.5/project-types/solutions.svg'
3030
import IconUserSentimentAnalysis from '../assets/icons/v.2.5/project-types/user-sentiment-analysis.svg'
3131
import IconDefault from '../assets/icons/v.2.5/project-types/default.svg'
32+
//import IconTcInternal from '../assets/icons/ui-rocket-white.svg'
3233

3334
const ProjectTypeIcon = ({ type }) => {
3435
// if type is defined as a relative path to the icon, convert it to icon "id"
@@ -60,6 +61,7 @@ const ProjectTypeIcon = ({ type }) => {
6061
case 'salesforce-implementation': return <IconSalesforceImplementation />
6162
case 'solutions': return <IconSolutions />
6263
case 'user-sentiment-analysis': return <IconUserSentimentAnalysis />
64+
//case 'tc-internal': return <IconTcInternal />
6365
default:
6466
// this will be default icon
6567
return <IconDefault />

src/config/constants.js

+15-4
Original file line numberDiff line numberDiff line change
@@ -706,19 +706,20 @@ export const DOMAIN = process.env.domain || 'topcoder.com'
706706
export const CONNECT_DOMAIN = `connect.${DOMAIN}`
707707
export const CONNECT_MAIN_PAGE_URL = `http://connect.${DOMAIN}`
708708
export const ACCOUNTS_APP_CONNECTOR_URL = process.env.ACCOUNTS_APP_CONNECTOR_URL
709-
export const ACCOUNTS_APP_LOGIN_URL = process.env.ACCOUNTS_APP_LOGIN_URL || `https://accounts.${DOMAIN}/#!/connect`
710-
export const ACCOUNTS_APP_REGISTER_URL = process.env.ACCOUNTS_APP_REGISTER_URL || `https://accounts.${DOMAIN}/#!/connect/registration`
709+
export const ACCOUNTS_APP_LOGIN_URL = process.env.ACCOUNTS_APP_LOGIN_URL || `https://accounts.${DOMAIN}/#!/member`
710+
export const ACCOUNTS_APP_REGISTER_URL = process.env.ACCOUNTS_APP_REGISTER_URL || `https://accounts.${DOMAIN}/#!/member/registration?regSource=tcBusiness`
711711

712712
export const TC_API_URL = `https://api.${DOMAIN}`
713713
export const DIRECT_PROJECT_URL = `https://www.${DOMAIN}/direct/projectOverview?formData.projectId=`
714+
export const WORK_MANAGER_APP = `https://challenges.${DOMAIN}/projects`
714715
export const SALESFORCE_PROJECT_LEAD_LINK = process.env.SALESFORCE_PROJECT_LEAD_LINK
715716
export const TC_NOTIFICATION_URL = process.env.TC_NOTIFICATION_URL || `${TC_API_URL}/v5/notifications`
716717
// Uncomment if you run TC Notifications locally
717718
// export const TC_NOTIFICATION_URL = 'http://localstho:4000/v5/notifications'
718719

719720
export const TC_CDN_URL = process.env.TC_CDN_URL || `https://community-app.${DOMAIN}/api/cdn/public`
720721

721-
export const RESET_PASSWORD_URL = `https://accounts.${DOMAIN}/connect/reset-password`
722+
export const RESET_PASSWORD_URL = `https://accounts.${DOMAIN}/member/reset-password`
722723
export const VERIFY_EMAIL_URL = `http://www.${DOMAIN}/settings/account/changeEmail`
723724

724725
export const PROJECT_NAME_MAX_LENGTH = 255
@@ -1000,4 +1001,14 @@ export const CONTENTFUL_SPACE_ID = process.env.CONTENTFUL_SPACE_ID
10001001
*/
10011002
export const CONTENTFUL_NODE_TYPES = {
10021003
HYPERLINK : 'hyperlink',
1003-
}
1004+
}
1005+
export const INTERNAL_PROJECT_URLS=[
1006+
'tc_internal',
1007+
'tc-internal'
1008+
]
1009+
1010+
1011+
/**
1012+
* Project category string
1013+
*/
1014+
export const PROJECT_CATEGORY_TAAS = 'talent-as-a-service'

src/projects/create/components/ProjectWizard.jsx

+12-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import {
2121
SPECIAL_QUERY_PARAMS,
2222
PROJECT_REF_CODE_MAX_LENGTH,
2323
PROJECT_ATTACHMENTS_FOLDER,
24+
MANAGER_ROLES,
25+
INTERNAL_PROJECT_URLS
2426
} from '../../../config/constants'
2527
import {
2628
buildProjectUpdateQueryByQueryParamSelectCondition,
@@ -212,7 +214,7 @@ class ProjectWizard extends Component {
212214
* @return {number} step where wizard should move after parsing the URL param
213215
*/
214216
loadProjectFromURL(urlParams, updateQuery) {
215-
const { projectTemplates, projectTypes } = this.props
217+
const { projectTemplates, projectTypes, userRoles } = this.props
216218
const urlAlias = urlParams && urlParams.project
217219
const statusParam = urlParams && urlParams.status
218220

@@ -233,10 +235,17 @@ class ProjectWizard extends Component {
233235
} else {
234236
// if it is not a project type, it should be a project template
235237
const projectTemplate = getProjectTemplateByAlias(projectTemplates, urlAlias)
238+
const managerRoles = _.filter(MANAGER_ROLES, mgrRole => {
239+
return _.find(userRoles, role => role === mgrRole)
240+
})
241+
const isInternalURL = _.find(INTERNAL_PROJECT_URLS, url => url === urlAlias)
242+
let isValidRole = true
243+
if(isInternalURL)
244+
isValidRole = managerRoles && managerRoles.length > 0
236245

237246
// if we have some project template key in the URL and we can find the project template
238247
// show details step
239-
if (projectTemplate) {
248+
if (isValidRole && projectTemplate) {
240249
updateQuery['type'] = { $set : projectTemplate.category }
241250
updateQuery['templateId'] = { $set : projectTemplate.id }
242251
updateQuery['details'] = {}
@@ -566,6 +575,7 @@ class ProjectWizard extends Component {
566575
onProjectTypeChange={ this.updateProjectType }
567576
projectTemplates={ projectTemplates }
568577
projectTypes={ projectTypes }
578+
userRoles={ userRoles }
569579
/>
570580
<SelectProjectTemplate
571581
onProjectTemplateChange={ this.updateProjectTemplate }

src/projects/create/components/SelectProjectType.jsx

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
import React from 'react'
22
import PT from 'prop-types'
3+
import _ from 'lodash'
34

45
import SelectProjectTypeCard from './SelectProjectTypeCard'
56
import { getProjectTemplatesByCategory } from '../../../helpers/templates'
67
import ProjectTypeIcon from '../../../components/ProjectTypeIcon'
78
import IconArrowRight from '../../../assets/icons/arrows-16px-1_tail-right.svg'
89

9-
import { DOMAIN } from '../../../config/constants'
10+
import { DOMAIN, MANAGER_ROLES } from '../../../config/constants'
1011

1112
import './SelectProjectType.scss'
1213

1314
const SelectProjectType = ({
1415
onProjectTypeChange,
1516
projectTypes,
1617
projectTemplates,
18+
userRoles,
1719
}) => {
1820
const cards = []
21+
const managerRoles = _.filter(MANAGER_ROLES, mgrRole => {
22+
return _.find(userRoles, role => role === mgrRole)
23+
})
24+
const isValidRole = managerRoles && managerRoles.length > 0
1925

2026
projectTypes.forEach((projectType) => {
2127

@@ -25,6 +31,10 @@ const SelectProjectType = ({
2531
// don't render hidden items as well, hidden items can be reached via direct link though
2632
if (projectType.disabled || projectType.hidden || visibleProjectTemplates.length === 0) return
2733

34+
// don't render internal projects to customer user roles
35+
if (projectType.metadata && projectType.metadata.isInternal
36+
&& projectType.metadata.isInternal === true && !isValidRole) return
37+
2838
const icon = <ProjectTypeIcon type={projectType.icon} />
2939

3040
cards.push(

src/projects/detail/components/Accordion/Accordion.jsx

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const TYPE = {
3232
SLIDER_STANDARD: 'slider-standard',
3333
SELECT_DROPDOWN: 'select-dropdown',
3434
TALENT_PICKER: 'talent-picker',
35+
TALENT_PICKER_V2: 'talent-picker-v2',
3536
}
3637

3738
/**
@@ -174,6 +175,11 @@ class Accordion extends React.Component {
174175
const totalPeoplePerRole = _.mapValues(_.groupBy(value, v => v.role), valuesUnderGroup => _.sumBy(valuesUnderGroup, v => Number(v.people)))
175176
return _.toPairs(totalPeoplePerRole).filter(([, people]) => people > 0).map(([role, people]) => `${getRoleName(role)}: ${people}`).join(', ')
176177
}
178+
case TYPE.TALENT_PICKER_V2: {
179+
const getRoleName = (role) => _.find(options, { role }).roleTitle
180+
const totalPeoplePerRole = _.mapValues(_.groupBy(value, v => v.role), valuesUnderGroup => _.sumBy(valuesUnderGroup, v => Number(v.people)))
181+
return _.toPairs(totalPeoplePerRole).filter(([, people]) => people > 0).map(([role, people]) => `${getRoleName(role)}: ${people}`).join(', ')
182+
}
177183
default: return value
178184
}
179185
}

src/projects/detail/components/SpecQuestionList/SpecQuestionList.scss

+8
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@
172172
border-color: $tc-gray-20;
173173
max-width: 300px;
174174
margin-left: 0px;
175+
176+
&.error {
177+
border: 1px solid #ff5b52 !important;
178+
}
175179

176180
&:after {
177181
border-bottom-color: $tc-gray-70;
@@ -190,6 +194,10 @@
190194
line-height: 24px;
191195
}
192196

197+
textarea.job-textarea {
198+
min-height: 100px;
199+
}
200+
193201
.radio-group-input,
194202
.checkbox-group-item {
195203
width: 100%;

src/projects/detail/components/SpecQuestions.jsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import SpecQuestionList from './SpecQuestionList/SpecQuestionList'
1111
import SpecQuestionIcons from './SpecQuestionList/SpecQuestionIcons'
1212
import SkillsQuestion from './SkillsQuestion/SkillsQuestion'
1313
import TalentPickerQuestion from './TalentPickerQuestion/TalentPickerQuestion'
14+
import TalentPickerQuestionV2 from './TalentPickerQuestion/TalentPickerQuestionV2'
1415
import SpecFeatureQuestion from './SpecFeatureQuestion'
1516
import ColorSelector from './../../../components/ColorSelector/ColorSelector'
1617
import SelectDropdown from './../../../components/SelectDropdown/SelectDropdown'
@@ -382,6 +383,12 @@ class SpecQuestions extends React.Component {
382383
options: q.options,
383384
})
384385
break
386+
case 'talent-picker-v2':
387+
ChildElem = TalentPickerQuestionV2
388+
_.assign(elemProps, {
389+
options: q.options,
390+
})
391+
break
385392
default:
386393
ChildElem = () => (
387394
<div style={{ borderWidth: 1, borderStyle: 'dashed', borderColor: '#f00' }}>
@@ -452,7 +459,7 @@ class SpecQuestions extends React.Component {
452459
!(question.type === 'estimation' && template.hideEstimation)
453460
).map((q, index) => {
454461
return (
455-
_.includes(['checkbox', 'checkbox-group', 'radio-group', 'add-ons', 'textinput', 'textbox', 'numberinput', 'skills', 'slide-radiogroup', 'slider-standard', 'select-dropdown', 'talent-picker'], q.type) && q.visibilityForRendering === STEP_VISIBILITY.READ_OPTIMIZED ? (
462+
_.includes(['checkbox', 'checkbox-group', 'radio-group', 'add-ons', 'textinput', 'textbox', 'numberinput', 'skills', 'slide-radiogroup', 'slider-standard', 'select-dropdown', 'talent-picker', 'talent-picker-v2'], q.type) && q.visibilityForRendering === STEP_VISIBILITY.READ_OPTIMIZED ? (
456463
<Accordion
457464
key={q.fieldName || `accordion-${index}`}
458465
title={q.summaryTitle || q.title}

0 commit comments

Comments
 (0)