Skip to content

Commit

Permalink
add condition
Browse files Browse the repository at this point in the history
  • Loading branch information
EDsCODE committed Mar 18, 2024
1 parent d29137c commit e77c92a
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions frontend/src/scenes/insights/insightVizDataLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ export const insightVizDataLogic = kea<insightVizDataLogicType>([
return ((isTrends && !!formula) || (series || []).length <= 1) && !breakdownFilter?.breakdown
},
],
isBreakdownSeries: [
(s) => [s.breakdownFilter],
(breakdownFilter): boolean => {
return !!breakdownFilter?.breakdown
},
],

isDataWarehouseSeries: [
(s) => [s.isTrends, s.series],
Expand All @@ -228,9 +234,20 @@ export const insightVizDataLogic = kea<insightVizDataLogicType>([
],

currentDataWarehouseSchemaColumns: [
(s) => [s.series, s.isSingleSeries, s.isDataWarehouseSeries, s.externalTablesMap],
(series, isSingleSeries, isDataWarehouseSeries, externalTablesMap): DatabaseSchemaQueryResponseField[] => {
if (!series || series.length === 0 || !isSingleSeries || !isDataWarehouseSeries) {
(s) => [s.series, s.isSingleSeries, s.isDataWarehouseSeries, s.isBreakdownSeries, s.externalTablesMap],
(
series,
isSingleSeries,
isDataWarehouseSeries,
isBreakdownSeries,
externalTablesMap
): DatabaseSchemaQueryResponseField[] => {
if (
!series ||
series.length === 0 ||
(!isSingleSeries && !isBreakdownSeries) ||
!isDataWarehouseSeries
) {
return []
}

Expand Down

0 comments on commit e77c92a

Please sign in to comment.