Commit graph

5536 commits

Author SHA1 Message Date
Julia Rechkunova
a6073e8458
[Data Views] Show loading indicators when submitting a data view form to prevent multiple requests (#150576)
Closes https://github.com/elastic/kibana/issues/146125

This PR adds loading indicators to the form buttons and also disables
them when submitting the form.

* Creating an ad-hoc data view
![Feb-08-2023
16-00-20](https://user-images.githubusercontent.com/1415710/217567470-53e0c614-d12d-4849-90e1-f157c6c36e79.gif)

* Editing an ad-hoc data view
![Feb-08-2023
16-01-38](https://user-images.githubusercontent.com/1415710/217567599-0066393c-4bae-4364-a568-b54c6509d8ad.gif)

* Creating a persisted data view
![Feb-08-2023
16-00-57](https://user-images.githubusercontent.com/1415710/217567411-67dd1b3c-99b9-455b-adbe-be21d61344ee.gif)

* Editing a persisted data view
![Feb-08-2023
16-02-08](https://user-images.githubusercontent.com/1415710/217567541-a6314611-544f-45f2-944d-f49c7a654a43.gif)
2023-02-16 09:50:02 +01:00
Maja Grubic
a7293f62b5
[Custom Branding] Add custom branding settings to Global settings (#150080)
## Summary

This PR registers custom branding settings from the `custom_branding`
plugin. Once registered, these settings can be viewed under "Global
settings".

UI changes:
<img width="1761" alt="Screenshot 2023-02-06 at 19 59 19"
src="https://user-images.githubusercontent.com/1937956/217060900-7e56c8e9-7d3d-4ac5-96b6-8a8a85d3c1c3.png">

I also removed the client-side version of the `custom_branding` plugin,
as it's not needed.

With this change, it became easier to test custom branding, so I made a
few changes where logo was not showing properly or image size was wrong
or test subjects were missing.

I am working with @gchaps on the exact wording, so that might change. 

### Checklist

Delete any items that are not applicable to this PR.

- [X] 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)
- [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] 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))
~- [ ] 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)~
- [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)


### 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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
2023-02-16 08:13:42 +01:00
Davis McPhee
4525c4b4e4
[Discover] Fix issue where editing a data view causes the UI to become out of sync (#150830)
## Summary

Let's try this again with a simpler and hopefully more robust approach.
This PR fixes the issue where editing a data view in Discover causes the
UI to become out of sync with the current data view due to the stable
object identity.

Fixes #149857.
Fixes #150740.

### 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~
- [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
- [ ] ~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)~

### 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)
2023-02-15 19:53:23 -04:00
Rachel Shen
50a4fc4916
[Shared UX] Adoption of Shared UX Route component (#150357)
## Summary

This PR removes all imports of Route from react-router-dom and
'@kbn/kibana-react-plugin/public' and instead imports Route from
@kbn/shared-ux-router.

### Context
Based on
https://github.com/elastic/kibana/issues/132629#issue-1243243678 This PR
executes steps 2 - 4:

> 2. To make the transition easier, we want to re-export other
react-router-dom exports alongside the modified' Route'.
> 3. Solutions should start using that Route component in place of the
one from react-router-dom. I.e. replace all occurrences of import { ...
} from 'react-router-dom' with import { ... } from
'@kbn/shared-ux-router'.
> 4. All manual calls to useExecutionContext are not needed anymore and
should be removed.

### Future PR

Looks like this might be getting worked on in:
https://github.com/elastic/kibana/pull/145863 (thanks!)

> Introduce an ESlint rule that ensures that react-router-dom is not
used directly in Kibana and that imports go through the new
@kbn/shared-ux-router package.

This is tangentially accomplished through
https://github.com/elastic/kibana/pull/150340 but only addresses using
Route through @kbn/kibana-react-plugin/public'


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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
2023-02-14 19:25:04 +00:00
Mark Hopkin
687294d4d3
[Fleet] Bugfix: prevent status runtime query going over character limit (#150910)
## Summary

Closes #150577 

if there are too many agent policies in a system, we were creating too
big a runtime query for elastic and the query would be rejected.

This PR adds a limit, if the user has more than 750 agent policies then
agents will not be marked as inactive anymore. If the user reaches the
limit then a warning badge is displayed (the text underlined has also
been added):

<img width="968" alt="Screenshot 2023-02-13 at 20 14 31"
src="https://user-images.githubusercontent.com/3315046/218565456-f5758e4b-74f6-4e7c-9b49-22f0fd6f9102.png">


Integration test added.
2023-02-14 07:05:34 -07:00
Alejandro Fernández Haro
58c68c94d4
[Telemetry] Fix OptedOut banner (#151084)
Resolves #135107.
2023-02-14 13:53:55 +01:00
Dzmitry Lemechko
8be882b58d
[ftr] create config file for each tested plugin with firefox tests (#150873)
## Summary

Splitting firefox test config by plugin to speedup pipeline execution
time.

<img width="1581" alt="image"
src="https://user-images.githubusercontent.com/10977896/218100374-4b19339a-c3fb-4344-9e27-9791206ef189.png">

test/functional/firefox/console.config.ts 6m 2s
test/functional/firefox/dashboard.config.ts 7m 39s
test/functional/firefox/discover.config.ts 4m 18s
test/functional/firefox/home.config.ts 1m 32s
test/functional/firefox/visualize.config.ts 22m 9s
2023-02-11 00:51:57 +01:00
Nathan Reese
51f3a5423e
fix test/functional/apps/dashboard/group3/dashboard_time_picker·ts (#150820)
Fixes https://github.com/elastic/kibana/issues/148736
2023-02-10 14:32:32 -05:00
Michael Dokolin
caee8cbe8e
[Saved Objects] Update document migrator not to bump core version on every migration (#150443) 2023-02-10 17:45:49 +01:00
Catherine Liu
1f03570126
[Dashboard Usability] Moves scrollbar to panel section (#145628)
## Summary

Closes https://github.com/elastic/kibana/issues/145404.
Closes #134257.

Cloud deployment for testing:
https://kibana-pr-145628.kb.us-west2.gcp.elastic-cloud.com:9243
User: `elastic`
Password: `zuIno5Tuy4lVmhMwbt2C6NyY`

This moves the scrollbar from the entire app to only the panel section
of the dashboard app. The search/filter bar and editor toolbar will
remain at the top while controls and panels scroll. The controls
floating actions were extracted out into their own component for future
use for panel actions.

#### Before
![Nov-17-2022
12-53-43](https://user-images.githubusercontent.com/1697105/202557972-6963b9d3-4eb0-40a4-963d-19e16e652d95.gif)


#### After
![Nov-17-2022
12-41-29](https://user-images.githubusercontent.com/1697105/202557993-251a984e-8bce-4b50-94c7-a7a39410a624.gif)


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

### 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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-09 11:10:54 -07:00
Nathan Reese
cb17912b6c
fix flaky test x-pack/test/functional/apps/dashboard/group2/panel_time_range·ts (#150630)
Fixers https://github.com/elastic/kibana/issues/150490

flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1899

Failures caused by settings panel not closing. PR resolves issue by
dismissing toasts so save button is clickable and retrying if settings
panel does not close.

<img width="500" alt="Screen Shot 2023-02-08 at 12 30 19 PM"
src="https://user-images.githubusercontent.com/373691/217639189-c1da31e8-b9d8-4d60-b95f-2e04b1d5c228.png">

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-09 10:38:34 -07:00
Spencer
1b85815402
[packages] migrate all plugins to packages (#148130)
Fixes https://github.com/elastic/kibana/issues/149344

This PR migrates all plugins to packages automatically. It does this
using `node scripts/lint_packages` to automatically migrate
`kibana.json` files to `kibana.jsonc` files. By doing this automatically
we can simplify many build and testing procedures to only support
packages, and not both "packages" and "synthetic packages" (basically
pointers to plugins).

The majority of changes are in operations related code, so we'll be
having operations review this before marking it ready for review. The
vast majority of the code owners are simply pinged because we deleted
all `kibana.json` files and replaced them with `kibana.jsonc` files, so
we plan on leaving the PR ready-for-review for about 24 hours before
merging (after feature freeze), assuming we don't have any blockers
(especially from @elastic/kibana-core since there are a few core
specific changes, though the majority were handled in #149370).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-08 21:06:50 -06:00
Nathan Reese
4446adb2ee
unskip flaky test test/functional/apps/dashboard/group1/embeddable_rendering·ts (#150596)
Fixes https://github.com/elastic/kibana/issues/132865

flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1891

PR fixes flaky test by ensuring window._echDebugStateFlag flag is set
before any panel renders.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-08 14:44:43 -07:00
Kibana Machine
c6a92e3333 skip failing test suite (#132865) 2023-02-08 13:51:09 -05:00
Drew Tate
d528635279
[Lens] better missing fields test (#150466) 2023-02-08 11:26:08 -06:00
Matthew Kime
a2c5bf8273
[data view mgmt] fix field refresh when index pattern is changed. (#150403)
Data view management now updates the field list of an edited data view
upon save.

Closes: https://github.com/elastic/kibana/issues/150248
2023-02-07 21:05:59 -06:00
Julia Rechkunova
9119a00a60
[Discover] Fix flaky adhoc test when removing a field (#150419)
Closes https://github.com/elastic/kibana/issues/142721
Closes https://github.com/elastic/kibana/issues/150271

100x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1873
2023-02-07 15:18:53 +01:00
Thomas Watson
50444bbd59
Change default value of csp.disableUnsafeEval to 'true' (#150157)
This change ensures that the `unsafe-eval` source expression isn't included in
the Kibana Content Security Policy (CSP) by default.

Users can set `csp.disableUnsafeEval: false` to reintroduce `unsafe-eval`.
However, since this config option is deprecated as of this commit, it's
recommended to instead set `csp.script_src: ['unsafe-eval']`.

Closes #150156
2023-02-07 07:07:13 -05:00
Sander Philipse
a496623003
[Enterprise Search] Add integration tiles for new connectors (#150369)
## Summary

This adds a bunch of integration tiles for our new connectors: Azure
Cloud, Google Cloud, Amazon S3, MS SQL, PostgreSQL and Oracle.
2023-02-07 04:59:48 -07:00
Stratoula Kalafateli
07b16a1193
[Vega] Stabilize the vega custom expressions tests (#150293)
## Summary
Closes https://github.com/elastic/kibana/issues/150208

The problem is that it adds the filter badge twice. I think that it
doesn't remove the previous one so a new is added. I think that waiting
the chart to be rendered after the clearing of the filters will
stabilize it.

Runner 100 times

### 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-02-07 08:56:36 +02:00
Hannah Mudge
55b66e20fe
[Dashboard] [Controls] Load more options list suggestions on scroll (#148331)
Closes https://github.com/elastic/kibana/issues/140175
Closes https://github.com/elastic/kibana/issues/143580

## Summary

Oh, boy! Get ready for a doozy of a PR, folks! Let's talk about the
three major things that were accomplished here:

### 1) Pagination
Originally, this PR was meant to add traditional pagination to the
options list control. However, after implementing a version of this, it
became apparent that, not only was UI becoming uncomfortably messy, it
also had some UX concerns because we were deviating from the usual
pagination pattern by showing the cardinality rather than the number of
pages:
    
<p align="center"><img
src="https://user-images.githubusercontent.com/8698078/214687041-f8950d3a-2b29-41d5-b656-c79d9575d744.gif"/></p>
    
So, instead of traditional pagination, we decided to take a different
approach (which was made possible by
https://github.com/elastic/kibana/pull/148420) - **load more options
when the user scrolls to the bottom!** Here it is in action:
    
<p align="center"><img
src="https://user-images.githubusercontent.com/8698078/214688854-06c7e8a9-7b8c-4dc0-9846-00ccf5e5f771.gif"/></p>

It is important that the first query remains **fast** - that is why we
still only request the top 10 options when the control first loads. So,
having a "load more" is the best approach that allows users to see more
suggestions while also ensuring that the performance of options lists
(especially with respect to chaining) is not impacted.

Note that it is **not possible** to grab every single value of a field -
the limit is `10,000`. However, since it is impractical that a user
would want to scroll through `10,000` suggestions (and potentially very
slow to fetch), we have instead made the limit of this "show more"
functionality `1,000`. To make this clear, if the field has more than
`1,000` values and the user scrolls all the way to the bottom, they will
get the following message:


<p align="center"><img
src="https://user-images.githubusercontent.com/8698078/214920302-1e3574dc-f2b6-4845-be69-f9ba04177e7f.png"/></p>


### 2) Cardinality
Previously, the cardinality of the options list control was **only**
shown as part of the control placeholder text - this meant that, once
the user entered their search term, they could no longer see the
cardinality of the returned options. This PR changes this functionality
by placing the cardinality in a badge **beside** the search bar - this
value now changes as the user types, so they can very clearly see how
many options match their search:

<p align="center"><img
src="https://user-images.githubusercontent.com/8698078/214689739-9670719c-5878-4e8b-806c-0b5a6f6f907f.gif"/></p>

> **Note**
> After some initial feedback, we have removed both the cardinality and
invalid selections badges in favour of displaying the cardinality below
the search bar, like so:
> 
> <p align="center"><img
src="https://user-images.githubusercontent.com/8698078/216473930-e99366a3-86df-4777-a3d8-cf2d41e550fb.gif"/></p>
> 
> So,  please be aware that the screenshots above are outdated.


### 3) Changes to Queries
This is where things get.... messy! Essentially, our previous queries
were all built with the expectation that the Elasticsearch setting
`search.allow_expensive_queries` was **off** - this meant that they
worked regardless of the value of this setting. However, when trying to
get the cardinality to update based on a search term, it became apparent
that this was not possible if we kept the same assumptions -
specifically, if `search.allow_expensive_queries` is off, there is
absolutely no way for the cardinality of **keyword only fields** to
respond to a search term.

After a whole lot of discussion, we decided that the updating
cardinality was a feature important enough to justify having **two
separate versions** of the queries:
1. **Queries for when `search.allow_expensive_queries` is off**:
These are essentially the same as our old queries - however, since we
can safely assume that this setting is **usually** on (it defaults on,
and there is no UI to easily change it), we opted to simplify them a
bit.
     
First of all, we used to create a special object for tracking the
parent/child relationship of fields that are mapped as keyword+text -
this was so that, if a user created a control on these fields, we could
support case-insensitive search. We no longer do this - if
`search.allow_expensive_queries` is off and you create a control on a
text+keyword field, the search will be case sensitive. This helps clean
up our code quite a bit.
     
Second, we are no longer returning **any** cardinality. Since the
cardinality is now displayed as a badge beside the search bar, users
would expect that this value would change as they type - however, since
it's impossible to make this happen for keyword-only fields and to keep
behaviour consistent, we have opted to simply remove this badge when
`search.allow_expensive_queries` is off **regardless** of the field
type. So, there is no longer a need to include the `cardinality` query
when grabbing the suggestions.

Finally, we do not support "load more" when
`search.allow_expensive_queries` is off. While this would theoretically
be possible, because we are no longer grabbing the cardinality, we would
have to always fetch `1,000` results when the user loads more, even if
the true cardinality is much smaller. Again, we are pretty confident
that **more often than not**, the `search.allow_expensive_queries` is
on; therefore, we are choosing to favour developer experience in this
instance because the impact should be quite small.
     
2. **Queries for when `search.allow_expensive_queries` is on**:
When this setting is on, we now have access to the prefix query, which
greatly simplifies how our queries are handled - now, rather than having
separate queries for keyword-only, keyword+text, and nested fields,
these have all been combined into a single query! And even better -
 now **all** string-based fields support case-insensitive search!
 Yup, that's right - even keyword-only fields 💃

There has been [discussion on the Elasticsearch side
](https://github.com/elastic/elasticsearch/issues/90898) about whether
or not this setting is even **practical**, and so it is possible that,
in the near future, this distinction will no longer be necessary. With
this in mind, I have made these two versions of our queries **completely
separate** from each other - while this introduces some code
duplication, it makes the cleanup that may follow much, much easier.

Well, that was sure fun, hey?

<p align="center"><img
src="https://user-images.githubusercontent.com/8698078/214921985-49058ff0-42f2-4b01-8ae3-0a4d259d1075.gif"/></p>


## How to Test
I've created a quick little Python program to ingest some good testing
data for this PR:

```python
import random
import time
import pandas as pd
from faker import Faker
from elasticsearch import Elasticsearch

SIZE = 10000
ELASTIC_PASSWORD = "changeme"
INDEX_NAME = 'test_large_index'

Faker.seed(time.time())
faker = Faker()
hundredRandomSentences = [faker.sentence(random.randint(5, 35)) for _ in range(100)]
thousandRandomIps = [faker.ipv4() if random.randint(0, 99) < 50 else faker.ipv6() for _ in range(1000)]

client = Elasticsearch(
    "http://localhost:9200",
    basic_auth=("elastic", ELASTIC_PASSWORD),
)

if(client.indices.exists(index=INDEX_NAME)):
    client.indices.delete(index=INDEX_NAME)
client.indices.create(index=INDEX_NAME, mappings={"properties":{"keyword_field":{"type":"keyword"},"id":{"type":"long"},"ip_field":{"type":"ip"},"boolean_field":{"type":"boolean"},"keyword_text_field":{"type":"text","fields":{"keyword":{"type":"keyword"}}},"nested_field":{"type":"nested","properties":{"first":{"type":"text","fields":{"keyword":{"type":"keyword"}}},"last":{"type":"text","fields":{"keyword":{"type":"keyword"}}}}},"long_keyword_text_field":{"type":"text","fields":{"keyword":{"type":"keyword"}}}}})

print('Generating data', end='')
for i in range(SIZE):
    name1 = faker.name();
    [first_name1, last_name1] = name1.split(' ', 1)
    name2 = faker.name();
    [first_name2, last_name2] = name2.split(' ', 1)
    response = client.create(index=INDEX_NAME, id=i, document={
        'keyword_field': faker.country(),
        'id': i,
        'boolean_field': faker.boolean(),
        'ip_field': thousandRandomIps[random.randint(0, 999)],
        'keyword_text_field': faker.name(),
        'nested_field': [
            { 'first': first_name1, 'last': last_name1},
            { 'first': first_name2, 'last': last_name2}
        ],
        'long_keyword_text_field': hundredRandomSentences[random.randint(0, 99)]
    })
    print('.', end='')
print(' Done!')
```
However, if you don't have Python up and running, here's a CSV with a
smaller version of this data:
[testNewQueriesData.csv](10538537/testNewQueriesData.csv)

> **Warning**
> When uploading, make sure to update the mappings of the CSV data to
the mappings included as part of the Python script above (which you can
find as part of the `client.indices.create` call). You'll notice,
however, that **none of the CSV documents have a nested field**.
Unfortunately, there doesn't seem to be a way to able to ingest nested
data through uploading a CSV, so the above data does not include one -
in order to test the nested data type, you'd have to add some of your
own documents
>
> Here's a sample nested field document, for your convenience:
> ```json
> {
>     "keyword_field": "Russian Federation",
>     "id": 0,
>     "boolean_field": true,
>     "ip_field": "121.149.70.251",
>     "keyword_text_field": "Michael Foster",
>     "nested_field": [
>       {
>         "first": "Rachel",
>         "last": "Wright"
>       },
>       {
>         "first": "Gary",
>         "last": "Reyes"
>       }
>     ],
> "long_keyword_text_field": "Color hotel indicate appear since well
sure right yet individual easy often test enough left a usually
attention."
> }
> ```
> 

### Testing Notes
Because there are now two versions of the queries, thorough testing
should be done for both when `search.allow_expensive_queries` is `true`
and when it is `false` for every single field type that is currently
supported. Use the following call to the cluster settings API to toggle
this value back and forth:

```php
PUT _cluster/settings
{
  "transient": {
	"search.allow_expensive_queries": <value> // true or false
  }
}
```

You should pay super special attention to the behaviour that happens
when toggling this value from `true` to `false` - for example, consider
the following:
1. Ensure `search.allow_expensive_queries` is either `true` or
`undefined`
2. Create and save a dashboard with at least one options list control
3. Navigate to the console and set `search.allow_expensive_queries` to
`false` - **DO NOT REFRESH**
4. Go back to the dashboard
5. Open up the options list control you created in step 2
6. Fetch a new, uncached request, either by scrolling to the bottom and
fetching more (assuming these values aren't already in the cache) or by
performing a search with a string you haven't tried before
7. ⚠️ **The options list control _should_ have a fatal error** ⚠️<br>The
Elasticsearch server knows that `search.allow_expensive_queries` is now
`false` but, because we only fetch this value on the first load on the
client side, it has not yet been updated - this means the options list
service still tries to fetch the suggestions using the expensive version
of the queries despite the fact that Elasticsearch will now reject this
request. The most graceful way to handle this is to simply throw a fatal
error.
8. Refreshing the browser will make things sync up again and you should
now get the expected results when opening the options list control.

### Flaky Test Runner

<a
href="https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1845"><img
src="https://user-images.githubusercontent.com/8698078/215894267-97f07e59-6660-4117-bda7-18f63cb19af6.png"/></a>

### Checklist

- [x] 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)
- [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] 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))
     > **Note**
> Technically, it actually does - however, it is due to an [EUI
bug](https://github.com/elastic/eui/issues/6565) from adding the group
label to the bottom of the list.
- [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)


### 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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-06 16:13:28 -07:00
Dima Arnautov
148a49adb8
[Console] Replace global GET /_mapping request with GET <index>/_mapping (#147770)
## Summary

### Notes for reviewers 

- Currently, autocomplete suggestions for fields don't work with
wildcards and data streams due to the
[bug](https://github.com/elastic/kibana/issues/149496) in the `main`. It
should be addressed separately.

### How to test

In order to spot the loading behaviour, ideally you should create an
index with a heavy mappings definition.
Afterwards, write a query that requires a field from this index, e.g.:

```
GET <my-index>/_search
{
  "aggs": {
    "my_agg": {
      "terms": {
        "field": "",
        "size": 10
      }
    }
  }
}
```

Place a cursor next to the `field` property, it should trigger mappings
fetch. After that, the mappings definition for this index will be cached
and accessed synchronously.

You can also open the browser's dev tools and enable Network throttling.
It allows noticing loading behaviour for any index.

--------------------

Resolves https://github.com/elastic/kibana/issues/146855

Instead of fetching all mappings upfront, requests mapping definition on
demand per index according to the cursor position.

Considering there is a maximum response size limit of 10MB in the
`/autocomplete_entities` endpoint, field autocompletion wasn't working
at all if the overall mappings definition exceeded this size. Retrieving
mappings per index tackles this and improves the init time.

![Jan-25-2023
17-16-31](https://user-images.githubusercontent.com/5236598/214616790-4954d005-e56f-49f9-be6d-435c076270a8.gif)

### Checklist

- [ ]
[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 was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
2023-02-06 15:14:51 -05:00
Yulia Čech
8705a6a77b
[Guided onboarding] Registers 3 separate guide IDs for search (#149968)
## Summary
Fixes https://github.com/elastic/kibana/issues/149691 
Follow up to https://github.com/elastic/kibana/pull/149528 

This PR adds 3 separate guide ID values `appSearch`, `websiteSearch` and
`databaseSearch` instead of previously used `search`. With that change,
each card for Search on the landing page has its own independent guide
that can be completed.

Example plugin for guided onboarding is also updated so that all 3
search guides can be managed there. Otherwise there should not be any
UI/UX changes.

Currently, all 3 ids are registered with the same config and that can be
easily updated by the team in the future.

#### Screenshot
<img width="485" alt="Screenshot 2023-01-31 at 18 24 12"
src="https://user-images.githubusercontent.com/6585477/215840343-f9a65be3-0568-40ca-b458-5de92bfe8aaf.png">


### 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-02-06 06:16:26 -07:00
Julia Rechkunova
62d348433f
[Discover] Refresh fields when data view is edited (#149861)
Closes https://github.com/elastic/kibana/issues/149838
2023-02-03 09:24:21 +01:00
Drew Tate
be37fa1190
[Lens] Don't block render on missing field (#149262) 2023-02-02 18:09:43 -06:00
Nathan Reese
2fb8620240
fix Failing test: Chrome UI Functional Tests.test/functional/apps/dashboard/group1/embeddable_rendering·ts (#149886)
Fixes https://github.com/elastic/kibana/issues/132865

flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1823

Failing tests did not provide anything useful in screen shot or debug
logs. PR adds more logging and scrolls to pie chart so if test continues
to be flaky, hopefully logs and screen shot can provide better data to
investigate

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-02 14:36:20 -07:00
Nick Peihl
ace2c30c29
[Dashboard Usability] Unified panel options pane (#148301) 2023-02-02 16:30:31 -05:00
Jean-Louis Leysens
df809bd53a
[Saved objects] Prepare SO management for versionable types (#149495)
## Summary

Part of preparing HTTP APIs and associated interfaces for versioning:

* Add domain-specific interfaces to the saved object management plugin
    * Add a V1 interface of domain types to `common`
    * Remove use of deprecated `SavedObject` type from public
* Follows on from https://github.com/elastic/kibana/pull/148602


Related https://github.com/elastic/kibana/issues/149098

Fixes https://github.com/elastic/kibana/pull/149495

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-02 17:02:38 +01:00
Julia Rechkunova
d0eaa7839f
[Discover] Fix flaky adhoc test (#150083)
Closes https://github.com/elastic/kibana/issues/144706

100x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1853
2023-02-02 09:11:01 +01:00
Julia Rechkunova
6bb1e5b9ee
[Discover] Unskip search alert tests (#150076)
Closes https://github.com/elastic/kibana/issues/148388
Closes https://github.com/elastic/kibana/issues/148386
Closes https://github.com/elastic/kibana/issues/148385

100x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1851
2023-02-02 09:10:31 +01:00
Julia Rechkunova
a5f7d17694
[Discover] Fix flaky sidebar test (#150081)
Closes https://github.com/elastic/kibana/issues/146996

100x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1852
2023-02-02 09:09:53 +01:00
Nathan Reese
2f39242610
fix Failing test: Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/dashboard/group2/sync_colors·ts (#150087)
Fixes https://github.com/elastic/kibana/issues/148557 and
https://github.com/elastic/kibana/issues/148558

Flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1854

See
https://github.com/elastic/kibana/issues/148557#issuecomment-1412415539
for explanation of failure. PR resolves flakiness by adding retry in
clickCreateNewLink, ensuring clickCreateNewLink opens lens or else
retries.
2023-02-01 11:43:17 -07:00
Julia Rechkunova
6f3b29df5d
[Discover] Add a way to quickly expand time range from "No results" screen (#147195)
Related to issue https://github.com/elastic/kibana/issues/12608
A part of Spacetime project
https://github.com/elastic/kibana/pull/146729 but only for "No results"
UI, excluding the time picker changes.

## Summary

This PR extends the "No results matches your search criteria. Expand
your time range..." message to allow users quickly expand the time range
by clicking on a link.

<img width="1492" alt="Screenshot 2022-12-07 at 14 38 45"
src="https://user-images.githubusercontent.com/1415710/206221177-1a466b98-6cd3-494d-b7fe-09fdd43b1222.png">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-01 04:24:45 -07:00
Nathan Reese
4e66e01c73
unskip Failing test: Chrome UI Functional Tests.test/functional/apps/dashboard/group4/dashboard_empty·ts (#149889)
Fixes https://github.com/elastic/kibana/issues/149256

Flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1824

Fix in https://github.com/elastic/kibana/pull/149582. `await
kibanaServer.importExport.unload(kbnDirectory);` is getting the `error
ECONNRESET`. Underlining cause determined to be @pgayvallet "Yeah, so
apparently it's related to the fact that
kibanaServer.importExport.unload calls bulkDelete with the summary from
the import file, which is not a valid SO. Not sure why it doesn't
constantly crashes on master though, as my changes in
https://github.com/elastic/kibana/pull/149582 makes it quite obvious"
2023-01-30 15:38:14 -07:00
Nathan Reese
53b50c5400
unskip Failing test: Chrome UI Functional Tests.test/functional/apps/visualize/input_control_vis/dynamic_options·ts (#149874)
Fixes https://github.com/elastic/kibana/issues/98974

Flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1820
2023-01-30 13:31:13 -07:00
Matthew Kime
a64027deed
[discover] Enable data view editing from flyout (#149453)
## Summary

Currently, changes to a data view require a round trip to management
when you're in discover. This PR allows editing of data views via flyout
from within discover.

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


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

---------

Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-30 08:42:58 -06:00
Yngrid Coello
3d3a885ad7
[APM] Show warning if transaction groups are dropped (#148625)
Closes https://github.com/elastic/kibana/issues/146648.

### Changes
- `transaction_detail_link.tsx` prevent navigation to tx details when
bucket name is other and display the warning tooltip
- `xpack.apm.ui.transactionGroupBucketSize` ui setting was removed and
now we have a hardcoded limit of `1000` buckets when querying
transactions.

**After this change**


https://user-images.githubusercontent.com/1313018/214321647-e0ae59d6-0761-4d9e-a0fe-ef21397aeff7.mov


- When kibana limit has been reached
<img width="1391" alt="image"
src="https://user-images.githubusercontent.com/1313018/214321902-05fbfa6c-7c99-4b21-a67b-7e134c14ab73.png">

- When having only `_other`
<img width="1390" alt="image"
src="https://user-images.githubusercontent.com/1313018/214332887-d6fd59a2-d1ef-4b61-b6ed-79a6d458f0a0.png">

### Test instructions
1. Checkout PR branch
2. Execute Synthtrace scenario
    a. For reaching kibana limit callout
        ```
node scripts/synthtrace --clean other_transaction_group_bucket.ts
--scenarioOpts.txGroups=1001
        ```
    b. For `_other` callout
        ```
node scripts/synthtrace --clean other_transaction_group_bucket.ts
        ```

---------

Co-authored-by: Achyut Jhunjhunwala <achyut.jhunjhunwala@elastic.co>
2023-01-30 15:40:25 +01:00
Julia Rechkunova
86b38a824d
[Discover] Unskip flaky a11y tests (#149827)
Closes https://github.com/elastic/kibana/issues/147186

100x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1811
2023-01-30 15:18:24 +01:00
Kibana Machine
5f73936937 skip failing test suite (#147186) 2023-01-27 09:28:54 -05:00
Nathan Reese
85b5351c90
unskip test/functional/apps/maps/group4/discover·js (#149554)
Fixes https://github.com/elastic/kibana/issues/137408 and
https://github.com/elastic/kibana/issues/149358

flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1790

Tests flaky because clicking on `Visualize` button not registered. This
resulted in test failing because the test started looking for elements
in Maps even though the page was still in Discover. PR resolves
flakiness by adding retry around click to ensure `Visualize` button is
clicked as expected.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-01-26 08:29:39 -07:00
Nathan Reese
c48406947f
[Maps] unskip X-Pack Saved Object Tagging Functional Tests.x-pack/test/saved_object_tagging/functional/tests/maps_integration·ts - saved objects tagging (#149356)
Fixes https://github.com/elastic/kibana/issues/89073 and
https://github.com/elastic/kibana/issues/106547

Flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1785

Issue with flaky maps_integration.ts is that there was not await when
filtering maps list by tags. This resulted in list page refreshing after
`const links = await
this.find.allByCssSelector('.euiTableRow-isSelectable .euiLink');` and
then getting an elemented unmounted on future `await
links[i].getVisibleText()` calls.

A [similar fix](https://github.com/elastic/kibana/pull/82930) was
implemented for visualize and dashboard listing pages.

https://github.com/elastic/kibana/pull/82930 introduced
`listingTable.waitUntilTableIsLoaded` but did not introduce the method
in a consistent way. Other methods that search table were not updated to
use `listingTable.waitUntilTableIsLoaded`, but instead used
`this.header.waitUntilLoadingHasFinished()`. This PR resolved this issue
by updating all listingTable methods that search to use
`listingTable.waitUntilTableIsLoaded` and then updated
`listingTable.waitUntilTableIsLoaded` with a call to
`this.header.waitUntilLoadingHasFinished()`

https://github.com/elastic/kibana/pull/82930 did not update
maps_integration tests, only resolving the issue for visualize and
dashboard. To avoid future situations where fixes only resolve a few
usages, this PR moves selectFilterTags into listing_table and replaces
all implementations of selectFilterTags with
listingTable.selectFilterTags.

While investigating dashboard_integrations test, I found
`x-pack/test/functional/apps/dashboard/group2/dashboard_tagging.ts`,
which duplicated most of dashboard_integrations test. This PR removes
x-pack/test/functional/apps/dashboard/group2/dashboard_tagging.ts adds
the unique test case to dashboard_integrations

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-26 08:13:52 -07:00
Julia Rechkunova
c19ef2f818
[Discover] Integrate unified field list filters into Discover (#148547)
Closes https://github.com/elastic/kibana/issues/145081
Part 1 of this integration was done in
https://github.com/elastic/kibana/pull/147255

<img width="640" alt="Screenshot 2023-01-16 at 16 58 59"
src="https://user-images.githubusercontent.com/1415710/212720438-8f37eb69-635a-4611-89bb-34b095d79b8c.png">


## Summary

This PR integrates the unified field list filters and search into
Discover.
- [x] Integrate into Discover
- [x] Clean up deprecated code ("searchable"/"aggregatable" filters were
removed too)
- [x] Refactor field icons, labels, desc to use the unified ones
- [x] Field list in SQL view needs refactoring to use the received field
types rather than data view field types
- [x] Update tests

### Checklist

- [x] 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)
- [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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-01-26 10:40:13 +01:00
Stratoula Kalafateli
bb207aadc3
[Lens] Remove the deprecated field list sampling strategy (#149482)
## Summary

This PR removes the deprecated field list sampling setting which was
marked as deprecated on 8.1. This
https://github.com/elastic/kibana/pull/139828 was the PR that added the
deprecation callout.
2023-01-26 09:38:21 +02:00
Tiago Costa
d74e2152e2
skip flaky suite (#149256) 2023-01-25 15:22:21 +00:00
Christiane (Tina) Heiligers
f7b25f5e46
[Saved Objects] Provide ability to remove SO type from global SO HTTP API without hiding from the client (#149166)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
resolves https://github.com/elastic/kibana/issues/147150
2023-01-23 15:04:24 -07:00
Aleh Zasypkin
422e9444b1
Upgrade cookiejar dependency (2.1.12.1.4). (#149323) 2023-01-23 17:20:38 +01:00
Yulia Čech
e7746b24d5
[Guided onboarding] Register test guide in the example plugin (#147703)
This PR moves the test guide used for testing and dev work to the guided
onboarding package. It is now being registered when the guided
onboarding example plugin is being setup. For that a server side is
added to the example plugin.
Registering the test guide from the example plugin demonstrates how the
"register guide" function can be used for production guides. The test
config needs to be in the `kbn-guided-onboarding` package because
example plugins have some problems importing files from other plugins.
That way the test config is available to the example plugin and to the
guided onboarding plugin for unit and functional tests.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-20 03:29:25 -07:00
Nick Peihl
ff5101d3c1
[Discover] Fix data-title attribute in savedsearch embeddable (#149078)
## Summary

Fixes an error where the `data-title` attribute in the `DiscoverGrid`
component was not getting updated when using a custom panel title via
the saved search embeddable `searchTitle` prop.

[This functional test was returning a false
positive](https://github.com/elastic/kibana/blob/main/test/functional/apps/dashboard/group5/data_shared_attributes.ts#L110-L124).
The previous test left a context menu open so the test was changing the
panel title of the first embeddable (a Lens embeddable) rather than the
saved search embeddable. As a result the bug in the saved search
embeddable was unnoticed.
2023-01-19 09:22:22 -05:00
Michael Dokolin
091b15e52d
[Saved Objects Management] Encapsulate saved objects deletion behind an API endpoint (#148602) 2023-01-19 15:05:07 +01:00
Sergi Massaneda
bca73b72ed
[Security Solution] [CellActions] Move to a package (#149057)
Epic: https://github.com/elastic/kibana/issues/144943

## Summary

Moving the existing CellActions implementation to a new home. The
`kbn-cell-actions` package contains components and hooks that are going
to be used by solutions to show data cell actions with a consistent UI
across them.

Security Solution is going to start using it by migrating all
"hover-actions" to the unified implementation, but the usage is not
restricted to it. Any plugin can register and attach its own actions to
a trigger via uiActions, and use this package to render the CellActions
components in a consistent way.

The initial implementation was placed in the uiActions plugin itself due
to a types constraints
(https://github.com/elastic/kibana/tree/main/src/plugins/ui_actions/public/cell_actions),
the constraint has been solved so we are creating the package for it as
planned.

This PR only moves that implementation to the new package, with small
directory changes. The exported components are not being used anywhere
currently, so the implementation may change during the migration phase.

### Checklist

Delete any items that are not applicable to this PR.

- [x] 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)
- [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

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-19 11:52:10 +01:00