({
+ type: 'error',
+ line: toLine(response.hogql ?? '', error.start ?? 0),
+ column: toColumn(response.hogql ?? '', error.start ?? 0),
+ ...error,
+ })),
+ ...(response.metadata as HogQLMetadataResponse).warnings.map((warn) => ({
+ type: 'warning',
+ line: toLine(response.hogql ?? '', warn.start ?? 0),
+ column: toColumn(response.hogql ?? '', warn.start ?? 0),
+ ...warn,
+ })),
+ ...(response.metadata as HogQLMetadataResponse).notices.map((notice) => ({
+ type: 'notice',
+ line: toLine(response.hogql ?? '', notice.start ?? 0),
+ column: toColumn(response.hogql ?? '', notice.start ?? 0),
+ ...notice,
+ })),
+ ].sort((a, b) => (a.start ?? 0) - (b.start ?? 0))}
+ columns={[
+ { title: 'Line', dataIndex: 'line', key: 'line', width: '40px' },
+ { title: 'Column', dataIndex: 'column', key: 'column', width: '40px' },
+ { title: 'Type', dataIndex: 'type', key: 'type', width: '80px' },
+ { title: 'Message', dataIndex: 'message', key: 'message' },
+ ]}
+ />
+ ),
+ },
+ ]
+ .filter(Boolean)
+ .map((tab) => ({ ...tab, content: {tab.content} }))
+ : []
+
+ return (
+
+ t && t.key === tab) ? tab : (tabs[0] && tabs[0].key) || 'response'}
+ onChange={(t) => setTab(t)}
+ tabs={tabs}
+ />
+
+ )
+}
diff --git a/frontend/src/scenes/experiments/utils.ts b/frontend/src/scenes/experiments/utils.ts
index fe25dc456323a..9d6a1fdc88dcc 100644
--- a/frontend/src/scenes/experiments/utils.ts
+++ b/frontend/src/scenes/experiments/utils.ts
@@ -83,7 +83,6 @@ export function getMinimumDetectableEffect(
return 100
} else if (baselineCount <= 1000) {
return 20
- } else {
- return 5
}
+ return 5
}
diff --git a/frontend/src/scenes/feature-flags/FeatureFlag.tsx b/frontend/src/scenes/feature-flags/FeatureFlag.tsx
index c6affd75911ee..f202471bbb5ad 100644
--- a/frontend/src/scenes/feature-flags/FeatureFlag.tsx
+++ b/frontend/src/scenes/feature-flags/FeatureFlag.tsx
@@ -618,13 +618,12 @@ function UsageTab({ featureFlag }: { id: string; featureFlag: FeatureFlagType })
const { generateUsageDashboard, enrichUsageDashboard } = useActions(featureFlagLogic)
const { featureFlagLoading } = useValues(featureFlagLogic)
let dashboard: DashboardType | null = null
- let connectedDashboardExists = false
if (dashboardId) {
+ // FIXME: Refactor out into , as React hooks under conditional branches are no good
const dashboardLogicValues = useValues(
dashboardLogic({ id: dashboardId, placement: DashboardPlacement.FeatureFlag })
)
dashboard = dashboardLogicValues.dashboard
- connectedDashboardExists = !dashboardLogicValues.receivedErrorsFromAPI
}
const { closeEnrichAnalyticsNotice } = useActions(featureFlagsLogic)
@@ -632,7 +631,6 @@ function UsageTab({ featureFlag }: { id: string; featureFlag: FeatureFlagType })
useEffect(() => {
if (
- connectedDashboardExists &&
dashboard &&
hasEnrichedAnalytics &&
!(dashboard.tiles?.find((tile) => (tile.insight?.name?.indexOf('Feature Viewed') ?? -1) > -1) !== undefined)
@@ -652,7 +650,7 @@ function UsageTab({ featureFlag }: { id: string; featureFlag: FeatureFlagType })
return (
- {connectedDashboardExists ? (
+ {dashboard ? (
<>
{!hasEnrichedAnalytics && !enrichAnalyticsNoticeAcknowledged && (
closeEnrichAnalyticsNotice()}>
diff --git a/frontend/src/scenes/feature-flags/featureFlagLogic.ts b/frontend/src/scenes/feature-flags/featureFlagLogic.ts
index 32c029e760e43..291656e9f4bc9 100644
--- a/frontend/src/scenes/feature-flags/featureFlagLogic.ts
+++ b/frontend/src/scenes/feature-flags/featureFlagLogic.ts
@@ -870,9 +870,8 @@ export const featureFlagLogic = kea([
},
],
}
- } else {
- return defaultEntityFilterOnFlag
}
+ return defaultEntityFilterOnFlag
},
],
hasEarlyAccessFeatures: [
diff --git a/frontend/src/scenes/feature-flags/featureFlagsLogic.ts b/frontend/src/scenes/feature-flags/featureFlagsLogic.ts
index 6773878fd071b..709c08f803f41 100644
--- a/frontend/src/scenes/feature-flags/featureFlagsLogic.ts
+++ b/frontend/src/scenes/feature-flags/featureFlagsLogic.ts
@@ -67,9 +67,8 @@ export const featureFlagsLogic = kea([
updateFlag: (state, { flag }) => {
if (state.find(({ id }) => id === flag.id)) {
return state.map((stateFlag) => (stateFlag.id === flag.id ? flag : stateFlag))
- } else {
- return [flag, ...state]
}
+ return [flag, ...state]
},
deleteFlag: (state, { id }) => state.filter((flag) => flag.id !== id),
},
diff --git a/frontend/src/scenes/funnels/funnelCorrelationLogic.ts b/frontend/src/scenes/funnels/funnelCorrelationLogic.ts
index d76e569d1f2d6..0f8441a5733ea 100644
--- a/frontend/src/scenes/funnels/funnelCorrelationLogic.ts
+++ b/frontend/src/scenes/funnels/funnelCorrelationLogic.ts
@@ -64,21 +64,20 @@ export const funnelCorrelationLogic = kea([
result_type: FunnelCorrelationResultsType.Events,
})) as FunnelCorrelation[],
}
- } else {
- const results: Omit[] = (
- await api.create(`api/projects/${values.currentTeamId}/insights/funnel/correlation`, {
- ...values.apiParams,
- funnel_correlation_type: 'events',
- funnel_correlation_exclude_event_names: values.excludedEventNames,
- })
- ).result?.events
+ }
+ const results: Omit[] = (
+ await api.create(`api/projects/${values.currentTeamId}/insights/funnel/correlation`, {
+ ...values.apiParams,
+ funnel_correlation_type: 'events',
+ funnel_correlation_exclude_event_names: values.excludedEventNames,
+ })
+ ).result?.events
- return {
- events: results.map((result) => ({
- ...result,
- result_type: FunnelCorrelationResultsType.Events,
- })),
- }
+ return {
+ events: results.map((result) => ({
+ ...result,
+ result_type: FunnelCorrelationResultsType.Events,
+ })),
}
} catch (error) {
lemonToast.error('Failed to load correlation results', { toastId: 'funnel-correlation-error' })
@@ -110,22 +109,21 @@ export const funnelCorrelationLogic = kea([
result_type: FunnelCorrelationResultsType.EventWithProperties,
})) as FunnelCorrelation[],
}
- } else {
- const results: Omit[] = (
- await api.create(`api/projects/${values.currentTeamId}/insights/funnel/correlation`, {
- ...values.apiParams,
- funnel_correlation_type: 'event_with_properties',
- funnel_correlation_event_names: [eventName],
- funnel_correlation_event_exclude_property_names: values.excludedEventPropertyNames,
- })
- ).result?.events
+ }
+ const results: Omit[] = (
+ await api.create(`api/projects/${values.currentTeamId}/insights/funnel/correlation`, {
+ ...values.apiParams,
+ funnel_correlation_type: 'event_with_properties',
+ funnel_correlation_event_names: [eventName],
+ funnel_correlation_event_exclude_property_names: values.excludedEventPropertyNames,
+ })
+ ).result?.events
- return {
- [eventName]: results.map((result) => ({
- ...result,
- result_type: FunnelCorrelationResultsType.EventWithProperties,
- })),
- }
+ return {
+ [eventName]: results.map((result) => ({
+ ...result,
+ result_type: FunnelCorrelationResultsType.EventWithProperties,
+ })),
}
},
},
diff --git a/frontend/src/scenes/funnels/funnelDataLogic.ts b/frontend/src/scenes/funnels/funnelDataLogic.ts
index 3080f0db0560f..555cfd116775f 100644
--- a/frontend/src/scenes/funnels/funnelDataLogic.ts
+++ b/frontend/src/scenes/funnels/funnelDataLogic.ts
@@ -158,9 +158,8 @@ export const funnelDataLogic = kea([
)
}
return insightData.result
- } else {
- return []
}
+ return []
},
],
steps: [
@@ -176,9 +175,8 @@ export const funnelDataLogic = kea([
return aggregateBreakdownResult(results, breakdownProperty).sort((a, b) => a.order - b.order)
}
return results.sort((a, b) => a.order - b.order)
- } else {
- return []
}
+ return []
},
],
stepsWithConversionMetrics: [
@@ -270,9 +268,8 @@ export const funnelDataLogic = kea([
return (histogramGraphData?.length ?? 0) > 0
} else if (funnelsFilter.funnelVizType === FunnelVizType.Trends) {
return (steps?.length ?? 0) > 0 && !!steps?.[0]?.labels
- } else {
- return false
}
+ return false
},
],
numericBinCount: [
@@ -352,9 +349,8 @@ export const funnelDataLogic = kea([
if (startIndex !== undefined && startIndex !== -1) {
return startIndex - steps[0].days.length
- } else {
- return 0
}
+ return 0
},
],
diff --git a/frontend/src/scenes/funnels/funnelPropertyCorrelationLogic.ts b/frontend/src/scenes/funnels/funnelPropertyCorrelationLogic.ts
index a12aa0ca2ec08..7a9be00e15782 100644
--- a/frontend/src/scenes/funnels/funnelPropertyCorrelationLogic.ts
+++ b/frontend/src/scenes/funnels/funnelPropertyCorrelationLogic.ts
@@ -94,22 +94,21 @@ export const funnelPropertyCorrelationLogic = kea[] = (
- await api.create(`api/projects/${values.currentTeamId}/insights/funnel/correlation`, {
- ...values.apiParams,
- funnel_correlation_type: 'properties',
- funnel_correlation_names: targetProperties,
- funnel_correlation_exclude_names: values.excludedPropertyNames,
- })
- ).result?.events
+ }
+ const results: Omit[] = (
+ await api.create(`api/projects/${values.currentTeamId}/insights/funnel/correlation`, {
+ ...values.apiParams,
+ funnel_correlation_type: 'properties',
+ funnel_correlation_names: targetProperties,
+ funnel_correlation_exclude_names: values.excludedPropertyNames,
+ })
+ ).result?.events
- return {
- events: results.map((result) => ({
- ...result,
- result_type: FunnelCorrelationResultsType.Properties,
- })),
- }
+ return {
+ events: results.map((result) => ({
+ ...result,
+ result_type: FunnelCorrelationResultsType.Properties,
+ })),
}
} catch (error) {
lemonToast.error('Failed to load correlation results', { toastId: 'funnel-correlation-error' })
diff --git a/frontend/src/scenes/funnels/funnelUtils.ts b/frontend/src/scenes/funnels/funnelUtils.ts
index fc3c5cad3fc8a..1bcd3569983a0 100644
--- a/frontend/src/scenes/funnels/funnelUtils.ts
+++ b/frontend/src/scenes/funnels/funnelUtils.ts
@@ -468,11 +468,10 @@ export const parseBreakdownValue = (
const components = item.split('::')
if (components.length === 1) {
return { breakdown: components[0], breakdown_value: '' }
- } else {
- return {
- breakdown: components[0],
- breakdown_value: components[1],
- }
+ }
+ return {
+ breakdown: components[0],
+ breakdown_value: components[1],
}
}
@@ -502,18 +501,17 @@ export const parseEventAndProperty = (
value: [propertyValue as string],
})),
}
- } else {
- return {
- name: components[0],
- properties: [
- {
- key: components[1],
- operator: PropertyOperator.Exact,
- value: components[2],
- type: PropertyFilterType.Event,
- },
- ],
- }
+ }
+ return {
+ name: components[0],
+ properties: [
+ {
+ key: components[1],
+ operator: PropertyOperator.Exact,
+ value: components[2],
+ type: PropertyFilterType.Event,
+ },
+ ],
}
}
@@ -538,11 +536,10 @@ export const parseDisplayNameForCorrelation = (
event: '$autocapture',
})
return { first_value, second_value }
- } else {
- // FunnelCorrelationResultsType.EventWithProperties
- // Events here come in the form of event::property::value
- return { first_value: values[1], second_value: values[2] }
}
+ // FunnelCorrelationResultsType.EventWithProperties
+ // Events here come in the form of event::property::value
+ return { first_value: values[1], second_value: values[2] }
}
export const appendToCorrelationConfig = (
diff --git a/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx b/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx
index 533a0a87fa1f8..2c24bf32f016e 100644
--- a/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx
+++ b/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx
@@ -21,7 +21,7 @@ import { urls } from 'scenes/urls'
import { actionsAndEventsToSeries } from '~/queries/nodes/InsightQuery/utils/filtersToQueryNode'
import { seriesToActionsAndEvents } from '~/queries/nodes/InsightQuery/utils/queryNodeToFilter'
-import { FunnelsQuery } from '~/queries/schema'
+import { FunnelsQuery, Node } from '~/queries/schema'
import { FilterType, InsightLogicProps, SavedInsightsTabs } from '~/types'
import { samplingFilterLogic } from '../EditorFilters/samplingFilterLogic'
@@ -139,10 +139,11 @@ export function InsightTimeoutState({
export interface InsightErrorStateProps {
excludeDetail?: boolean
title?: string
+ query?: Record | Node | null
queryId?: string | null
}
-export function InsightErrorState({ excludeDetail, title, queryId }: InsightErrorStateProps): JSX.Element {
+export function InsightErrorState({ excludeDetail, title, query, queryId }: InsightErrorStateProps): JSX.Element {
const { preflight } = useValues(preflightLogic)
const { openSupportForm } = useActions(supportLogic)
@@ -181,6 +182,18 @@ export function InsightErrorState({ excludeDetail, title, queryId }: InsightErro
)}
{queryId ? Query ID: {queryId}
: null}
+ {query && (
+
+ Open in query debugger
+
+ )}