Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
388e4d3
Added description for TaaS redirection button
RishiRajSahu Feb 2, 2021
87fe8ca
Merge pull request #4311 from appirio-tech/hotfix/hide-manage-ba-in-s…
Feb 23, 2021
1a416c1
Merge pull request #4319 from appirio-tech/hotfix/regression-fix-wron…
Feb 25, 2021
e8aab36
fix: issue #4249
yoution Mar 1, 2021
fef90c5
fix: issue-4301
yoution Mar 1, 2021
990b0cd
fix: issue #4300
yoution Mar 2, 2021
93698dc
fix: issue 4316
narekcat Mar 2, 2021
d250b84
Merge pull request #4313 from appirio-tech/hotfix/taas-intake-form-re…
maxceem Mar 2, 2021
35cd8ec
Merge pull request #4330 from appirio-tech/hotfix/taas-job-editor-imp…
maxceem Mar 2, 2021
df328ec
fix: issue #4315
yoution Mar 2, 2021
94ab43c
fix issue #4249
yoution Mar 3, 2021
d75e512
Merge pull request #4327 from narekcat/issue-4316
maxceem Mar 3, 2021
a23bc24
fix: issue #4315
yoution Mar 4, 2021
e9361c3
fix: issue #4300
yoution Mar 4, 2021
0426134
Revert "fix: issue-4301"
yoution Mar 4, 2021
59fa185
fix: issue #4301
yoution Mar 4, 2021
3c5adbb
Merge pull request #4322 from yoution/issue-4249
maxceem Mar 4, 2021
a43243c
Merge pull request #4326 from yoution/issue-4300
maxceem Mar 4, 2021
8537f27
Merge pull request #4332 from yoution/issue-4315
maxceem Mar 4, 2021
b755103
fix: issue #4301
yoution Mar 4, 2021
b9bfb71
Merge pull request #4323 from yoution/issue-4301
maxceem Mar 4, 2021
3b4becd
fix: issue #4281
yoution Mar 4, 2021
0a30cdf
fix: issue #4310
yoution Mar 5, 2021
0bb5c10
Merge pull request #4333 from yoution/issue-4281
maxceem Mar 9, 2021
79caec5
fix: issue #4310
yoution Mar 9, 2021
ea20e9b
Merge pull request #4334 from yoution/issue-4310
maxceem Mar 9, 2021
90a9340
Merge pull request #4293 from appirio-tech/feature/add_msg_for_taas_p…
Mar 11, 2021
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/add_msg_for_taas_projects']

- 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 @@ -38,6 +38,7 @@ module.exports = {
FILE_PICKER_ACCEPT: process.env.FILE_PICKER_ACCEPT_DEV,

SALESFORCE_PROJECT_LEAD_LINK: 'https://c.cs18.visual.force.com/apex/ConnectLead?connectProjectId=',
SALESFORCE_BILLING_ACCOUNT_LINK: 'https://c.cs18.visual.force.com/apex/baredirect?id=',

CONNECT_SEGMENT_KEY: process.env.DEV_SEGMENT_KEY,
PREDIX_PROGRAM_ID : 3448,
Expand Down
1 change: 1 addition & 0 deletions config/constants/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = {
FILE_PICKER_ACCEPT: process.env.FILE_PICKER_ACCEPT_PROD,

SALESFORCE_PROJECT_LEAD_LINK: 'https://topcoder.my.salesforce.com/apex/ConnectLead?connectProjectId=',
SALESFORCE_BILLING_ACCOUNT_LINK: 'https://topcoder.my.salesforce.com/apex/baredirect?id=',
CONNECT_SEGMENT_KEY: process.env.PROD_SEGMENT_KEY,
PREDIX_PROGRAM_ID : 3448,
IBM_COGNITIVE_PROGRAM_ID : 3449,
Expand Down
1 change: 1 addition & 0 deletions config/constants/qa.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module.exports = {
FILE_PICKER_ACCEPT: process.env.FILE_PICKER_ACCEPT_QA,

SALESFORCE_PROJECT_LEAD_LINK: 'https://c.cs18.visual.force.com/apex/ConnectLead?connectProjectId=',
SALESFORCE_BILLING_ACCOUNT_LINK: 'https://c.cs18.visual.force.com/apex/baredirect?id=',
CONNECT_SEGMENT_KEY: process.env.QA_SEGMENT_KEY,
PREDIX_PROGRAM_ID : 3448,
IBM_COGNITIVE_PROGRAM_ID : 3449,
Expand Down
24 changes: 19 additions & 5 deletions src/actions/loadUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {
ACCOUNTS_APP_CONNECTOR_URL,
LOAD_USER_SUCCESS,
LOAD_USER_FAILURE,
LOAD_USER_CREDENTIAL,
LOAD_USER_CREDENTIAL_FAILURE,
LOAD_ORG_CONFIG_SUCCESS,
LOAD_ORG_CONFIG_FAILURE,
ROLE_ADMINISTRATOR,
Expand All @@ -16,7 +18,7 @@ import {
ROLE_PRESALES, ROLE_PROJECT_MANAGER, ROLE_SOLUTION_ARCHITECT
} from '../config/constants'
import { getFreshToken, configureConnector, decodeToken } from 'tc-auth-lib'
import { getUserProfile } from '../api/users'
import { getUserProfile, getCredential } from '../api/users'
import { fetchGroups } from '../api/groups'
import { getOrgConfig } from '../api/orgConfig'
import { EventTypes } from 'redux-segment'
Expand All @@ -26,6 +28,18 @@ configureConnector({
frameId: 'tc-accounts-iframe'
})

export function getUserCredential(userId) {
return (dispatch) => {
return dispatch({
type: LOAD_USER_CREDENTIAL,
payload: getCredential(userId)
}).catch((err) => {
console.log(err)
dispatch({ type: LOAD_USER_CREDENTIAL_FAILURE })
})
}
}

export function loadUser() {
return ((dispatch, getState) => {
const state = getState()
Expand Down Expand Up @@ -125,9 +139,9 @@ export function loadUserSuccess(dispatch, token) {
loadGroups(dispatch, currentUser.userId)
})
.catch((err) => {
// if we fail to load user's profile, still dispatch user load success
// ideally it shouldn't happen, but if it is, we can render the page
// without profile information
// if we fail to load user's profile, still dispatch user load success
// ideally it shouldn't happen, but if it is, we can render the page
// without profile information
console.log(err)
dispatch({ type: LOAD_USER_SUCCESS, user : currentUser })
})
Expand Down Expand Up @@ -161,7 +175,7 @@ function loadGroups(dispatch, userId) {
}
})
.catch((err) => {
// if we fail to load groups
// if we fail to load groups
console.log(err)
})
}
Expand Down
17 changes: 17 additions & 0 deletions src/api/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ export function getUserProfile(handle) {
})
}


/**
* Gets credential for the specified user id.
*
* NOTE: Only admins are authorized to use the underlying endpoint.
*
* @param {Number} userId The user id
* @return {Promise} Resolves to the linked accounts array.
*/
export function getCredential(userId) {
return axios.get(`${TC_API_URL}/v3/users/${userId}?fields=credential`)
.then(resp => {
return _.get(resp.data, 'result.content', {})
})
}


/**
* Update user profile
*
Expand Down
2 changes: 1 addition & 1 deletion src/components/MobileMenu/MobileMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const MobileMenu = ({ user, onClose, menu }) => {
</ul>
))}
</div>
<div styleName="footer">Topcoder &copy; 2018</div>
<div styleName="footer">Topcoder &copy; {new Date().getFullYear()}</div>
</div>
</MobilePage>
)
Expand Down
2 changes: 2 additions & 0 deletions src/components/Select/Select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const Select = (props) => {
{...props}
createOptionPosition="first"
className={containerclass}
ref={props.createSelectRef}
classNamePrefix="react-select"
/>
)
Expand All @@ -36,6 +37,7 @@ const Select = (props) => {
createOptionPosition="first"
className={containerclass}
classNamePrefix="react-select"
isClearable
/>
)
}
Expand Down
17 changes: 16 additions & 1 deletion src/components/TeamManagement/AutocompleteInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ class AutocompleteInput extends React.Component {
const {
placeholder,
selectedMembers,
disabled
createSelectRef,
disabled,
onBlur
} = this.props

return (
<div className="autocomplete-wrapper">
<Select
isMulti
onBlur={onBlur}
closeMenuOnSelect
createSelectRef={createSelectRef}
showDropdownIndicator={false}
createOption
placeholder={placeholder}
Expand All @@ -41,6 +45,7 @@ class AutocompleteInput extends React.Component {
AutocompleteInput.defaultProps = {
placeholder: 'Enter one or more user handles',
selectedMembers: [],
createSelectRef: () => {},
disabled: false
}

Expand All @@ -50,6 +55,16 @@ AutocompleteInput.propTypes = {
*/
onUpdate: PropTypes.func,

/**
* Callback fired when input blur
*/
onBlur: PropTypes.func,

/**
* Callback for pass select Ref to parent component
*/
createSelectRef : PropTypes.func,

/**
* The current logged in user in the app.
* Used to determinate "You" label and access
Expand Down
26 changes: 26 additions & 0 deletions src/components/TeamManagement/AutocompleteInputContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ class AutocompleteInputContainer extends React.Component {
constructor(props) {
super(props)
this.debounceTimer = null
this.selectInstance = null

this.clearUserSuggestions = this.clearUserSuggestions.bind(this)
this.handleInputBlur = this.handleInputBlur.bind(this)
this.createSelectRef = this.createSelectRef.bind(this)
}

/**
Expand Down Expand Up @@ -66,13 +69,36 @@ class AutocompleteInputContainer extends React.Component {
this.clearUserSuggestions()
}

handleInputBlur(event) {
const {
selectedMembers
} = this.props
const value = event.target.value
const innerSelectInstance = this.selectInstance.select

if (value) {
const hasExist = _.find(selectedMembers, ({label}) => label === value)
if (!hasExist) {
// format new option from input value
const newOption = {value, label: value}
innerSelectInstance.select.selectOption(newOption)
}
}
}

createSelectRef(ref) {
this.selectInstance = ref
}

render() {

const { placeholder, currentUser, selectedMembers, disabled } = this.props

return (
<AutocompleteInput
createSelectRef={this.createSelectRef}
placeholder={placeholder ? placeholder:''}
onBlur={this.handleInputBlur}
onInputChange={this.onInputChange.bind(this)}
onUpdate={this.onUpdate.bind(this)}
suggestedMembers={this.props.suggestedMembers}
Expand Down
10 changes: 2 additions & 8 deletions src/components/TopBar/TopBarContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,8 @@ class TopBarContainer extends React.Component {
{ label: 'Account and security', link: '/settings/account' },
{ label: 'Notification settings', link: '/settings/notifications' },
]
}, {
items: [
{ label: 'About', link: 'https://www.topcoder.com/company/', absolute: true },
{ label: 'Contact us', link: 'https://www.topcoder.com/contact-us/', absolute: true },
{ label: 'Privacy', link: 'https://www.topcoder.com/privacy-policy/', absolute: true },
{ label: 'Terms', link: 'https://connect.topcoder.com/terms', absolute: true },
]
}, {
},
{
items: [
{ label: 'Log Out', link: logoutLink, absolute: true, onClick: logoutClick },
]
Expand Down
7 changes: 7 additions & 0 deletions src/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import { getCookie } from '../helpers/cookie'
export const LOAD_USER_SUCCESS = 'LOAD_USER_SUCCESS'
export const LOAD_USER_FAILURE = 'LOAD_USER_FAILURE'

export const LOAD_USER_CREDENTIAL = 'LOAD_USER_CREDENTIAL'
export const LOAD_USER_CREDENTIAL_PENDING = 'LOAD_USER_CREDENTIAL_PENDING'
export const LOAD_USER_CREDENTIAL_SUCCESS = 'LOAD_USER_CREDENTIAL_SUCCESS'
export const LOAD_USER_CREDENTIAL_FAILURE = 'LOAD_USER_CREDENTIAL_FAILURE'


// Load organization configs
export const LOAD_ORG_CONFIG_SUCCESS = 'LOAD_ORG_CONFIG_SUCCESS'
export const LOAD_ORG_CONFIG_FAILURE = 'LOAD_ORG_CONFIG_FAILURE'
Expand Down Expand Up @@ -738,6 +744,7 @@ export const TC_API_URL = `https://api.${DOMAIN}`
export const DIRECT_PROJECT_URL = `https://www.${DOMAIN}/direct/projectOverview?formData.projectId=`
export const WORK_MANAGER_APP = `https://challenges.${DOMAIN}/projects`
export const SALESFORCE_PROJECT_LEAD_LINK = process.env.SALESFORCE_PROJECT_LEAD_LINK
export const SALESFORCE_BILLING_ACCOUNT_LINK = process.env.SALESFORCE_BILLING_ACCOUNT_LINK
export const TC_NOTIFICATION_URL = process.env.TC_NOTIFICATION_URL || `${TC_API_URL}/v5/notifications`
// Uncomment if you run TC Notifications locally
// export const TC_NOTIFICATION_URL = 'http://localstho:4000/v5/notifications'
Expand Down
2 changes: 1 addition & 1 deletion src/projects/create/components/FillProjectDetails.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
@include flexBox;
background-color: transparent;
display: flex;
max-width: 760px;
max-width: 880px;
margin: 20px auto;

.left-area {
Expand Down
2 changes: 1 addition & 1 deletion src/projects/create/components/HeaderWithProgress.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

.content {
margin: 0 auto;
max-width: 600px;
max-width: 720px;
}

.title-estimate {
Expand Down
29 changes: 16 additions & 13 deletions src/projects/detail/components/BillingAccountField/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react'
import moment from 'moment'
import {HOC as hoc} from 'formsy-react'

import Select from '../../../../components/Select/Select'
import {fetchBillingAccounts} from '../../../../api/billingAccounts'
// import {SALESFORCE_PROJECT_LEAD_LINK} from '../../../../config/constants'
import {SALESFORCE_BILLING_ACCOUNT_LINK} from '../../../../config/constants'

import styles from './styles.module.scss'

Expand All @@ -14,7 +15,7 @@ import styles from './styles.module.scss'
* @returns {{ label: string, value: number }} option for Select
*/
const buildOption = (billingAccountObj) => ({
label: `${billingAccountObj.name} (${billingAccountObj.tcBillingAccountId})`,
label: `${billingAccountObj.name} (${billingAccountObj.tcBillingAccountId}) ${billingAccountObj.endDate ? ' - '+ moment(billingAccountObj.endDate).format('DD MMM YYYY'): ''}`,
value: billingAccountObj.tcBillingAccountId
})

Expand Down Expand Up @@ -72,7 +73,7 @@ class BillingAccountField extends React.Component {

handleChange(value) {
this.setState({ selectedBillingAccount: value })
this.props.setValue(value.value)
this.props.setValue(value ? value.value : null)
}

render() {
Expand All @@ -89,18 +90,20 @@ class BillingAccountField extends React.Component {
value={this.state.selectedBillingAccount}
options={this.state.billingAccounts}
isDisabled={this.state.billingAccounts.length === 0}
showDropdownIndicator
/>
{/* Hide this link because we haven't implemented a required page in SFDC yet */}
{/* <div className={styles.manageBillingAccountLinkWrapper}>
<a
className={styles.manageBillingAccountLink}
href={`${SALESFORCE_PROJECT_LEAD_LINK}${this.props.projectId}`}
target="_blank"
rel="noopener noreferrer"
>
{this.state.selectedBillingAccount && (
<div className={styles.manageBillingAccountLinkWrapper}>
<a
className={styles.manageBillingAccountLink}
href={`${SALESFORCE_BILLING_ACCOUNT_LINK}${this.state.selectedBillingAccount.value}`}
target="_blank"
rel="noopener noreferrer"
>
Manage the billing account in Salesforce
</a>
</div> */}
</a>
</div>
)}
</div>
)
}
Expand Down
4 changes: 1 addition & 3 deletions src/projects/detail/components/JobPickerRow/JobPickerRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ class JobPickerRow extends React.PureComponent {
{ value: 'designer', title: 'Designer'},
{ value: 'software-developer', title: 'Software Developer'},
{ value: 'data-scientist', title: 'Data Scientist'},
{ value: 'data-engineer', title: 'Data Engineer'},
{ value: 'qa', title: 'QA Tester'},
{ value: 'qa-engineer', title: 'QA Engineer'}
{ value: 'data-engineer', title: 'Data Engineer'}
]
}
handleJobTitleChange(evt) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
}

.spec-question-list-item {
&.question-type-jobs-picker {
margin-left: -12.5px;
margin-right: -12.5px;
}
padding: 0;
margin-bottom: 30px;

Expand Down Expand Up @@ -170,7 +174,7 @@
.dropdown-wrap.default {
background: $tc-gray-neutral-light;
border-color: $tc-gray-20;
max-width: 300px;
max-width: 352px;
margin-left: 0px;

&.error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ import './TaasProjectWelcome.scss'
const TaasProjectWelcome = ({ projectId }) => {
const url = `${TAAS_APP_URL}/myteams/${projectId}`
return (
<div styleName="container">
<a href={url} className="tc-btn tc-btn-lg tc-btn-primary">Go to your Talent Team</a>
<div>
<div styleName="text-container">
<p>This is a Talent as a Service project. Click this button to navigate to a TaaS focused experience where you can get information specific to your TaaS team.</p>
</div>
<div styleName="container">
<a href={url} className="tc-btn tc-btn-lg tc-btn-primary">Go to your Talent Team</a>
</div>
</div>
)
}
Expand Down
Loading