Skip to content

Commit

Permalink
Addressing feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-buttner committed Aug 30, 2022
1 parent 039447c commit 9ca5a6a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { EuiFlexGroup, EuiFlexItem, EuiLoadingContent } from '@elastic/eui';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import React, { useCallback, useMemo } from 'react';
import { isEqual, uniq } from 'lodash';
import { useGetCurrentUserProfile } from '../../../containers/user_profiles/use_get_current_user_profile';
import { useBulkGetUserProfiles } from '../../../containers/user_profiles/use_bulk_get_user_profiles';
Expand Down Expand Up @@ -58,19 +58,12 @@ export const CaseViewActivity = ({
[caseData.assignees]
);

const [uidsToRetrieve, setUidsToRetrieve] = useState<string[]>([]);
const uidsToRetrieve = uniq([...(userActionsData?.profileUids ?? []), ...assignees]);

const { data: userProfiles, isLoading: isLoadingUserProfiles } = useBulkGetUserProfiles({
uids: uidsToRetrieve,
});

useEffect(() => {
if (userActionsData?.profileUids !== undefined) {
const uids = uniq([...userActionsData.profileUids, ...assignees]);
setUidsToRetrieve(uids);
}
}, [assignees, userActionsData?.profileUids]);

const { data: currentUserProfile, isLoading: isLoadingCurrentUserProfile } =
useGetCurrentUserProfile();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const FormatListItem: React.FC<{
if (shouldAddAnd(index, listSize)) {
return (
<>
{i18n.AND_SPACE}
{children}
{i18n.AND} {children}
</>
);
} else if (shouldAddComma(index, listSize)) {
Expand Down Expand Up @@ -82,7 +81,7 @@ interface AssigneesProps {
const AssigneesComponent = ({ assignees, createdByUser }: AssigneesProps) => (
<>
{assignees.length > 0 && (
<EuiFlexGroup alignItems="center" gutterSize="xs">
<EuiFlexGroup alignItems="center" gutterSize="xs" wrap>
{assignees.map((assignee, index) => {
const usernameDataTestSubj = getUsernameDataTestSubj(assignee);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ export const THEMSELVES = i18n.translate('xpack.cases.caseView.assignee.themselv
defaultMessage: 'themselves',
});

export const AND_SPACE = i18n.translate('xpack.cases.caseView.assignee.and', {
defaultMessage: 'and ',
export const AND = i18n.translate('xpack.cases.caseView.assignee.and', {
defaultMessage: 'and',
});

0 comments on commit 9ca5a6a

Please sign in to comment.