From 1375c14337dc066a4edc43873ccbc0f6d6c3e896 Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Wed, 13 Nov 2024 16:50:49 +0100 Subject: [PATCH] Dev (#2739) * 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 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 * feat(chalice): autocomplete return top 10 with stats * fix(chalice): fixed autocomplete top 10 meta-filters * refactor(chalice): added dynatrace to the list of supported integrations --- api/.gitignore | 3 ++- api/chalicelib/core/integrations_global.py | 5 ++++- api/schemas/schemas.py | 1 + ee/api/.gitignore | 1 + ee/api/chalicelib/core/integrations_global.py | 5 ++++- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/api/.gitignore b/api/.gitignore index 8cf51ee60..1a01c4a78 100644 --- a/api/.gitignore +++ b/api/.gitignore @@ -175,4 +175,5 @@ SUBNETS.json ./chalicelib/.configs README/* -.local \ No newline at end of file +.local +/.dev/ \ No newline at end of file diff --git a/api/chalicelib/core/integrations_global.py b/api/chalicelib/core/integrations_global.py index c7c79d7a5..6959c9ff6 100644 --- a/api/chalicelib/core/integrations_global.py +++ b/api/chalicelib/core/integrations_global.py @@ -54,7 +54,10 @@ def get_global_integrations_status(tenant_id, user_id, project_id): WHERE type='slack' AND deleted_at ISNULL)) AS {schemas.IntegrationType.SLACK.value}, EXISTS((SELECT 1 FROM public.webhooks - WHERE type='msteams' AND deleted_at ISNULL)) AS {schemas.IntegrationType.MS_TEAMS.value};""", + WHERE type='msteams' AND deleted_at ISNULL)) AS {schemas.IntegrationType.MS_TEAMS.value}, + EXISTS((SELECT 1 + FROM public.integrations + WHERE project_id=%(project_id)s AND provider='dynatrace')) AS {schemas.IntegrationType.DYNATRACE.value};""", {"user_id": user_id, "tenant_id": tenant_id, "project_id": project_id}) ) current_integrations = cur.fetchone() diff --git a/api/schemas/schemas.py b/api/schemas/schemas.py index f158e9df6..805da7d85 100644 --- a/api/schemas/schemas.py +++ b/api/schemas/schemas.py @@ -1425,6 +1425,7 @@ class IntegrationType(str, Enum): STACKDRIVER = "STACKDRIVER" CLOUDWATCH = "CLOUDWATCH" NEWRELIC = "NEWRELIC" + DYNATRACE = "DYNATRACE" class SearchNoteSchema(_PaginatedSchema): diff --git a/ee/api/.gitignore b/ee/api/.gitignore index 118d56462..9a62041d0 100644 --- a/ee/api/.gitignore +++ b/ee/api/.gitignore @@ -278,3 +278,4 @@ Pipfile.lock /chalicelib/core/spot.py /chalicelib/core/unprocessed_sessions.py /run-db_init-dev.sh +/.dev/ diff --git a/ee/api/chalicelib/core/integrations_global.py b/ee/api/chalicelib/core/integrations_global.py index e0f5bba4a..3f0d96751 100644 --- a/ee/api/chalicelib/core/integrations_global.py +++ b/ee/api/chalicelib/core/integrations_global.py @@ -54,7 +54,10 @@ def get_global_integrations_status(tenant_id, user_id, project_id): WHERE type='slack' AND tenant_id=%(tenant_id)s AND deleted_at ISNULL)) AS {schemas.IntegrationType.SLACK.value}, EXISTS((SELECT 1 FROM public.webhooks - WHERE type='msteams' AND tenant_id=%(tenant_id)s AND deleted_at ISNULL)) AS {schemas.IntegrationType.MS_TEAMS.value};""", + WHERE type='msteams' AND tenant_id=%(tenant_id)s AND deleted_at ISNULL)) AS {schemas.IntegrationType.MS_TEAMS.value}, + EXISTS((SELECT 1 + FROM public.integrations + WHERE project_id=%(project_id)s AND provider='dynatrace')) AS {schemas.IntegrationType.DYNATRACE.value};""", {"user_id": user_id, "tenant_id": tenant_id, "project_id": project_id}) ) current_integrations = cur.fetchone()