## Summary
Before https://github.com/elastic/kibana/pull/160691 was merged, the
filter builder depth of 1 was the same as 0, and so I mistakenly had
this value set to 2. With it set to 2, it's possible to create a filter
with top level AND and 2 levels of nesting that will cause the designed
for only 1 level of nesting data provider code to throw a run time
error. Setting this to the now working level of 1 prevents that.
## Summary
### Problem
The `HeaderLogo` being used by Kibana's nav isn't actually using the
`<EuiHeaderLogo>` component, it's instead a completely custom logo that
happens to bogart `EuiHeaderLogo`'s CSS styles. When `EuiHeaderLogo` was
recently converted from Sass to Emotion, any styles attached to that CSS
completely disappeared, hence the misaligned appearance below:
### Before
<img width="432" alt=""
src="f28e870c-e407-4c8b-b144-dd65fb27708d">
### After
<img width="443" alt=""
src="8c3ab23d-f942-4473-b7d5-c8c558933eb9">
### Solution
I opted to resolve the bug with the following interim steps:
1. Remove the `euiHeaderLogo` className - it isn't doing anything, and
this isn't an EuiHeaderLogo, so it might as well go
2. Add a `chrHeaderLogo` className (based on the className of a nearby
child element) and reinstate the most relevant CSS (flex alignment and
layout) needed to restore the logo visual behavior
Long-term, fixing `HeaderLogo` to use `EuiHeaderLogo` (this will require
updating `EuiHeaderLogo` to facilitate loading behavior and non-text
children) is probably the better solution, instead of making Kibana use
its own custom logo component.
### Checklist
- [x] Snapshots ~[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
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
Part of https://github.com/elastic/kibana/issues/159342.
In this PR, I'm preparing the non-alerting (rule types) response ops
task types for serverless by defining an explicit task state schema.
This schema is used to validate the task's state before saving but also
when reading. In the scenario an older Kibana node runs a task after a
newer Kibana node has stored additional task state, the unknown state
properties will be dropped. Additionally, this will prompt developers to
be aware that adding required fields to the task state is a breaking
change that must be handled with care. (see
https://github.com/elastic/kibana/issues/155764).
For more information on how to use `stateSchemaByVersion`, see
https://github.com/elastic/kibana/pull/159048 and
https://github.com/elastic/kibana/blob/main/x-pack/plugins/task_manager/README.md.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
around 4 weeks ago, some of FTR test are skipped due to it being
'unstable' (this was caused by Error: socket hang up issue, however this
issue has stopped occurring 2 weeks ago as such the skipped test should
be included back into our test cycle)
https://github.com/elastic/kibana/issues/159554
Resolves https://github.com/elastic/kibana/issues/161126
## Summary
Removes references to the following list of action variables in the code
and in the UI:
| Mustache legacy variable | Recommended replacement expression | To be
deprecated
| ----------- | ----------- | ----------- |
| alertId | rule.id | yes |
| alertName | rule.name | yes |
| spaceId | rule.spaceId | yes |
| tags | rule.tags | yes |
| params | rule.params | yes |
| alertInstanceId | alert.id | yes |
| alertActionGroup | alert.actionGroup | yes |
| alertActionSubgroup | alert.actionSubgroup | yes |
| alertActionGroupName | alert.actionGroupName | yes |
Also deprecates `params` in favor of `rule.params`
### Checklist
- [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
### Checklist
1. Create an es query/index threshold rule and add a connector
2. Verify that the default message does not contain any legacy variables
3. Click on the list of available action variables and verify that
`params` is deprecated and all the params variables are prefixed with
`rules.`
## Release Note
The following rule action variables have been deprecated; use the
recommended variables (in parentheses) instead:
- `alertActionGroup` (`alert.actionGroup`)
- `alertActionGroupName` (`alert.actionGroupName`)
- `alertActionSubgroup` (`alert.actionSubgroup`)
- `alertId` (`rule.id`)
- `alertInstanceId` (`alert.id`)
- `alertName` (`rule.name`)
- `params` (`rule.params`)
- `spaceId` (`rule.spaceId`)
- `tags` (`rule.tags`)
Fixes https://github.com/elastic/kibana/issues/150085
## Summary
Small PR to fix some broken functionalities in the KQL UI search bars. I
need this change for the API validation changes, but I thought it would
be better to split up this part as it can be released on its own and
also backported.
- The suggested fields were broken for the agent policies
- Whatever fields we were trying to filter down, the `dataViews` was
redoing a fetch ignoring our filtering. I changed the code to only
return the fields that we pass down.
- [Fields that should be
hidden](e4ec664ae2/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx (L21))
were being ignored
- From now on, all the fields have the format `fleet-index.field` rather
than just `field`. This is going to be necessary with the upcoming KQL
queries validation
<details>
<summary>Screenshots (before and after)</summary>
### Agent List search bar
## Before
<img width="873" alt="Screenshot 2023-07-12 at 16 55 48"
src="a97c3c5d-c341-4a02-b571-5d5555604dae">
## After
<img width="882" alt="Screenshot 2023-07-12 at 16 48 19"
src="e948de07-8cf8-4324-a158-3060629e6767">
### Agent policies search bar:
## Before
<img width="1076" alt="Screenshot 2023-07-12 at 16 58 48"
src="dcf74677-0bfe-4336-b9f0-73f6e2d43b06">
## After
<img width="1117" alt="Screenshot 2023-07-12 at 16 48 26"
src="c7c10a9e-056d-43c3-b1cf-e45fb8efe441">
### Enrollment keys search bar:
## Before
<img width="1168" alt="Screenshot 2023-07-12 at 16 59 43"
src="0940cd1c-e59c-4cd9-ad6d-0a116f8f5edd">
## After
<img width="1130" alt="Screenshot 2023-07-12 at 16 48 35"
src="6a749d51-901f-4745-8f85-b8912b5f21e6">
</details>
### Checklist
- [ ] [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
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
fixes https://github.com/elastic/kibana/issues/161441
fixes https://github.com/elastic/kibana/issues/161464
The recent `EuiButtonEmpty`/`EuiButtonIcon` Emotion conversions have
highlighted a CSS order/specificity flaw in Kibana compared to EUI - EUI
orders its Sass _after_ its Emotion styles (see
https://elastic.github.io/eui/#/), and Kibana orders Sass _before_
Emotion styles.
I'm not totally sure why Greg set up Kibana's style order the way he did
in https://github.com/elastic/kibana/pull/134919, but at this point, EUI
has enough of its baseline atom components converted to Emotion that
remaining components in Sass are all generally molecules or higher level
components that need to come after Emotion.
### QA
- [x] Test as many pages in Kibana as possible to ensure no visual
regressions 🤞
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Closes#161514
## Summary
This PR fixes the flyout test, it seems there was a timeout before the
check (in the screenshot is visible that the button is there so could be
that the check happened before the loading finished) I added a retry
there.
## Summary
Closes https://github.com/elastic/kibana/issues/159991
Fields that have been utilised to fulfil `basic` and `agent` fields can
be easily amended if these are incorrect.
Multiple datasets are supported, and these can contain more than one
type.
## Testing
A curl command similar to the following should allow you to hit the API
(check the credentials etc):
```
curl -XPOST -u 'elastic:changeme' -H 'kbn-xsrf: something' -d '{
"integrationName": "web_custom_nginx",
"datasets": [{"name": "access", "type": "logs"}, {"name": "error", "type": "metrics"}, {"name": "warning", "type":"logs"}]
}' 'http://localhost:5601/<BASE_PATH>/api/fleet/epm/custom_integrations'
```
## History / context
- [Prototype
learnings](https://github.com/elastic/kibana/issues/158552#issuecomment-1598685163)
- [Prototype PR](https://github.com/elastic/kibana/pull/160003)
## Results / expectations
API response (with installed assets):

We see the custom integration in "installed integrations" (albeit with a
verification warning):

We see the custom integration in Discover with the logs explorer
profile:

The assets are installed correctly:



## Summary
Implements https://github.com/elastic/kibana/issues/160935.
This PR adds the `title` and `icons` (also `description` since it was
there) properties to the installed packages API, these are extracted
from the matching manifest assets (so that we don't have to call the
registry, and can query for multiple items at once). Discover has also
been updated to use these new properties.
List:
<img width="343" alt="Screenshot 2023-07-12 at 17 13 52"
src="6929b17d-5317-4332-96ea-0ee85c19aebe">
With selection:
<img width="319" alt="Screenshot 2023-07-12 at 17 14 10"
src="550d050f-5b33-42d9-9139-99164d64a770">
I've made this robust against a matching manifest asset not being found
- I don't think this is actually possible, but just incase.
## Testing
- When accessing the log explorer profile within Discover pretty titles
should be displayed in the dataset selector
- When accessing the log explorer profile within Discover icons should
be displayed in the dataset selector
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
This PR doesn't introduce a new feature to the users. It is mostly a
refactoring for the edit flyout.
This change will make it easier to make the flyout work with the
formBased charts as it uses the exact same functions as the mounter
(Lens editor)
### Checklist
- [ ] [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
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Closes#159774, closes#159778, closes#159779, closes#159776
## Summary
This PR fixes the data view list in the new metric threshold. Also, it
adds an API integration test to check the reference in the rule saved
object.
Also, this PR improves the error handling and loading of the data view,
similar to what we have for elasticsearch rule data view.
|Threshold rule error|Elasticsearch query error|
|---|---|
||
## How to test
- Make sure `xpack.observability.unsafe.thresholdRule.enabled` is set to
true in kibana yml config
Error handling
- Throw an error
[here](https://github.com/elastic/kibana/pull/161462/files#diff-4f65f6debaf6457d4b0400a27c1ea57ba52bfe4426ee40460d43a857c5bd165eL98)
and make sure the message is shown correctly in the rule.
Temporary data view
- Create a temporary data view
- Check the list of data views and make sure the new temporary one is
added to the list
|Adding a new temporary data view|Temporary data view in the list|
|---|---|
||
## Summary
Without this mapping, timelines that try to make use of a top level OR
filter from the unified search filter builder cannot be saved,
everything works as expected with this change.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
- Re-creates all policy settings form components so that the Policy
settings are provided as a prop
- Adds `mode = view` to the policy form. When in this mode (user has no
authz to edit), form will be displayed in view only mode (no more
`disabled` form elements)
## Summary
This PR updates the `View rule` button to open rule detail page in a new
tab. This is option 1 of improving the UX experience on rules in
expandable flyout

## Summary
- Addresses https://github.com/elastic/kibana/issues/161460
- Exclude `agent.id` in case the Alert's `agent.type` is not `endpoint`
- Handle Alert `event.category` array field ex. `[process]`
- For the `Threshold Rule` there are two additional fields the Alert
Summary populates the `Event Count` and the `Event Cardinality` which
can be ignored as they are not relevant to the Rule exception

### Checklist
- [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
A bunch of APM unit tests were passing on CI but failing locally. This
PR fixes the unit tests
**Why fail locally and pass on CI??**
The reason they pass on CI is because `console.error` calls are omitted.
In the APM jest config `console.error` is treated as a test failure:
7ea0dd6b11/x-pack/plugins/apm/jest_setup.js (L12-L15)
Closes https://github.com/elastic/kibana/issues/159566
## Summary
Adds a new section in the profile bar that highlights the assigned roles
of the current user.
The roles are rendered using the EUI Badges and if there are more roles
than one, then the section only renders the first one while the rest are
rendered in a Popover.
## Old UI
<img width="1088" alt="image"
src="2d28353a-bd0a-47fd-b0b8-c3e09fd4d6b0">
## New UI
#### For a user with a single role:
<img width="1058" alt="image"
src="ec101a0c-0776-4484-8dec-dab43dca5732">
#### For a user with more than one role
Show helper text and a button that opens a popover on click
<img width="311" alt="image"
src="d9834072-69d1-414a-ac75-fdbde60195c3">
#### Popover for users with long role names
Setting the badge group max width to 200px (arbitrary for now) allows
truncation of the role badges
<img width="270" alt="image"
src="ffac590c-e6e6-49dd-96ae-0288b7496714">
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Closes https://github.com/elastic/ingest-dev/issues/1491
Querying agent statuses per version to add to telemetry.
How to test locally:
- enroll a few different version of agents
- wait up to 1h to see the telemetry task triggered
- check debug logs to see that the agents per version telemetry contains
the status information
```
[2023-07-12T11:00:45.172+02:00][DEBUG][plugins.fleet] Agents per version telemetry: [{"version":"8.7.1","count":4,"healthy":4,"unhealthy":0,"updating":0,"inactive":0,"unenrolled":0,"offline":0},{"version":"8.2.1","count":3,"healthy":3,"unhealthy":0,"updating":0,"inactive":0,"unenrolled":0,"offline":0},{"version":"8.2.0","count":2,"healthy":0,"unhealthy":0,"updating":0,"inactive":0,"unenrolled":0,"offline":2}]
```
### Checklist
- [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
This adds reasonable error handling and returns for connectors in case
the indices haven't been created yet. Specifically:
- Creating a connector or sync job targets the concrete index so the
index template can be triggered.
- Fetches of connectors or sync jobs return undefined or empty arrays if
the index doesn't exist.