## Summary
This PR addresses two issues in the builder:
- **Existing behavior:** if you add a bunch of entries then delete all but one, the indent that shows for when multiple entries exists does not go away
- **Updated behavior:** if you add a bunch of entries and delete all but one, the indent that shows for when multiple entries exist goes away
- **Existing behavior:** on render of add exception modal, if no exception items exist (or no exception items with entries exist) an `Add Exception` button appears
- **Updated behavior:** if only one entry exists, the delete button is disabled for that entry; on initial render of the add exception modal, if no entries exist, an empty entry is shown
* Add a few asciidoc readmes
* add updated code-exploration. Need to fix the script in another go to add asciidoc support. The snippet didn't show up anyway.
* save kibana installation references after other updates have completed to avoid conflict error
* unskip tests
* uncomment out line
* add back await to not change things
* unskip fleet_unenroll_agent
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This removes an unnecessary JSON encoding step of values before they are passed to the field column component used in the log entry example rows in both the Anomalies and Categories tabs.
* Add new hook to wrap the toasts service
When receiving error responses from our APIs, this gives us better toast
messages.
* Replace useToasts with useAppToasts in trivial case
* WIP: prevent infinite polling when server is unresponsive
The crux of this issue was that we had no steady state when the server
returned a non-API error (!isApiError), as it would if the server was
throwing 500s or just generally misbehaving.
The solution, then, is to addresse these non-API errors in our
underlying useListsIndex and useListsPrivileges hooks.
This also refactors those hooks to:
* collapse multiple error states into one (that's all we currently need)
* use useAppToasts for better UI
TODO: I don't think I need the changes in useListsConfig's useEffect.
* Slightly more legible variables
The only task in this hook is our readPrivileges task right now, so I'm
shortening the variable until we have a need to disambiguate it further.
* Remove unnecessary conditions around creating our index
If the index hook has an error needsIndex will not be true.
* Better toast errors for Kibana API errors
Our isApiError predicate does not work for errors coming back from
Kibana platform itself, e.g. for a request payload error.
I've added a separate predicate for that case, isKibanaError, and then a
wrapping isAppError predicate since most of our use cases just care
about error.body.message, which is common to both.
* Use new toasts hook on our exceptions modals
This fixes two issues:
* toast appears above modal overlay
* Error message from response is now presented in the toast
* Fix bug with toasts dependencies
Because of the way some of the exception modal's hooks are written, a
change to one of its callbacks means that the request will be canceled.
Because the toasts service exports instance methods, the context within
the function (and thus the function itself) can change leading to a
mutable ref.
Because we don't want/need this behavior, we store our exported
functions in refs to 'freeze' them for react.
With our bound functions, we should now be able to declare e.g.
`toast.addError` as a dependency, however react cannot determine that it
is bound (and thus that toast.addError() is equivalent to addError()),
and so we must destructure our functions in order to use them as
dependencies.
* Alert clipboard toasts through new Toasts service
This fixes the z-index issue between modals and toasts.
* Fix type errors
* Mock external dependency
These tests now call out to the Notifications service (in a context)
instead of our redux implementation.
* Move isThresholdRule predicate into our common folder
This is very similar to isMlRule, which is already used extensively and
lives at this level.
* Disable endpoint association checkbox for ML and Threshold rules
The fullWidth and isDisabled props were not used; what we want is
disabled.
* Fix react warning about nesting buttons
This removes the AdvancedSettingsAccordion in favor of a plain
EuiAccordion with buttonContent, as that seems to be all that's needed
here.
* Disable Exceptions tab on Details for ML or Threshold rules
These rule types do not currently support exceptions.
* Fix type error
Unused import
* Overview Alerts Histogram stacking defaults to signal.rule.name
Since this is now the default for all AlertsHistograms, I've moved this
default upstream into the histogram itself.
* Replace magic strings with our constant ENDPOINT_LIST_ID
Also replaced a few unintentional uses of this string with the
non-reserved 'endpoint_list_id'.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Ensure getColors selector modifies and returns the same object
* Call onSourceConfigChange on CreateSourceEditor mount
* Back out selector update
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [Maps] typescript vector style phase 1
* tslint
* unify Ordinal and Categorical field meta since they are mixed in real data
* field formatter type
* review feedback
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
* Adds the createEndpointListSchema to the create_endpoint_list_route for API boundary checks
* Adds unit tests to the requests
* Fixes a few bugs found in the find endpoints for types
* Fixes or deletes the skipped tests
* Updated TODO blocks and removed ones that are obsolete
### Checklist
Delete any items that are not applicable to this PR.
- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios