Skip to content

Commit

Permalink
Merge branch 'master' into rbac
Browse files Browse the repository at this point in the history
# Conflicts:
#	mypy-baseline.txt
  • Loading branch information
benjackwhite committed Mar 20, 2024
2 parents 8e07413 + 0c5b8cb commit d2cddc2
Show file tree
Hide file tree
Showing 60 changed files with 1,225 additions and 194 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-e2e-depot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ jobs:
calculate-running-time:
name: Calculate running time
runs-on: ubuntu-latest
needs: [cypress]
if: needs.changes.outputs.shouldTriggerCypress == 'true'
steps:
- name: Calculate running time
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ jobs:
calculate-running-time:
name: Calculate running time
runs-on: ubuntu-latest
needs: [cypress]
if: needs.changes.outputs.shouldTriggerCypress == 'true'
steps:
- name: Calculate running time
Expand Down
149 changes: 146 additions & 3 deletions ee/frontend/mobile-replay/__snapshots__/transform.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ exports[`replay/transform transform incremental mutations de-duplicate the tree
"node": {
"attributes": {
"data-rrweb-id": 99571736,
"style": "color: #000000;width: 150px;height: 19px;position: fixed;left: 10px;top: 584px;align-items: flex-start;justify-content: flex-start;display: flex;font-size: 14px;font-family: sans-serif;overflow:hidden;white-space:normal;",
"style": "color: #000000;width: 150px;height: 19px;position: fixed;left: 10px;top: 584px;align-items: flex-start;justify-content: flex-start;display: flex;padding-left: 0px;padding-right: 0px;padding-top: 0px;padding-bottom: 0px;font-size: 14px;font-family: sans-serif;overflow:hidden;white-space:normal;",
},
"childNodes": [],
"id": 99571736,
Expand All @@ -1404,7 +1404,7 @@ exports[`replay/transform transform incremental mutations de-duplicate the tree
"node": {
"attributes": {
"data-rrweb-id": 240124529,
"style": "color: #000000;width: 48px;height: 32px;position: fixed;left: 10px;top: 548px;align-items: center;justify-content: center;display: flex;font-size: 14px;font-family: sans-serif;overflow:hidden;white-space:normal;",
"style": "color: #000000;width: 48px;height: 32px;position: fixed;left: 10px;top: 548px;align-items: center;justify-content: center;display: flex;padding-left: 32px;padding-right: 0px;padding-top: 6px;padding-bottom: 6px;font-size: 14px;font-family: sans-serif;overflow:hidden;white-space:normal;",
},
"childNodes": [],
"id": 240124529,
Expand All @@ -1427,7 +1427,7 @@ exports[`replay/transform transform incremental mutations de-duplicate the tree
"node": {
"attributes": {
"data-rrweb-id": 52129787,
"style": "color: #000000;width: 368px;height: 19px;position: fixed;left: 66px;top: 556px;align-items: flex-start;justify-content: flex-start;display: flex;font-size: 14px;font-family: sans-serif;overflow:hidden;white-space:normal;",
"style": "color: #000000;width: 368px;height: 19px;position: fixed;left: 66px;top: 556px;align-items: flex-start;justify-content: flex-start;display: flex;padding-left: 0px;padding-right: 0px;padding-top: 0px;padding-bottom: 0px;font-size: 14px;font-family: sans-serif;overflow:hidden;white-space:normal;",
},
"childNodes": [],
"id": 52129787,
Expand Down Expand Up @@ -5421,6 +5421,149 @@ exports[`replay/transform transform inputs input - url - https://example.io 1`]
}
`;

exports[`replay/transform transform inputs input gets 0 padding by default but can be overridden 1`] = `
{
"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": 101,
"textContent": "
body {
margin: unset;
}
input, button, select, textarea {
font: inherit;
margin: 0;
padding: 0;
border: 0;
outline: 0;
background: transparent;
}
.input:focus {
outline: none;
}
img {
border-style: none;
}
",
"type": 3,
},
],
"id": 100,
"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": 12359,
"style": "width: 100px;height: 30px;position: fixed;left: 0px;top: 0px;",
"type": "text",
"value": "",
},
"childNodes": [],
"id": 12359,
"tagName": "input",
"type": 2,
},
{
"attributes": {
"data-rrweb-id": 12361,
"style": "width: 100px;height: 30px;position: fixed;left: 0px;top: 0px;padding-left: 16px;padding-right: 16px;",
"type": "text",
"value": "",
},
"childNodes": [],
"id": 12361,
"tagName": "input",
"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 inputs isolated add mutation 1`] = `
{
"data": {
Expand Down
16 changes: 16 additions & 0 deletions ee/frontend/mobile-replay/mobile.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,22 @@ export type MobileStyles = {
* @description maps to CSS font-family. Accepts any valid CSS font-family value.
*/
fontFamily?: string
/**
* @description maps to CSS padding-left. Expects a number (treated as pixels) or a string that is a number followed by px e.g. 16px
*/
paddingLeft?: string | number
/**
* @description maps to CSS padding-right. Expects a number (treated as pixels) or a string that is a number followed by px e.g. 16px
*/
paddingRight?: string | number
/**
* @description maps to CSS padding-top. Expects a number (treated as pixels) or a string that is a number followed by px e.g. 16px
*/
paddingTop?: string | number
/**
* @description maps to CSS padding-bottom. Expects a number (treated as pixels) or a string that is a number followed by px e.g. 16px
*/
paddingBottom?: string | number
}

type wireframeBase = {
Expand Down
16 changes: 16 additions & 0 deletions ee/frontend/mobile-replay/schema/mobile/rr-mobile-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,22 @@
"enum": ["left", "right", "center"],
"type": "string"
},
"paddingBottom": {
"description": "maps to CSS padding-bottom. Expects a number (treated as pixels) or a string that is a number followed by px e.g. 16px",
"type": ["string", "number"]
},
"paddingLeft": {
"description": "maps to CSS padding-left. Expects a number (treated as pixels) or a string that is a number followed by px e.g. 16px",
"type": ["string", "number"]
},
"paddingRight": {
"description": "maps to CSS padding-right. Expects a number (treated as pixels) or a string that is a number followed by px e.g. 16px",
"type": ["string", "number"]
},
"paddingTop": {
"description": "maps to CSS padding-top. Expects a number (treated as pixels) or a string that is a number followed by px e.g. 16px",
"type": ["string", "number"]
},
"verticalAlign": {
"description": "vertical alignment with respect to its parent",
"enum": ["top", "bottom", "center"],
Expand Down
32 changes: 32 additions & 0 deletions ee/frontend/mobile-replay/transform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ describe('replay/transform', () => {
beforeEach(async () => {
posthogEEModule = await posthogEE()
})

test('can process unknown types without error', () => {
expect(
posthogEEModule.mobileReplay?.transformToWeb([
Expand Down Expand Up @@ -535,6 +536,37 @@ describe('replay/transform', () => {
})

describe('inputs', () => {
test('input gets 0 padding by default but can be overridden', () => {
expect(
posthogEEModule.mobileReplay?.transformEventToWeb({
type: 2,
data: {
wireframes: [
{
id: 12359,
width: 100,
height: 30,
type: 'input',
inputType: 'text',
},
{
id: 12361,
width: 100,
height: 30,
type: 'input',
inputType: 'text',
style: {
paddingLeft: '16px',
paddingRight: 16,
},
},
],
},
timestamp: 1,
})
).toMatchSnapshot()
})

test('buttons with nested elements', () => {
expect(
posthogEEModule.mobileReplay?.transformEventToWeb({
Expand Down
15 changes: 15 additions & 0 deletions ee/frontend/mobile-replay/transformer/wireframeStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,24 @@ function makeLayoutStyles(wireframe: wireframe, styleOverride?: StyleOverride):
}`
)
}

if (styleParts.length) {
styleParts.push(`display: flex`)
}

if (isUnitLike(combinedStyles.paddingLeft)) {
styleParts.push(`padding-left: ${ensureUnit(combinedStyles.paddingLeft)}`)
}
if (isUnitLike(combinedStyles.paddingRight)) {
styleParts.push(`padding-right: ${ensureUnit(combinedStyles.paddingRight)}`)
}
if (isUnitLike(combinedStyles.paddingTop)) {
styleParts.push(`padding-top: ${ensureUnit(combinedStyles.paddingTop)}`)
}
if (isUnitLike(combinedStyles.paddingBottom)) {
styleParts.push(`padding-bottom: ${ensureUnit(combinedStyles.paddingBottom)}`)
}

return asStyleString(styleParts)
}

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.
36 changes: 0 additions & 36 deletions frontend/src/lib/components/Support/SupportForm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { IconBug, IconInfo, IconQuestion } from '@posthog/icons'
import {
LemonBanner,
LemonInput,
LemonSegmentedButton,
LemonSegmentedButtonOption,
Expand All @@ -16,7 +15,6 @@ import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonFileInput } from 'lib/lemon-ui/LemonFileInput/LemonFileInput'
import { LemonSelect } from 'lib/lemon-ui/LemonSelect/LemonSelect'
import { LemonTextArea } from 'lib/lemon-ui/LemonTextArea/LemonTextArea'
import posthog from 'posthog-js'
import { useEffect, useRef } from 'react'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { userLogic } from 'scenes/userLogic'
Expand Down Expand Up @@ -97,40 +95,6 @@ export function SupportForm(): JSX.Element | null {
<LemonField name="target_area" label="Topic">
<LemonSelect fullWidth options={TARGET_AREA_TO_NAME} />
</LemonField>
{posthog.getFeatureFlag('show-troubleshooting-docs-in-support-form') === 'test-replay-banner' &&
sendSupportRequest.target_area === 'session_replay' && (
<LemonBanner type="info">
<>
We're pretty proud of our docs. Check out these helpful links:
<ul>
<li>
<Link target="_blank" to="https://posthog.com/docs/session-replay/troubleshooting">
Session replay troubleshooting
</Link>
</li>
<li>
<Link
target="_blank"
to="https://posthog.com/docs/session-replay/how-to-control-which-sessions-you-record"
>
How to control which sessions you record
</Link>
</li>
</ul>
</>
</LemonBanner>
)}
{posthog.getFeatureFlag('show-troubleshooting-docs-in-support-form') === 'test-replay-banner' &&
sendSupportRequest.target_area === 'toolbar' && (
<LemonBanner type="info">
<>
We're pretty proud of our docs.{' '}
<Link target="_blank" to="https://posthog.com/docs/toolbar#troubleshooting-and-faq">
Check out this troubleshooting guide
</Link>
</>
</LemonBanner>
)}
<LemonField
name="message"
label={sendSupportRequest.kind ? SUPPORT_TICKET_KIND_TO_PROMPT[sendSupportRequest.kind] : 'Content'}
Expand Down
10 changes: 8 additions & 2 deletions frontend/src/queries/nodes/InsightViz/Breakdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic'
import { EditorFilterProps } from '~/types'

export function Breakdown({ insightProps }: EditorFilterProps): JSX.Element {
const { breakdownFilter, display, isTrends, isDataWarehouseSeries } = useValues(insightVizDataLogic(insightProps))
const { breakdownFilter, display, isTrends, isSingleSeries, isDataWarehouseSeries } = useValues(
insightVizDataLogic(insightProps)
)
const { updateBreakdownFilter, updateDisplay } = useActions(insightVizDataLogic(insightProps))

return (
Expand All @@ -14,9 +16,13 @@ export function Breakdown({ insightProps }: EditorFilterProps): JSX.Element {
breakdownFilter={breakdownFilter}
display={display}
isTrends={isTrends}
isDataWarehouseSeries={isDataWarehouseSeries}
updateBreakdownFilter={updateBreakdownFilter}
updateDisplay={updateDisplay}
disabledReason={
!isSingleSeries && isDataWarehouseSeries
? 'Breakdowns are not allowed for multiple series types'
: undefined
}
/>
)
}
Loading

0 comments on commit d2cddc2

Please sign in to comment.