Skip to content
6 changes: 3 additions & 3 deletions src/api/projectMembers.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function addProjectMember(projectId, newMember) {


export function updateProjectMember(projectId, memberId, updatedProps) {
const fields = 'id,userId,role,isPrimary,deletedAt,createdAt,updatedAt,deletedBy,createdBy,updatedBy,handle,photoURL,workingHourStart,workingHourEnd,timeZone'
const fields = 'id,userId,role,isPrimary,deletedAt,createdAt,updatedAt,deletedBy,createdBy,updatedBy,handle,photoURL,workingHourStart,workingHourEnd,timeZone,email'
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/${memberId}/?fields=`
+ encodeURIComponent(fields)
return axios.patch(url, updatedProps)
Expand All @@ -68,7 +68,7 @@ export function removeProjectMember(projectId, memberId) {
}

export function getProjectMembers(projectId) {
const fields = 'id,userId,role,isPrimary,deletedAt,createdAt,updatedAt,deletedBy,createdBy,updatedBy,handle,photoURL,workingHourStart,workingHourEnd,timeZone'
const fields = 'id,userId,role,isPrimary,deletedAt,createdAt,updatedAt,deletedBy,createdBy,updatedBy,handle,photoURL,workingHourStart,workingHourEnd,timeZone,email'
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/?fields=`
+ encodeURIComponent(fields)
return axios.get(url)
Expand All @@ -78,7 +78,7 @@ export function getProjectMembers(projectId) {
}

export function getProjectMember(projectId, memberId) {
const fields = 'id,userId,role,isPrimary,deletedAt,createdAt,updatedAt,deletedBy,createdBy,updatedBy,handle,photoURL,workingHourStart,workingHourEnd,timeZone'
const fields = 'id,userId,role,isPrimary,deletedAt,createdAt,updatedAt,deletedBy,createdBy,updatedBy,handle,photoURL,workingHourStart,workingHourEnd,timeZone,email'
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/${memberId}?fields=`
+ encodeURIComponent(fields)
return axios.get(url)
Expand Down
5 changes: 2 additions & 3 deletions src/components/TeamManagement/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ class Dialog extends React.Component {
isOpen
className="management-dialog"
overlayClassName="management-dialog-overlay"
onRequestClose={onCancel}
shouldCloseOnOverlayClick={!isLoading}
shouldCloseOnEsc={!isLoading}
shouldCloseOnOverlayClick={false}
shouldCloseOnEsc={false}
contentLabel=""
>
<div className="management-dialog-container">
Expand Down
3 changes: 2 additions & 1 deletion src/components/User/UserTooltip.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import _ from 'lodash'
import React from 'react'
import PropTypes from 'prop-types'
import cn from 'classnames'
import Tooltip from 'appirio-tech-react-components/components/Tooltip/Tooltip'
import Avatar from 'appirio-tech-react-components/components/Avatar/Avatar'
import { DOMAIN } from '../../config/constants'
Expand Down Expand Up @@ -53,7 +54,7 @@ const UserTooltip = ({ usr, id, previewAvatar, size, invitedLabel, showEmailOnly
</span>
)}
</div>
<div className="tt-col-user-data">
<div className={cn('tt-col-user-data', { 'with-invite-label': invitedLabel })}>
{!showEmailOnly && <div className="user-name-container">
<span>{userFullName}</span>
</div>}
Expand Down
18 changes: 13 additions & 5 deletions src/components/User/UserTooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,14 @@
display: flex;
flex-wrap: wrap;
align-content: flex-start;
position: relative;
width: 80%;
overflow: hidden;
}

.user-name-container {
flex: 1 0 90%;
flex: 1 1 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

span {
font-size: 15px;
Expand All @@ -143,8 +145,10 @@
}

.user-handle-container {
padding-right: 10px;
height: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

&.with-email {
border-right: 1px solid $tc-gray-50;
Expand All @@ -163,7 +167,6 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 80%;

a {
font-size: 12px;
Expand All @@ -186,6 +189,11 @@
}
}
}

.tt-col-user-data.with-invite-label .user-name-container,
.tt-col-user-data.with-invite-label .user-email-container.text-dark {
margin-right: 75px;
}
}

.sf-data-bottom-container {
Expand Down
1 change: 1 addition & 0 deletions src/config/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const TOPCODER_ALL = [
ROLE_ADMINISTRATOR,
ROLE_CONNECT_ADMIN,
ROLE_CONNECT_MANAGER,
ROLE_CONNECT_COPILOT_MANAGER,
ROLE_CONNECT_ACCOUNT_MANAGER,
ROLE_BUSINESS_DEVELOPMENT_REPRESENTATIVE,
ROLE_PRESALES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ class TalentPickerQuestion extends Component {
return v.people !== '0' && v.duration !== '0' && v.skills.length > 0
}) // validation body
},
noPartialFillsExist: (formValues, value) => {
return _.every(value, v => {
const isOneValueFilled = v.people > 0 || v.duration > 0 || (v.skills && v.skills.length)
const isAllValuesFilled = v.people > 0 && v.duration > 0 && v.skills && v.skills.length

// If one value is filled, all values should be filled to make this row valid. Partial fill is not valid
const isRowValid = !isOneValueFilled || isAllValuesFilled
return isRowValid
})
}
}
setValidations(validations)
}
Expand Down
27 changes: 24 additions & 3 deletions src/projects/detail/components/TalentPickerRow/TalentPickerRow.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import PT from 'prop-types'
import cn from 'classnames'

import IconX from '../../../../assets/icons/ui-16px-1_bold-remove.svg'
import IconAdd from '../../../../assets/icons/ui-16px-1_bold-add.svg'
Expand All @@ -21,6 +22,9 @@ class TalentPickerRow extends React.PureComponent {
this.handleDurationChange = this.handleDurationChange.bind(this)
this.handleSkillChange = this.handleSkillChange.bind(this)

this.resetPeople = this.resetPeople.bind(this)
this.resetDuration = this.resetDuration.bind(this)

this.onAddRow = this.onAddRow.bind(this)
this.onDeleteRow = this.onDeleteRow.bind(this)
}
Expand All @@ -37,6 +41,20 @@ class TalentPickerRow extends React.PureComponent {
this.props.onChange(this.props.rowIndex, 'skills', value)
}

resetDuration() {
const { rowIndex, onChange, value } = this.props
if (!value.duration) {
onChange(rowIndex, 'duration', '0')
}
}

resetPeople() {
const { rowIndex, onChange, value } = this.props
if (!value.people) {
onChange(rowIndex, 'people', '0')
}
}

onAddRow() {
const { rowIndex, value, onAddRow: addRowHandler } = this.props
addRowHandler(rowIndex + 1, value.role)
Expand All @@ -49,6 +67,7 @@ class TalentPickerRow extends React.PureComponent {

render() {
const { value, canBeDeleted, roleSetting, rowIndex } = this.props
const isRowIncomplete = value.people > 0 || value.duration > 0 || (value.skills && value.skills.length)

/* Different columns are defined here and used in componsing mobile/desktop views below */
const roleColumn = (
Expand Down Expand Up @@ -83,9 +102,10 @@ class TalentPickerRow extends React.PureComponent {
<PositiveNumberInput
type="number"
styleName="noMargin"
className="tc-file-field__inputs"
className={cn('tc-file-field__inputs', { error: isRowIncomplete && value.people <= 0 })}
value={value.people || ''}
onChange={this.handlePeopleChange}
onBlur={this.resetPeople}
/>
</div>
)
Expand All @@ -98,9 +118,10 @@ class TalentPickerRow extends React.PureComponent {
<PositiveNumberInput
type="number"
styleName="noMargin"
className="tc-file-field__inputs"
className={cn('tc-file-field__inputs', {error: isRowIncomplete && value.duration <= 0 })}
value={value.duration || ''}
onChange={this.handleDurationChange}
onBlur={this.resetDuration}
/>
</div>
)
Expand All @@ -126,7 +147,7 @@ class TalentPickerRow extends React.PureComponent {
setValue={this.handleSkillChange}
getValue={() => value.skills}
onChange={_.noop}
selectWrapperClass={styles.noMargin}
selectWrapperClass={cn(styles.noMargin, {[styles.skillHasError]: isRowIncomplete && !(value.skills && value.skills.length)})}
/>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,12 @@
overflow: hidden;
text-overflow: ellipsis;
}


.skillHasError {
:global {
.react-select__control {
border-color: $tc-red-70;
}
}
}