Skip to content

Commit

Permalink
Merge branch 'master' into dn-chore/update-python-requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin committed Mar 13, 2024
2 parents 48e16cd + 4fd93da commit de63ad9
Show file tree
Hide file tree
Showing 95 changed files with 2,717 additions and 1,115 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ module.exports = {
'Radio',
'Divider',
'Popconfirm',
'Table',
],
message: 'please use the Lemon equivalent instead',
},
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/experiments.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ describe('Experiments', () => {

// Select goal type
cy.get('[data-attr="experiment-goal-type-select"]').click()
cy.contains('Trend').should('be.visible')
cy.contains('Conversion funnel').should('be.visible')
cy.get('.Popover__content').contains('Trend').should('be.visible')
cy.get('.Popover__content').contains('Conversion funnel').should('be.visible')

// Add secondary metric
const secondaryMetricName = `Secondary metric ${Math.floor(Math.random() * 10000000)}`
Expand All @@ -65,8 +65,8 @@ describe('Experiments', () => {
.type(secondaryMetricName)
.should('have.value', secondaryMetricName)
cy.get('[data-attr="metrics-selector"]').click()
cy.contains('Trends').should('be.visible')
cy.contains('Funnels').should('be.visible')
cy.get('.Popover__content').contains('Funnels').should('be.visible')
cy.get('.Popover__content').contains('Trends').should('be.visible')
cy.get('[data-attr="create-annotation-submit"]').click()
cy.contains(secondaryMetricName).should('exist')

Expand Down
10 changes: 5 additions & 5 deletions ee/api/test/test_team.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def test_rename_private_project_as_org_member_forbidden(self):
self.team.refresh_from_db()

self.assertEqual(response.status_code, HTTP_403_FORBIDDEN)
self.assertEqual(self.team.name, "Default Project")
self.assertEqual(self.team.name, "Default project")

def test_rename_private_project_current_as_org_outsider_forbidden(self):
self.organization_membership.delete()
Expand Down Expand Up @@ -368,7 +368,7 @@ def test_fetch_team_as_org_admin_works(self):
self.assertEqual(response.status_code, HTTP_200_OK)
self.assertDictContainsSubset(
{
"name": "Default Project",
"name": "Default project",
"access_control": False,
"effective_membership_level": OrganizationMembership.Level.ADMIN,
},
Expand All @@ -385,7 +385,7 @@ def test_fetch_team_as_org_member_works(self):
self.assertEqual(response.status_code, HTTP_200_OK)
self.assertDictContainsSubset(
{
"name": "Default Project",
"name": "Default project",
"access_control": False,
"effective_membership_level": OrganizationMembership.Level.MEMBER,
},
Expand Down Expand Up @@ -424,7 +424,7 @@ def test_fetch_private_team_as_org_member_and_project_member(self):
self.assertEqual(response.status_code, HTTP_200_OK)
self.assertDictContainsSubset(
{
"name": "Default Project",
"name": "Default project",
"access_control": True,
"effective_membership_level": OrganizationMembership.Level.MEMBER,
},
Expand All @@ -448,7 +448,7 @@ def test_fetch_private_team_as_org_member_and_project_admin(self):
self.assertEqual(response.status_code, HTTP_200_OK)
self.assertDictContainsSubset(
{
"name": "Default Project",
"name": "Default project",
"access_control": True,
"effective_membership_level": OrganizationMembership.Level.ADMIN,
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions frontend/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1928,13 +1928,10 @@ const api = {
password: string,
schema: string
): Promise<ExternalDataPostgresSchema[]> {
const queryParams = toParams({ host, port, dbname, user, password, schema })

return await new ApiRequest()
.externalDataSources()
.withAction('database_schema')
.withQueryString(queryParams)
.get()
.create({ data: { host, port, dbname, user, password, schema } })
},
},

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Fuse from 'fuse.js'
import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { posthog } from 'posthog-js'
import posthog from 'posthog-js'
import { Scene } from 'scenes/sceneTypes'
import { teamLogic } from 'scenes/teamLogic'
import { userLogic } from 'scenes/userLogic'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"result": {
"events": [
{
"success_count": 472,
"success_people_url": "http://localhost:8000/api/person/funnel/correlation/?breakdown_attribution_type=first_touch&breakdown_normalize_url=False&date_from=-7d&display=FunnelViz",
"failure_count": 9,
"failure_people_url": "http://localhost:8000/api/person/funnel/correlation/?breakdown_attribution_type=first_touch&breakdown_normalize_url=False&date_from=-7d&display=FunnelViz",
"odds_ratio": 3006.964172813488,
"correlation_type": "success",
"event": {
"event": "score updated",
"properties": {},
"elements": []
}
},
{
"success_count": 60,
"success_people_url": "http://localhost:8000/api/person/funnel/correlation/?breakdown_attribution_type=first_touch&breakdown_normalize_url=False&date_from=-7d&display=FunnelViz",
"failure_count": 0,
"failure_people_url": "http://localhost:8000/api/person/funnel/correlation/?breakdown_attribution_type=first_touch&breakdown_normalize_url=False&date_from=-7d&display=FunnelViz",
"odds_ratio": 2750.7485294117646,
"correlation_type": "success",
"event": {
"event": "onboard teammate clicked",
"properties": {},
"elements": []
}
},
{
"success_count": 65,
"success_people_url": "http://localhost:8000/api/person/funnel/correlation/?breakdown_attribution_type=first_touch&breakdown_normalize_url=False&date_from=-7d&display=FunnelViz",
"failure_count": 75,
"failure_people_url": "http://localhost:8000/api/person/funnel/correlation/?breakdown_attribution_type=first_touch&breakdown_normalize_url=False&date_from=-7d&display=FunnelViz",
"odds_ratio": 35.41070956534874,
"correlation_type": "failure",
"event": {
"event": "cancellation prompt shown",
"properties": {},
"elements": []
}
}
],
"skewed": true
},
"last_refresh": "2024-03-11T18:44:25.153943Z",
"is_cached": false
}
12 changes: 12 additions & 0 deletions frontend/src/queries/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5443,6 +5443,9 @@
}
},
"type": "object"
},
"useSessionsTable": {
"type": "boolean"
}
},
"required": ["properties"],
Expand Down Expand Up @@ -5504,6 +5507,9 @@
}
},
"type": "object"
},
"useSessionsTable": {
"type": "boolean"
}
},
"required": ["kind", "properties"],
Expand Down Expand Up @@ -5605,6 +5611,9 @@
}
},
"type": "object"
},
"useSessionsTable": {
"type": "boolean"
}
},
"required": ["breakdownBy", "kind", "properties"],
Expand Down Expand Up @@ -5686,6 +5695,9 @@
}
},
"type": "object"
},
"useSessionsTable": {
"type": "boolean"
}
},
"required": ["kind", "properties"],
Expand Down
1 change: 1 addition & 0 deletions frontend/src/queries/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ export interface WebAnalyticsQueryBase {
enabled?: boolean
forceSamplingRate?: SamplingRate
}
useSessionsTable?: boolean
}

export interface WebOverviewQuery extends WebAnalyticsQueryBase {
Expand Down
12 changes: 8 additions & 4 deletions frontend/src/scenes/data-warehouse/ViewLinkModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { IconSwapHoriz } from 'lib/lemon-ui/icons'
import { useState } from 'react'
import { viewLinkLogic } from 'scenes/data-warehouse/viewLinkLogic'

import { DatabaseSchemaQueryResponseField } from '~/queries/schema'
import { DatabaseSchemaQueryResponseField, NodeKind } from '~/queries/schema'

export function ViewLinkModal(): JSX.Element {
const { isJoinTableModalOpen } = useValues(viewLinkLogic)
Expand All @@ -45,7 +45,6 @@ export function ViewLinkModal(): JSX.Element {
export function ViewLinkForm(): JSX.Element {
const {
tableOptions,
selectedJoiningTable,
selectedJoiningTableName,
selectedSourceTableName,
sourceTableKeys,
Expand Down Expand Up @@ -116,6 +115,7 @@ export function ViewLinkForm(): JSX.Element {
<HogQLDropdown
hogQLValue={selectedSourceKey ?? ''}
onHogQLValueChange={selectSourceKey}
tableName={selectedSourceTableName ?? ''}
/>
)}
</>
Expand All @@ -132,14 +132,15 @@ export function ViewLinkForm(): JSX.Element {
fullWidth
onSelect={selectJoiningKey}
value={joiningIsUsingHogQLExpression ? '' : selectedJoiningKey ?? undefined}
disabledReason={selectedJoiningTable ? '' : 'Select a table to choose join key'}
disabledReason={selectedJoiningTableName ? '' : 'Select a table to choose join key'}
options={[...joiningTableKeys, { value: '', label: <span>HogQL Expression</span> }]}
placeholder="Select a key"
/>
{joiningIsUsingHogQLExpression && (
<HogQLDropdown
hogQLValue={selectedJoiningKey ?? ''}
onHogQLValueChange={selectJoiningKey}
tableName={selectedJoiningTableName ?? ''}
/>
)}
</>
Expand Down Expand Up @@ -195,14 +196,16 @@ export function ViewLinkForm(): JSX.Element {
const HogQLDropdown = ({
hogQLValue,
onHogQLValueChange,
tableName,
}: {
hogQLValue: string
tableName: string
onHogQLValueChange: (hogQLValue: string) => void
}): JSX.Element => {
const [isHogQLDropdownVisible, setIsHogQLDropdownVisible] = useState(false)

return (
<div className="flex-auto overflow-hidden">
<div className="flex-auto overflow-hidden mt-2">
<LemonDropdown
visible={isHogQLDropdownVisible}
closeOnClickInside={false}
Expand All @@ -213,6 +216,7 @@ const HogQLDropdown = ({
<HogQLEditor
disablePersonProperties
value={hogQLValue}
metadataSource={{ kind: NodeKind.HogQLQuery, query: `SELECT * FROM ${tableName}` }}
onChange={(currentValue) => {
onHogQLValueChange(currentValue)
setIsHogQLDropdownVisible(false)
Expand Down
Loading

0 comments on commit de63ad9

Please sign in to comment.