## Issue
Fixes#137435
Reason formatter was not when working correctly in case of threshold alerts. In an ideal scenario, if threshold alert is grouped by a field, say `user.name` then that field should be available in the reason message.
It was missing as per the bug.
## Solution
For threshold alerts, `mergedDoc` in results in a different shape of object where the fields are contained in `_source` key instead of `fields` key. This was corrected so that if `fields` key is not available in the `mergedDoc`, `_source` will act as the fallback key.
### Checklist
Delete any items that are not applicable to this PR.
- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
### For maintainers
- [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
(cherry picked from commit ac0635bd9d)
Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
* Update discover and canvas tests
* Add length
* Update rule name to have no spaces
* Fix calling function
* Try to close tooltip
* Fix rules spinner
* Move toggleLayerVisibility to gis_page
* Add wait for layers to load
* Remove unused declaration
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 99695135d9)
Co-authored-by: liza-mae <liza-mae@users.noreply.github.com>
* Fix console test on cloud
* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'
* Fix access to sample data
* Clean up access after test
* Fix restore test
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit a9a1828a23)
Co-authored-by: liza-mae <liza-mae@users.noreply.github.com>
* Fix axis auto assigment
* Simplify auto assignment logic + add new unit tests for that
Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 8dfba64acb)
Co-authored-by: Uladzislau Lasitsa <vlad.lasitsa@gmail.com>
## Summary
Addresses issue #138231
There's a bit of a race condition happening between data views/index patterns. When a rule has a data view defined, we really shouldn't be making calls to fetch the default index patterns which is what had started happening here, however then once the data view id was defined, the fetch index was cut short but the `useFetchIndex` hook never reset to loading `false`, hence the perpetual loading state. That initial call should be avoided all together so that's what this change does. There's still a little funkiness in the code here that I'd like to look at during our work in 8.5.
(cherry picked from commit cb8cf84720)
Co-authored-by: Yara Tercero <yctercero@users.noreply.github.com>
* updated field names for Orchestrator Accordion on details panel
* eslint auto-fix
* addressing PR comments
* addressing more comments
(cherry picked from commit a630dafae4)
Co-authored-by: Rickyanto Ang <rickyangwyn@gmail.com>
* Added an EnterpriseSearchProvider to propagate access data
Co-authored-by: Brian McGue <mcgue.brian@gmail.com>
Co-authored-by: Rodney Norris <rodney.norris@elastic.co>
* Move productAccess into KibanaLogic
* Fix PageTemplate tests
* Add tests for access based navigation
* Push useValues for productAccess down into useEnterpriseSearchNav
Co-authored-by: Brian McGue <mcgue.brian@gmail.com>
Co-authored-by: Rodney Norris <rodney.norris@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit c7ee95079c)
Co-authored-by: James Rucker <james.rucker@elastic.co>
The new proxy tests added can test a variety of different proxy
and target server configurations, however many of those tests
are broken with our current proxy agents. Hopefully to be fixed
by replacing with hpagent instead. In the meantime, we wanted to
get the basic test framework in as well.
In addition to tests, the stand-alone forward proxy has been
enhanced to use a better proxy server, `proxy`. The existing
proxy server `http-proxy` does not support HTTPS out of the box,
and so any HTTPS testing with it is going to be a little sketchy.
Using the stand-alone forward proxy, I was able to post to Slack
through http/https proxies with and without auth, with
proxyRequestUnauthorized set to false. Which shows the existing
proxy agents do work in _some_ environments.
(cherry picked from commit 9631649e72)
Co-authored-by: Patrick Mueller <patrick.mueller@elastic.co>
* Fix page template loader conditions to trigger on page load
This commit adds a new flag to check if we are on the page load to
adjust the load conditions. In combination with isInitialRequest it is
used to set the loading states of the page including the search bar.
* Review suggestions
(cherry picked from commit 53cc0cc226)
Co-authored-by: Efe Gürkan YALAMAN <efeguerkan.yalaman@elastic.co>
* Bump saved objects index fields limit to 1.5k
* Update src/core/server/saved_objects/migrations/actions/create_index.ts
Link to issue which is causing us to require an @ts-expect-error comment
(cherry picked from commit 430e2880df)
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
Also stringify the query while passing to the search api.
(cherry picked from commit 4bc142f4a3)
Co-authored-by: Efe Gürkan YALAMAN <efeguerkan.yalaman@elastic.co>
* Add override pattern for fetch_indices
* Add tests for fetch_indices override pattern
* Include only aliases.
* Add negative check to the tests and added some comments
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 64c1d3cb2b)
Co-authored-by: Efe Gürkan YALAMAN <efeguerkan.yalaman@elastic.co>
* [Lens] metric visualization functional tests (#137731)
(cherry picked from commit c9f160b4db)
* clear input before typing new color
* wait for filter retries
Co-authored-by: Andrew Tate <andrew.tate@elastic.co>
* Update copy for test now functionality on private locations.
* Update copy based on PR feedback.
(cherry picked from commit e7772b1feb)
Co-authored-by: Justin Kambic <jk@elastic.co>
* Normalize the selected event with expandDottedObject to improve panel display
* Remove debugging tsconfig change
(cherry picked from commit 1f57ee2c9c)
Co-authored-by: Kevin Qualters <56408403+kqualters-elastic@users.noreply.github.com>
This PR adds initial support for automated ResponseOps docs screenshots and takes the first three screenshots.
(cherry picked from commit 6d1f3dff2c)
Co-authored-by: Robert Oskamp <robert.oskamp@elastic.co>