From 122d0118ce1ccc48a64adcce05074a6c13fde513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Obermu=CC=88ller?= Date: Wed, 17 Jan 2024 00:25:27 +0100 Subject: [PATCH] fixes --- .../InsightQuery/utils/queryNodeToFilter.ts | 53 +++++++++---------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/frontend/src/queries/nodes/InsightQuery/utils/queryNodeToFilter.ts b/frontend/src/queries/nodes/InsightQuery/utils/queryNodeToFilter.ts index 3b0bf6b17ce235..9f41bcb7eefd2e 100644 --- a/frontend/src/queries/nodes/InsightQuery/utils/queryNodeToFilter.ts +++ b/frontend/src/queries/nodes/InsightQuery/utils/queryNodeToFilter.ts @@ -159,16 +159,15 @@ export const queryNodeToFilter = (query: InsightQueryNode): Partial 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 @@ -179,30 +178,28 @@ export const queryNodeToFilter = (query: InsightQueryNode): Partial 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