Skip to content

Commit

Permalink
Merge branch 'master' into cohorts-from-queries
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Dec 5, 2023
2 parents 1176d69 + ec24bc3 commit 5916346
Show file tree
Hide file tree
Showing 120 changed files with 1,504 additions and 1,305 deletions.
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"SKIP_SERVICE_VERSION_REQUIREMENTS": "1",
"PRINT_SQL": "1",
"REPLAY_EVENTS_NEW_CONSUMER_RATIO": "1.0",
"AUTO_LOGIN": "True",
"BILLING_SERVICE_URL": "https://billing.dev.posthog.dev"
},
"console": "integratedTerminal",
Expand Down
40 changes: 30 additions & 10 deletions ee/frontend/mobile-replay/__snapshots__/transform.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ exports[`replay/transform transform can convert images 1`] = `
"type": 1,
},
{
"attributes": {},
"attributes": {
"style": "height: 100vh; width: 100vw;",
},
"childNodes": [
{
"attributes": {},
Expand All @@ -37,7 +39,9 @@ exports[`replay/transform transform can convert images 1`] = `
"type": 2,
},
{
"attributes": {},
"attributes": {
"style": "height: 100vh; width: 100vw;",
},
"childNodes": [
{
"attributes": {},
Expand Down Expand Up @@ -122,7 +126,9 @@ exports[`replay/transform transform can convert rect with text 1`] = `
"type": 1,
},
{
"attributes": {},
"attributes": {
"style": "height: 100vh; width: 100vw;",
},
"childNodes": [
{
"attributes": {},
Expand All @@ -132,7 +138,9 @@ exports[`replay/transform transform can convert rect with text 1`] = `
"type": 2,
},
{
"attributes": {},
"attributes": {
"style": "height: 100vh; width: 100vw;",
},
"childNodes": [
{
"attributes": {},
Expand Down Expand Up @@ -232,7 +240,9 @@ exports[`replay/transform transform can ignore unknown wireframe types 1`] = `
"type": 1,
},
{
"attributes": {},
"attributes": {
"style": "height: 100vh; width: 100vw;",
},
"childNodes": [
{
"attributes": {},
Expand All @@ -242,7 +252,9 @@ exports[`replay/transform transform can ignore unknown wireframe types 1`] = `
"type": 2,
},
{
"attributes": {},
"attributes": {
"style": "height: 100vh; width: 100vw;",
},
"childNodes": [
{
"attributes": {},
Expand Down Expand Up @@ -311,7 +323,9 @@ exports[`replay/transform transform can process unknown types without error 1`]
"type": 1,
},
{
"attributes": {},
"attributes": {
"style": "height: 100vh; width: 100vw;",
},
"childNodes": [
{
"attributes": {},
Expand All @@ -321,7 +335,9 @@ exports[`replay/transform transform can process unknown types without error 1`]
"type": 2,
},
{
"attributes": {},
"attributes": {
"style": "height: 100vh; width: 100vw;",
},
"childNodes": [
{
"attributes": {},
Expand Down Expand Up @@ -414,7 +430,9 @@ exports[`replay/transform transform child wireframes are processed 1`] = `
"type": 1,
},
{
"attributes": {},
"attributes": {
"style": "height: 100vh; width: 100vw;",
},
"childNodes": [
{
"attributes": {},
Expand All @@ -424,7 +442,9 @@ exports[`replay/transform transform child wireframes are processed 1`] = `
"type": 2,
},
{
"attributes": {},
"attributes": {
"style": "height: 100vh; width: 100vw;",
},
"childNodes": [
{
"attributes": {},
Expand Down
6 changes: 3 additions & 3 deletions ee/frontend/mobile-replay/transformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
wireframeRectangle,
wireframeText,
} from './mobile.types'
import { makePositionStyles, makeStylesString, makeSvgBorder } from './wireframeStyle'
import { makeBodyStyles, makeHTMLStyles, makePositionStyles, makeStylesString, makeSvgBorder } from './wireframeStyle'

const PLACEHOLDER_IMAGE =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAIAAAAP3aGbAAAViUlEQVR4nO3d0XLjOA5GYfTWPuO8Y+Yp98JTGa8lSyJBEvjBcy5nA4mbbn/lKDT7z8/PjxERKfSf6AUQET0NsIhIJsAiIpkAi4hkAiwikum/z7/0r7/+uvhf//777+5LeWaJyFPUK7dp9reGd1jXN2hy5ONSnlki6k5LK2v9kRCziMokodXHbPMzLMwiKpCiVtb30B2ziKQT1cq6f0uIWUSi6Wplnm0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npCr89eoeVRA20InovcF/oyvdZ792DlUQNtCI6tptZN2AlUQOtiL61lVlXYCVRA62Iros1a+W20q9gJVEDrYiepPI5Z+f4OVhJ1EArouepoOMZPwEriRpoRdSaBDqecc50RysqVX50POOc6U5UreToeMY5052oYM4PKqc1izPdiWq28mwGz92bxjnTnahs9cza/Ux3otoVM2vrM92JdmilWbPJ2/dMd6J9WmaWc/z2Fb3pme5Eu1XDrB3PdCfaM+cHlWN/tHy13ZnuRJsnYdbpuO12pjsRmbJZT8FKIg5aEQ1J1KxdznQnoo+cZi0j770tznQnotMC94X2vUjrn+lORBdpmVX8THciui3WrKbXbOUz3YnoYdk+M/itsme6E1FTEmbVPNOdiDrKb1bBM92JqLvkZlU7052InGU2q9SZ7kQ0pLRm1TnTnYgGltOsPz8/Pw+vexpaERXO+ap8Pn76iu7/8POTe6AVUbFiz+07jsuf6U5EU0tllvaZ7kS0oFiz3hM+052IlpXhfGTTPdOdiBYXfj6yiZ7pTkQhhZuld6Y7EQW28qxR+TPdiShDUWYpnelORHniTPerWSLKFme6n88SUc5Wno9sEme6E1Hmln1M2vKf6U5E+Vtmlve0BiKiZblOayAiWhlgEZFMgEVEMv0PU/uJezostYUAAAAASUVORK5CYII='
Expand Down Expand Up @@ -262,7 +262,7 @@ export const makeFullEvent = (
{
type: NodeType.Element,
tagName: 'html',
attributes: {},
attributes: { style: makeHTMLStyles() },
id: 3,
childNodes: [
{
Expand All @@ -275,7 +275,7 @@ export const makeFullEvent = (
{
type: NodeType.Element,
tagName: 'body',
attributes: {},
attributes: { style: makeBodyStyles() },
id: BODY_ID,
childNodes: [
{
Expand Down
8 changes: 8 additions & 0 deletions ee/frontend/mobile-replay/wireframeStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,11 @@ export function makeStylesString(wireframe: wireframe): string {
styles += makeFontStyles(wireframe)
return styles
}

export function makeHTMLStyles(): string {
return 'height: 100vh; width: 100vw;'
}

export function makeBodyStyles(): string {
return 'height: 100vh; width: 100vw;'
}
Binary file modified frontend/__snapshots__/components-command-bar--search--dark.png
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.
Binary file modified frontend/__snapshots__/components-command-bar--search.png
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/lemon-ui-lemon-button--types-3000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/lemon-ui-lemon-tag--lemon-tag--dark.png
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useEffect } from 'react'
import { App } from 'scenes/App'
import { urls } from 'scenes/urls'

import { setFeatureFlags } from '~/mocks/browser'
import { mswDecorator, setFeatureFlags } from '~/mocks/browser'
import { SidePanelTab } from '~/types'

import { sidePanelStateLogic } from './sidePanelStateLogic'
Expand All @@ -18,6 +18,14 @@ const meta: Meta = {
viewMode: 'story',
mockDate: '2023-07-04', // To stabilize relative dates
},
decorators: [
mswDecorator({
get: {
'/api/projects/:team_id/dashboard_templates/': {},
'/api/projects/:id/integrations': { results: [] },
},
}),
],
}
export default meta

Expand Down
14 changes: 6 additions & 8 deletions frontend/src/layout/navigation-3000/sidepanel/sidePanelLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export const sidePanelLogic = kea<sidePanelLogicType>([

selectors({
enabledTabs: [
(s) => [s.featureFlags, s.isCloudOrDev],
(featureFlags, isCloudOrDev) => {
(s) => [s.featureFlags, s.isCloudOrDev, s.isReady, s.hasCompletedAllTasks],
(featureFlags, isCloudOrDev, isReady, hasCompletedAllTasks) => {
const tabs: SidePanelTab[] = []

if (featureFlags[FEATURE_FLAGS.NOTEBOOKS]) {
Expand All @@ -46,7 +46,9 @@ export const sidePanelLogic = kea<sidePanelLogicType>([

tabs.push(SidePanelTab.Docs)
tabs.push(SidePanelTab.Settings)
tabs.push(SidePanelTab.Activation)
if (isReady && !hasCompletedAllTasks) {
tabs.push(SidePanelTab.Activation)
}
tabs.push(SidePanelTab.Activity)

if (featureFlags[FEATURE_FLAGS.EARLY_ACCESS_FEATURE_SITE_BUTTON]) {
Expand All @@ -59,7 +61,7 @@ export const sidePanelLogic = kea<sidePanelLogicType>([

visibleTabs: [
(s) => [s.enabledTabs, s.selectedTab, s.sidePanelOpen, s.isReady, s.hasCompletedAllTasks],
(enabledTabs, selectedTab, sidePanelOpen, isReady, hasCompletedAllTasks): SidePanelTab[] => {
(enabledTabs, selectedTab, sidePanelOpen): SidePanelTab[] => {
return enabledTabs.filter((tab: any) => {
if (tab === selectedTab && sidePanelOpen) {
return true
Expand All @@ -70,10 +72,6 @@ export const sidePanelLogic = kea<sidePanelLogicType>([
return false
}

if (tab === SidePanelTab.Activation && (!isReady || hasCompletedAllTasks)) {
return false
}

return true
})
},
Expand Down
16 changes: 13 additions & 3 deletions frontend/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { decompressSync, strFromU8 } from 'fflate'
import { encodeParams } from 'kea-router'
import { ActivityLogProps } from 'lib/components/ActivityLog/ActivityLog'
import { ActivityLogItem, ActivityScope } from 'lib/components/ActivityLog/humanizeActivity'
import { toParams } from 'lib/utils'
import { objectClean, toParams } from 'lib/utils'
import posthog from 'posthog-js'
import { SavedSessionRecordingPlaylistsResult } from 'scenes/session-recordings/saved-playlists/savedSessionRecordingPlaylistsLogic'

Expand Down Expand Up @@ -102,6 +102,7 @@ export interface ActivityLogPaginatedResponse<T> extends PaginatedResponse<T> {

export interface ApiMethodOptions {
signal?: AbortSignal
headers?: Record<string, any>
}

const CSRF_COOKIE_NAME = 'posthog_csrftoken'
Expand Down Expand Up @@ -1519,8 +1520,14 @@ const api = {
},

notebooks: {
async get(notebookId: NotebookType['short_id']): Promise<NotebookType> {
return await new ApiRequest().notebook(notebookId).get()
async get(
notebookId: NotebookType['short_id'],
params: Record<string, any> = {},
headers: Record<string, any> = {}
): Promise<NotebookType> {
return await new ApiRequest().notebook(notebookId).withQueryString(toParams(params)).get({
headers,
})
},
async update(
notebookId: NotebookType['short_id'],
Expand Down Expand Up @@ -1842,6 +1849,7 @@ const api = {
response = await fetch(url, {
signal: options?.signal,
headers: {
...objectClean(options?.headers ?? {}),
...(getSessionId() ? { 'X-POSTHOG-SESSION-ID': getSessionId() } : {}),
},
})
Expand All @@ -1865,6 +1873,7 @@ const api = {
const response = await fetch(url, {
method: 'PATCH',
headers: {
...objectClean(options?.headers ?? {}),
...(isFormData ? {} : { 'Content-Type': 'application/json' }),
'X-CSRFToken': getCookie(CSRF_COOKIE_NAME) || '',
...(getSessionId() ? { 'X-POSTHOG-SESSION-ID': getSessionId() } : {}),
Expand Down Expand Up @@ -1897,6 +1906,7 @@ const api = {
const response = await fetch(url, {
method: 'POST',
headers: {
...objectClean(options?.headers ?? {}),
...(isFormData ? {} : { 'Content-Type': 'application/json' }),
'X-CSRFToken': getCookie(CSRF_COOKIE_NAME) || '',
...(getSessionId() ? { 'X-POSTHOG-SESSION-ID': getSessionId() } : {}),
Expand Down
9 changes: 6 additions & 3 deletions frontend/src/lib/components/CommandBar/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ import { SearchTabs } from './SearchTabs'
export const SearchBar = (): JSX.Element => {
useMountedLogic(searchBarLogic) // load initial results

/** Ref to the search input for focusing after tab change. */
const inputRef = useRef<HTMLInputElement>(null)

return (
<div className="flex flex-col h-full">
<SearchInput ref={inputRef} />
<SearchResults />
<div className="flex w-full h-full">
<SearchTabs inputRef={inputRef} />
<div className="grow flex flex-col overscroll-contain overflow-hidden">
<SearchInput ref={inputRef} />
<SearchResults />
</div>
</div>
)
}
Loading

0 comments on commit 5916346

Please sign in to comment.