From 98a456ce55cc42910fbd2952ecf681eeb1855f71 Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Wed, 3 Jul 2024 17:59:19 +0200 Subject: [PATCH] Dev (#2348) * refactor(chalice): upgraded dependencies * refactor(chalice): upgraded dependencies feat(chalice): support heatmaps * feat(chalice): support table-of-browsers showing user-count * feat(chalice): support table-of-devices showing user-count * feat(chalice): support table-of-URLs showing user-count * fix(chalice): fixed Math-operators validation refactor(chalice): search for sessions that have events for heatmaps * refactor(chalice): search for sessions that have at least 1 location event for heatmaps * refactor(chalice): path-analysis card, return issues identical to the chart --- api/chalicelib/core/custom_metrics.py | 15 ++++++++++++--- ee/api/chalicelib/core/custom_metrics.py | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/api/chalicelib/core/custom_metrics.py b/api/chalicelib/core/custom_metrics.py index eeecf4fc1..e5c0039c8 100644 --- a/api/chalicelib/core/custom_metrics.py +++ b/api/chalicelib/core/custom_metrics.py @@ -272,11 +272,20 @@ def __get_path_analysis_issues(project_id: int, user_id: int, data: schemas.Card page=data.page, filters=filters ) + # ---- To make issues response close to the chart response + search_data.filters.append(schemas.SessionSearchFilterSchema(type=schemas.FilterType.events_count, + operator=schemas.MathOperator._greater, + value=[1])) + if len(data.start_point) == 0: + search_data.events.append(schemas.SessionSearchEventSchema2(type=schemas.EventType.location, + operator=schemas.SearchEventOperator._is_any, + value=[])) + # ---- End for s in data.excludes: - search_data.filters.append(schemas.SessionSearchEventSchema2(type=s.type, - operator=schemas.SearchEventOperator._not_on, - value=s.value)) + search_data.events.append(schemas.SessionSearchEventSchema2(type=s.type, + operator=schemas.SearchEventOperator._not_on, + value=s.value)) result = sessions.search_table_of_individual_issues(project_id=project_id, data=search_data) return result diff --git a/ee/api/chalicelib/core/custom_metrics.py b/ee/api/chalicelib/core/custom_metrics.py index 5c241a80c..ebcb7a077 100644 --- a/ee/api/chalicelib/core/custom_metrics.py +++ b/ee/api/chalicelib/core/custom_metrics.py @@ -292,11 +292,20 @@ def __get_path_analysis_issues(project_id: int, user_id: int, data: schemas.Card page=data.page, filters=filters ) + # ---- To make issues response close to the chart response + search_data.filters.append(schemas.SessionSearchFilterSchema(type=schemas.FilterType.events_count, + operator=schemas.MathOperator._greater, + value=[1])) + if len(data.start_point) == 0: + search_data.events.append(schemas.SessionSearchEventSchema2(type=schemas.EventType.location, + operator=schemas.SearchEventOperator._is_any, + value=[])) + # ---- End for s in data.excludes: - search_data.filters.append(schemas.SessionSearchEventSchema2(type=s.type, - operator=schemas.SearchEventOperator._not_on, - value=s.value)) + search_data.events.append(schemas.SessionSearchEventSchema2(type=s.type, + operator=schemas.SearchEventOperator._not_on, + value=s.value)) result = sessions.search_table_of_individual_issues(project_id=project_id, data=search_data) return result