Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add interaction components to schema #19040

Merged
merged 16 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 57 additions & 1 deletion ee/frontend/mobile-replay/mobile.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,51 @@ type wireframeBase = {
style?: MobileStyles
}

export type wireframeInputBase = wireframeBase & {
type: 'input'
disabled: boolean
}

export type wireframeCheckBox = wireframeInputBase & {
inputType: 'checkbox'
checked: boolean
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
label?: string
}

export type wireframeRadioGroup = wireframeBase & {
groupName: string
Copy link
Member Author

@pauldambra pauldambra Dec 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
groupName: string
type: 'radio group'

@marandaneto is there any value to the App to specify this group name? Otherwise I can pass a UUID to all children radios...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could set the viewId similarly to how it's generated for any other component, but we don't have such groupName on Android.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let's leave it out... easier to add than to remove 👍

}

export type wireframeRadio = wireframeInputBase & {
inputType: 'radio'
checked: boolean
label?: string
}

export type wireframeInput = wireframeInputBase & {
inputType: 'text' | 'password' | 'email' | 'number' | 'search' | 'tel' | 'url'
value?: string
}

export type wireframeSelect = wireframeInputBase & {
inputType: 'select'
value?: string
options?: string[]
}

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

export type wireframeButton = wireframeInputBase & {
inputType: 'button'
/**
* @description this is the text that is displayed on the button, if not sent then you must send childNodes with the button content
*/
value?: string
}

export type wireframeText = wireframeBase & {
type: 'text'
text: string
Expand All @@ -146,7 +191,18 @@ export type wireframeDiv = wireframeBase & {
type: 'div'
}

export type wireframe = wireframeText | wireframeImage | wireframeRectangle | wireframeDiv
export type wireframe =
| wireframeText
| wireframeImage
| wireframeRectangle
| wireframeDiv
| wireframeCheckBox
| wireframeRadioGroup
| wireframeRadio
| wireframeInput
| wireframeSelect
| wireframeTextArea
| wireframeButton

// the rrweb full snapshot event type, but it contains wireframes not html
export type fullSnapshotEvent = {
Expand Down
Loading
Loading