Skip to content

Commit

Permalink
Merge branch 'master' into chore/hogql-retention
Browse files Browse the repository at this point in the history
# Conflicts:
#	frontend/__snapshots__/scenes-app-sidepanels--side-panel-settings.png
  • Loading branch information
webjunkie committed Dec 6, 2023
2 parents 8ec4112 + 23053e1 commit 55a8199
Show file tree
Hide file tree
Showing 28 changed files with 2,461 additions and 94 deletions.
1,656 changes: 1,656 additions & 0 deletions ee/frontend/mobile-replay/__snapshots__/transform.test.ts.snap

Large diffs are not rendered by default.

31 changes: 22 additions & 9 deletions ee/frontend/mobile-replay/mobile.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export type serializedNodeWithId = serializedNode & { id: number }

// end copied section

export type MobileNodeType = 'text' | 'image' | 'rectangle' | 'div'
export type MobileNodeType = 'text' | 'image' | 'rectangle' | 'input' | 'div' | 'radio_group'

export type MobileStyles = {
/**
Expand Down Expand Up @@ -124,21 +124,30 @@ type wireframeBase = {

export type wireframeInputBase = wireframeBase & {
type: 'input'
/**
* @description for several attributes we technically only care about true or absent as values. They are represented as bare attributes in HTML <input disabled>. When true that attribute is added to the HTML element, when absent that attribute is not added to the HTML element. When false or absent they are not added to the element.
*/
disabled: boolean
}

export type wireframeCheckBox = wireframeInputBase & {
inputType: 'checkbox'
/**
* @description for several attributes we technically only care about true or absent as values. They are represented as bare attributes in HTML <input checked>. When true that attribute is added to the HTML element, when absent that attribute is not added to the HTML element. When false or absent they are not added to the element.
*/
checked: boolean
label?: string
}

export type wireframeRadioGroup = wireframeBase & {
groupName: string
type: 'radio_group'
}

export type wireframeRadio = wireframeInputBase & {
inputType: 'radio'
/**
* @description for several attributes we technically only care about true or absent as values. They are represented as bare attributes in HTML <input checked>. When true that attribute is added to the HTML element, when absent that attribute is not added to the HTML element. When false or absent they are not added to the element.
*/
checked: boolean
label?: string
}
Expand All @@ -155,7 +164,7 @@ export type wireframeSelect = wireframeInputBase & {
}

export type wireframeTextArea = wireframeInputBase & {
inputType: 'textarea'
inputType: 'text_area'
value?: string
}

Expand All @@ -167,6 +176,15 @@ export type wireframeButton = wireframeInputBase & {
value?: string
}

// these are grouped as a type so that we can easily use them as function parameters
export type wireframeInputComponent =
| wireframeCheckBox
| wireframeRadio
| wireframeInput
| wireframeSelect
| wireframeTextArea
| wireframeButton

export type wireframeText = wireframeBase & {
type: 'text'
text: string
Expand Down Expand Up @@ -196,13 +214,8 @@ export type wireframe =
| wireframeImage
| wireframeRectangle
| wireframeDiv
| wireframeCheckBox
| wireframeInputComponent
| wireframeRadioGroup
| wireframeRadio
| wireframeInput
| wireframeSelect
| wireframeTextArea
| wireframeButton

// the rrweb full snapshot event type, but it contains wireframes not html
export type fullSnapshotEvent = {
Expand Down
56 changes: 34 additions & 22 deletions ee/frontend/mobile-replay/schema/mobile/rr-mobile-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"type": "number"
},
"MobileNodeType": {
"enum": ["text", "image", "rectangle", "div"],
"enum": ["text", "image", "rectangle", "input", "div", "radio_group"],
"type": "string"
},
"MobileStyles": {
Expand Down Expand Up @@ -201,25 +201,10 @@
"$ref": "#/definitions/wireframeDiv"
},
{
"$ref": "#/definitions/wireframeCheckBox"
"$ref": "#/definitions/wireframeInputComponent"
},
{
"$ref": "#/definitions/wireframeRadioGroup"
},
{
"$ref": "#/definitions/wireframeRadio"
},
{
"$ref": "#/definitions/wireframeInput"
},
{
"$ref": "#/definitions/wireframeSelect"
},
{
"$ref": "#/definitions/wireframeTextArea"
},
{
"$ref": "#/definitions/wireframeButton"
}
]
},
Expand All @@ -233,6 +218,7 @@
"type": "array"
},
"disabled": {
"description": "for several attributes we technically only care about true or absent as values. They are represented as bare attributes in HTML <input disabled>. When true that attribute is added to the HTML element, when absent that attribute is not added to the HTML element. When false or absent they are not added to the element.",
"type": "boolean"
},
"height": {
Expand Down Expand Up @@ -273,6 +259,7 @@
"additionalProperties": false,
"properties": {
"checked": {
"description": "for several attributes we technically only care about true or absent as values. They are represented as bare attributes in HTML <input checked>. When true that attribute is added to the HTML element, when absent that attribute is not added to the HTML element. When false or absent they are not added to the element.",
"type": "boolean"
},
"childWireframes": {
Expand All @@ -282,6 +269,7 @@
"type": "array"
},
"disabled": {
"description": "for several attributes we technically only care about true or absent as values. They are represented as bare attributes in HTML <input disabled>. When true that attribute is added to the HTML element, when absent that attribute is not added to the HTML element. When false or absent they are not added to the element.",
"type": "boolean"
},
"height": {
Expand Down Expand Up @@ -401,6 +389,7 @@
"type": "array"
},
"disabled": {
"description": "for several attributes we technically only care about true or absent as values. They are represented as bare attributes in HTML <input disabled>. When true that attribute is added to the HTML element, when absent that attribute is not added to the HTML element. When false or absent they are not added to the element.",
"type": "boolean"
},
"height": {
Expand Down Expand Up @@ -436,10 +425,33 @@
"required": ["disabled", "height", "id", "inputType", "type", "width", "x", "y"],
"type": "object"
},
"wireframeInputComponent": {
"anyOf": [
{
"$ref": "#/definitions/wireframeCheckBox"
},
{
"$ref": "#/definitions/wireframeRadio"
},
{
"$ref": "#/definitions/wireframeInput"
},
{
"$ref": "#/definitions/wireframeSelect"
},
{
"$ref": "#/definitions/wireframeTextArea"
},
{
"$ref": "#/definitions/wireframeButton"
}
]
},
"wireframeRadio": {
"additionalProperties": false,
"properties": {
"checked": {
"description": "for several attributes we technically only care about true or absent as values. They are represented as bare attributes in HTML <input checked>. When true that attribute is added to the HTML element, when absent that attribute is not added to the HTML element. When false or absent they are not added to the element.",
"type": "boolean"
},
"childWireframes": {
Expand All @@ -449,6 +461,7 @@
"type": "array"
},
"disabled": {
"description": "for several attributes we technically only care about true or absent as values. They are represented as bare attributes in HTML <input disabled>. When true that attribute is added to the HTML element, when absent that attribute is not added to the HTML element. When false or absent they are not added to the element.",
"type": "boolean"
},
"height": {
Expand Down Expand Up @@ -493,9 +506,6 @@
},
"type": "array"
},
"groupName": {
"type": "string"
},
"height": {
"type": "number"
},
Expand All @@ -519,7 +529,7 @@
"type": "number"
}
},
"required": ["groupName", "height", "id", "type", "width", "x", "y"],
"required": ["height", "id", "type", "width", "x", "y"],
"type": "object"
},
"wireframeRectangle": {
Expand Down Expand Up @@ -567,6 +577,7 @@
"type": "array"
},
"disabled": {
"description": "for several attributes we technically only care about true or absent as values. They are represented as bare attributes in HTML <input disabled>. When true that attribute is added to the HTML element, when absent that attribute is not added to the HTML element. When false or absent they are not added to the element.",
"type": "boolean"
},
"height": {
Expand Down Expand Up @@ -656,6 +667,7 @@
"type": "array"
},
"disabled": {
"description": "for several attributes we technically only care about true or absent as values. They are represented as bare attributes in HTML <input disabled>. When true that attribute is added to the HTML element, when absent that attribute is not added to the HTML element. When false or absent they are not added to the element.",
"type": "boolean"
},
"height": {
Expand All @@ -665,7 +677,7 @@
"type": "number"
},
"inputType": {
"const": "textarea",
"const": "text_area",
"type": "string"
},
"style": {
Expand Down
Loading

0 comments on commit 55a8199

Please sign in to comment.