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 4 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
54 changes: 54 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,60 @@ 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
value?: 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
value: string
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
label: string
pauldambra marked this conversation as resolved.
Show resolved Hide resolved
}

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