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
Changes from 1 commit
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
51 changes: 51 additions & 0 deletions ee/frontend/mobile-replay/mobile.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,57 @@ 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
}

export type wireframeRadio = wireframeInputBase & {
inputType: 'radio'
checked: string
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
/**
* @description to keep the transformer stateless we don't send each radio separately with a group name. Group name in the generated HTML will be a UUID tying each of these values together
*/
values: string[]
}

export type wireframeInput = wireframeInputBase & {
inputType: 'text' | 'password' | 'email' | 'number' | 'search' | 'tel' | 'url'
value: string
pauldambra marked this conversation as resolved.
Show resolved Hide resolved
}

export type wireframeSelect = wireframeInputBase & {
inputType: 'select'
value: string
pauldambra marked this conversation as resolved.
Show resolved Hide resolved
options: string[]
pauldambra marked this conversation as resolved.
Show resolved Hide resolved
}

export type wireframeTextArea = wireframeInputBase & {
inputType: 'textarea'
value: string
pauldambra marked this conversation as resolved.
Show resolved Hide resolved
}

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 wireframeInputComponent =
| wireframeCheckBox
| wireframeRadio
| wireframeInput
| wireframeSelect
| wireframeTextArea
| wireframeButton

export type wireframeText = wireframeBase & {
type: 'text'
text: string
Expand Down
Loading