* 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
Backport #72078 is failing because of the type check because `observer.name` is not defined. Not sure why this wasn't a problem on master, but adding it here so I can include it.
* make hyper parameters one word
* update analytics job types help text
* update job type text
* ensure long description has word break to prevent overflow
* [Maps] fix notifying user about losing unsaved changes when navigating away from map
* clean up
* tslint fixes
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Starting with 7.9.0 we will be dropping support for IE11. Updating the
config to reflect this should minimize the bundle sizes.
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
* add checkIndexExists endpoint wrapping field_caps
* replace indexNames with checkIndexExists check
* update translations
* show error toast on index check fail
* add new route to api doc
* [ML] Fix job list crashing due to undefined processed records
* [ML] Add explicit undefined check
* [ML] Add check to toLocaleString and update test
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Add a task to gather transasctions telemetry as described in #71593.
Also:
* Fix typo in mapping for country code mapping
* Add back `mergeTelemetryMapping` function to fix broken `upload-telemetry-data` script.
* show empty state when has data returns false
* adding return type
* addressing pr comments
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* rename float to discrete
* use same section title level on all source files
* Elasticsearch => {es}
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This PR removes the validation of `total_by_field_count` for categorization jobs because the number of detected categories is not necessarily stable across analytics changes.
resolves https://github.com/elastic/kibana/issues/70086
Configures the saved object client for the event log to access the recently
hidden action and alert saved objects.
We didn't have tests for action/alert event log activity, so added some now.
Also found a buglet that was preventing access to event log data from actions
and alerts in non-default spaces.