diff --git a/frontend/src/lib/components/Cards/InsightCard/InsightCard.tsx b/frontend/src/lib/components/Cards/InsightCard/InsightCard.tsx index e4b091861d0a5..70ee897d088fa 100644 --- a/frontend/src/lib/components/Cards/InsightCard/InsightCard.tsx +++ b/frontend/src/lib/components/Cards/InsightCard/InsightCard.tsx @@ -237,7 +237,6 @@ function InsightMeta({ aggregationLabel, cohortsById, mathDefinitions, - isUsingDataExploration: true, isUsingDashboardQueries: !!featureFlags[FEATURE_FLAGS.HOGQL], }) diff --git a/frontend/src/scenes/insights/InsightPageHeader.tsx b/frontend/src/scenes/insights/InsightPageHeader.tsx index 62fa4a2864f4b..889488963c2da 100644 --- a/frontend/src/scenes/insights/InsightPageHeader.tsx +++ b/frontend/src/scenes/insights/InsightPageHeader.tsx @@ -124,7 +124,6 @@ export function InsightPageHeader({ insightLogicProps }: { insightLogicProps: In name="name" value={insight.name || ''} placeholder={summarizeInsight(query, filters, { - isUsingDataExploration, aggregationLabel, cohortsById, mathDefinitions, diff --git a/frontend/src/scenes/insights/insightLogic.ts b/frontend/src/scenes/insights/insightLogic.ts index 5dcf5925ba9fc..4b8d9f113e13e 100644 --- a/frontend/src/scenes/insights/insightLogic.ts +++ b/frontend/src/scenes/insights/insightLogic.ts @@ -606,24 +606,9 @@ export const insightLogic = kea([ !!props.dashboardItemId && props.dashboardItemId !== 'new' && !props.dashboardItemId.startsWith('new-'), ], derivedName: [ - (s) => [ - s.insight, - s.aggregationLabel, - s.cohortsById, - s.mathDefinitions, - s.isUsingDataExploration, - s.isUsingDashboardQueries, - ], - ( - insight, - aggregationLabel, - cohortsById, - mathDefinitions, - isUsingDataExploration, - isUsingDashboardQueries - ) => + (s) => [s.insight, s.aggregationLabel, s.cohortsById, s.mathDefinitions, s.isUsingDashboardQueries], + (insight, aggregationLabel, cohortsById, mathDefinitions, isUsingDashboardQueries) => summarizeInsight(insight.query, insight.filters || {}, { - isUsingDataExploration, aggregationLabel, cohortsById, mathDefinitions, diff --git a/frontend/src/scenes/insights/summarizeInsight.test.ts b/frontend/src/scenes/insights/summarizeInsight.test.ts index eb110c3804006..dc7c1dd0c59bf 100644 --- a/frontend/src/scenes/insights/summarizeInsight.test.ts +++ b/frontend/src/scenes/insights/summarizeInsight.test.ts @@ -69,13 +69,11 @@ const summaryContext: SummaryContext = { aggregationLabel, cohortsById: cohortIdsMapped, mathDefinitions, - isUsingDataExploration: false, isUsingDashboardQueries: false, } const flagsOnSummaryContext: SummaryContext = { ...summaryContext, - isUsingDataExploration: true, isUsingDashboardQueries: true, } diff --git a/frontend/src/scenes/insights/summarizeInsight.ts b/frontend/src/scenes/insights/summarizeInsight.ts index fba6014b00385..da74a706b9eb5 100644 --- a/frontend/src/scenes/insights/summarizeInsight.ts +++ b/frontend/src/scenes/insights/summarizeInsight.ts @@ -329,7 +329,6 @@ function summariseQuery(query: Node): string { } export interface SummaryContext { - isUsingDataExploration: boolean isUsingDashboardQueries: boolean aggregationLabel: groupsModelType['values']['aggregationLabel'] cohortsById: cohortsModelType['values']['cohortsById'] @@ -342,8 +341,7 @@ export function summarizeInsight( context: SummaryContext ): string { const hasFilters = Object.keys(filters || {}).length > 0 - - return context.isUsingDataExploration && isInsightVizNode(query) + return isInsightVizNode(query) ? summarizeInsightQuery(query.source, context) : context.isUsingDashboardQueries && !!query && !isInsightVizNode(query) ? summariseQuery(query) diff --git a/frontend/src/scenes/saved-insights/SavedInsights.tsx b/frontend/src/scenes/saved-insights/SavedInsights.tsx index f2432bdb21da4..437f600c1e210 100644 --- a/frontend/src/scenes/saved-insights/SavedInsights.tsx +++ b/frontend/src/scenes/saved-insights/SavedInsights.tsx @@ -334,7 +334,6 @@ function SavedInsightsGrid(): JSX.Element { export function SavedInsights(): JSX.Element { const { featureFlags } = useValues(featureFlagLogic) - const isUsingDataExploration = true const isUsingDashboardQueries = !!featureFlags[FEATURE_FLAGS.HOGQL] const { loadInsights, updateFavoritedInsight, renameInsight, duplicateInsight, setSavedInsightsFilters } = @@ -372,7 +371,6 @@ export function SavedInsights(): JSX.Element { {name || ( {summarizeInsight(insight.query, insight.filters, { - isUsingDataExploration, aggregationLabel, cohortsById, mathDefinitions,