## Summary
Closes#154500.
Closes https://github.com/elastic/kibana/issues/114206.
This updates the UX around cloning dashboards. I removed the clone
confirm model, so cloning a dashboard is just a one click action now.
This aligns with how other apps like ML handle cloning. I've also made
the dashboard title breadcrumb a button in edit mode that opens the
dashboard settings flyout for better discoverability.
4f5ea117-a5e4-4ec5-9113-8b09fd8c84a1
I also changed the pattern for cloned dashboard title from `Dashboard
Title Copy` to `Dashboard Title (#)`.
<img width="1226" alt="Screenshot 2023-06-30 at 1 03 35 PM"
src="b50ba5c6-dc95-4aab-a320-b1a78b74c1b6">
## Summary
Tackles the first improvement described in
https://github.com/elastic/kibana/issues/160038.
When "picking up" the updated mappings, we add a "query" in order to
select and update only the SO types that have been updated, compared to
the previous version.
We achieve this by comparing `migrationMappingPropertyHashes`; we
compare the hashes stored in the
`<soIndex>.mapping._meta.migrationMappingPropertyHashes` against the
ones calculated from the definitions from the `typeRegistry`.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Original issue: https://github.com/elastic/kibana/issues/144943
## Summary
* Update CellActions value to be `Serializable`.
* Update Default Actions and SecuritySolution Actions to allowlist the
supported Kibana types.
* Add an extra check to Action's `execute` to ensure the field value is
compatible.
### How to test it?
* Open Discover and create a saved search with many different field
types
* Go to Security Solutions dashboards
* Create a new dashboard and import the saved search
* Test the created dashboard inside Security Solutions
### 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
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Adds support to the Files plugin for DataStreams. Changes include:
- use `op_type` of `create` on all document creations
- When the `indexIsAlias` option is used:
- check for index existence will not be done, thus Index will NOT be
automatically created if it does not yet exist
- `@timestamp` top-level document property will be written for the
metadata as well as each file chunk
- Fixes `ElasticsearchBlobStorageClient.createIndexIfNotExists()` to
ensure it is executed no more than once per index name
- added `.catch(wrapErrorAndReThrow)` to several `esClient` calls in
order to get better stack traces for failures
### 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>
## Summary
Previously - If you changed a data view's index pattern AND the new
pattern didn't contain the timestamp field, you'd see a blank timestamp
field and it would let you save. The data view would have been saved
with the previous timestamp field which doesn't exist.
Now - The timestamp validator checks to make sure the selected timestamp
field is in the list of available options. This is helpful because it
keeps the previous timestamp value in case you do select an index
pattern that contains it.
Closes: https://github.com/elastic/kibana/issues/150219
## Summary
Fixes#160737
This PR adds support for title and description within the Embeddable
overrides realm.
While there also enables the support for overrides for the new TagCloud
visualization.
The playground example has been extended to test it for any type of
chart:
<img width="572" alt="Screenshot 2023-06-30 at 10 17 04"
src="8b069c2f-dd31-4aaa-9ded-0e33f34b4860">
### 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)
### Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.
When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:
| Risk | Probability | Severity | Mitigation/Notes |
|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces—unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |
### 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>
## Summary
This updates tsdb sample dataset so it contains additional field:
`bytes_counter_normal` which contains same values as `bytes_counter`
field but is NOT a tsdb metric field.
This allows easy testing of functionalities for tsdb counter metric
field.
Dimensions are also updated. Event.dataset is now the only dimension
field, so that whole dataset contains a single dimension. This was done
so that the values indexed in the bytes_counter field are correct (as
the counter needs to be increasing for each unique dimension
combination).
Timestamps were also updated, as tsdb requires a single document with
unique dimensions per timestamp
- Closes https://github.com/elastic/kibana/issues/150317
## Summary
This PR:
- hides "Use without saving" button from NoData screen on Discover page
to align with Dashboard and Lens behaviour
- allows to open a saved search via URL even if there are no data views
present (before NoData screen was shown instead).
## Summary
Composite runtime fields with dots in the name were broken, now fixed.
To verify -
1. Create runtime field with dot in the name
2. Make a composite runtime field with subfields with dot in the name
3. Go back and edit those fields
Closes: https://github.com/elastic/kibana/issues/159648
### Release note
Fixes creation and editing of composite runtime fields with dots in the
names.
## Summary
- Move field preview to internal route
- Add versioning to route
- Endpoint is called with version
- Response schema validation
Closes https://github.com/elastic/kibana/issues/159158
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Adds a 404 page, and ensures that errors are properly surfaced both if
they happen at dashboard container creation time and if they happen when
navigating from one dashboard to the next.
Part of https://github.com/elastic/kibana/issues/141978
PR updates tracks layer with "group by time series" logic. When true,
geo_line metric aggregation is proceeded by `time_series` bucket
aggregation instead of `filters` bucket aggregation (used by existing
terms split).
### UI when creating tracks layer with time series data view
<img width="481" alt="Screen Shot 2023-06-22 at 12 35 46 PM"
src="ccfeb6ef-c714-49a3-a6d6-f6b52cce80be">
<img width="469" alt="Screen Shot 2023-06-22 at 12 35 55 PM"
src="55cba2dc-6326-4141-bde5-7a6cc0f0b333">
<img width="542" alt="Screen Shot 2023-06-22 at 12 49 22 PM"
src="694ce621-2b6e-4a20-ba20-b9f9d20da8ef">
### UI when editing tracks layer with time series data view
<img width="447" alt="Screen Shot 2023-06-22 at 12 36 17 PM"
src="96cbb3f3-4ca5-430f-91b3-71b5013ca6e9">
<img width="457" alt="Screen Shot 2023-06-22 at 12 36 24 PM"
src="4d603809-7e6a-4b72-98d7-d3a516b2c809">
### Test instructions
* clone https://github.com/thomasneirynck/faketracks
* cd into `faketracks`
* run `npm install`
* run `node ./generate_tracks.js --isTimeSeries`
* In Kibana, create `tracks` data view
* In Maps, create new map and add `Tracks` layer. Select `Tracks` data
view.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Think the filters builder component does not allow a maxDepth of 1
correctly, as behavior in that state is indistinguishable from usage of
the component with a maxDepth of 0, both states only allow top level
ANDs only. With this change, it's possible to have 1 level of nesting of
either type, but no deeper. The renderedLevel prop will never go above 0
without this change with 0 or 1 as well, it now matches maxDepth.
After:
<img width="639" alt="image"
src="405098d6-4e3a-43b3-9bf9-b783abb9eb0a">
Before maxDepth 0:
<img width="658" alt="image"
src="a3e11bc0-1b9f-4bf2-a1fa-4d8d34be5907">
(Or is never an option)
Before maxDepth 1:
<img width="683" alt="image"
src="bde6bb59-2b41-4496-922b-6fd6d6eb29dc">
(Or is never an option)
Before maxDepth 2:
<img width="656" alt="image"
src="32f407ee-d1f5-42cb-bbef-6e8dc4ff115b">
Works as expected
Fixes https://github.com/elastic/kibana/issues/152883
The task says this is the behavior that we want for datatable, but with
the way data plugin interacts with Lens, it's actually impossible to
modify only for datatable. In my opinion that's an improvement though,
we probably want the same behavior for all supported visualization (so
also metric).
### Scenarios to test:
<img width="316" alt="Screenshot 2023-06-27 at 09 10 35"
src="55b42b45-2154-4a32-b9e4-01f6fbdc4493">
1,2,3 returns the `price:${value}` filter
4. returns `price:exists` filter
5. returns `category.keyword:${value}` coming from filter by
6. `OR` filter for array values
<img width="419" alt="Screenshot 2023-06-28 at 16 31 43"
src="d7842617-7be3-4b8a-a39f-206a145f9b81">
Fixes#159808
It was working before, the only missing point was you couldn't color
when all groups were collaped by.
1. Moved dimension editor code to separate file.
2. Removed StaticColorValue component and used `ColorPicker` that we use
for other places in the code
3. Fixed the issue for pie (hopefully tested everything now)
4. Fixed the issue for xy chart. To reproduce - create a date histogram
xy chart, assign color to the Count of records. Then create a breakdown
dimension and collapse it. Open dimension panel for count of records -
the displayed color is the default one, not the one we assigned.
## 📓 Summary
Closes https://github.com/elastic/observability-dev/issues/2655
This PR introduces a customized log consumption experience in the
Discover plugin. By leveraging the new `discover_log_explorer` plugin
and utilizing the `discover.customize` functionality, we have curated a
more tailored user experience.
The key feature of this implementation is the `DatasetSelector`
component, which replaces the original Discover `DataViewPicker`. It
handles the retrieval, rendering, and navigation of integrations and
data streams related to logs, providing an improved user interface.
This PR involves significant development efforts, including the creation
of the `discover_log_explorer` plugin, implementation of services, state
machines, custom hooks, and enhancements to presentational components.
The following overview will help reviewers understand the
responsibilities of each component in this implementation.
d725b699-452e-4718-8189-8dc1fab4d044
## DatasetsService & DatasetsClient
The DatasetsService is introduced, a crucial component that mediates
access to the newly implemented DatasetsClient. During the plugin's
lifecycle, the DatasetsService exposes a client property through its
start() method, providing convenient access to a DatasetsClient
instance.
The DatasetsClient is responsible for abstracting the data fetching
process for two endpoints: the integrations endpoint and the data
streams listing endpoint. These endpoints are utilized to populate the
selector options in the user interface. To facilitate this, the
DatasetsClient exposes the findIntegrations and findDatasets methods,
which handle the respective data fetching.
## Discover Customization
The critical part of this work consists of where the customization is
applied.
Inside the `public/plugin.tsx`, we lazy load and create, injecting the
required dependencies, the `CustomDatasetSelector`, which already
encapsulates all the logic required to make the selector work with the
external APIs.
We kept separating the data fetching logic from how the selector works,
and all the data and events are passed into the UI component with
properties.
```ts
discover.customize(
DISCOVER_LOG_EXPLORER_PROFILE_ID,
({ customizations, stateContainer }) => {
customizations.set({
id: 'search_bar',
CustomDataViewPicker: createLazyCustomDatasetSelector({
datasetsClient: datasetsService.client,
stateContainer,
}),
});
...
```
## Data fetching state machines & custom hooks
To handle the data fetching of integrations and unmanaged data streams,
we created two different state machines to separately handle the related
action for each dataset, such as remote search, in-memory search, error
handling etc.
### Integration machine and useIntegrations
The integrations state machine handles automatic data fetching of the
resources and additionally provides transitions for loading more
integrations, searching integrations by HTTP request, searching locally
into integration streams, and all the related loading and error handling
states.
It is then interpreted inside the `useIntegrations` custom hook, which
exposes the fetched data and handlers for all the above-mentioned
actions.
<img width="1975" alt="Screenshot 2023-05-30 at 09 44 42"
src="6daeca9f-826d-4a0f-bd90-eb4826ed1bde">
### Datasets machine and useDatasets
Similar to the integrations state machine, but simplified since the data
streams search can only happen with HTTP requests and there is no
pagination that requires to handle the load of more entries.
It is interpreted inside the `useDatasets` custom hook, which also
exposes the fetched data and handlers for the available actions.
<img width="1692" alt="Screenshot 2023-05-30 at 09 45 11"
src="5f9690e2-4e8f-439e-9ffd-f3b34cf3eaf5">
## DatasetSelector
The `DatasetSelector` component contains all the logic that manages the
navigation and searches across the different panels that render
integrations, integrations' streams or unmanaged streams.
As the datasets come from different APIs or are performed in-memory, the
search work follow this logic:
- When listing the integrations list (first level of the
`EuiContextMenu`), the search is done with an HTTP request.
- When listing the data streams list for a specific integration (second
level of the `EuiContextMenu`), the search is done in-memory, filtering
and sorting directly in the client.
- When listing the unmanaged data streams list (second level of the
`EuiContextMenu`), the search is done again with an HTTP request.
To handle these possible user journeys correctly without side effects,
we created another state machine and exposed its actions with an
internal `useDatasetSelector` custom hook.
<img width="1978" alt="Screenshot 2023-05-30 at 09 46 04"
src="84aa4247-c65d-40de-9eb6-6117bee731f8">
## Next steps
This component will change quite a lot until we won't get to a final
design. As soon as a first solid mvp is defined for production, a
complete test for the component will be implemented, among with a more
generic functional test for the core customization features.
---------
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
## Summary
This updates connector tiles for Enterprise Search to bring them in line
with 8.9.
<img width="1032" alt="Screenshot 2023-06-26 at 16 26 40"
src="a222a2a3-17ad-4e72-8ce8-57e09d89d05e">
<img width="1035" alt="Screenshot 2023-06-26 at 16 25 04"
src="3ce1e78c-b4fe-404b-b314-e02f3d6f439e">
<img width="1086" alt="Screenshot 2023-06-26 at 16 24 40"
src="14dd6ca5-875f-4c2d-9408-a2fa15abbbec">
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This adds an overview of the number of documents per document type. It's
possible to filter the data via search bar and time range.
<img width="1478" alt="image"
src="32c1c79c-c76a-4b84-ab16-c1b1faccba32">
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Fix https://github.com/elastic/kibana/issues/160385
Use the internal client instead of the scoped one for the extended stats
ES requests to avoid an error with unauthenticated users (when anonymous
access is allowed)
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- For https://github.com/elastic/kibana/pull/159638
- Also closes https://github.com/elastic/kibana/issues/160432
## Summary
This PR makes `theme` available in kibana context which is necessary for
supporting dark mode in `CodeEditor`.
Also fixed Inspect on Search Sessions page: it was blank because of
missing `settings`. Shall we backport?
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Add support for `Boolean` and `Number` types to CellActions and update
Security Actions accordingly.
It also fixes the copy-to-clipboard action for fields of the type number
(`process.parent.pid`).
issue: https://github.com/elastic/kibana/issues/159298
- [x] Remove discover fields value casting if it gets merged after the
[discover PR](https://github.com/elastic/kibana/pull/157201)
### How to test it?
The quickest way is to find an alert field that is a boolean or number
on the alerts page and check if security solution actions still work.
But all boolean fields that I tested are actually strings. 🤷
Alternatively, you could render the `<SecurityCellActions />` with fake
data (boolean and number).
### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
This PR adds custom performance metrics collection in Discover app
client using EBT.
[Discussed](https://elastic.slack.com/archives/CNKNE0PHN/p1685631040718719)
in slack
The following events will be collected (thanks a lot to @davismcphee for
the great code overview and suggestions)
Discover main view:
- `discoverLoadSavedSearch` will report Saved Search loading time on
opening app by calculating
[loadSavedSearch](5b784c8967/src/plugins/discover/public/application/main/discover_main_route.tsx (L131-L170))
call duration
- `discoverFetchAll`: reports Discover table loading time ("time to
data") by calculating
[fetchAll](5b784c8967/src/plugins/discover/public/application/main/services/discover_data_state_container.ts (L208-L223))
call duration
- `discoverFetchAllRequestsOnly`: reports [fetching ES
documents](5b784c8967/src/plugins/discover/public/application/main/utils/fetch_all.ts (L85-L96))
duration only (event meta contains `fetchType: fetchDocuments |
fetchSQL` ), part of "time to data" duration. It calculates
`fetchDocuments` | `fetchSQL` call duration.
Discover single doc view:
- `discoverSingleDocFetch`: reports individual document fetching time by
calculating
[requestData](5b784c8967/src/plugins/discover/public/hooks/use_es_doc_search.ts (L39-L75))
call duration
Surrounding documents view:
- `discoverSurroundingDocsFetch` reports [surrounding docs fetching
time](5b784c8967/src/plugins/discover/public/application/context/context_app.tsx (L122-L149))
and will also contain fetchType in meta, e.g. `fetchType:
'predecessors'`
**Note**: currently we won't report it, since `many_fields_discover`
journey uses esArchives with data not supporting surrounding docs. We
can add new journey with custom dataset to address it and other
performance-related areas.
Metrics can be tracked on [single user perf
dashboard](dd0473ac-826f-5621-9a10-25319700326e?_g=())
as `many_fields_discover` targeted Lens viz:
<img width="1423" alt="image"
src="aaaaa6a0-a666-4ea2-b627-fa44b4673210">
4 runs were done before `discoverFetchAllRequestsOnly` was added, so you
only see 3 data points for this metric
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Fixes https://github.com/elastic/kibana/issues/159410
This PR adds a new package `kbn-generate-console-definitions` that will
eventually replace the package `kbn-spec-to-console`. It also adds a new
command to use the script in the new package. The new command can be
used as following:
- `node scripts/generate_console_definitions.js --source
<PATH_TO_ES_SPECIFICATION_REPO>` where `PATH_TO_ES_SPECIFICATION_FOLDER`
is the absolute path to the root of the [ES specification
repo](https://github.com/elastic/elasticsearch-specification), for
example `/Users/yulia/elastic/elasticsearch-specification`. This command
will generate autocomplete definitions in the folder
`KIBANA_ROOT/src/plugins/console/server/lib/json/generated`.
- Optionally `--dest` parameter can be passed to generate definitions in
a different folder, relative to `KIBANA_ROOT`.
Basic script functionality was implemented in this PR:
- [x] Create the folder if doesn't exist yet
- [x] Remove all files in the folder before generating definitions
- [x] Load the specification schema and parse each endpoint
- [x] Create a file for each endpoint with the endpoint name, methods,
patterns and doc urls.
Functionality that will be added in follow up PRs:
- Url paramaters
- Request body parameters
- Availability property
- Unit test for script functions
### How to test
1. Checkout ES specification repo
2. Run the command with `node scripts/generate_console_definitions.js
--source <ES_SPECIFICATION_REPO> --emptyDest` where
`<ES_SPECIFICATION_REPO>` is the absolute path to the root of the ES
specification repo
3. Check the changes to the generated files in the folder
`/KIBANA_REPO/src/plugins/console/server/lib/spec_definitions/json/generated`
and make sure they have a correct endpoint name, patterns, methods and
doc links. We are not generating any url params, request body params or
availability property for now.
4. Change the constant in the file
`KIBANA_REPO/src/plugins/console/common/constants/autocomplete_definitions.ts`
to a non-existent folder. Run the script `node
scripts/generate_console_definitions.js --source
<ES_SPECIFICATION_REPO>` and check that the folder has been created
successfully
5. Re-run the command without `--emptyDest` flag targeting a folder that
already contain some files. Check that the script fails and doesn't
silently remove existing files
6. Run the help command `node scripts/generate_console_definitions.js
--help` and check if the help message makes sense
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
Optimize switch to text-based queries by reducing unnecessary EuiDataGrid renderings and addressing performance regression. Introduce a PARTIAL state emission in the document$ observable for text-based query results. This state indicates ongoing loading in the UI. The appState to URL changes hook completes with the COMPLETE state submission to document$, enabling UI rendering.
Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
## Summary
While working on https://github.com/elastic/kibana/issues/159410, I
noticed that there are some unused functions in the Console server side
plugin contracts. This PR removes the function `addProcessorDefinition`
from the `start` contract. I was not able to find any uses of this
function in the Kibana code. I believe it might have been planned to be
used for ingest processors but currently we use the `_processor`
endpoint for that (see
[here](6f94e42a32/src/plugins/console/server/lib/spec_definitions/js/ingest.ts (LL605C15-L605C37))).
And since the tests also pass I think it's safe to remove this function.
I'm using the label `release_note:breaking` because the plugin's
contracts are public and theoretically it's possible that there are some
external plugins that use that function.
### Release note
The function `addProcessorDefinition` is removed from the Console plugin
start contract (server side).
## Summary
Why?
To simplify the process of migration to react-router@6.
https://github.com/remix-run/react-router/discussions/8753
What problems exactly it solves?
- In my previous PR I added `CompatRouter`
https://github.com/elastic/kibana/pull/159173, which caused changes in
~50 files and pinged 15 Teams. And this is just meant to be a temporary
change, so when we're done with the migration I would have to revert
these changes and engage everyone to review the PR again. And it is just
a single step in the migration strategy. So to make our lives easier I
think it would be better to have a common place where we do import our
router components because it will allow us to surface some extra logic
in single place instead of going through the whole source code again.
- `react-router@6` doesn't support a custom `Route` component, so that
means our custom `Route` component that we're using almost everywhere
today, will need to be replaced by a different solution. I have decided
to add `Routes` component, which will be responsible for rendering the
proper component (`react-router@6` renamed `Switch` to `Routes`, so I
have named this component to align with the dictionary of the new
router) and also is going to add the logic that today is done in `Route`
(moving logic to `Routes` will be done in the follow-up PR, here I just
wanted to focus on using the common router components to make the review
process easier)
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
closes: https://github.com/elastic/kibana/issues/157191
Enables Discover DataGrid to use registered cell actions instead of the
default static actions.
### New `cellActionsTriggerId` prop
This PR introduces a new `cellActionsTriggerId` _optional_ prop in the
DataGrid component:
98c210f9ec/src/plugins/discover/public/components/discover_grid/discover_grid.tsx (L198-L201)
When this prop is defined, the component queries the trigger's registry
to retrieve the cellActions attached to it, using the CellActions
package' `useDataGridColumnsCellActions` hook. This hook returns the
cellActions array ready to be passed for each column to the EuiDataGrid
component.
When (non-empty) actions are found in the registry, they are used,
replacing all of the default static Discover actions. Otherwise, the
default cell actions are used.
This new prop also allows other instances of the Discover DataGrid to be
configured with custom cell actions, which will probably be needed by
Security Timeline integration with Discover.
### New `SEARCH_EMBEDDABLE_CELL_ACTIONS_TRIGGER` Trigger
Along with the new `cellActionsTriggerId` prop the plugin also registers
a new trigger for "saved search" embeddable:
055750c8dd/src/plugins/discover/public/plugin.tsx (L387)
And it gets passed to the DataGrid component on the Embeddable creation:
055750c8dd/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx (L403)
Having this new trigger available allows solutions to attach custom
actions to it, in order to be displayed in the saved search embeddables.
Each action will be able to implement its `isCompatible` check to
determine if they are going to be displayed in the embedded saved search
DataGrid field, or not. If no compatible actions are found, DataGrid
will render the default static actions.
ℹ️ In this implementation, the actions registered to this new
"embeddable trigger" need to check if they are being rendered inside
Security using the `isCompatible` function, to prevent them from being
displayed in other solutions, resulting in a non-optimal architecture.
This approach was needed since there's no plausible way to pass the
`cellActionsTriggerId` property from the Dashboard Renderer used in
Security, all the way down to the specific Discover "saved search"
embeddable. However, the Dashboards team is planning to enable us to
pass options to nested embeddables using a registry
(https://github.com/elastic/kibana/issues/148933). When this new tool is
available we will be able to delegate the trigger registering to
Security and configure the "saved search" embeddables to use it.
Therefore, the trigger will only be used by Security, so we won't have
to worry about Security actions being rendered outside Security.
## Videos
before:
de92cd74-6125-4766-8e9d-7e0985932618
after:
f9bd597a-860e-4572-aa9d-9f1c72c11a4b
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Pablo Neves Machado <pablo.nevesmachado@elastic.co>
- Closes https://github.com/elastic/kibana/issues/149336
## Summary
This PR converts `unifiedFieldList` plugin into a new
`@kbn/unified-field-list` package.
Had to also move some deps:
- from `uiActions` plugin to the existing `@kbn/ui-actions-browser`
package
- from `data` plugin to a new `@kbn/data-service` package
Please test that Field Stats from the package are still working on your
pages.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Fixes#147107
This PR fixes two issues with locale and default dimension labels:
* generate default (non-custom) dimension labels at expression runtime
rather than at dimension generation
* make date histogram interval unit support locale
Test notes:
* create a dashboard with some panels with default labels, others with
custom ones
* then change the i18n configuration in the `kibana.yml` file and reload
the dashboard
* default labels + intervals should be now translated
* custom labels should not change
Here's a dashboard using all 4 editors with a date histogram charts.
This PR is expected to have full effect on Lens and some effects on
Agg-based visualization, no effects on Vega and TSVB:
<img width="1508" alt="Screenshot 2023-06-06 at 10 21 03"
src="812c7176-5a81-44bc-8619-7436a24fe608">
<img width="1507" alt="Screenshot 2023-06-06 at 10 19 01"
src="34b8957d-eb07-48a6-8049-88b9e5e165e4">
<img width="1508" alt="Screenshot 2023-06-06 at 10 17 59"
src="fde657fb-c9f7-4860-bc92-d4a3806fc16e">
<img width="1506" alt="Screenshot 2023-06-06 at 10 14 39"
src="93c26f31-e98d-4985-a179-2c86e1ddb875">
## Note
<details>
<summary>Previous issue with single unit</summary>
There's a breaking change which affects the unit rate when it's a single
value unit:
<img width="1505" alt="Screenshot 2023-06-06 at 10 23 20"
src="52eceaa5-78aa-4903-96be-8f33fd0360e9">
<img width="1509" alt="Screenshot 2023-06-06 at 10 22 34"
src="f8625ec7-69c8-4b5d-ac87-50b9e56e282f">
The change is `timestamp per hour` to `timestamp per one hour`. ❌
It would be possible to handle few of these cases with manual parsing of
the string for some languages (i.e. `durationDescription.split('
')[1]`), but that is not a universal fix as it won't work for languages
without spaces.
TSVB "solves" reduces a lot this problem by stepping down the unit
avoiding to use single value unit: `1 hour` => `60 minutes`. Perhaps a
similar solution could be leveraged as well? I would still be some sort
of major change.
</details>
The previous issue with single unit has been solved and will be
completely visible once the i18n will be applied.
### 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)
### Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.
When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:
| Risk | Probability | Severity | Mitigation/Notes |
|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces—unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |
### 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: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
- Closes https://github.com/elastic/kibana/issues/160212
## Summary
Added the missing encoding and updated tests.
## For testing
An id with special characters like `/` can be specified via `_bulk` API.
Example:
```
POST _bulk
{ "index" : { "_index" : "context-special", "_id" : "test&?#+/=" } }
{ "timestamp":"2023-06-20T20:00:00.123Z", "name": "test" }
```
Partially addresses https://github.com/elastic/kibana/issues/159590
## Summary
This PR disables the Advanced settings plugin for all projects in
serverless.
**How to test:**
1. Start Elasticsearch with `yarn es snapshot` and Kibana with `yarn
serverless-{mode}` where {mode} can be `es`, `security`, or `oblt`.
2. Verify that the Advanced settings app is not accessible and its
endpoint (`app/management/kibana/settings`) leads to the Stack
Management landing page.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
The `Run pattern analysis` button should only be available for time
series data.
This PR adds an additional check using the dataview's `isTimeBased`
method.