Commit graph

22292 commits

Author SHA1 Message Date
Clint Andrew Hall
d2bb992823 Add provider to kibana_react KibanaContextProvider if theme is included in services. 2023-07-11 22:51:48 -04:00
kibanamachine
0eb891c6fb [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' 2023-07-12 02:14:55 +00:00
Clint Andrew Hall
4af25273cf Reflect changes from kibana/159638, remove hook, rely on EuiProvider instead 2023-07-11 22:09:09 -04:00
Clint Andrew Hall
ce3e43aa2f Merge branch 'main' into kibana_context 2023-07-11 15:33:06 -04:00
Kurt
323b0477e3
Changing where CodeEditor fields get useDarkMode value (#159638)
## Summary

Closes https://github.com/elastic/kibana/issues/157203
Closes https://github.com/elastic/kibana/issues/158051
Closes https://github.com/elastic/kibana/issues/158049

With the addition of Per User Dark Mode, components can no longer rely
on `uiSettings` as the source of truth for theme.

CodeEditor fields used to call `uiSettings` to determine if Dark Mode
was enabled, which had been provided in each callers Kibana React
Context.

The new source of truth for theme is the `CoreStart >
ThemeServiceStart`.

Currently, not all callers of CodeEditor provide the `theme` service in
their Kibana Context in a similar way and some callers don't provide it
at all.

This PR updates CodeEditor to get theme values from the Kibana Context
using a new `useKibanaTheme` react hook.

It also attempts audit the callers of CodeEditor to see if their Kibana
Context contains the theme service at the top level (Where I could add
theme to a caller's Context without major changes, I did. Some cases
will require CodeOwner guidance).

The new `useKibanaTheme` react hook will throw a TypeError if theme
isn't found in the top level of the Kibana Context, this will help with
testing as the component will not render. I will remove this after
testing so as not to introduce breaking changes.

## Testing

Please review files for which you are CODEOWNER.

I've attempted to tag all usages of `CodeEditor`/`CodeEditorFIeld` with
a TODO comment with one of the following scenarios:

1) a note where theme was provided already/where I made changes to
provide it in the appropriate context
2) I've asked for CODEOWNER guidance

For scenario 1, please pull and test that CodeEditor locally:

1. Enable Dark Mode from Edit User Profiles by clicking on the Profile
Icon on the top right, and updating your profile.
2. Navigate to the CodeEditors in the plugins you own. If they render
and display in Dark Mode - add a green check to the table below - and
you're done!
3. If it is not rendering, please help me figure out where the theme
service should be provided in the context.

For scenario 2, we will need to figure out where to make changes so your
context is providing theme. Some of the more complex usages may need to
addressed in separate issues.


## Tracking
| Team | Plugin | Theme in Context ? | Verified Working |
| - | - | - | - |
| apm-ui | apm | APM Storybook broken | ? |
| kibana-presentation | presentation_util | Yes. | Yes |
| response-ops | trigger_actions_ui | Yes | Yes |
| response-ops | stack_alerts | Yes | Yes |
| kibana-security | security  | Yes | Yes |
| security-defend-workflows | osquery | Yes | Yes |
| kibana-app-services | examples/expression_explorer | Yes | Yes |
| ml-ui | transform | Yes | Yes |
| ml-ui | ml | Yes | Yes |
| uptime | synthetics | Yes | Yes |
| kibana-gis | maps | Yes | Yes |
| kibana-gis | file_upload | Yes | Yes |
| platform-deployment-management | watcher | Yes | [AG] Yes |
| platform-deployment-management | snapshot_restore | Yes | [AG] Yes |
| platform-deployment-management | runtime_fields | Yes | [AG] Yes |
| platform-deployment-management | painless_lab | Yes | [AG] Yes |
| platform-deployment-management | ingest_pipelines | Yes | [AG] Yes |
| platform-deployment-management | index_management | Yes | [AG] Yes |
| platform-deployment-management | grokdebugger | Yes | [AG] Yes |
| platform-deployment-management | es_ui_shared | Yes | [AG] Yes |
| fleet | fleet | Yes | Yes |
| enterprise-search-frontend | enterprise_search | Yes | [AG] Yes |
| kibana-cloud-security-posture | cloud-security-posture | Yes | yes |
| sec-cloudnative-integrations | cloud_defend | Yes | Yes |
| kibana-visualizations/kibana-data-discovery | data | Yes | Yes |
| kibana-visualizations | examples/testing_embedded_lens | Yes | Yes |
| kibana-visualizations | vis_types | Yes | Yes |
| kibana-visualizations | vis_default_editor | Yes | Yes |
| kibana-visualizations | unified_search | Yes | Yes |
| kibana-visualizations | packages/kbn-text-based-editor | Yes | Yes |
| kibana-visualizatons | lens | Yes | Yes|
| kibana-core | saved_objects_management | Yes | Yes |
| kibana-presentation | inspector | Yes | Yes |
| kibana-presentation | canvas | Yes | Yes |
| kibana-data-discovery | discover | Yes | Yes |
| kibana-data-discovery | data_view_management | Yes | Yes |
| kibana-data-discovery | data_view_field_editor | Yes | Yes |
| appex-sharedux | advanced_settings | Yes | Yes |
| enterprise-search-frontend | serverless_search | Yes | [AG] Yes |
| - | - | - | - |

## Unit tests

Currently, many tests are failing since they are probably not providing
`theme` in the context. Once CODEOWNERs have weighed in on CodeEditors
usages that require discussion, I will update the accompanying tests.

## Release note
- Fixes theming of CodeEditors

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
Co-authored-by: Dima Arnautov <arnautov.dima@gmail.com>
2023-07-11 14:02:42 -04:00
Tim Sullivan
787491e2bb
[Reporting] Allow Chromium to work by default in Docker (#149080)
## Summary

Closes https://github.com/elastic/kibana/issues/129148


### Checklist

Delete any items that are not applicable to this PR.

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [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

## Release Note
Fixed a bug where Kibana Reporting would not work in Elastic Docker
without adding a special setting in kibana.yml.
2023-07-11 08:16:03 -07:00
Nathan Reese
a92432869f
[embeddable] add should_fetch unit test (#161596)
While messing around with time slider control and custom time ranges, I
noticed shouldFetch$ is triggered (turns out search session id is
changing - maybe a separate issue).

During investigation, I found it difficult to explore without unit test
for shouldFetch$.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-11 08:58:39 -06:00
Marta Bondyra
7e7293a520
[Lens] Fix a11y issues & small styling issues (#161073)
## Summary

Fixes the following issues:

1. Suggestions are not reachable by keyboard navigation (it was actually
broken when fixing the [accesibility axe
warning](https://github.com/elastic/kibana/issues/154787), I ran it now
and it doesn't show now)


46c9eb70-4df7-462b-a878-b7d190aaf8c9

2. Dimension removal button is not reachable by keyboard navigation

before:


5011679b-b05a-48ca-a877-bbc940607b56

after:


9d056512-a622-4c1c-aa5b-242e2762e9ae

3. The padding for the reordering groups got a distance between the
empty dimension button (btw I have more little fixes for drag and drop
look but want to submit it in a separate PR to not ping here Discover
team):
 
<img width="421" alt="Screenshot 2023-07-03 at 17 42 41"
src="a1d22267-07b6-4179-89f9-b4c7ec5da030">
<img width="459" alt="Screenshot 2023-07-03 at 17 39 11"
src="a7b697ca-4ff3-4c18-bf96-a8710615a9df">

4. The focus outline for dataview selector and layer chart selector got
a nicer rectangular shape

before:
<img width="343" alt="Screenshot 2023-07-03 at 10 50 52"
src="0ca305b8-cdbf-4c43-b73d-0058046ab919">
<img width="360" alt="Screenshot 2023-07-03 at 17 41 18"
src="54e61646-5d4e-4512-b6e1-6d758e2b7498">

after:
<img width="350" alt="Screenshot 2023-07-03 at 11 11 01"
src="8ddd81dd-8072-4cf8-a98b-ae5eb9998add">
<img width="415" alt="Screenshot 2023-07-03 at 17 39 51"
src="1c36b3bd-cb15-4cb8-858e-92fc19e3181f">

5. The focus outline was corrected for dimension buttons. I also
refactored code here to make margins, paddings and gaps the property of
the containers and not the items themselves. I think this way it's more
correct.

before:

<img width="418" alt="Screenshot 2023-07-03 at 17 40 54"
src="b8ce4a22-dc69-44a7-8689-70928340ac24">

after:


712e2ac8-f81d-4896-b384-164fc2854766
2023-07-11 15:51:58 +02:00
Matthew Kime
d9d1404119
[saved search] Remove saved object client from data views plugin for saved search usage (#159109)
## Summary

Previously the data plugin relied on the data view plugin to load saved
searches since the saved searches depend upon the data plugin and
circular dependencies needed to be avoided. This is innovative and
perhaps a bit crazy.

What this PR does
- Data view api no longer loads saved searches, removing browser saved
object client usage
- Moves `kibana_context` expression and getKibanaContext function from
data plugin to saved search plugin since it loads saved searches
- Rename data views `SavedObjectsClientCommon` to `PersistenceAPI` -
this is the abstraction around saved object loading that no longer is
exclusive to the saved objects api.
- Adds saved search server api (plugin contract) for loading saved
searches.
- Functional tests on browser and server for kibana_context expression
when loading saved searches

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-11 08:23:46 -05:00
Stratoula Kalafateli
672c90a9c1
[Dashboard] Panel settings action improvements (#161616)
## Summary

Part of https://github.com/elastic/kibana/issues/160256

- Replaces the Edit panel settings text with the simpler Panel settings
- Replaces the documentation
- Replaces the icon

<img width="1757" alt="image"
src="e0ea6c19-8a65-44b8-906e-c364c00536a0">

### Checklist

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
2023-07-11 16:22:57 +03:00
Stratoula Kalafateli
f8ef18a26b
[Textbased] Depict histogram for timebased adhoc dataviews (#161524)
## Summary

Part of https://github.com/elastic/kibana/issues/158802

We decided that in the case we don't render a Lens suggestion (for
example when we have the SELECT * case) to render the histogram.

**Reminder**: Histogram makes sense only of there is a time field. For
text based mode, time field exists **ONLY** if there is the @timestamp
field.

I don't allow navigation to Lens or open the edit flyout in this case.
When the edit flyout allows the editing of the form based visualizations
(such as histogram) I will enable it then.

FTs have been changed to accomodate this change.


<img width="1751" alt="image"
src="3d28d881-bc60-43de-acf8-8cbcd172a3df">


### 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
2023-07-11 14:32:33 +03:00
Marta Bondyra
91a0d2f454
[Lens] Refactor drag and drop (#161257)
## Summary

When I created drag and drop for Lens, the API I went for was not the
most readable one. It was designed this way because I wanted to gain
some performance, but it was very hard to maintain the performance gain
with a lot of changes in the drag and drop area because all the pieces
of the code needed to memoized in a tricky way and it wasn't
communicated well.
In the end it works even without these tricks so I decided to simplify
it in this PR.

The main changes include:

1. Instead of multiple `useState` per parameter, we keep all the state
in reducer both for `ReorderProvider` and `RootDragDropProvider`. Thanks
to that we get multiple improvements:
2. The code in `DragDrop` component becomes more descriptive as we don't
run multiple state updates when user executes an action but one state
update describing what actually happens (eg. `dispatchDnd({type:
'selectDropTarget' ....})`. The internal logic of the update lives in
the reducer.
3. We don't have to pass `trackUiCounterEvents` as another prop to
`DragDrop` and run it wherever we need - instead we pass it as a
middleware to the context and run before dispatching (and it's very easy
to add more middlewares if we need extra integrations at some point!)
4. We also run a11y announcements as a middleware instead of inside
`DragDrop` component
5. The `ChildDragDropProvider` props look much cleaner:
    before:
```
      <ChildDragDropProvider
        keyboardMode={keyboardModeState}
        setKeyboardMode={setKeyboardModeState}
        dragging={draggingState.dragging}
        setA11yMessage={setA11yMessage}
        setDragging={setDragging}
        activeDropTarget={activeDropTargetState}
        setActiveDropTarget={setActiveDropTarget}
        registerDropTarget={registerDropTarget}
        dropTargetsByOrder={dropTargetsByOrderState}
        dataTestSubjPrefix={dataTestSubj}
        onTrackUICounterEvent={onTrackUICounterEvent}
      >
        {children}
      </ChildDragDropProvider>
```
after:
```
<ChildDragDropProvider value={[state, dispatch]}>{children}</ChildDragDropProvider>
```
6. Created custom hook `useDragDropContext` instead of using
`useContext(DragContext)` and making DragContext private. This way we
will avoid potential problems with using context outside of root.
7. Bonus thing - if we ever decide to move to redux, the structure is
there already



What I am still not happy with is that the tests are very
domain-dependant instead of user-driven - instead of checking the store
actions, I should check the interface from the user perspective. I will
try to work on it once I find some time between more important tasks
though.
2023-07-11 13:05:03 +02:00
Sébastien Loix
7ea0dd6b11
[TableListView] Fix dark mode for content editor (#161570) 2023-07-11 03:37:15 -07:00
Patryk Kopyciński
ba539d7a39
[Defend Workflows] Use Vagrant for real agent Cypress e2e (#160050)
## Summary

Run Real Endpoint Cypress E2E on CI using Vagrant

---------

Co-authored-by: Tomasz Ciecierski <ciecierskitomek@gmail.com>
Co-authored-by: Ashokaditya <am.struktr@gmail.com>
2023-07-11 03:02:51 -07:00
Jean-Louis Leysens
bda0195982
[http] Fix running FTR tests locally (#161336)
## Summary

Running FTR tests locally (not on CI) that make API requests to public
versioned Kibana endpoints is currently broken. This is because:

* we require version headers to be set for both internal and **public**
endpoints in **dev** by way of a runtime check (ensures our code is
locked to a version)
* the vast majority of FTR tests do not set these headers for talking to
public endpoints
* on CI, this is different as we run these tests against a distributable
build (i.e., non-dev)

This manifests locally as a 400 response. E.g. the current
api_integration tests for data views by running:

```
node scripts/functional_test_runner.js --config ./test/api_integration/config.js --grep 'index_pattern_crud'
```

---

There are a few ways to resolve this, this PR proposes that we:

* Keep FTR tests as they are (i.e., don't update all of them to set
headers when making requests to public versioned endpoints), this is a
useful way to exercise our intended end-user behaviour
* Make the version resolution behaviour not depend on `--dev`: rather
set the default resolution to `none` (new setting) when we run in
`--dev` so that it can be configured to behave as we want for tests.

In this way we keep the runtime check for its intended purpose and can
run our FTR tests "as end users" of our endpoints.

---

Close https://github.com/elastic/kibana/issues/161435
2023-07-11 11:51:05 +02:00
Gerard Soldevila
5396f1be91
Move some IT to a separate group (#161535)
The goal is to prevent the following warning and reduce overall CI
times:

```
The following "Jest Integration Tests" config has a duration that exceeds the maximum amount of time desired for a single CI job. This is not an error, and if you don't own this config then you can ignore this warning. If you own this config please split it up ASAP and ask Operations if you have questions about how to do that.

src/core/server/integration_tests/saved_objects/migrations/group3/jest.integration.config.js: 40.7 minutes
```

Source https://buildkite.com/elastic/kibana-pull-request/builds/140963
2023-07-11 10:35:45 +02:00
Ignacio Rivas
68b3baec93
[Deployment management] Mark devtools and management sidenav deeplinks as visible on serverless (#161227) 2023-07-11 10:31:21 +02:00
Rodney Norris
4ae5e1757e
[Enterprise Search] rename ent-search integration category title to Search (#161397)
## Summary

Updated the title for the `enterprise_search` Integration category from
`Enterprise Search` to `Search`

### Screenshots
<img width="1676" alt="image"
src="4f882c01-570c-4117-8689-5caddb7a7de1">

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-10 16:56:02 -05:00
Clint Andrew Hall
07103a02dd
Merge branch 'main' into kibana_context 2023-07-10 17:02:58 +02:00
Pablo Machado
6db79db1e0
[Security Solutions] Update Events/alerts table to use FieldSpec for CellActions (#161361)
EPIC: https://github.com/elastic/kibana/issues/144943

## Summary

Update Events/alerts table to provide `CellActions` with a complete
`FieldSpec`object from DataView

### Affected pages:
* Alerts page
* Security Dashboards
* Rule preview
* Host events
* Users events

### How to test it
Use CellActions on one of the affected pages.




### 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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-10 16:57:04 +02:00
Clint Andrew Hall
f4b1011641
Merge branch 'main' into kibana_context 2023-07-10 15:57:23 +02:00
Pierre Gayvallet
79b5754a12
[ZDT] handle failures during switch from v2 algo (#161476)
## Summary

Fix a bug that was causing the cluster to fall into an unrecoverable
state if an error occurs during the document migration phase of a `v2`
to `zdt` migration (first zdt migration to take over the `v2`
algorithm).

When an error occurs during the document migration phase, the index gets
in a state where `mappingVersions` is present but not `docVersions`, and
the algorithm wasn't able to understand what this state was, and
considered it to just be a plain `zdt` predecessors, which caused an
error when entering the document migration phase, as `docVersions`
couldn't be found.

This PR addresses this, by properly identifying this specific state, and
acting accordingly (by initiating a document migration without checking
for the versions in `docVersions`, as we do then coming from a plain v2
algo)
2023-07-10 05:46:41 -07:00
Julia Rechkunova
ea53763028
[UnifiedFieldList][Discover] Create a high level unified field list building block (#160397)
- Closes https://github.com/elastic/kibana/issues/145162 
- Closes https://github.com/elastic/kibana/issues/147884

## Summary

This PR creates a wrapper/container component (building block) for
unified field list subcomponents:

93acc6f707/packages/kbn-unified-field-list/README.md (L5)

Available customization options are listed here:
93acc6f707/packages/kbn-unified-field-list/src/types.ts (L116)

It's now integrated [into
Discover](93acc6f707/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx (L373))
and [into example
plugin](93acc6f707/examples/unified_field_list_examples/public/field_list_sidebar.tsx (L84)).
Usage of unified field list subcomponents and hooks stays unchanged in
Lens plugin as it requires more complex customization (for example Lens
uses IndexPattern/IndexPatternField types instead of data view types).

Also this PR allows to disable multifields grouping and select a variant
(responsive, list only, button only) via
`UnifiedFieldListSidebarContainer` properties.

There should no visual changes on Discover and Lens pages. Unified Field
List Examples plugin will get the same sidebar UI as it's on Discover.

### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [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
- [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)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-07-10 12:18:40 +02:00
Xavier Mouligneau
8ef3b3dd85
[RAM] KQL search bar for rules (#158106)
## Summary

Allow KQL bar working with saved objects.


![KQL-for-rules](80bb2498-78a8-4124-8d03-e771015eb103)


### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] 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))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Lukas Olson <olson.lukas@gmail.com>
2023-07-07 19:40:58 -07:00
Lukas Olson
4b7d18b5c3
[bfetch] Use versioned router (#161317)
## Summary

Part of https://github.com/elastic/kibana/issues/157095.

Uses the new versioned router capabilities for the bfetch plugin.

### Checklist

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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>
2023-07-07 16:48:02 -07:00
Andrea Del Rio
96beacf080
[Controls] Change badge color in options list (#161401) 2023-07-07 09:05:02 -07:00
Pierre Gayvallet
52eb488692
[modelVersions] add new migration change types (#161147)
## Summary

Related to https://github.com/elastic/kibana/issues/150296

- Add the following SO model version change types:
  - `data_removal`
  - `unsafe_transform`
- Change the existing `data_backfill` type to something less permissive
- Update the tsdoc and documentation accordingly

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-07 17:18:21 +02:00
Nathan Reese
d9c0c554f8
[dashboard] fix Memory leak when reset causes by-value panel to be deleted (#161394)
Closes https://github.com/elastic/kibana/issues/161310

Issue caused by `setState` call after async action without checking that
component is still mounted. Resolved issue by checking component is
mounted after any async action or subscription.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-07 08:53:50 -06:00
Stratoula Kalafateli
fde953907c
[TextBased] Allow inline editing from dashboards (#161146)
## Summary

Part of https://github.com/elastic/kibana/issues/158802

For panels created from Discover with text based languages, not navigate
to Lens but open a flyout instead.


![sql](489402ac-dcdb-468b-89b9-a84f4c4f2ca5)


Follow up PR: 
- Remove the SQL option from Lens dataview picker and move the FTs in
Discover/Dashboard

Note:
- Changing the query on the dashboard level is going to be added in 8.11

### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ] [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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] 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))
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-07 11:20:45 +03:00
Tim Sullivan
f82588ba5e
[Serverless] Support banner header (#160912)
## Summary

Closes https://github.com/elastic/kibana/issues/160052

This PR adds support for the header banner in serverless projects. 
<img width="1437" alt="image"
src="c950bbe7-46bb-4b82-b9ee-406aef7748dc">

**NOTE:** This PR adds support for the header banner by applying the
same techniques as in the "classic" layout: special class names of
`header__bar`/`header_firstBar`/`header__secondBar`. The effect is the
"header action menu" bar, which is an optional 2nd bar in the chrome
header, works better after this change when it is always visible. This
is a temporary issue that unblocks the header banner, and fixes other
overlapping issues with the current project layout stylings.

_As followup work_, the @elastic/appex-sharedux team will investigate
converting the Kibana page template to the new
[EuiPageTemplate](https://elastic.github.io/eui/#/templates/page-template/examples)
which supports horizontal sections of a page that have dynamic height --
we need this for the dynamic presence of the header banner, and the
intended dynamic presence of the header action menu.

### Checklist

Delete any items that are not applicable to this PR.

- [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)
2023-07-06 14:43:26 -07:00
Devon Thomson
1d783110b3
[Dashboard] Fix Alias Redirect Race Condition (#161043)
Fixes a race condition that could happen in the case of an alias match redirect.
2023-07-06 16:19:54 -04:00
Bree Hall
4cf630bfec
Upgrade EUI to 83.0.0 (#160813)
`eui@82.1.0`  `83.0.0`

⚠️ The biggest change in this PR by far is the `EuiButtonEmpty` Emotion
conversion, which changes the DOM structure of the button slightly as
well as several CSS classes around it.

EUI has attempted to convert any custom EuiButtonEmpty CSS overrides
where possible, but would super appreciate it if CODEOWNERS checked
their touched files. If anything other than a snapshot or test was
touched, please double check the display of your button(s) and confirm
everything still looks shipshape. Feel free to ping us for advice if
not.

---

## [`83.0.0`](https://github.com/elastic/eui/tree/v83.0.0)

**Bug fixes**

- Fixed `EuiPaginationButton` styling affected by `EuiButtonEmpty`'s
Emotion conversion ([#6893](https://github.com/elastic/eui/pull/6893))

**Breaking changes**

- Removed `isPlaceholder` prop from `EuiPaginationButton`
([#6893](https://github.com/elastic/eui/pull/6893))

## [`82.2.1`](https://github.com/elastic/eui/tree/v82.2.1)

- Updated supported Node engine versions to allow Node 16, 18 and >=20
([#6884](https://github.com/elastic/eui/pull/6884))

## [`82.2.0`](https://github.com/elastic/eui/tree/v82.2.0)

- Updated EUI's SVG icons library to use latest SVGO v3 optimization
([#6843](https://github.com/elastic/eui/pull/6843))
- Added success color `EuiNotificationBadge`
([#6864](https://github.com/elastic/eui/pull/6864))
- Added `badgeColor` prop to `EuiFilterButton`
([#6864](https://github.com/elastic/eui/pull/6864))
- Updated `EuiBadge` to use CSS-in-JS for named colors instead of inline
styles. Custom colors will still use inline styles.
([#6864](https://github.com/elastic/eui/pull/6864))

**CSS-in-JS conversions**

- Converted `EuiButtonGroup` and `EuiButtonGroupButton` to Emotion
([#6841](https://github.com/elastic/eui/pull/6841))
- Converted `EuiButtonIcon` to Emotion
([#6844](https://github.com/elastic/eui/pull/6844))
- Converted `EuiButtonEmpty` to Emotion
([#6863](https://github.com/elastic/eui/pull/6863))
- Converted `EuiCollapsibleNav` and `EuiCollapsibleNavGroup` to Emotion
([#6865](https://github.com/elastic/eui/pull/6865))
- Removed Sass variables `$euiCollapsibleNavGroupLightBackgroundColor`,
`$euiCollapsibleNavGroupDarkBackgroundColor`, and
`$euiCollapsibleNavGroupDarkHighContrastColor`
([#6865](https://github.com/elastic/eui/pull/6865))

---------

Co-authored-by: Cee Chen <constance.chen@elastic.co>
Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-06 12:46:55 -07:00
Matthew Kime
c843c97193
[data views] REST endpoint for swapping saved object references (#157665)
## Summary

Managing large number of saved objects can be cumbersome. This api
endpoint allows the management of references without clicking through a
lot of different UIs.

For example - 

This swaps all data view id `abcd-efg` references to `xyz-123`

```
POST /api/data_views/swap_references
{
     "from_id" : "abcd-efg",
     "to_id" : "xyz-123",
     "preview" : false, // optional, necessary to save changes
     "delete" : true // optional, removes data view which is no longer referenced
}

returns 
{
  preview: false,
  result: [{ id: "123", type: "visualization" }],
  deleteSuccess: true
}
```

Additional params - 
```
from_type: string - specify the saved object type. Default is `index-pattern` for data view
for_id: string | string[] - limit the affected saved objects to one or more by id
for_type: string - limit the affected saved objects by type
```



Closes https://github.com/elastic/kibana/issues/153806
2023-07-06 08:29:01 -05:00
Stratoula Kalafateli
75140a8977
[Unified search] Make the dataview optional in the search input ui (#161166)
## Summary

Closes https://github.com/elastic/kibana/issues/158986

This PR is applying a very simple fix on the unified search bar. It
makes the dataview to not be required to load the text area.

The dataview(s) is required for the suggestions but not for running a
query.


![apm](be5fc64e-4c90-4d69-90b8-4f30ccf7913e)

There is currently a bug
https://github.com/elastic/kibana/issues/158986#issuecomment-1620099640
on the apm side. It is happening because the url update is not allowed
when the dataview is not set. This needs to be fixed on the apm side so
I synced with the apm team and they are going to take it.
2023-07-06 12:45:30 +03:00
Sean Sullivan
9a20abc5c3
Add Multi format for geopoint and consolidate geo converstion tools i… (#147272)
Add multiple formats for geo_point fields and make geo conversion tools
part of field_format/common/utils

This is needed because various users need locations displayed in
different formats. It would be problematic to allow users to change the
index field formatting for everyone.

WKT and LL where already formatters availible.

I added MGRS and DMS.
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.

![image](https://user-images.githubusercontent.com/11495566/206515127-14774b76-49f9-4fed-a306-1b03936c8766.png)



### 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)

---------

Co-authored-by: Sean Sullivan <ssullivan@spectric.com>
Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com>
2023-07-06 11:23:21 +02:00
Konrad Szwarc
bbeccd71ea
[Fleet] Kafka integration API (#159110)
This PR addresses the API aspect of
https://github.com/elastic/kibana/issues/143324

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-06 10:41:07 +02:00
Drew Tate
569e873ffb
[Event annotations] fix table list tag filtering (#161048) 2023-07-06 08:55:53 +03:00
Tiago Costa
c9dc2bf308
skip flaky suite (#160994) 2023-07-05 18:54:27 +01:00
Catherine Liu
112a0f9abf
[Dashboard] Editing toolbar update (#154966) 2023-07-05 10:52:26 -07:00
Jean-Louis Leysens
644356c491
[HTTP] Additional version negotiation mechanism (#160399)
## Summary

Close https://github.com/elastic/kibana/issues/160207.

Adds a new, additional mechanism for negotiating version (via query
parameter). This is specifically intended to enable Kibana versioned
endpoints to be usable in browser environments where setting a header is
not always possible (like in an `img` tag's `href`).

Note: the header-based version still takes precedence if present.


### 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
2023-07-05 17:00:53 +02:00
Pierre Gayvallet
833410b39f
[ZDT] support registering new types (#161255)
## Summary

Related to https://github.com/elastic/kibana/issues/150296

Fix a bug causing the ZDT migration algorithm to fail when a new type
gets introduced between two versions.
2023-07-05 16:56:09 +02:00
Jean-Louis Leysens
512c81c242
[HTTP] Additional tests for response validation in dev (#160384)
## Summary

Adds a few more test cases to prove that response validation is working
e2e.
2023-07-05 06:53:33 -07:00
Matthew Kime
803d139adc
[data views] Fix overwrite param for create (#160953)
## Summary

Under some circumstances passing `override` to `POST
/api/data_views/data_view` would fail. Its now fixed.

To test - Try using the override param from the Kibana dev console. I
found it reproduced the problem before the fix and shows its resolved
after the fix. The problem did not appear in the integration tests.

I suspect the problem had to do with how quickly the delete was
performed - if it completed before the create command then everything
was fine. If it didn't then the error would appear. Passing the
overwrite param to the saved object client eliminates the possibility of
the delete failing to complete.

Closes https://github.com/elastic/kibana/issues/161016
2023-07-04 15:35:40 -05:00
Ignacio Rivas
2a71469894
[Deployment Management] Add landing page redirect feature and implement in security solution (#161060) 2023-07-04 15:43:47 +02:00
Julia Rechkunova
4819efa8eb
[Discover] Refresh fields when entering Discover (#160195)
- Closes https://github.com/elastic/kibana/issues/156556
- Probably also addresses
https://github.com/elastic/kibana/issues/157239

## Summary

This PR allows to refresh fields list when revisiting Discover page.

## For testing

1. Open discover
2. In a separate tab open Dev Tools and create documents which include
new field names
3. Press "Refresh" in the unified search bar on Discover and notice that
new fields appear under Unmapped section
4. Navigate to another Kibana app (for example Home page)
5. Navigate back to Discover and notice that new fields are now under
Available section and have a proper icon.
2023-07-04 10:19:30 +02:00
Drew Tate
1d82d2cb61
[Event annotations] Lens design improvements (#159057) 2023-07-03 09:16:47 -05:00
Stratoula Kalafateli
e8b2303875
[Text based] Configure Lens suggestion on the fly from Discover (#159559)
## Summary

Part of https://github.com/elastic/kibana/issues/158802

This PR removes the navigation from Discover to Lens and renders a push
flyout instead.


![textbased](92c6f290-6cf9-4daa-920e-f1409595d765)


Next tasks (follow-up PRs):

- [ ] Remove the text based support from Lens dataview picker. The FTs
should be removed from there and possibly moved to discover FTs
- [ ] Apply the same flyout in dashboard for text based panels
- [ ] Allow drag and drop between dimensions
- [ ] Investigate why the Field select doesnt close when you click
outside the dropdown

### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] 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))
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
2023-07-03 15:18:05 +03:00
Pierre Gayvallet
90b3e712cb
[http] capture errors thrown from handlers (#161063)
## Summary

Fix https://github.com/elastic/kibana/issues/156803

Use `apm.captureError` to properly capture errors thrown by the route
handler (as those errors are then converted to generic 500 errors before
being returned by the server to avoid leaking internal info)
2023-07-03 05:16:35 -07:00
Matthias Wilhelm
25c6446711
[Discover] Fix search sessions using temporary data views (#161029)
Enables search sessions in Discover to work correctly with temporary data view

Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com>
2023-07-03 05:10:25 -07:00
Gerard Soldevila
646d2e897e
Increase timeout for costly ".kibana split" integration test (#160631)
Tackles https://github.com/elastic/kibana/issues/157510

Nothing's wrong with the test, it's only that it's a bit costly, as it
migrates a 100k SO archive.

This PR simply increases the timeout for the conflicting test.
2023-07-03 03:38:13 -07:00