* Fix typo in ML Job toggle state
We were passing the wrong argument in to this predicate function,
meaning that the job not correctly shown as loading if it's data feed
was loading.
* Refresh ML Popover after job has been toggled
Previously, toggling a job would put the component into a permanent
loading state. Now we wait for the callback to resolve before updating
the component's loading state, and once the job itself is updated the
reset will rerender as necessary.
* Rename folder for consistency
* Export our function as its common alias
Until we need to distinguish between different types of tracking, the
extra qualifiers on the name aren't really necessary.
* Add telemetry middleware for redux
Rather than adding lots of tracking calls throughout the app, this
allows us to track specific events as redux sees them, regardless of
their source.
* Track a timeline being saved
Whether this happens due to a new timeline or an update, this metric
signifies a timeline having been persisted to the user's index.
* Move 'timeline opened' tracking into middleware
* Only track timeline opening when we truly open it
This action fires for both opening and closing, which is not quite the
logic we need. This refactors the middleware to leverage
typescript-fsa to type these actions' payloads, allowing us to inspect
them. Hopefully we won't have to do this often.
* Track when a timeline name is modified
In the future we can fire the title as it's part of the payload, but for
now we can only say "someone changed the name of their timeline."
* Initialize telemetry in an NP-friendly way
With the previous solution, we were invoking createUiStatsReporter,
which pulls modules from ui/new_platform, in the module scope. Since
only a few components used this module, it was mostly fine.
However, with our new telemetry middleware the redux setup itself also
referenced this file, and thus indirectly ui/new_platform. This lead to
hundreds of tests breaking, as any test that loaded a module from the
store folder (actions, etc.) without also mocking ui/new_platform would
blow up when those modules were undefined.
Instead of adding hundreds of `jest.mock` calls and deferring the issue,
this creates a singleton module that is initialized during our plugin's
setup and can then be freely imported by any module thereafter.
Also throws an error in case this singleton gets misused; we should only
be initializing telemetry once, during plugin setup.
* Track when rules are enabled or disabled
* Update type of incoming function prop
This is always given an async method, currently, and we should type it
as such because we're now leveraging that fact with an await.
* Guard against errors from our telemetry calls
This ensures that we always have a tracking function so as to prevent
errors at the call sites. Also guards against errors during either setup
or from the underlying telemetry call.
Fixes loading influencers, charts and anomaly table if view-by selection is job ID and cells in the overall swimlanes are selected.
Previously, the check to return the job ids to filter on for the query would return the wrong value for a selection in the overall swimlane. This PR move the wrong and redundant code to a fixed util function getSelectionJobIds().
* Hide ML Popover when SIEM index DNE
* Hide timeline when SIEM has no data
In cases where there's nothing to inspect (i.e. the user hasn't
populated data), we don't want to show them the mostly inert timeline.
* Update snapshot for header
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Fix skipped alerting UI tests
* Fix switch click to use new pageobject function
* Use .click function directly instead of find then click
* Merge state variables into one for alerts and alert types
* Fix flaky tests by fixing react code
* Could this be it?? The one thing missing that caused all this flakiness??
* Cleanup convertAlertsToTableItems function
* Remove I from interface names, fix disabled boolean logic
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [Uptime] Expand timespan range to fix missing data in UI
With a short timespan range of 10s as originally here we can miss data
in the case of long refresh intervals in ES or other delays in data
coming from heartbeat to ES. If data is more than 10s stale we show
empty screens. Expanding this to 5m provides most of the performance
benefits and also quite a bit of safety in terms of delays. It lets
users query very large timespans (say a year), and still only really
query 5m of data, keeping the general purpose of this perf enhancement
going.
* Remove unnecessary complexity
* Revert "Remove unnecessary complexity"
This reverts commit 97c74804f4.
* Check for data rather than field
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This addresses two issues that have come up:
Alerting and Actions have TypeScript types that are needed across server and public plugins, and need to be extracted to a common path (thanks @chrisronline for bringing this to our attention)
Due to the above, types have been duplicated between the alerting and actions when needed in the Alerting UI, which has led to them diverging. This forces the UI to type check against the API, which will help reduce these errors in the future.
* Disallow importing Joi client side
* Move elasticsearch lib into server folder
* Add a comment about the 'joi' eslint rule
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Fixes the view-by selection when a KQL filter gets active and restores previous behavior:
- If the filter includes AND view-by switches to Job ID.
- Otherwise the view-by selection switches to the first available option present in the KQL filter
- Additionally, the view-by dropdown options get filtered down to the options present in the KQL filter
Fixes the check whether to do a full refresh of the page or not. lastRefresh was mistakenly part of the check. This fixes keeping the flyout open for rules editing.
The search markers where placed on the minimap using a different scale
than the density chart and time ruler. That made the log stream jump to
unexpected time positions when the user clicked on a search marker.
This also fixes an problem where the search markers didn't move
alongside the rest of the minimap when the user dragged and dropped it.
* DocViews uses local angular
* Clean up
* Create embeddableInjector only when it's used
* Revert occasional changes
* Update unit test
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Default sort is no longer in state. There's now a separate function to provide default sort for ES and UI, in case the user didn't actively select a field to sort by
* More Typescript Fixes
* [Reporting/New Platform] Use the logger service from core
* Add log tag
* fix jest tests
* ts fixes
* fix mocha test
* convert to jest