Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions src/libs/actions/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,20 +568,21 @@ function clearOutTaskInfoAndNavigate(reportID) {
/**
* Get the assignee data
*
* @param {Object} details
* @param {Number} assigneeAccountID
* @param {Object} personalDetails
* @returns {Object}
*/
function getAssignee(details) {
function getAssignee(assigneeAccountID, personalDetails) {
const details = personalDetails[assigneeAccountID];
if (!details) {
return {
icons: [],
displayName: '',
subtitle: '',
};
}
const source = UserUtils.getAvatar(lodashGet(details, 'avatar', ''), lodashGet(details, 'accountID', -1));
return {
icons: [{source, type: 'avatar', name: details.login}],
icons: ReportUtils.getIconsForParticipants([details.accountID], personalDetails),
displayName: details.displayName,
subtitle: details.login,
};
Expand Down
7 changes: 1 addition & 6 deletions src/pages/tasks/NewTaskPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import MenuItemWithTopDescription from '../../components/MenuItemWithTopDescript
import MenuItem from '../../components/MenuItem';
import reportPropTypes from '../reportPropTypes';
import * as Task from '../../libs/actions/Task';
import * as OptionsListUtils from '../../libs/OptionsListUtils';
import * as ReportUtils from '../../libs/ReportUtils';
import FormAlertWithSubmitButton from '../../components/FormAlertWithSubmitButton';
import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoundView';
Expand Down Expand Up @@ -78,11 +77,7 @@ function NewTaskPage(props) {
// If we have an assignee, we want to set the assignee data
// If there's an issue with the assignee chosen, we want to notify the user
if (props.task.assignee) {
const assigneeDetails = lodashGet(OptionsListUtils.getPersonalDetailsForAccountIDs([props.task.assigneeAccountID], props.personalDetails), props.task.assigneeAccountID);
if (!assigneeDetails) {
return setErrorMessage(props.translate('task.assigneeError'));
}
const displayDetails = Task.getAssignee(assigneeDetails);
const displayDetails = Task.getAssignee(props.task.assigneeAccountID, props.personalDetails);
setAssignee(displayDetails);
}

Expand Down