diff --git a/src/components/Assets/AssetList/AssetEntry/index.tsx b/src/components/Assets/AssetList/AssetEntry/index.tsx index b71f766d8..7f778ac99 100644 --- a/src/components/Assets/AssetList/AssetEntry/index.tsx +++ b/src/components/Assets/AssetList/AssetEntry/index.tsx @@ -1,4 +1,5 @@ import { DefaultTheme, useTheme } from "styled-components"; +import { InsightType } from "../../../../types"; import { getInsightImportanceColor } from "../../../../utils/getInsightImportanceColor"; import { getInsightTypeInfo } from "../../../../utils/getInsightTypeInfo"; import { getInsightTypeOrderPriority } from "../../../../utils/getInsightTypeOrderPriority"; @@ -40,7 +41,16 @@ export const AssetEntry = (props: AssetEntryProps) => { const lastSeenDateTime = props.entry.lastSpanInstanceInfo.startTime; - const sortedInsights = [...props.entry.insights].sort( + // Do not show unimplemented insights + const filteredInsights = props.entry.insights.filter( + (x) => + ![ + InsightType.SpanScalingWell, + InsightType.SpanScalingInsufficientData + ].includes(x.type as InsightType) + ); + + const sortedInsights = [...filteredInsights].sort( (a, b) => a.importance - b.importance || getInsightTypeOrderPriority(a.type) - getInsightTypeOrderPriority(b.type) diff --git a/src/components/Assets/AssetList/index.tsx b/src/components/Assets/AssetList/index.tsx index 8f4d5b8a7..801d990b6 100644 --- a/src/components/Assets/AssetList/index.tsx +++ b/src/components/Assets/AssetList/index.tsx @@ -217,7 +217,7 @@ const getAvailableSortingCriterions = ( SORTING_CRITERION.NAME ]; - if (assets[0].impactScores) { + if (assets.length > 0 && assets[0].impactScores) { criterions.push( SORTING_CRITERION.PERFORMANCE_IMPACT, SORTING_CRITERION.OVERALL_IMPACT