diff --git a/src/components/Insights/InsightsCatalog/index.tsx b/src/components/Insights/InsightsCatalog/index.tsx index cd7b47313..4ed3689ca 100644 --- a/src/components/Insights/InsightsCatalog/index.tsx +++ b/src/components/Insights/InsightsCatalog/index.tsx @@ -144,11 +144,15 @@ export const InsightsCatalog = (props: InsightsCatalogProps) => { setSorting(val); }} options={[ - { - value: SORTING_CRITERION.CRITICAL_INSIGHTS, - label: "Critical insights", - defaultOrder: SORTING_ORDER.DESC - }, + ...(defaultQuery.insightViewType === "Issues" + ? [ + { + value: SORTING_CRITERION.CRITICAL_INSIGHTS, + label: "Critical insights", + defaultOrder: SORTING_ORDER.DESC + } + ] + : []), { value: SORTING_CRITERION.LATEST, label: "Latest", diff --git a/src/components/Insights/common/InsightCard/Select/index.tsx b/src/components/Insights/common/InsightCard/Select/index.tsx index 0346d7a5d..66404cd23 100644 --- a/src/components/Insights/common/InsightCard/Select/index.tsx +++ b/src/components/Insights/common/InsightCard/Select/index.tsx @@ -53,11 +53,11 @@ export const Select = (props: SelectProps) => { > {selectedOption ? ( - {selectedOption.customContent ? ( - <>{selectedOption.customContent} - ) : ( - {selectedOption.label} - )} + + {selectedOption.customContent + ? selectedOption.customContent + : selectedOption.label} + ) : ( props.placeholder diff --git a/src/components/Insights/common/InsightCard/Select/styles.ts b/src/components/Insights/common/InsightCard/Select/styles.ts index 016dcf9d5..e081747b1 100644 --- a/src/components/Insights/common/InsightCard/Select/styles.ts +++ b/src/components/Insights/common/InsightCard/Select/styles.ts @@ -56,7 +56,7 @@ export const SelectBar = styled.div` } `; -export const SelectedValue = styled.span` +export const SelectedValue = styled.div` text-overflow: ellipsis; white-space: nowrap; overflow: hidden;