diff --git a/src/components/Insights/InsightsCatalog/index.tsx b/src/components/Insights/InsightsCatalog/index.tsx index 78ea1b023..74e792bf0 100644 --- a/src/components/Insights/InsightsCatalog/index.tsx +++ b/src/components/Insights/InsightsCatalog/index.tsx @@ -3,11 +3,12 @@ import { usePrevious } from "../../../hooks/usePrevious"; import { useTheme } from "styled-components"; import { actions as globalActions } from "../../../actions"; +import { getFeatureFlagValue } from "../../../featureFlags"; import { useDebounce } from "../../../hooks/useDebounce"; import { isNumber } from "../../../typeGuards/isNumber"; import { isString } from "../../../typeGuards/isString"; import { isUndefined } from "../../../typeGuards/isUndefined"; -import { GetInsightStatsPayload } from "../../../types"; +import { FeatureFlag, GetInsightStatsPayload } from "../../../types"; import { sendUserActionTrackingEvent } from "../../../utils/actions/sendUserActionTrackingEvent"; import { formatUnit } from "../../../utils/formatUnit"; import { ConfigContext } from "../../common/App/ConfigContext"; @@ -202,6 +203,11 @@ export const InsightsCatalog = (props: InsightsCatalogProps) => { selectedFilters ]); + const areInsightStatsSupported = getFeatureFlagValue( + config, + FeatureFlag.ARE_INSIGHT_STATS_SUPPORTED + ); + return ( <> @@ -247,11 +253,16 @@ export const InsightsCatalog = (props: InsightsCatalogProps) => { {mode === ViewMode.All ? ( <> {!searchInputValue && + !props.hideInsightsStats && (insights.length > 0 || selectedFilters.length > 0) && ( )} diff --git a/src/components/Insights/InsightsCatalog/types.ts b/src/components/Insights/InsightsCatalog/types.ts index 8ea62c0fb..394e2f737 100644 --- a/src/components/Insights/InsightsCatalog/types.ts +++ b/src/components/Insights/InsightsCatalog/types.ts @@ -14,6 +14,7 @@ export interface InsightsCatalogProps { isDismissalEnabled: boolean; unreadCount?: number; isMarkingAsReadEnabled: boolean; + hideInsightsStats?: boolean; } export enum ViewMode { diff --git a/src/components/Insights/index.tsx b/src/components/Insights/index.tsx index eec752c59..f278e6814 100644 --- a/src/components/Insights/index.tsx +++ b/src/components/Insights/index.tsx @@ -327,6 +327,7 @@ export const Insights = (props: InsightsProps) => { isDismissalEnabled={isDismissalEnabled} unreadCount={data.unreadCount} isMarkingAsReadEnabled={isMarkingAsReadEnabled} + hideInsightsStats={props.insightViewType === "Analytics"} /> ); }; diff --git a/src/featureFlags.ts b/src/featureFlags.ts index 809f29403..35408031a 100644 --- a/src/featureFlags.ts +++ b/src/featureFlags.ts @@ -3,7 +3,8 @@ import { ConfigContextData } from "./components/common/App/types"; import { FeatureFlag } from "./types"; export const featureFlagMinBackendVersions: Record = { - [FeatureFlag.ARE_IMPACT_HIGHLIGHTS_ENABLED]: "0.3.7" + [FeatureFlag.ARE_IMPACT_HIGHLIGHTS_ENABLED]: "0.3.7", + [FeatureFlag.ARE_INSIGHT_STATS_SUPPORTED]: "0.3.7" }; export const getFeatureFlagValue = ( diff --git a/src/types.ts b/src/types.ts index 1ec9ebf9e..5be2ad208 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,7 +1,8 @@ import { Duration } from "./globals"; export enum FeatureFlag { - ARE_IMPACT_HIGHLIGHTS_ENABLED + ARE_IMPACT_HIGHLIGHTS_ENABLED, + ARE_INSIGHT_STATS_SUPPORTED } export enum InsightType {