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

Adding support for FieldDisplayModes & disabling certain input methods #2187

Merged
merged 2 commits into from
Jul 19, 2024
Merged
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
21 changes: 20 additions & 1 deletion packages/core/src/destination-kit/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ export interface GlobalSetting {
export type FieldTypeName = 'string' | 'text' | 'number' | 'integer' | 'datetime' | 'boolean' | 'password' | 'object'

/** The supported field categories */
type FieldCategory = 'identifier' | 'data' | 'internal' | 'config'
type FieldCategory = 'identifier' | 'data' | 'internal' | 'config' | 'sync'

/** supported input methods when picking values */
type FieldInputMethods = 'literal' | 'variable' | 'function' | 'enrichment' | 'freeform'

/** display modes for a field */
type FieldDisplayMode = 'expanded' | 'normal' | 'collapsed'

/** Properties of an InputField which are involved in creating the generated-types.ts file */
export interface InputFieldJSONSchema {
Expand Down Expand Up @@ -213,6 +219,19 @@ export interface InputField extends InputFieldJSONSchema {
* Determines how the field should be categorized in the UI. This is useful for grouping fields together in the UI.
*/
category?: FieldCategory

/**
* Determines how the field should be displayed in the UI:
* - expanded: Fully visible title and description for detailed information.
* - normal (default): One line field, and title, with description hidden behind a tooltip.
* - collapsed: Fields grouped behind a dropdown
*/
displayMode?: FieldDisplayMode
Copy link
Member

Choose a reason for hiding this comment

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

What's the default? assuming normal? Might be worth it to update the comment to point to the default

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done 💥


/**
* Determines which input methods are disabled for this field. This is useful when you want to restrict variable selection, freeform entry, etc.
*/
disabledInputMethods?: FieldInputMethods[]
}

/** Base interface for conditions */
Expand Down
Loading