Skip to content

[7.x] [Logs UI] log rate setup index validation (#50008)#51614

Merged
afgomez merged 2 commits intoelastic:7.xfrom
afgomez:backport/7.x/pr-50008
Nov 26, 2019
Merged

[7.x] [Logs UI] log rate setup index validation (#50008)#51614
afgomez merged 2 commits intoelastic:7.xfrom
afgomez:backport/7.x/pr-50008

Conversation

@afgomez
Copy link
Copy Markdown
Contributor

@afgomez afgomez commented Nov 25, 2019

Backports the following commits to 7.x:

* Scaffold API endpoint

* Implement the API endpoint

* Implement API client

* Set error messages in `useAnalysisSetupState`

* Show validation errors next to the submit button

* Check for setup errors regarding the selected indexes

* Call validation only once

Enrich the `availableIndices` array with validation information to show
it later in the form.

* Ensure validation runs before showing the indices

* Adjust naming conventions

- Replace `index_pattern` with `indices`, since it means something
  different in kibana.
- Group validation actions under the `validation` namespace.

* Move index error messages to the `InitialConfigurationStep`

* Move error messages to the UI layer

* Move validation call to `useAnalysisSetupState`

* Pass timestamp as a parameter of `useAnalysisSetupState`

* Fix regression with the index names in the API response

* Use `_field_caps` api

* s/timestamp/timestampField/g

* Tweak error messages

* Move `ValidationIndicesUIError` to `log_analysis_setup_state`

* Track validation status

It's safer to rely on the state of the promise instead of treating an
empty array as "loading"

* Handle network errors

* Use individual `<EuiCheckbox />` elements for the indices

This allows to disable individual checkboxes

* Pass the whole `validatedIndices` array to the inner objects

This will make easier to determine which indeces have errors in the
checkbox list itself and simplify the state we keep track of.

* Disable indices with errors

Show a tooltip above the disabled index to explain why it cannot be
selected.

* Pass indices to the API as an array

* Show overlay while the validation loads

* Wrap tooltips on a `block` element

Prevents the checkboxes from collapsing on the same line

* Use the right dependencies for `useEffect => validateIndices()`

* Restore formatter function name

* Simplify mapping of selected indices to errors

* s/checked/isSelected/g

* Make errors field-generic

* Allow multiple errors per index

* Simplify code a bit
@afgomez afgomez added the backport This PR is a backport of another PR label Nov 25, 2019
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@afgomez
Copy link
Copy Markdown
Contributor Author

afgomez commented Nov 26, 2019

@elasticmachine update branch

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@afgomez afgomez merged commit a47a4b3 into elastic:7.x Nov 26, 2019
@afgomez afgomez deleted the backport/7.x/pr-50008 branch November 26, 2019 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants