From 48fdd47ea7de9e93e7594909a4257d5ff4fc2afe Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Mon, 27 Feb 2023 20:42:06 +0100 Subject: [PATCH 01/11] chore(helm): support http protocol for OR acces --- .../openreplay/charts/alerts/templates/deployment.yaml | 4 ++-- .../openreplay/charts/assets/templates/deployment.yaml | 2 +- .../openreplay/charts/assist/templates/deployment.yaml | 2 +- .../openreplay/charts/chalice/templates/deployment.yaml | 4 ++-- .../openreplay/charts/http/templates/deployment.yaml | 2 +- .../openreplay/charts/sink/templates/deployment.yaml | 2 +- scripts/helmcharts/openreplay/values.yaml | 4 +++- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml index d4c1d6e49..58ed2388f 100644 --- a/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml @@ -71,10 +71,10 @@ spec: value: '{{ .Values.global.postgresql.postgresqlPassword }}' {{- end}} - name: SITE_URL - value: 'https://{{ .Values.global.domainName }}' + value: '{{ ternary "https" "http" .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}' - name: S3_HOST {{- if contains "minio" .Values.global.s3.endpoint }} - value: 'https://{{ .Values.global.domainName }}:{{ .Values.global.ingress.controller.service.ports.https}}' + value: '{{ .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}:{{ ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess }}' {{- else}} value: '{{ .Values.global.s3.endpoint }}' {{- end}} diff --git a/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml index f959adc13..cdfb0a302 100644 --- a/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml @@ -83,7 +83,7 @@ spec: - name: ASSETS_ORIGIN {{- if contains "minio" .Values.global.s3.endpoint }} # Local minio Installation - value: 'https://{{ .Values.global.domainName }}:{{.Values.global.ingress.controller.service.ports.https}}/{{.Values.global.s3.assetsBucket}}' + value: '{{ .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}:{{ ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess }}' {{- else if contains "amazonaws.com" .Values.global.s3.endpoint }} # AWS S3 # Ref: https://stackoverflow.com/questions/53634583/go-template-split-string-by-delimiter diff --git a/scripts/helmcharts/openreplay/charts/assist/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/assist/templates/deployment.yaml index 92ae9a93c..db42a3e0e 100644 --- a/scripts/helmcharts/openreplay/charts/assist/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/assist/templates/deployment.yaml @@ -51,7 +51,7 @@ spec: value: "{{ .Values.global.s3.region }}" - name: S3_HOST {{- if contains "minio" .Values.global.s3.endpoint }} - value: 'https://{{ .Values.global.domainName }}:{{ .Values.global.ingress.controller.service.ports.https}}' + value: '{{ .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}:{{ ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess }}' {{- else}} value: '{{ .Values.global.s3.endpoint }}' {{- end}} diff --git a/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml index a15553a8a..eaaab92c5 100644 --- a/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml @@ -81,10 +81,10 @@ spec: value: '{{ .Values.global.postgresql.postgresqlPassword }}' {{- end}} - name: SITE_URL - value: 'https://{{ .Values.global.domainName }}' + value: '{{ ternary "https" "http" .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}' - name: S3_HOST {{- if contains "minio" .Values.global.s3.endpoint }} - value: 'https://{{ .Values.global.domainName }}:{{ .Values.global.ingress.controller.service.ports.https}}' + value: '{{ ternary "https" "http" .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}:{{ ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess }}' {{- else}} value: '{{ .Values.global.s3.endpoint }}' {{- end}} diff --git a/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml index 1add28054..0f46b47e0 100644 --- a/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml @@ -90,7 +90,7 @@ spec: - name: ASSETS_ORIGIN {{- if contains "minio" .Values.global.s3.endpoint }} # Local minio Installation - value: 'https://{{ .Values.global.domainName }}:{{.Values.global.ingress.controller.service.ports.https}}/{{.Values.global.s3.assetsBucket}}' + value: '{{ .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}:{{ ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess }}' {{- else if contains "amazonaws.com" .Values.global.s3.endpoint }} # AWS S3 # Ref: https://stackoverflow.com/questions/53634583/go-template-split-string-by-delimiter diff --git a/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml index 88bd89c1f..3b940658f 100644 --- a/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml @@ -59,7 +59,7 @@ spec: - name: ASSETS_ORIGIN {{- if contains "minio" .Values.global.s3.endpoint }} # Local minio Installation - value: 'https://{{ .Values.global.domainName }}:{{.Values.global.ingress.controller.service.ports.https}}/{{.Values.global.s3.assetsBucket}}' + value: '{{ .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}:{{ ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess }}' {{- else if contains "amazonaws.com" .Values.global.s3.endpoint }} # AWS S3 # Ref: https://stackoverflow.com/questions/53634583/go-template-split-string-by-delimiter diff --git a/scripts/helmcharts/openreplay/values.yaml b/scripts/helmcharts/openreplay/values.yaml index 694585180..3b4f9e985 100644 --- a/scripts/helmcharts/openreplay/values.yaml +++ b/scripts/helmcharts/openreplay/values.yaml @@ -37,5 +37,7 @@ global: vault: *vault redis: *redis clusterDomain: "svc.cluster.local" - # In case you've http proxy to access internet. env: {} + # If you're accessing OpenReplay with http, then update the value to http + ORSecureAccess: true + From 2490a323ace047f808a35691dfe6fea2e19c6bf0 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Tue, 28 Feb 2023 11:17:08 +0100 Subject: [PATCH 02/11] feat(chalice): fixed create&add card to dashboard at the same time --- api/chalicelib/core/dashboards.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/chalicelib/core/dashboards.py b/api/chalicelib/core/dashboards.py index 89f56176b..17826f762 100644 --- a/api/chalicelib/core/dashboards.py +++ b/api/chalicelib/core/dashboards.py @@ -121,7 +121,7 @@ def update_dashboard(project_id, user_id, dashboard_id, data: schemas.EditDashbo WHERE dashboards.project_id = %(projectId)s AND dashboard_id = %(dashboard_id)s AND (dashboards.user_id = %(userId)s OR is_public) - RETURNING dashboard_id,name,description,is_public,created_at;""" + RETURNING dashboard_id,name,description,is_public,created_at""" if data.metrics is not None and len(data.metrics) > 0: pg_query = f"""WITH dash AS ({pg_query}) INSERT INTO dashboard_widgets(dashboard_id, metric_id, user_id, config) From 2a5e478e641fd3de2d886e2ec429714132cb816e Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Mon, 27 Feb 2023 16:58:02 +0100 Subject: [PATCH 03/11] change(ui) - dashboard list text change --- .../Dashboard/components/DashboardList/DashboardList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/app/components/Dashboard/components/DashboardList/DashboardList.tsx b/frontend/app/components/Dashboard/components/DashboardList/DashboardList.tsx index 2b60ad40a..18c96f12a 100644 --- a/frontend/app/components/Dashboard/components/DashboardList/DashboardList.tsx +++ b/frontend/app/components/Dashboard/components/DashboardList/DashboardList.tsx @@ -37,7 +37,7 @@ function DashboardList() {
Title
Visibility
-
Created
+
Creation Date
{sliceListPerPage(list, dashboardStore.page - 1, dashboardStore.pageSize).map( From 63594548aefda60f76bde4ff2f6ee590591fa227 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Mon, 27 Feb 2023 17:12:58 +0100 Subject: [PATCH 04/11] change(ui) - player speed include 0.5 --- frontend/app/player/player/Player.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/app/player/player/Player.ts b/frontend/app/player/player/Player.ts index 837443f3f..9ebd04259 100644 --- a/frontend/app/player/player/Player.ts +++ b/frontend/app/player/player/Player.ts @@ -13,7 +13,7 @@ const SKIP_TO_ISSUE_STORAGE_KEY = "__$session-skipToIssue$__" const AUTOPLAY_STORAGE_KEY = "__$player-autoplay$__" const SHOW_EVENTS_STORAGE_KEY = "__$player-show-events$__" const storedSpeed: number = typedLocalStorage.number(SPEED_STORAGE_KEY) -const initialSpeed = [1, 2, 4, 8, 16].includes(storedSpeed) ? storedSpeed : 1 +const initialSpeed = [0.5, 1, 2, 4, 8, 16].includes(storedSpeed) ? storedSpeed : 0.5 const initialSkip = typedLocalStorage.boolean(SKIP_STORAGE_KEY) const initialSkipToIssue = typedLocalStorage.boolean(SKIP_TO_ISSUE_STORAGE_KEY) const initialAutoplay = typedLocalStorage.boolean(AUTOPLAY_STORAGE_KEY) @@ -91,7 +91,7 @@ export default class Player extends Animator { toggleSpeed() { const { speed } = this.pState.get() - this.updateSpeed(speed < HIGHEST_SPEED ? speed * 2 : 1) + this.updateSpeed(speed < HIGHEST_SPEED ? speed * 2 : 0.5) } speedUp() { From e9e2bc1e1e60a4de3c76702136f917fc17ab1af7 Mon Sep 17 00:00:00 2001 From: Alex Kaminskii Date: Mon, 27 Feb 2023 17:37:55 +0100 Subject: [PATCH 05/11] fix(frontend): cancellabelTimeoutHook: clean only once --- frontend/app/hooks/useCancelableTimeout.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/app/hooks/useCancelableTimeout.ts b/frontend/app/hooks/useCancelableTimeout.ts index 9f12f336a..1ab4d032a 100644 --- a/frontend/app/hooks/useCancelableTimeout.ts +++ b/frontend/app/hooks/useCancelableTimeout.ts @@ -15,6 +15,6 @@ export default function useCancelableTimeout( clearTimeout(idRef.current) onCancel() } - useEffect(() => () => clearTimeout(idRef.current)) // auto-cancel without callback (clean) + useEffect(() => () => clearTimeout(idRef.current), []) // auto-cancel without callback (on clean) return [ triggerTimeout, cancelTimeout ] } \ No newline at end of file From 5f86ae055d461dd88361aca2c887733d77693bee Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Mon, 27 Feb 2023 20:42:06 +0100 Subject: [PATCH 06/11] chore(helm): support http protocol for OR acces --- .../openreplay/charts/alerts/templates/deployment.yaml | 4 ++-- .../openreplay/charts/assets/templates/deployment.yaml | 2 +- .../openreplay/charts/assist/templates/deployment.yaml | 2 +- .../openreplay/charts/chalice/templates/deployment.yaml | 4 ++-- .../openreplay/charts/http/templates/deployment.yaml | 2 +- .../openreplay/charts/sink/templates/deployment.yaml | 2 +- scripts/helmcharts/openreplay/values.yaml | 4 +++- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml index d4c1d6e49..58ed2388f 100644 --- a/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml @@ -71,10 +71,10 @@ spec: value: '{{ .Values.global.postgresql.postgresqlPassword }}' {{- end}} - name: SITE_URL - value: 'https://{{ .Values.global.domainName }}' + value: '{{ ternary "https" "http" .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}' - name: S3_HOST {{- if contains "minio" .Values.global.s3.endpoint }} - value: 'https://{{ .Values.global.domainName }}:{{ .Values.global.ingress.controller.service.ports.https}}' + value: '{{ .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}:{{ ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess }}' {{- else}} value: '{{ .Values.global.s3.endpoint }}' {{- end}} diff --git a/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml index f959adc13..cdfb0a302 100644 --- a/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml @@ -83,7 +83,7 @@ spec: - name: ASSETS_ORIGIN {{- if contains "minio" .Values.global.s3.endpoint }} # Local minio Installation - value: 'https://{{ .Values.global.domainName }}:{{.Values.global.ingress.controller.service.ports.https}}/{{.Values.global.s3.assetsBucket}}' + value: '{{ .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}:{{ ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess }}' {{- else if contains "amazonaws.com" .Values.global.s3.endpoint }} # AWS S3 # Ref: https://stackoverflow.com/questions/53634583/go-template-split-string-by-delimiter diff --git a/scripts/helmcharts/openreplay/charts/assist/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/assist/templates/deployment.yaml index 92ae9a93c..db42a3e0e 100644 --- a/scripts/helmcharts/openreplay/charts/assist/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/assist/templates/deployment.yaml @@ -51,7 +51,7 @@ spec: value: "{{ .Values.global.s3.region }}" - name: S3_HOST {{- if contains "minio" .Values.global.s3.endpoint }} - value: 'https://{{ .Values.global.domainName }}:{{ .Values.global.ingress.controller.service.ports.https}}' + value: '{{ .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}:{{ ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess }}' {{- else}} value: '{{ .Values.global.s3.endpoint }}' {{- end}} diff --git a/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml index a15553a8a..eaaab92c5 100644 --- a/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml @@ -81,10 +81,10 @@ spec: value: '{{ .Values.global.postgresql.postgresqlPassword }}' {{- end}} - name: SITE_URL - value: 'https://{{ .Values.global.domainName }}' + value: '{{ ternary "https" "http" .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}' - name: S3_HOST {{- if contains "minio" .Values.global.s3.endpoint }} - value: 'https://{{ .Values.global.domainName }}:{{ .Values.global.ingress.controller.service.ports.https}}' + value: '{{ ternary "https" "http" .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}:{{ ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess }}' {{- else}} value: '{{ .Values.global.s3.endpoint }}' {{- end}} diff --git a/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml index 1add28054..0f46b47e0 100644 --- a/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml @@ -90,7 +90,7 @@ spec: - name: ASSETS_ORIGIN {{- if contains "minio" .Values.global.s3.endpoint }} # Local minio Installation - value: 'https://{{ .Values.global.domainName }}:{{.Values.global.ingress.controller.service.ports.https}}/{{.Values.global.s3.assetsBucket}}' + value: '{{ .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}:{{ ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess }}' {{- else if contains "amazonaws.com" .Values.global.s3.endpoint }} # AWS S3 # Ref: https://stackoverflow.com/questions/53634583/go-template-split-string-by-delimiter diff --git a/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml index 88bd89c1f..3b940658f 100644 --- a/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml @@ -59,7 +59,7 @@ spec: - name: ASSETS_ORIGIN {{- if contains "minio" .Values.global.s3.endpoint }} # Local minio Installation - value: 'https://{{ .Values.global.domainName }}:{{.Values.global.ingress.controller.service.ports.https}}/{{.Values.global.s3.assetsBucket}}' + value: '{{ .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}:{{ ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess }}' {{- else if contains "amazonaws.com" .Values.global.s3.endpoint }} # AWS S3 # Ref: https://stackoverflow.com/questions/53634583/go-template-split-string-by-delimiter diff --git a/scripts/helmcharts/openreplay/values.yaml b/scripts/helmcharts/openreplay/values.yaml index 694585180..3b4f9e985 100644 --- a/scripts/helmcharts/openreplay/values.yaml +++ b/scripts/helmcharts/openreplay/values.yaml @@ -37,5 +37,7 @@ global: vault: *vault redis: *redis clusterDomain: "svc.cluster.local" - # In case you've http proxy to access internet. env: {} + # If you're accessing OpenReplay with http, then update the value to http + ORSecureAccess: true + From 9aec3ef2a0fb3708c637c3bc650bdef02b02fabc Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Tue, 28 Feb 2023 11:42:16 +0100 Subject: [PATCH 07/11] feat(chalice): fixed create&add card to dashboard at the same time --- api/chalicelib/core/dashboards.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/chalicelib/core/dashboards.py b/api/chalicelib/core/dashboards.py index 17826f762..d78a778ef 100644 --- a/api/chalicelib/core/dashboards.py +++ b/api/chalicelib/core/dashboards.py @@ -126,7 +126,9 @@ def update_dashboard(project_id, user_id, dashboard_id, data: schemas.EditDashbo pg_query = f"""WITH dash AS ({pg_query}) INSERT INTO dashboard_widgets(dashboard_id, metric_id, user_id, config) VALUES {",".join([f"(%(dashboard_id)s, %(metric_id_{i})s, %(userId)s, (SELECT default_config FROM metrics WHERE metric_id=%(metric_id_{i})s)||%(config_{i})s)" for i in range(len(data.metrics))])} - RETURNING dash.*;""" + RETURNING (SELECT dashboard_id FROM dash),(SELECT name FROM dash), + (SELECT description FROM dash),(SELECT is_public FROM dash), + (SELECT created_at FROM dash);""" for i, m in enumerate(data.metrics): params[f"metric_id_{i}"] = m # params[f"config_{i}"] = schemas.AddWidgetToDashboardPayloadSchema.schema() \ From a7804b9cb5506d2f67fd707b74ba0985a3a3b5e1 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Tue, 28 Feb 2023 12:38:48 +0100 Subject: [PATCH 08/11] fix(ui) - table card - metricOf value --- frontend/app/mstore/metricStore.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/app/mstore/metricStore.ts b/frontend/app/mstore/metricStore.ts index 9ef49759d..dfdeaf0c9 100644 --- a/frontend/app/mstore/metricStore.ts +++ b/frontend/app/mstore/metricStore.ts @@ -130,6 +130,10 @@ export default class MetricStore { obj['metricValue'] = []; + if (value === TABLE) { + obj['metricOf'] = 'userId'; + } + if (value === TABLE || value === TIMESERIES) { obj['viewType'] = 'table'; } From ea036f0e9b602dc3e0731ac8e5afc71bfb8d6218 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Tue, 28 Feb 2023 13:00:42 +0100 Subject: [PATCH 09/11] feat(chalice): fixed funnels --- api/chalicelib/core/significance.py | 12 +++++++----- ee/api/chalicelib/core/significance.py | 12 +++++++----- ee/api/chalicelib/core/significance_exp.py | 12 +++++++----- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/api/chalicelib/core/significance.py b/api/chalicelib/core/significance.py index 8477cc985..822753be0 100644 --- a/api/chalicelib/core/significance.py +++ b/api/chalicelib/core/significance.py @@ -57,7 +57,7 @@ def get_stages_and_events(filter_d, project_id) -> List[RealDictRow]: f_k = f"f_value{i}" values = {**values, **sh.multi_values(helper.values_for_operator(value=f["value"], op=f["operator"]), - value_key=f_k)} + value_key=f_k)} if filter_type == schemas.FilterType.user_browser: # op = sessions.__get_sql_operator_multiple(f["operator"]) first_stage_extra_constraints.append( @@ -166,7 +166,7 @@ def get_stages_and_events(filter_d, project_id) -> List[RealDictRow]: continue values = {**values, **sh.multi_values(helper.values_for_operator(value=s["value"], op=s["operator"]), - value_key=f"value{i + 1}")} + value_key=f"value{i + 1}")} if sh.is_negation_operator(op) and i > 0: op = sh.reverse_sql_operator(op) main_condition = "left_not.session_id ISNULL" @@ -180,7 +180,7 @@ def get_stages_and_events(filter_d, project_id) -> List[RealDictRow]: main_condition = "TRUE" else: main_condition = sh.multi_conditions(f"main.{next_col_name} {op} %(value{i + 1})s", - values=s["value"], value_key=f"value{i + 1}") + values=s["value"], value_key=f"value{i + 1}") n_stages_query.append(f""" (SELECT main.session_id, {"MIN(main.timestamp)" if i + 1 < len(stages) else "MAX(main.timestamp)"} AS stage{i + 1}_timestamp @@ -574,8 +574,10 @@ def get_top_insights(filter_d, project_id): # Obtain the first part of the output stages_list = get_stages(stages, rows) # Obtain the second part of the output - total_drop_due_to_issues = get_issues(stages, rows, first_stage=filter_d.get("firstStage"), - last_stage=filter_d.get("lastStage"), drop_only=True) + n_critical_issues, issues_dict, total_drop_due_to_issues = get_issues(stages, rows, + first_stage=filter_d.get("firstStage"), + last_stage=filter_d.get("lastStage"), + drop_only=True) return stages_list, total_drop_due_to_issues diff --git a/ee/api/chalicelib/core/significance.py b/ee/api/chalicelib/core/significance.py index 4e02eee41..bb9a53aaa 100644 --- a/ee/api/chalicelib/core/significance.py +++ b/ee/api/chalicelib/core/significance.py @@ -63,7 +63,7 @@ def get_stages_and_events(filter_d, project_id) -> List[RealDictRow]: f_k = f"f_value{i}" values = {**values, **sh.multi_values(helper.values_for_operator(value=f["value"], op=f["operator"]), - value_key=f_k)} + value_key=f_k)} if filter_type == schemas.FilterType.user_browser: # op = sessions.__get_sql_operator_multiple(f["operator"]) first_stage_extra_constraints.append( @@ -172,7 +172,7 @@ def get_stages_and_events(filter_d, project_id) -> List[RealDictRow]: continue values = {**values, **sh.multi_values(helper.values_for_operator(value=s["value"], op=s["operator"]), - value_key=f"value{i + 1}")} + value_key=f"value{i + 1}")} if sh.is_negation_operator(op) and i > 0: op = sh.reverse_sql_operator(op) main_condition = "left_not.session_id ISNULL" @@ -186,7 +186,7 @@ def get_stages_and_events(filter_d, project_id) -> List[RealDictRow]: main_condition = "TRUE" else: main_condition = sh.multi_conditions(f"main.{next_col_name} {op} %(value{i + 1})s", - values=s["value"], value_key=f"value{i + 1}") + values=s["value"], value_key=f"value{i + 1}") n_stages_query.append(f""" (SELECT main.session_id, {"MIN(main.timestamp)" if i + 1 < len(stages) else "MAX(main.timestamp)"} AS stage{i + 1}_timestamp @@ -580,8 +580,10 @@ def get_top_insights(filter_d, project_id): # Obtain the first part of the output stages_list = get_stages(stages, rows) # Obtain the second part of the output - total_drop_due_to_issues = get_issues(stages, rows, first_stage=filter_d.get("firstStage"), - last_stage=filter_d.get("lastStage"), drop_only=True) + n_critical_issues, issues_dict, total_drop_due_to_issues = get_issues(stages, rows, + first_stage=filter_d.get("firstStage"), + last_stage=filter_d.get("lastStage"), + drop_only=True) return stages_list, total_drop_due_to_issues diff --git a/ee/api/chalicelib/core/significance_exp.py b/ee/api/chalicelib/core/significance_exp.py index 4e02eee41..bb9a53aaa 100644 --- a/ee/api/chalicelib/core/significance_exp.py +++ b/ee/api/chalicelib/core/significance_exp.py @@ -63,7 +63,7 @@ def get_stages_and_events(filter_d, project_id) -> List[RealDictRow]: f_k = f"f_value{i}" values = {**values, **sh.multi_values(helper.values_for_operator(value=f["value"], op=f["operator"]), - value_key=f_k)} + value_key=f_k)} if filter_type == schemas.FilterType.user_browser: # op = sessions.__get_sql_operator_multiple(f["operator"]) first_stage_extra_constraints.append( @@ -172,7 +172,7 @@ def get_stages_and_events(filter_d, project_id) -> List[RealDictRow]: continue values = {**values, **sh.multi_values(helper.values_for_operator(value=s["value"], op=s["operator"]), - value_key=f"value{i + 1}")} + value_key=f"value{i + 1}")} if sh.is_negation_operator(op) and i > 0: op = sh.reverse_sql_operator(op) main_condition = "left_not.session_id ISNULL" @@ -186,7 +186,7 @@ def get_stages_and_events(filter_d, project_id) -> List[RealDictRow]: main_condition = "TRUE" else: main_condition = sh.multi_conditions(f"main.{next_col_name} {op} %(value{i + 1})s", - values=s["value"], value_key=f"value{i + 1}") + values=s["value"], value_key=f"value{i + 1}") n_stages_query.append(f""" (SELECT main.session_id, {"MIN(main.timestamp)" if i + 1 < len(stages) else "MAX(main.timestamp)"} AS stage{i + 1}_timestamp @@ -580,8 +580,10 @@ def get_top_insights(filter_d, project_id): # Obtain the first part of the output stages_list = get_stages(stages, rows) # Obtain the second part of the output - total_drop_due_to_issues = get_issues(stages, rows, first_stage=filter_d.get("firstStage"), - last_stage=filter_d.get("lastStage"), drop_only=True) + n_critical_issues, issues_dict, total_drop_due_to_issues = get_issues(stages, rows, + first_stage=filter_d.get("firstStage"), + last_stage=filter_d.get("lastStage"), + drop_only=True) return stages_list, total_drop_due_to_issues From 557024bc80ae7540a8c8cc776429904a31316d13 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Tue, 28 Feb 2023 12:38:48 +0100 Subject: [PATCH 10/11] fix(ui) - table card - metricOf value --- frontend/app/mstore/metricStore.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/app/mstore/metricStore.ts b/frontend/app/mstore/metricStore.ts index 9ef49759d..dfdeaf0c9 100644 --- a/frontend/app/mstore/metricStore.ts +++ b/frontend/app/mstore/metricStore.ts @@ -130,6 +130,10 @@ export default class MetricStore { obj['metricValue'] = []; + if (value === TABLE) { + obj['metricOf'] = 'userId'; + } + if (value === TABLE || value === TIMESERIES) { obj['viewType'] = 'table'; } From f042f85d75a7acdcbdedf3dc79d53a9368cf5ddb Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Tue, 28 Feb 2023 13:10:09 +0100 Subject: [PATCH 11/11] feat(chalice): fixed funnels --- api/chalicelib/core/significance.py | 2 +- ee/api/chalicelib/core/significance.py | 2 +- ee/api/chalicelib/core/significance_exp.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/chalicelib/core/significance.py b/api/chalicelib/core/significance.py index 822753be0..937f00af2 100644 --- a/api/chalicelib/core/significance.py +++ b/api/chalicelib/core/significance.py @@ -258,7 +258,7 @@ def pearson_corr(x: list, y: list): return None, None, False if n == 2: - return math.copysign(1, x[1] - x[0]) * math.copysign(1, y[1] - y[0]), 1.0 + return math.copysign(1, x[1] - x[0]) * math.copysign(1, y[1] - y[0]), 1.0, True xmean = sum(x) / len(x) ymean = sum(y) / len(y) diff --git a/ee/api/chalicelib/core/significance.py b/ee/api/chalicelib/core/significance.py index bb9a53aaa..ac6eef548 100644 --- a/ee/api/chalicelib/core/significance.py +++ b/ee/api/chalicelib/core/significance.py @@ -264,7 +264,7 @@ def pearson_corr(x: list, y: list): return None, None, False if n == 2: - return math.copysign(1, x[1] - x[0]) * math.copysign(1, y[1] - y[0]), 1.0 + return math.copysign(1, x[1] - x[0]) * math.copysign(1, y[1] - y[0]), 1.0, True xmean = sum(x) / len(x) ymean = sum(y) / len(y) diff --git a/ee/api/chalicelib/core/significance_exp.py b/ee/api/chalicelib/core/significance_exp.py index bb9a53aaa..ac6eef548 100644 --- a/ee/api/chalicelib/core/significance_exp.py +++ b/ee/api/chalicelib/core/significance_exp.py @@ -264,7 +264,7 @@ def pearson_corr(x: list, y: list): return None, None, False if n == 2: - return math.copysign(1, x[1] - x[0]) * math.copysign(1, y[1] - y[0]), 1.0 + return math.copysign(1, x[1] - x[0]) * math.copysign(1, y[1] - y[0]), 1.0, True xmean = sum(x) / len(x) ymean = sum(y) / len(y)