Skip to content

Commit

Permalink
Merge branch 'master' into rbac
Browse files Browse the repository at this point in the history
# Conflicts:
#	frontend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light.png
#	frontend/__snapshots__/scenes-other-settings--settings-organization--dark.png
#	frontend/__snapshots__/scenes-other-settings--settings-organization--light.png
#	frontend/src/scenes/feature-flags/FeatureFlag.tsx
#	frontend/src/scenes/feature-flags/FeatureFlagPermissions.tsx
#	frontend/src/scenes/settings/SettingsMap.tsx
  • Loading branch information
benjackwhite committed Mar 26, 2024
2 parents 328bad7 + fad9f5e commit 137c67a
Show file tree
Hide file tree
Showing 244 changed files with 4,720 additions and 1,574 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-backend-depot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
changes:
runs-on: depot-ubuntu-latest-4
timeout-minutes: 5
if: ${{ contains(github.event.pull_request.labels.*.name, 'test-depot') }}
if: github.repository == 'PostHog/posthog'
name: Determine need to run backend checks
# Set job outputs to values from filter step
outputs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e-depot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
changes:
runs-on: depot-ubuntu-latest-4
timeout-minutes: 5
if: ${{ contains(github.event.pull_request.labels.*.name, 'test-depot') }}
if: github.repository == 'PostHog/posthog'
name: Determine need to run E2E checks
# Set job outputs to values from filter step
outputs:
Expand Down
10 changes: 2 additions & 8 deletions cypress/e2e/featureFlags.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ describe('Feature Flags', () => {
let name

beforeEach(() => {
cy.intercept('**/decide/*', (req) =>
req.reply(
decideResponse({
'new-feature-flag-operators': true,
})
)
)
cy.intercept('**/decide/*', (req) => req.reply(decideResponse({})))

cy.intercept('/api/projects/*/property_definitions?type=person*', {
fixture: 'api/feature-flags/property_definition',
Expand Down Expand Up @@ -116,7 +110,7 @@ describe('Feature Flags', () => {
cy.get('.Toastify').contains('Undo').should('be.visible')
})

it.only('Move between property types smoothly, and support relative dates', () => {
it('Move between property types smoothly, and support relative dates', () => {
// ensure unique names to avoid clashes
cy.get('[data-attr=top-bar-name]').should('contain', 'Feature flags')
cy.get('[data-attr=new-feature-flag]').click()
Expand Down
1 change: 0 additions & 1 deletion cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ beforeEach(() => {
// set feature flags here e.g.
// 'toolbar-launch-side-action': true,
'surveys-new-creation-flow': true,
'surveys-results-visualizations': true,
'auto-redirect': true,
hogql: true,
'data-exploration-insights': true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@
"x": 66,
"y": 556
}
},
{
"parentId": 209272202,
"wireframe": {
"id": 52129787123,
"type": "text"
}
}
],
"removes": [
Expand Down
162 changes: 162 additions & 0 deletions ee/frontend/mobile-replay/__snapshots__/transform.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,147 @@ exports[`replay/transform transform can convert images 1`] = `
]
`;

exports[`replay/transform transform can convert invalid text wireframe 1`] = `
[
{
"data": {
"height": 600,
"href": "",
"width": 300,
},
"timestamp": 1,
"type": 4,
},
{
"data": {
"initialOffset": {
"left": 0,
"top": 0,
},
"node": {
"childNodes": [
{
"id": 2,
"name": "html",
"publicId": "",
"systemId": "",
"type": 1,
},
{
"attributes": {
"data-rrweb-id": 3,
"style": "height: 100vh; width: 100vw;",
},
"childNodes": [
{
"attributes": {
"data-rrweb-id": 4,
},
"childNodes": [
{
"attributes": {
"type": "text/css",
},
"childNodes": [
{
"id": 102,
"textContent": "
body {
margin: unset;
}
input, button, select, textarea {
font: inherit;
margin: 0;
padding: 0;
border: 0;
outline: 0;
background: transparent;
padding-block: 0 !important;
}
.input:focus {
outline: none;
}
img {
border-style: none;
}
",
"type": 3,
},
],
"id": 101,
"tagName": "style",
"type": 2,
},
],
"id": 4,
"tagName": "head",
"type": 2,
},
{
"attributes": {
"data-rrweb-id": 5,
"style": "height: 100vh; width: 100vw;",
},
"childNodes": [
{
"attributes": {
"data-rrweb-id": 12345,
"style": "border-width: 4px;border-radius: 10px;border-color: #ee3ee4;border-style: solid;color: #ee3ee4;width: 100px;height: 30px;position: fixed;left: 11px;top: 12px;overflow:hidden;white-space:normal;",
},
"childNodes": [],
"id": 12345,
"tagName": "div",
"type": 2,
},
{
"attributes": {
"data-render-reason": "a fixed placeholder to contain the keyboard in the correct stacking position",
"data-rrweb-id": 9,
},
"childNodes": [],
"id": 9,
"tagName": "div",
"type": 2,
},
{
"attributes": {
"data-rrweb-id": 7,
},
"childNodes": [],
"id": 7,
"tagName": "div",
"type": 2,
},
{
"attributes": {
"data-rrweb-id": 11,
},
"childNodes": [],
"id": 11,
"tagName": "div",
"type": 2,
},
],
"id": 5,
"tagName": "body",
"type": 2,
},
],
"id": 3,
"tagName": "html",
"type": 2,
},
],
"id": 1,
"type": 0,
},
},
"timestamp": 1,
"type": 2,
},
]
`;

exports[`replay/transform transform can convert navigation bar 1`] = `
[
{
Expand Down Expand Up @@ -1453,6 +1594,20 @@ exports[`replay/transform transform incremental mutations de-duplicate the tree
},
"parentId": 52129787,
},
{
"nextId": null,
"node": {
"attributes": {
"data-rrweb-id": 52129787123,
"style": "position: fixed;left: 0px;top: 0px;overflow:hidden;white-space:normal;",
},
"childNodes": [],
"id": 52129787123,
"tagName": "div",
"type": 2,
},
"parentId": 209272202,
},
],
"attributes": [],
"removes": [
Expand Down Expand Up @@ -1689,6 +1844,13 @@ AAAAAAAAAAAAAAAAAAAAAAAAgCN/AW0xMqHnNQceAAAAAElFTkSuQmCC
"y": 556,
},
},
{
"parentId": 209272202,
"wireframe": {
"id": 52129787123,
"type": "text",
},
},
],
"removes": [
{
Expand Down
37 changes: 37 additions & 0 deletions ee/frontend/mobile-replay/transform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,43 @@ describe('replay/transform', () => {
expect(converted).toMatchSnapshot()
})

test('can convert invalid text wireframe', () => {
const converted = posthogEEModule.mobileReplay?.transformToWeb([
{
data: {
width: 300,
height: 600,
},
timestamp: 1,
type: 4,
},
{
type: 2,
data: {
wireframes: [
{
id: 12345,
type: 'text',
x: 11,
y: 12,
width: 100,
height: 30,
style: {
color: '#ee3ee4',
borderColor: '#ee3ee4',
borderWidth: '4',
borderRadius: '10px',
},
// text property is missing
},
],
},
timestamp: 1,
},
])
expect(converted).toMatchSnapshot()
})

test('can set background image to base64 png', () => {
const converted = posthogEEModule.mobileReplay?.transformToWeb([
{
Expand Down
26 changes: 17 additions & 9 deletions ee/frontend/mobile-replay/transformer/transformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ export function _isPositiveInteger(id: unknown): id is number {
return typeof id === 'number' && id > 0 && id % 1 === 0
}

function _isNullish(x: unknown): x is null | undefined {
return x === null || x === undefined
}

function isRemovedNodeMutation(x: addedNodeMutation | removedNodeMutation): x is removedNodeMutation {
return isObject(x) && 'id' in x
}
Expand Down Expand Up @@ -218,6 +222,17 @@ function makeTextElement(
// because we might have to style the text, we always wrap it in a div
// and apply styles to that
const id = context.idSequence.next().value

const childNodes = [...children]
if (!_isNullish(wireframe.text)) {
childNodes.unshift({
type: NodeType.Text,
textContent: wireframe.text,
// since the text node is wrapped, we assign it a synthetic id
id,
})
}

return {
result: {
type: NodeType.Element,
Expand All @@ -227,15 +242,7 @@ function makeTextElement(
'data-rrweb-id': wireframe.id,
},
id: wireframe.id,
childNodes: [
{
type: NodeType.Text,
textContent: wireframe.text,
// since the text node is wrapped, we assign it a synthetic id
id: id,
},
...children,
],
childNodes,
},
context,
}
Expand Down Expand Up @@ -983,6 +990,7 @@ function isMobileIncrementalSnapshotEvent(x: unknown): x is MobileIncrementalSna

function makeIncrementalAdd(add: MobileNodeMutation, context: ConversionContext): addedNodeMutation[] | null {
const converted = convertWireframe(add.wireframe, context)

if (!converted) {
return null
}
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.
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.
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.
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__/scenes-other-login--cloud--dark.png
Binary file modified frontend/__snapshots__/scenes-other-login--cloud--light.png
Binary file modified frontend/__snapshots__/scenes-other-login--cloud-eu--dark.png
Binary file modified frontend/__snapshots__/scenes-other-login--cloud-eu--light.png
Binary file modified frontend/__snapshots__/scenes-other-login--self-hosted--dark.png
Binary file modified frontend/__snapshots__/scenes-other-login--sso-error--dark.png
Binary file modified frontend/__snapshots__/scenes-other-login--sso-error--light.png
Binary file modified frontend/__snapshots__/scenes-other-signup--cloud--dark.png
Binary file modified frontend/__snapshots__/scenes-other-signup--cloud--light.png
Binary file modified frontend/__snapshots__/scenes-other-signup--self-hosted--light.png
Binary file modified frontend/__snapshots__/scenes-other-toolbar--heatmap--dark.png
Binary file modified frontend/__snapshots__/scenes-other-toolbar--heatmap--light.png
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { actions, connect, events, kea, listeners, path, reducers, selectors } f
import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
import api from 'lib/api'
import { reverseProxyCheckerLogic } from 'lib/components/ReverseProxyChecker/reverseProxyCheckerLogic'
import { permanentlyMount } from 'lib/utils/kea-logic-builders'
import posthog from 'posthog-js'
import { membersLogic } from 'scenes/organization/membersLogic'
Expand Down Expand Up @@ -58,6 +59,8 @@ export const activationLogic = kea<activationLogicType>([
['insights'],
dashboardsModel,
['rawDashboards'],
reverseProxyCheckerLogic,
['hasReverseProxy'],
],
actions: [
inviteLogic,
Expand Down Expand Up @@ -193,6 +196,7 @@ export const activationLogic = kea<activationLogicType>([
s.customEventsCount,
s.installedPlugins,
s.currentTeamSkippedTasks,
s.hasReverseProxy,
],
(
currentTeam,
Expand All @@ -202,7 +206,8 @@ export const activationLogic = kea<activationLogicType>([
dashboards,
customEventsCount,
installedPlugins,
skippedTasks
skippedTasks,
hasReverseProxy
) => {
const tasks: ActivationTaskType[] = []
for (const task of Object.values(ActivationTasks)) {
Expand Down Expand Up @@ -286,7 +291,7 @@ export const activationLogic = kea<activationLogicType>([
id: ActivationTasks.SetUpReverseProxy,
name: 'Set up a reverse proxy',
description: 'Send your events from your own domain to avoid tracking blockers',
completed: false,
completed: hasReverseProxy || false,
canSkip: true,
skipped: skippedTasks.includes(ActivationTasks.SetUpReverseProxy),
url: 'https://posthog.com/docs/advanced/proxy',
Expand Down
Loading

0 comments on commit 137c67a

Please sign in to comment.