Skip to content

Commit

Permalink
Fix undefined entity list when heatmap is empty (#383)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
  • Loading branch information
ohltyler authored Jan 4, 2023
1 parent ecd0814 commit ae5efd8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions public/pages/utils/anomalyResultUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1767,10 +1767,17 @@ export const convertToCategoryFieldAndEntityString = (
if (index > 0) {
entityString += delimiter;
}

// It is possible that entity.name is undefined when we artificially add
// whitespace strings as the entity values when the heatmap is empty (see
// getSampleAnomaliesHeatmapData())
// If true, set the entire string as 'None'
entityString +=
entity.name +
`${HEATMAP_CALL_ENTITY_KEY_VALUE_DELIMITER}` +
entity.value;
entity.name !== undefined
? entity.name +
`${HEATMAP_CALL_ENTITY_KEY_VALUE_DELIMITER}` +
entity.value
: 'None';
});
}
return entityString;
Expand Down

0 comments on commit ae5efd8

Please sign in to comment.