Skip to content

Commit

Permalink
[ML] Fixes display of job group badges in recognizer wizard (#101775)
Browse files Browse the repository at this point in the history
  • Loading branch information
peteharverson authored and semd committed Jun 10, 2021
1 parent afea43e commit 9942cf4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export const EditJob: FC<EditJobProps> = ({ job, jobOverride, existingGroupIds,
);

const handleValidation = () => {
const jobGroupsValidationResult =
formState.jobGroups ??
[].map((group) => groupValidator(group)).filter((result) => result !== null);
const jobGroupsValidationResult = (formState.jobGroups ?? [])
.map((group) => groupValidator(group))
.filter((result) => result !== null);

setValidationResult({
jobGroups: jobGroupsValidationResult,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,11 @@ export const JobItem: FC<JobItemProps> = memo(
</EuiText>

<EuiFlexGroup wrap responsive={false} gutterSize="xs">
{jobGroups ??
[].map((group) => (
<EuiFlexItem grow={false} key={group}>
<EuiBadge color={tabColor(group)}>{group}</EuiBadge>
</EuiFlexItem>
))}
{(jobGroups ?? []).map((group) => (
<EuiFlexItem grow={false} key={group}>
<EuiBadge color={tabColor(group)}>{group}</EuiBadge>
</EuiFlexItem>
))}
</EuiFlexGroup>

{setupResult && setupResult.error && (
Expand Down

0 comments on commit 9942cf4

Please sign in to comment.