[Controls as Code] Use discriminated union#259670
Merged
Heenawter merged 32 commits intoApr 7, 2026
Merged
Conversation
…minated-union_2026-03-25
…heenawter/kibana into controls-discriminated-union_2026-03-25
Contributor
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
Heenawter
commented
Apr 2, 2026
|
|
||
| export const getOptionsListControlFactory = (): EmbeddableFactory< | ||
| OptionsListControlState, | ||
| OptionsListDSLControlState, |
Contributor
Author
davismcphee
approved these changes
Apr 3, 2026
Contributor
davismcphee
left a comment
There was a problem hiding this comment.
Code-only review, Data Discovery changes LGTM 👍
nreese
approved these changes
Apr 3, 2026
Contributor
nreese
left a comment
There was a problem hiding this comment.
kibana-presentation changes LGTM
code review only
Contributor
💔 Build Failed
Failed CI StepsMetrics [docs]Module Count
Async chunks
History
cc @Heenawter |
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
History
cc @Heenawter |
sddonne
approved these changes
Apr 7, 2026
5 tasks
nickpeihl
added a commit
that referenced
this pull request
Apr 8, 2026
…cal Preview (#256302) Fixes #256073 ## Summary Introduces the Dashboard API endpoints as Technical Preview Dashboard API documentation will be published as OpenAPI specifications and available in the [Kibana API Documentation](https://www.elastic.co/docs/api/doc/kibana/). Dashboard API create/update endpoints are initially limited to a select few types including Lens, markdown, synthetics, and SLO panels. Support for additional panel types will be available in future updates. ## OAS documentation To build documentation bundle for public route * Add `server.oas.enabled: true` to `config/kibana.dev.yml` * Run `node scripts/capture_oas_snapshot --include-path /api/dashboards --no-serverless --update` ### Blocked by - [x] #259670 - [x] #259461 - [x] #260040 - [x] #261186 - [x] #260945 --------- Co-authored-by: Nathan Reese <reese.nathan@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Nick Partridge <nicholas.partridge@elastic.co>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #259864
Summary
This PR makes two changes to control schemas.
Rather than having pinned panels be
oneOfan array of control schemas, it instead uses a discriminated union based on thetypeof the control.There are two types of ES|QL controls - static value and query - which are distinguished via the
control_typeattribute. Previously, bothavailable_options(for static value controls) andesql_query(for query controls) were optional parts of the schema - however, to make the schemas clearer, I made them both required but as a discriminated union based oncontrol_type.In other words, a
STATIC_VALUEScontrol requiresavailable_optionsbut will throw ifesql_queryis included and, conversely, aVALUES_FROM_QUERYcontrol requires anesql_querybut will throw ifavailable_optionsis included.Checklist
release_note:*label is applied per the guidelinesbackport:*labels.