From 5619629bb72c49f3cd20106da6b769103d836d04 Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Thu, 4 Jul 2024 16:58:07 +0200 Subject: [PATCH] Dev (#2357) * 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 * fix(chalice): fixed heatmap update with no selected session --- api/chalicelib/core/custom_metrics.py | 2 +- ee/api/chalicelib/core/custom_metrics.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/chalicelib/core/custom_metrics.py b/api/chalicelib/core/custom_metrics.py index e5c0039c8..406dbd9b1 100644 --- a/api/chalicelib/core/custom_metrics.py +++ b/api/chalicelib/core/custom_metrics.py @@ -403,7 +403,7 @@ def update_card(metric_id, user_id, project_id, data: schemas.CardSchema): elif data.metric_type == schemas.MetricType.heat_map: if data.session_id is not None: params["session_data"] = json.dumps({"sessionId": data.session_id}) - elif "data" in metric: + elif metric.get("data"): params["session_data"] = json.dumps({"sessionId": metric["data"]["sessionId"]}) with pg_client.PostgresClient() as cur: diff --git a/ee/api/chalicelib/core/custom_metrics.py b/ee/api/chalicelib/core/custom_metrics.py index ebcb7a077..6b8e99619 100644 --- a/ee/api/chalicelib/core/custom_metrics.py +++ b/ee/api/chalicelib/core/custom_metrics.py @@ -435,7 +435,7 @@ def update_card(metric_id, user_id, project_id, data: schemas.CardSchema): elif data.metric_type == schemas.MetricType.heat_map: if data.session_id is not None: params["session_data"] = json.dumps({"sessionId": data.session_id}) - elif "data" in metric: + elif metric.get("data"): params["session_data"] = json.dumps({"sessionId": metric["data"]["sessionId"]}) with pg_client.PostgresClient() as cur: