-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Ingest] Data source configuration validation UI #61180
Conversation
Pinging @elastic/ingest-management (Feature:Fleet) |
Thanks for thinking through this Jen! I put together a mockup with notes to show validation errors in a variety of states (expanded/collapsed). Please note that the input and stream's advanced options toggle should always expand to show the invalid form field when the user submits the form. Also note, the mockup uses the latest design / layout, but you should just focus on the validation aspects, and don't worry matching the overall design. You can view the mockup here in Figma: https://www.figma.com/file/0IiPRxG8NKuLYjIJDn9Nuk/Ingest-Manager-Screens?node-id=1828%3A104574 One small thing I noticed. If you collapse an advanced option which has an invalid input, it doesn't appear as invalid when you expand the advanced options again. Would it be possible to validate the form field when advanced options is expanded so that invalid form fields are highlighted? I noticed this behavior only happens when you haven't submitted the form yet. |
* Returns validation information for a given datasource configuration and package info | ||
* Note: this method assumes that `datasource` is correctly structured for the given package | ||
*/ | ||
export const validateDatasource = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function seems a good candidate for a test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a validate_datasource.test.ts
file (github doesn't expand that file diff automatically 😄)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
@hbharding FYI I'm merging this PR now as-is to unblock downstream PRs, I'll make the visual changes you mocked up in a subsequent PR. Thanks! |
* Initial pass at datasource configuration validation * Show error icon and red text at input and stream levels * Add tests, fix bugs in validation method * Fix typings
…chore/put-all-xjson-together * 'master' of github.com:elastic/kibana: (35 commits) [SIEM] [Detection Engine] Fixes bug when notification doesn't… (elastic#63013) [SIEM][Detection Engine] Fix rule notification critical bugs Add Error Exception Type Column (elastic#59596) [APM] Agent remote configuration: changes in Java property descriptions (elastic#62282) [Alerting] Displays warning when a permanent encryption key is missing and hides alerting UI appropriately (elastic#62772) FTR: add chromium-based Edge browser support (elastic#61684) [Ingest] Data source configuration validation UI (elastic#61180) restore empty_kibana after saved objects test (elastic#62951) Index pattern management plugin - src/legacy/core_plugins/management => new platform plugin (elastic#62594) Add basic StatusService (elastic#60335) [kbn/optimizer] link to kibanaReact/kibanaUtils plugins (elastic#62720) [APM] Service map - fixes layout issues for maps with no rum services (elastic#62887) Exclude disabled datasources and streams from agent config (elastic#62869) [Alerting] Fix validation support for nested IErrorObjects (elastic#62833) [Metrics UI] Invalidate non-count alerts which have no metrics (elastic#62837) Add --filter option to API docs script (elastic#62888) [Maps] fix attribution overflow with exit full screen button (elastic#62699) [Uptime]Alerting UI text in case filter is selected (elastic#62570) [Maps] Show create filter button for top-term tooltip property (elastic#62461) skip flaky suite (elastic#59030) ... # Conflicts: # src/plugins/es_ui_shared/public/index.ts
* master: (40 commits) [ML] Functional transform tests - stabilize source selection (elastic#63087) add embed flag to saved object url as well (elastic#62926) [SIEM] [Detection Engine] Fixes bug when notification doesn't… (elastic#63013) [SIEM][Detection Engine] Fix rule notification critical bugs Add Error Exception Type Column (elastic#59596) [APM] Agent remote configuration: changes in Java property descriptions (elastic#62282) [Alerting] Displays warning when a permanent encryption key is missing and hides alerting UI appropriately (elastic#62772) FTR: add chromium-based Edge browser support (elastic#61684) [Ingest] Data source configuration validation UI (elastic#61180) restore empty_kibana after saved objects test (elastic#62951) Index pattern management plugin - src/legacy/core_plugins/management => new platform plugin (elastic#62594) Add basic StatusService (elastic#60335) [kbn/optimizer] link to kibanaReact/kibanaUtils plugins (elastic#62720) [APM] Service map - fixes layout issues for maps with no rum services (elastic#62887) Exclude disabled datasources and streams from agent config (elastic#62869) [Alerting] Fix validation support for nested IErrorObjects (elastic#62833) [Metrics UI] Invalidate non-count alerts which have no metrics (elastic#62837) Add --filter option to API docs script (elastic#62888) [Maps] fix attribution overflow with exit full screen button (elastic#62699) [Uptime]Alerting UI text in case filter is selected (elastic#62570) ...
Resolves #60446
Summary
This PR adds validation to data source configuration UI. It validates:
type
,required
,multi
)Unit tests for the validation methods are included in this PR.
UI behavior
onBlur
(aka field dirty/touched state)More screenshots
Expand me!
.
Required fields validation:
YAML field validation:
If user clicks Continue with invalid fields, a callout is displayed above the button, and the panels that need fixing are highlighted: