Skip to content

Commit

Permalink
move timezone to viz data logic
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr committed Jul 14, 2023
1 parent 03413bd commit 57b0f4f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion frontend/src/scenes/insights/insightLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ export const insightLogic = kea<insightLogicType>([
},
],
intervalUnit: [(s) => [s.filters], (filters) => filters?.interval || 'day'],
timezone: [(s) => [s.insight], (insight) => insight?.timezone || 'UTC'],
exporterResourceParams: [
(s) => [s.filters, s.currentTeamId, s.insight],
(
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/scenes/insights/insightVizDataLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ export const insightVizDataLogic = kea<insightVizDataLogicType>([
return insightDataError?.queryId || null
},
],

timezone: [(s) => [s.insightData], (insightData) => insightData?.timezone || 'UTC'],
}),

listeners(({ actions, values }) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export function InsightsTable({
isMainInsightView = false,
}: InsightsTableProps): JSX.Element {
const { insightMode } = useValues(insightSceneLogic)
// TODO: replace insight etc. with data exploration variant
const { insightProps, isInDashboardContext, insight, hiddenLegendKeys } = useValues(insightLogic)
const { toggleVisibility } = useActions(insightLogic)
const {
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/scenes/insights/views/LineGraph/LineGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { PieChart } from 'scenes/insights/views/LineGraph/PieChart'
import { themeLogic } from '~/layout/navigation-3000/themeLogic'
import { SeriesLetter } from 'lib/components/SeriesGlyph'
import { TrendsFilter } from '~/queries/schema'
import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic'

export function ensureTooltipElement(): HTMLElement {
let tooltipEl = document.getElementById('InsightTooltipWrapper')
Expand Down Expand Up @@ -242,7 +243,8 @@ export function LineGraph_({
let datasets = _datasets

const { createTooltipData } = useValues(lineGraphLogic)
const { insight, timezone } = useValues(insightLogic)
const { insight, insightProps } = useValues(insightLogic)
const { timezone } = useValues(insightVizDataLogic(insightProps))
const { aggregationLabel } = useValues(groupsModel)
const { isDarkModeOn } = useValues(themeLogic)

Expand Down

0 comments on commit 57b0f4f

Please sign in to comment.