diff --git a/api/chalicelib/core/custom_metrics.py b/api/chalicelib/core/custom_metrics.py index 24415a072..c40316067 100644 --- a/api/chalicelib/core/custom_metrics.py +++ b/api/chalicelib/core/custom_metrics.py @@ -572,7 +572,7 @@ def get_funnel_sessions_by_issue(user_id, project_id, metric_id, issue_id, "issue": issue} -def make_chart_from_card(project_id, user_id, metric_id, data: schemas.CardChartSchema, ignore_click_map=False): +def make_chart_from_card(project_id, user_id, metric_id, data: schemas.CardChartSchema): raw_metric: dict = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, include_data=True) if raw_metric is None: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="card not found") @@ -580,9 +580,6 @@ def make_chart_from_card(project_id, user_id, metric_id, data: schemas.CardChart if metric.is_template: return get_predefined_metric(key=metric.metric_of, project_id=project_id, data=data.dict()) elif __is_click_map(metric): - # TODO: remove this when UI is able to stop this endpoint calls for clickMap - if ignore_click_map: - return None if raw_metric["data"]: keys = sessions_mobs. \ __get_mob_keys(project_id=project_id, session_id=raw_metric["data"]["sessionId"]) diff --git a/api/routers/core.py b/api/routers/core.py index 6668f44a0..55c7ffc73 100644 --- a/api/routers/core.py +++ b/api/routers/core.py @@ -62,7 +62,6 @@ def logout_user(response: Response, context: schemas.CurrentContext = Depends(OR @app.post('/{projectId}/sessions/search', tags=["sessions"]) -@app.post('/{projectId}/sessions/search2', tags=["sessions"]) def sessions_search(projectId: int, data: schemas.FlatSessionsSearchPayloadSchema = Body(...), context: schemas.CurrentContext = Depends(OR_context)): data = sessions.search_sessions(data=data, project_id=projectId, user_id=context.user_id) @@ -70,7 +69,6 @@ def sessions_search(projectId: int, data: schemas.FlatSessionsSearchPayloadSchem @app.post('/{projectId}/sessions/search/ids', tags=["sessions"]) -@app.post('/{projectId}/sessions/search2/ids', tags=["sessions"]) def session_ids_search(projectId: int, data: schemas.FlatSessionsSearchPayloadSchema = Body(...), context: schemas.CurrentContext = Depends(OR_context)): data = sessions.search_sessions(data=data, project_id=projectId, user_id=context.user_id, ids_only=True) diff --git a/api/routers/subs/metrics.py b/api/routers/subs/metrics.py index 2bf4e56ff..ac54842da 100644 --- a/api/routers/subs/metrics.py +++ b/api/routers/subs/metrics.py @@ -230,13 +230,8 @@ def get_custom_metric_errors_list(projectId: int, metric_id: int, @app.post('/{projectId}/custom_metrics/{metric_id}/chart', tags=["customMetrics"]) def get_card_chart(projectId: int, metric_id: int, request: Request, data: schemas.CardChartSchema = Body(...), context: schemas.CurrentContext = Depends(OR_context)): - # TODO: remove this when UI is able to stop this endpoint calls for clickMap - import re - ignore_click_map = re.match(r".*\/[0-9]+\/dashboard\/[0-9]+$", request.headers.get('referer')) is not None \ - or re.match(r".*\/[0-9]+\/metrics$", request.headers.get('referer')) is not None \ - if request.headers.get('referer') else False data = custom_metrics.make_chart_from_card(project_id=projectId, user_id=context.user_id, metric_id=metric_id, - data=data, ignore_click_map=ignore_click_map) + data=data) return {"data": data} diff --git a/ee/api/chalicelib/core/custom_metrics.py b/ee/api/chalicelib/core/custom_metrics.py index 94b2289b7..e4dd9beb3 100644 --- a/ee/api/chalicelib/core/custom_metrics.py +++ b/ee/api/chalicelib/core/custom_metrics.py @@ -628,7 +628,7 @@ def get_funnel_sessions_by_issue(user_id, project_id, metric_id, issue_id, "issue": issue} -def make_chart_from_card(project_id, user_id, metric_id, data: schemas.CardChartSchema, ignore_click_map=False): +def make_chart_from_card(project_id, user_id, metric_id, data: schemas.CardChartSchema): raw_metric: dict = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, include_data=True) if raw_metric is None: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="card not found") @@ -636,9 +636,6 @@ def make_chart_from_card(project_id, user_id, metric_id, data: schemas.CardChart if metric.is_template: return get_predefined_metric(key=metric.metric_of, project_id=project_id, data=data.dict()) elif __is_click_map(metric): - # TODO: remove this when UI is able to stop this endpoint calls for clickMap - if ignore_click_map: - return None if raw_metric["data"]: keys = sessions_mobs. \ __get_mob_keys(project_id=project_id, session_id=raw_metric["data"]["sessionId"]) diff --git a/ee/api/routers/subs/metrics.py b/ee/api/routers/subs/metrics.py index 574763d65..274c8e256 100644 --- a/ee/api/routers/subs/metrics.py +++ b/ee/api/routers/subs/metrics.py @@ -232,13 +232,8 @@ def get_custom_metric_errors_list(projectId: int, metric_id: int, @app.post('/{projectId}/custom_metrics/{metric_id}/chart', tags=["customMetrics"]) def get_card_chart(projectId: int, metric_id: int, request: Request, data: schemas.CardChartSchema = Body(...), context: schemas.CurrentContext = Depends(OR_context)): - # TODO: remove this when UI is able to stop this endpoint calls for clickMap - import re - ignore_click_map = re.match(r".*\/[0-9]+\/dashboard\/[0-9]+$", request.headers.get('referer')) is not None \ - or re.match(r".*\/[0-9]+\/metrics$", request.headers.get('referer')) is not None \ - if request.headers.get('referer') else False data = custom_metrics.make_chart_from_card(project_id=projectId, user_id=context.user_id, metric_id=metric_id, - data=data, ignore_click_map=ignore_click_map) + data=data) return {"data": data}