Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr committed Jan 16, 2024
1 parent 7989ca9 commit 122d011
Showing 1 changed file with 25 additions and 28 deletions.
53 changes: 25 additions & 28 deletions frontend/src/queries/nodes/InsightQuery/utils/queryNodeToFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,15 @@ export const queryNodeToFilter = (query: InsightQueryNode): Partial<FilterType>
const insightFilter = JSON.parse(JSON.stringify(query[filterMap[query.kind]] || {}))
const legacyProps = {}
if (isTrendsQuery(query)) {
;(legacyProps as TrendsFilterLegacy).smoothing_intervals =
insightFilter.smoothingIntervals(legacyProps as TrendsFilterLegacy).decimal_places =
insightFilter.decimalPlaces(legacyProps as TrendsFilterLegacy).aggregation_axis_format =
insightFilter.aggregationAxisFormat(legacyProps as TrendsFilterLegacy).aggregation_axis_postfix =
insightFilter.aggregationAxisPostfix(legacyProps as TrendsFilterLegacy).aggregation_axis_prefix =
insightFilter.aggregationAxisPrefix(legacyProps as TrendsFilterLegacy).show_labels_on_series =
insightFilter.showLabelsOnSeries(legacyProps as TrendsFilterLegacy).show_percent_stack_view =
insightFilter.showPercentStackView(legacyProps as TrendsFilterLegacy).show_legend =
insightFilter.showLegend(legacyProps as TrendsFilterLegacy).show_values_on_series =
insightFilter.showValuesOnSeries
;(legacyProps as TrendsFilterLegacy).smoothing_intervals = insightFilter.smoothingIntervals
;(legacyProps as TrendsFilterLegacy).decimal_places = insightFilter.decimalPlaces
;(legacyProps as TrendsFilterLegacy).aggregation_axis_format = insightFilter.aggregationAxisFormat
;(legacyProps as TrendsFilterLegacy).aggregation_axis_postfix = insightFilter.aggregationAxisPostfix
;(legacyProps as TrendsFilterLegacy).aggregation_axis_prefix = insightFilter.aggregationAxisPrefix
;(legacyProps as TrendsFilterLegacy).show_labels_on_series = insightFilter.showLabelsOnSeries
;(legacyProps as TrendsFilterLegacy).show_percent_stack_view = insightFilter.showPercentStackView
;(legacyProps as TrendsFilterLegacy).show_legend = insightFilter.showLegend
;(legacyProps as TrendsFilterLegacy).show_values_on_series = insightFilter.showValuesOnSeries
delete insightFilter.smoothingIntervals
delete insightFilter.decimalPlaces
delete insightFilter.aggregationAxisFormat
Expand All @@ -179,30 +178,28 @@ export const queryNodeToFilter = (query: InsightQueryNode): Partial<FilterType>
delete insightFilter.showLegend
delete insightFilter.showValuesOnSeries
} else if (isStickinessFilter(query)) {
;(legacyProps as StickinessFilterLegacy).show_legend = insightFilter.showLegend(
legacyProps as StickinessFilterLegacy
).show_values_on_series = insightFilter.showValuesOnSeries
;(legacyProps as StickinessFilterLegacy).show_legend = insightFilter.showLegend
;(legacyProps as StickinessFilterLegacy).show_values_on_series = insightFilter.showValuesOnSeries
delete insightFilter.showLegend
delete insightFilter.showValuesOnSeries
} else if (isLifecycleFilter(query)) {
;(legacyProps as LifecycleFilterLegacy).show_values_on_series = insightFilter.showValuesOnSeries
delete insightFilter.showValuesOnSeries
} else if (isPathsFilter(query)) {
;(legacyProps as PathsFilterLegacy).edge_limit =
insightFilter.edgeLimit(legacyProps as PathsFilterLegacy).paths_hogql_expression =
insightFilter.pathsHogQLExpression(legacyProps as PathsFilterLegacy).include_event_types =
insightFilter.includeEventTypes(legacyProps as PathsFilterLegacy).start_point =
insightFilter.startPoint(legacyProps as PathsFilterLegacy).end_point =
insightFilter.endPoint(legacyProps as PathsFilterLegacy).path_groupings =
insightFilter.pathGroupings(legacyProps as PathsFilterLegacy).exclude_events =
insightFilter.excludeEvents(legacyProps as PathsFilterLegacy).step_limit =
insightFilter.stepLimit(legacyProps as PathsFilterLegacy).path_replacements =
insightFilter.pathReplacements(legacyProps as PathsFilterLegacy).local_path_cleaning_filters =
insightFilter.localPathCleaningFilters(legacyProps as PathsFilterLegacy).min_edge_weight =
insightFilter.minEdgeWeight(legacyProps as PathsFilterLegacy).max_edge_weight =
insightFilter.maxEdgeWeight(legacyProps as PathsFilterLegacy).funnel_paths =
insightFilter.funnelPaths(legacyProps as PathsFilterLegacy).funnel_filter =
insightFilter.funnelFilter
;(legacyProps as PathsFilterLegacy).edge_limit = insightFilter.edgeLimit
;(legacyProps as PathsFilterLegacy).paths_hogql_expression = insightFilter.pathsHogQLExpression
;(legacyProps as PathsFilterLegacy).include_event_types = insightFilter.includeEventTypes
;(legacyProps as PathsFilterLegacy).start_point = insightFilter.startPoint
;(legacyProps as PathsFilterLegacy).end_point = insightFilter.endPoint
;(legacyProps as PathsFilterLegacy).path_groupings = insightFilter.pathGroupings
;(legacyProps as PathsFilterLegacy).exclude_events = insightFilter.excludeEvents
;(legacyProps as PathsFilterLegacy).step_limit = insightFilter.stepLimit
;(legacyProps as PathsFilterLegacy).path_replacements = insightFilter.pathReplacements
;(legacyProps as PathsFilterLegacy).local_path_cleaning_filters = insightFilter.localPathCleaningFilters
;(legacyProps as PathsFilterLegacy).min_edge_weight = insightFilter.minEdgeWeight
;(legacyProps as PathsFilterLegacy).max_edge_weight = insightFilter.maxEdgeWeight
;(legacyProps as PathsFilterLegacy).funnel_paths = insightFilter.funnelPaths
;(legacyProps as PathsFilterLegacy).funnel_filter = insightFilter.funnelFilter
delete insightFilter.edgeLimit
delete insightFilter.pathsHogQLExpression
delete insightFilter.includeEventTypes
Expand Down

0 comments on commit 122d011

Please sign in to comment.