Commit graph

290 commits

Author SHA1 Message Date
Kibana Machine
c4f03aeb64
[8.x] [Logs Overview] Add a flyout to show category document examples (#194867) (#197966)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Logs Overview] Add a flyout to show category document examples
(#194867)](https://github.com/elastic/kibana/pull/194867)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Kerry
Gallagher","email":"kerry.gallagher@elastic.co"},"sourceCommit":{"committedDate":"2024-10-24T14:49:27Z","message":"[Logs
Overview] Add a flyout to show category document examples
(#194867)\n\n## Summary\r\n\r\nImplements
https://github.com/elastic/kibana/issues/193450.\r\n\r\n## Discover
changes ⚠️ \r\n\r\nAs part of this we need to render a basic table with
the log level and\r\nsummary columns, which is technically context aware
but only in the\r\nsense we know we want it to be a logs context up
front.\r\n\r\nThe \"correct\" solution here (or at least from recent
conversations) is\r\nto use the saved search embeddable. There is
upcoming work planned to\r\nmove log stream component usages over to the
saved search embeddable.\r\nHowever, currently this isn't in a place to
just be dropped in without\r\nsome pretty extensive work. I didn't feel
comfortable doing a big push\r\non that work as a side effort to this
work, especially with a loose (if\r\npossible) 8.16 aim for
this.\r\n\r\nWhat I've done (and which isn't ideal I appreciate) is used
the start\r\ncontract of the Discover plugin to export the columns /
cells\r\npre-wrapped with the Discover services. It's not ideal in the
sense of\r\ndependencies, but technically Discover doesn't use logs
shared. I\r\nconsidered Discover shared but that's for registering
functionality for\r\nDiscover, rather than the other way
around.\r\n\r\nEventually we'll be able to remove this and convert over
to the new\r\nsolution. I'm all ears to a better solution, but there's a
big mismatch\r\nbetween the needs here and dropping in something that
exists currently.\r\nThankfully the changeset for Discover is small if
we're happy to keep\r\nthis temporarily.\r\n\r\nEdit: I've made some
notes
here:\r\nhttps://github.com/elastic/logs-dev/issues/111#issuecomment-2411096251\r\n\r\nEdit:
New package added
here:\r\nc290819c1c\r\n\r\n##
Overview\r\n\r\nFrom a high level:\r\n\r\n- Adds a new state machine for
handling \"details\" to show in the flyout\r\n(document examples now,
plus details and a timeline later).\r\n\r\n- Hooks this up to a flyout
expanded from the categories table.\r\n\r\n- Provides linking to
Discover to view documents from the category in\r\nthe
flyout.\r\n\r\nI've also left some comments inline.\r\n\r\n## UI / UX
\r\n\r\n![Screenshot 2024-10-10 at 15
05\r\n21](249ef269-0105-48af-9c81-ebae1cfb1680)\r\n\r\n---------\r\n\r\nCo-authored-by:
Felix Stürmer <felix.stuermer@elastic.co>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by: Felix
Stürmer <weltenwort@users.noreply.github.com>\r\nCo-authored-by: Julia
Rechkunova
<julia.rechkunova@gmail.com>","sha":"6b63f7f6314e9c05525df32629be7ba769c6ab4c","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport
missing","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-logs","backport:version"],"title":"[Logs
Overview] Add a flyout to show category document examples
","number":194867,"url":"https://github.com/elastic/kibana/pull/194867","mergeCommit":{"message":"[Logs
Overview] Add a flyout to show category document examples
(#194867)\n\n## Summary\r\n\r\nImplements
https://github.com/elastic/kibana/issues/193450.\r\n\r\n## Discover
changes ⚠️ \r\n\r\nAs part of this we need to render a basic table with
the log level and\r\nsummary columns, which is technically context aware
but only in the\r\nsense we know we want it to be a logs context up
front.\r\n\r\nThe \"correct\" solution here (or at least from recent
conversations) is\r\nto use the saved search embeddable. There is
upcoming work planned to\r\nmove log stream component usages over to the
saved search embeddable.\r\nHowever, currently this isn't in a place to
just be dropped in without\r\nsome pretty extensive work. I didn't feel
comfortable doing a big push\r\non that work as a side effort to this
work, especially with a loose (if\r\npossible) 8.16 aim for
this.\r\n\r\nWhat I've done (and which isn't ideal I appreciate) is used
the start\r\ncontract of the Discover plugin to export the columns /
cells\r\npre-wrapped with the Discover services. It's not ideal in the
sense of\r\ndependencies, but technically Discover doesn't use logs
shared. I\r\nconsidered Discover shared but that's for registering
functionality for\r\nDiscover, rather than the other way
around.\r\n\r\nEventually we'll be able to remove this and convert over
to the new\r\nsolution. I'm all ears to a better solution, but there's a
big mismatch\r\nbetween the needs here and dropping in something that
exists currently.\r\nThankfully the changeset for Discover is small if
we're happy to keep\r\nthis temporarily.\r\n\r\nEdit: I've made some
notes
here:\r\nhttps://github.com/elastic/logs-dev/issues/111#issuecomment-2411096251\r\n\r\nEdit:
New package added
here:\r\nc290819c1c\r\n\r\n##
Overview\r\n\r\nFrom a high level:\r\n\r\n- Adds a new state machine for
handling \"details\" to show in the flyout\r\n(document examples now,
plus details and a timeline later).\r\n\r\n- Hooks this up to a flyout
expanded from the categories table.\r\n\r\n- Provides linking to
Discover to view documents from the category in\r\nthe
flyout.\r\n\r\nI've also left some comments inline.\r\n\r\n## UI / UX
\r\n\r\n![Screenshot 2024-10-10 at 15
05\r\n21](249ef269-0105-48af-9c81-ebae1cfb1680)\r\n\r\n---------\r\n\r\nCo-authored-by:
Felix Stürmer <felix.stuermer@elastic.co>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by: Felix
Stürmer <weltenwort@users.noreply.github.com>\r\nCo-authored-by: Julia
Rechkunova
<julia.rechkunova@gmail.com>","sha":"6b63f7f6314e9c05525df32629be7ba769c6ab4c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194867","number":194867,"mergeCommit":{"message":"[Logs
Overview] Add a flyout to show category document examples
(#194867)\n\n## Summary\r\n\r\nImplements
https://github.com/elastic/kibana/issues/193450.\r\n\r\n## Discover
changes ⚠️ \r\n\r\nAs part of this we need to render a basic table with
the log level and\r\nsummary columns, which is technically context aware
but only in the\r\nsense we know we want it to be a logs context up
front.\r\n\r\nThe \"correct\" solution here (or at least from recent
conversations) is\r\nto use the saved search embeddable. There is
upcoming work planned to\r\nmove log stream component usages over to the
saved search embeddable.\r\nHowever, currently this isn't in a place to
just be dropped in without\r\nsome pretty extensive work. I didn't feel
comfortable doing a big push\r\non that work as a side effort to this
work, especially with a loose (if\r\npossible) 8.16 aim for
this.\r\n\r\nWhat I've done (and which isn't ideal I appreciate) is used
the start\r\ncontract of the Discover plugin to export the columns /
cells\r\npre-wrapped with the Discover services. It's not ideal in the
sense of\r\ndependencies, but technically Discover doesn't use logs
shared. I\r\nconsidered Discover shared but that's for registering
functionality for\r\nDiscover, rather than the other way
around.\r\n\r\nEventually we'll be able to remove this and convert over
to the new\r\nsolution. I'm all ears to a better solution, but there's a
big mismatch\r\nbetween the needs here and dropping in something that
exists currently.\r\nThankfully the changeset for Discover is small if
we're happy to keep\r\nthis temporarily.\r\n\r\nEdit: I've made some
notes
here:\r\nhttps://github.com/elastic/logs-dev/issues/111#issuecomment-2411096251\r\n\r\nEdit:
New package added
here:\r\nc290819c1c\r\n\r\n##
Overview\r\n\r\nFrom a high level:\r\n\r\n- Adds a new state machine for
handling \"details\" to show in the flyout\r\n(document examples now,
plus details and a timeline later).\r\n\r\n- Hooks this up to a flyout
expanded from the categories table.\r\n\r\n- Provides linking to
Discover to view documents from the category in\r\nthe
flyout.\r\n\r\nI've also left some comments inline.\r\n\r\n## UI / UX
\r\n\r\n![Screenshot 2024-10-10 at 15
05\r\n21](249ef269-0105-48af-9c81-ebae1cfb1680)\r\n\r\n---------\r\n\r\nCo-authored-by:
Felix Stürmer <felix.stuermer@elastic.co>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by: Felix
Stürmer <weltenwort@users.noreply.github.com>\r\nCo-authored-by: Julia
Rechkunova
<julia.rechkunova@gmail.com>","sha":"6b63f7f6314e9c05525df32629be7ba769c6ab4c"}}]}]
BACKPORT-->

Co-authored-by: Kerry Gallagher <kerry.gallagher@elastic.co>
2024-10-28 07:19:04 -05:00
Joe McElroy
522fffba1e
[8.x] [Search][Onboarding] api-key plugin (#191926) (#194756)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Search][Onboarding] api-key plugin
(#191926)](https://github.com/elastic/kibana/pull/191926)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Yan
Savitski","email":"yan.savitski@elastic.co"},"sourceCommit":{"committedDate":"2024-10-02T08:45:20Z","message":"[Search][Onboarding]
api-key plugin (#191926)\n\n## Summary\r\nKibana plugin that helps
manage the session for the api-key that\r\nprovides two exports:\r\n-
React custom hook to read the api-key stored in session. This
hook\r\nshould return the api-key if it exists, otherwise null.\r\n-
Component to present either the api key in storage or action to
create\r\napi key and store into sessionStorage after callback.\r\n<img
width=\"1255\" alt=\"Screenshot 2024-09-27 at 20 52
52\"\r\nsrc=\"https://github.com/user-attachments/assets/dc5bcd39-7fe6-433c-8aaa-ad3578a68b62\">\r\n<img
width=\"1248\" alt=\"Screenshot 2024-09-27 at 20 52
39\"\r\nsrc=\"https://github.com/user-attachments/assets/d760c163-9017-4f57-ba1a-38ee8ee21534\">\r\n<img
width=\"676\" alt=\"Screenshot 2024-09-27 at 20 52
28\"\r\nsrc=\"https://github.com/user-attachments/assets/e908d20a-7e0c-4f3b-9ea2-8e2d1a74c9eb\">","sha":"c5aa73991463dee50b036bb51645e03cc283bb8c","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor"],"number":191926,"url":"https://github.com/elastic/kibana/pull/191926","mergeCommit":{"message":"[Search][Onboarding]
api-key plugin (#191926)\n\n## Summary\r\nKibana plugin that helps
manage the session for the api-key that\r\nprovides two exports:\r\n-
React custom hook to read the api-key stored in session. This
hook\r\nshould return the api-key if it exists, otherwise null.\r\n-
Component to present either the api key in storage or action to
create\r\napi key and store into sessionStorage after callback.\r\n<img
width=\"1255\" alt=\"Screenshot 2024-09-27 at 20 52
52\"\r\nsrc=\"https://github.com/user-attachments/assets/dc5bcd39-7fe6-433c-8aaa-ad3578a68b62\">\r\n<img
width=\"1248\" alt=\"Screenshot 2024-09-27 at 20 52
39\"\r\nsrc=\"https://github.com/user-attachments/assets/d760c163-9017-4f57-ba1a-38ee8ee21534\">\r\n<img
width=\"676\" alt=\"Screenshot 2024-09-27 at 20 52
28\"\r\nsrc=\"https://github.com/user-attachments/assets/e908d20a-7e0c-4f3b-9ea2-8e2d1a74c9eb\">","sha":"c5aa73991463dee50b036bb51645e03cc283bb8c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191926","number":191926,"mergeCommit":{"message":"[Search][Onboarding]
api-key plugin (#191926)\n\n## Summary\r\nKibana plugin that helps
manage the session for the api-key that\r\nprovides two exports:\r\n-
React custom hook to read the api-key stored in session. This
hook\r\nshould return the api-key if it exists, otherwise null.\r\n-
Component to present either the api key in storage or action to
create\r\napi key and store into sessionStorage after callback.\r\n<img
width=\"1255\" alt=\"Screenshot 2024-09-27 at 20 52
52\"\r\nsrc=\"https://github.com/user-attachments/assets/dc5bcd39-7fe6-433c-8aaa-ad3578a68b62\">\r\n<img
width=\"1248\" alt=\"Screenshot 2024-09-27 at 20 52
39\"\r\nsrc=\"https://github.com/user-attachments/assets/d760c163-9017-4f57-ba1a-38ee8ee21534\">\r\n<img
width=\"676\" alt=\"Screenshot 2024-09-27 at 20 52
28\"\r\nsrc=\"https://github.com/user-attachments/assets/e908d20a-7e0c-4f3b-9ea2-8e2d1a74c9eb\">","sha":"c5aa73991463dee50b036bb51645e03cc283bb8c"}}]}]
BACKPORT-->

---------

Co-authored-by: Yan Savitski <yan.savitski@elastic.co>
2024-10-03 14:02:05 +02:00
Stratoula Kalafateli
0895634081
[8.x] [ES|QL] Renames the textbased editor to esql editor (#193521) (#193706)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[ES|QL] Renames the textbased editor to esql editor
(#193521)](https://github.com/elastic/kibana/pull/193521)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Stratoula
Kalafateli","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2024-09-23T10:06:53Z","message":"[ES|QL]
Renames the textbased editor to esql editor (#193521)\n\n##
Summary\r\n\r\nRenames the text-based-editor to esql-editor\r\n\r\nI
tried to also rename components, data-test-subj, classNames and
files.\r\nMy focus is mostly on the plugin and package of the esql
editor\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"d56a1bbbbafee958abf7583e7a867bd1ac8187a6","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Feature:ES|QL","ci:project-deploy-observability","Team:ESQL","v8.16.0"],"number":193521,"url":"https://github.com/elastic/kibana/pull/193521","mergeCommit":{"message":"[ES|QL]
Renames the textbased editor to esql editor (#193521)\n\n##
Summary\r\n\r\nRenames the text-based-editor to esql-editor\r\n\r\nI
tried to also rename components, data-test-subj, classNames and
files.\r\nMy focus is mostly on the plugin and package of the esql
editor\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"d56a1bbbbafee958abf7583e7a867bd1ac8187a6"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193521","number":193521,"mergeCommit":{"message":"[ES|QL]
Renames the textbased editor to esql editor (#193521)\n\n##
Summary\r\n\r\nRenames the text-based-editor to esql-editor\r\n\r\nI
tried to also rename components, data-test-subj, classNames and
files.\r\nMy focus is mostly on the plugin and package of the esql
editor\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"d56a1bbbbafee958abf7583e7a867bd1ac8187a6"}},{"branch":"8.x","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
2024-09-23 15:22:56 +02:00
Stratoula Kalafateli
601c8a8f3c
[8.x] [ES|QL] Renames the language package to a more generic name (#193517) (#193691)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[ES|QL] Renames the language package to a more generic name
(#193517)](https://github.com/elastic/kibana/pull/193517)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Stratoula
Kalafateli","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2024-09-23T07:58:53Z","message":"[ES|QL]
Renames the language package to a more generic name (#193517)\n\n##
Summary\r\n\r\nRenames the language-documentation-popover to
language-documentation as\r\nit stores additional layouts:\r\n-
popover\r\n- flyout\r\n-
inline","sha":"9d0d41ce871be49f4d18b8bbfad7791173c6ebc8","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Feature:ES|QL","Team:ESQL","v8.16.0"],"number":193517,"url":"https://github.com/elastic/kibana/pull/193517","mergeCommit":{"message":"[ES|QL]
Renames the language package to a more generic name (#193517)\n\n##
Summary\r\n\r\nRenames the language-documentation-popover to
language-documentation as\r\nit stores additional layouts:\r\n-
popover\r\n- flyout\r\n-
inline","sha":"9d0d41ce871be49f4d18b8bbfad7791173c6ebc8"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193517","number":193517,"mergeCommit":{"message":"[ES|QL]
Renames the language package to a more generic name (#193517)\n\n##
Summary\r\n\r\nRenames the language-documentation-popover to
language-documentation as\r\nit stores additional layouts:\r\n-
popover\r\n- flyout\r\n-
inline","sha":"9d0d41ce871be49f4d18b8bbfad7791173c6ebc8"}},{"branch":"8.x","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
2024-09-23 13:48:05 +02:00
Dario Gieselaar
98aa1ab769
[Inventory] Inventory plugin (#191798)
## Description

This PR adds an inventory plugin, which renders an inventory UI.
Currently only data streams are rendered. This is part of the LogsAI
initiative - basically we need a UI for tasks like structuring data,
extracting entities, listing the results etc. This is mostly POC-level
stuff. Eventually some of this code might be handed over to ECO but
let's cross that bridge when we get to it.

## Notes for reviewers:

@elastic/appex-ai-infra @elastic/security-generative-ai: added a
`truncateList` utility function that takes the first n elements of an
array and appends a `{l-n} more` string value if there are more values
than n. Really simple but I expect will also be very often used because
we cannot send a huge amount of items to the LLM.

@elastic/kibana-core @elastic/kibana-operations: just boiler plate stuff
for adding a new plugin (and thank you for enabling us to run
`quick_checks` locally!

@elastic/obs-knowledge-team: added support for streaming using an
Observable.

@elastic/obs-ux-management-team: added links to the Inventory UI in the
Observability plugin

@elastic/obs-entities: I've added an entity manager client to be able to
fetch entity definitions on the server. Maybe there's a better way? LMK.

@elastic/obs-ux-logs-team: added a deeplink to the Inventory UI. I've
also moved CODEOWNERS for this package to
@elastic/obs-ux-management-team as they own the Observability plugin
where this is mostly used.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-12 15:07:09 +02:00
Devon Thomson
b02f6dbcc5
[Collapsable Panels] Better Scrolling for kbn grid layout (#191120)
changes `kbn grid layout` to allow better scrolling behaviour.
2024-08-27 13:36:33 -04:00
Candace Park
14498a0221
[Security Solution][Admin][AVC Banner] AVC banner logic moved into a kbn package (#188359)
## Summary

- [x] This is an improvement pr to move all the avc banner logic into a
reusable kibana package (security solution and fleet integrations)
- [x] Compresses the svg used in the banner's  background 
- [x] Fixes a bug where the blog link didn't previously open in a new
tab

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-19 09:24:28 +10:00
Vadim Kibana
7e4c8a83e1
[ES|QL] Rename text-based-languages pugin to esql plugin (#187520)
## Summary

Renames `@kbn/text-based-languages` plugin to `@kbn/esql` plugin. This
has been discussed internally, the rationale is that now there will be
only one language: ES|QL; and we may use this plugin for ES|QL related
HTTP routes.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-10 00:16:32 +10:00
Umberto Pepato
f99f83428c
[ResponseOps][Alerts] Implement platform alerts grouping components (#184635)
## Summary

Adds solution-agnostic components to create hierarchical alerts grouping
UIs, adapting the original implementation from Security Solution.

Closes #184398 

## To Verify

For existing usages of the `@kbn/grouping` package: verify that the
grouped UIs work correctly (Security Alerts, Cloud Security Posture).

New alerting UI components: checkout
https://github.com/elastic/kibana/pull/183114 (PoC PR), where the
updated `@kbn/grouping` package and these new components are used in
Observability's main Alerts page.

### 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>
Co-authored-by: Gerard Soldevila <gerard.soldevila@elastic.co>
Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
Co-authored-by: Tre <wayne.seymour@elastic.co>
2024-07-08 19:23:49 +02:00
Ignacio Rivas
1e197cf718
[Ingest Pipelines] Add unsaved changes prompt (#183699) 2024-06-07 20:35:56 +02:00
Stratoula Kalafateli
5860259222
[ES|QL] Render a Discover-like table in the assistant instead of a Lens chart (#184106)
## Summary

This PR does 2 things:

- Creates a new plugin that is a wrapper of the unified datatable and is
only for rendering as a table ES|QL results. The UnifiedDatatable
package is good but the consumers need to know all the properties to
understand how to use it and the necessity of displaying in a table the
results of an ES|QL query comes a lot lately. This plugin has only 3
required properties (rows, columns, query) which make it very easy for
the consumers to use it. It also integrates the Row Viewer flyout

- It changes the implementation of the obs ai assistant to render a
Discover like table instead of a Lens table. The Discover-like table is
much better on rendering a table with thousands of columns and is going
to be much more helpful for our users.

The same plugin can be used later for the inline ediitng flyout too in a
dashboard if we want to also display the results of an ES|QL query.

Some screenshots of the new possibilities in the assistant:

- I can see the results of an ES|QL query in a visualization


![meow](27f77ca3-633b-45f2-b935-42c62c184a04)

- I can render my results as a Document view

<img width="880" alt="image"
src="e8034e10-325d-4d9e-b8a5-34d01b0dbd9d">

<img width="1095" alt="image"
src="c8236e65-96aa-4fcb-b7c3-835e2a5665bd">

<img width="955" alt="image"
src="78b1d664-6863-42bf-a337-659143b7683d">


### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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>
2024-06-05 20:20:20 +02:00
Umberto Pepato
df15fe1b06
[ResponseOps][Security Solution] Transfer ownership of the alerts grouping package to ResponseOps (#184131)
## Summary

As agreed in the recent ResponseOps/Security/Observability meeting, the
ResponseOps team will take ownership of the alerts grouping package
(formerly `@kbn/securitysolution-grouping`) in order to provide a
solution-agnostic API surface for future usages in Observability and
Stack rules.

This PR implements this transfer, while also renaming the package to
`@kbn/grouping` to reflect the change in scope.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-28 11:15:04 +02:00
Rodney Norris
98329a8879
[Search] Move TryInConsoleButton to it's own package (#183201)
## Summary

Moved the TryInConsoleButton from the search api panels package to its
own package. This should make it easier to import and encourage usage in
more parts of Kibana even outside of search.
2024-05-13 14:34:41 -05:00
Stratoula Kalafateli
7054f58170
[ES|QL] More usages of getESQLQueryColumns (#182691)
## Summary

This PR is an attempt to use the `getESQLQueryColumns` util everywhere
we are trying to fetch the columns (using the limit 0).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-10 18:07:31 +02:00
Stratoula Kalafateli
807da63c61
[ES|QL] Fetch the query columns utils (#182338)
## Summary

Revives this https://github.com/elastic/kibana/pull/181969

To do so, I had to create a new package `search-types` and move the
types I need there.

The Discovery team can take it from here.

Note: It also does a cleanup on the types I move, some of them were
declared twice.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-06 10:51:40 +02:00
Eyo O. Eyo
03696a4561
Share Modal (#179037)
## Summary

This PR is based off of https://github.com/elastic/kibana/pull/176617,
which in turn builds off of the generic tabbed modal component created
here https://github.com/elastic/kibana/pull/176261.
Partially addresses https://github.com/elastic/kibana-team/issues/753

The PR introduces an alternate way of sharing a dashboard by
consolidating the existing share options into a single place.

## TO TEST
Set `share.new_version.enabled: true `in your kibana.dev.yml in order to
see these changes.
- [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: rshen91 <rshen@elastic.co>
2024-04-04 09:06:14 -07:00
Marco Liberati
fb19e57a4e
[ES|QL] New @kbn/esql-services package (#179029)
## Summary

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

This PR extracts the ES|QL service like "validation", "autocomplete",
"code_action" (quick fixes) and some other services into a separate
package `@kbn/esql-validation-autocomplete` which has no tie with Monaco
editor anymore.

All the AST and grammar logic has been encapsulated into a single
`@kbn/esql-ast` package who contains the `getAst` function together with
the `parser` and `lexer`.

## Validation enhancements

The validation API has been enhanced to gracefully degrade whenever
callbacks are not provided, via the `ignoreOnMissingCallback` option.
Tests are included as well for this scenario.

### Example plugin

An example plugin app has been developed to show to to use the
validation API

<img width="500" alt="Screenshot 2024-03-22 at 17 45 38"
src="ebc172d3-ee61-4f3a-9e42-dcb9b15c7e69">

The app starts with a missing callback:

<img width="855" alt="Screenshot 2024-03-22 at 17 36 22"
src="c9b81370-8a10-487d-b22f-2359e1365a54">

Toggling the ignore option will hide the index error due to the lack of
`getSources` callback:

<img width="816" alt="Screenshot 2024-03-22 at 17 28 17"
src="931f4e5f-3ad6-46f7-97ca-63d7bb66646b">

Warnings are shown as well when detected:

<img width="807" alt="Screenshot 2024-03-22 at 17 35 56"
src="5e3e0537-cba2-475f-946b-0302867384ca">

#### Code snippet

The example app produces a copyable code snippet of the current
configuration of the validator:

![Code
snippet](https://private-user-images.githubusercontent.com/924948/316838987-fd16da58-8790-40b2-851d-b92aca1811dc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTE0NTY0MzUsIm5iZiI6MTcxMTQ1NjEzNSwicGF0aCI6Ii85MjQ5NDgvMzE2ODM4OTg3LWZkMTZkYTU4LTg3OTAtNDBiMi04NTFkLWI5MmFjYTE4MTFkYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwMzI2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDMyNlQxMjI4NTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00ZDhhOGRlMjZjMzZhN2NjNTdkYWMxYTNjOWVkNTA3NDk5NGViOTg2NWEzMTAyZGM4MGYyOTQ0YjQ2N2Q3ZDI1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.H-3r_B57NK1-rS8UbR_bxlNtAMQ0flFGtW0oTIiOlr0)

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-03-27 14:39:48 +01:00
Sander Philipse
a64642b58c
[Search] Create connectors plugin (#178663)
## Summary

Creates a new search-connectors-plugin that houses some shared stateful
code for connectors. Right now this houses just images and a list of
connector types. In the futures this will also house API calls.


### 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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [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] 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)


### 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&mdash;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&mdash;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

- [x] 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>
2024-03-26 06:56:16 -07:00
Søren Louv-Jansen
bb72b3e8e9
[ObsAiAssistant] Move AI Assistant Management plugin to x-pack (#179235)
This PR moves the AI Assistant Management plugin into x-pack to
co-locate it with the other assistant plugins and to make it possible to
statically import from the other assistant plugins. This is not
currently possible because the Management plugin is in OSS and the other
plugins are in xpack.
2024-03-25 08:36:36 -05:00
Sébastien Loix
37dee75e31
[Stateful sidenav] Add deeplink definitions & hide page side nav (#178861) 2024-03-20 12:39:47 +00:00
Rachel Shen
f43fecc1cd
[Shared UX] Separate share reporting and reporting api client into packages from central reporting plugin (#176104)
## Summary
This PR separates the reporting api client and the reporting share
plugin out of the reporting plugin. As a result, Jobs had to be taken
out of the plugin as well. This is work that will benefit the share
modal redesign epic by isolating the reporting share plugin code.

The share code is added to the @kbn/reporting-public package.

### 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: Timothy Sullivan <tsullivan@elastic.co>
2024-02-22 09:03:03 -07:00
Stratoula Kalafateli
25898e68bd
[Obs ai assistant][ESQL] Visualizes a query (#174677)
## Summary


This PR

1. Adds a new CTA (Visualize query) on the generated ES|QL queries
<img width="965" alt="image"
src="3ec3176a-23e1-4329-9d27-a01c6ff8aa92">

2. Clicking the CTA, requests from Lens to suggest a chart based on the
given query
<img width="955" alt="image"
src="466da7d8-f6c4-4c46-9b51-a7fad5e31e55">


3. The embeddable has 2 actions:
- Edit the embeddable
- Save the embeddable on a dashboard

4. Editing the embeddable opens a push flyout where the user can

- Change the query
- Change the chart configuration (colors, dimensions etc)
- Click one of the chart suggestions


![ai_assistant](11fb6a55-60a6-491c-9540-060bebdfaa4a)

5. With clicking the apply button, the new chart configuration is saved
to the conversation

6. User can save the ES|QL chart on a dashboard. From there they can
continue editing the chart (we also display the same inline editing
flyout giving a seamless experience)

### 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] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
Co-authored-by: Milton Hultgren <miltonhultgren@gmail.com>
Co-authored-by: Coen Warmer <coen.warmer@gmail.com>
2024-02-05 17:55:13 +02:00
Drew Tate
1d4b7df989
[Lens] Prevent overwriting managed content from editor (#175062)
## Summary

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

I marked this a breaking change since it is preventing users from doing
something they have been able to do before. They can no longer save
changes to managed Lens visualizations. Instead, they have to save
changes to a new visualization.

To test, import this `ndjson` file which includes both a managed and an
unmanaged visualization:

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2024-01-24 09:06:05 -06:00
Devon Thomson
64ebaffd89
[Embeddable Refactor] Create Decoupled Presentation Panel (#172017)
Closes https://github.com/elastic/kibana/issues/167426
Closes https://github.com/elastic/kibana/issues/167890

Contains much of the prep work required to decouple the Embeddables system from Kibana in anticipation of its deprecation and removal.

Co-authored-by: Nathan Reese <reese.nathan@gmail.com>
2024-01-17 17:13:02 -05:00
Marco Liberati
99fc9099c5
[Lens] Move formula docs into separate package (#173770)
## Summary

Fixes #103248 and #164952

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2024-01-02 16:02:46 +02:00
Nathan Reese
bb84e24637
@kbn/search-errors package (#171563)
Part of https://github.com/elastic/kibana/issues/171570

PR breaks EsError out of data plugin and into @kbn/search-errors
package. This will allow for future efforts to move [lens error
handing](https://github.com/elastic/kibana/blob/main/x-pack/plugins/lens/public/editor_frame_service/error_helper.tsx)
into this package and more closely align error handling across kibana.

An unplanned part of this PR was moving `BfetchRequestError` into its
own package `@kbn/bfetch`. This is required because `@kbn/search-errors`
package can not import code from a plugin. `BfetchRequestError` could
not be part of `@kbn/search-errors` because that created a circular
dependency graph.

Another unexpected problem found while working on this PR is that the
package had to be included in `ui-shared-deps`. The reason for this is
that `renderSearchError` uses `instanceof EsError` check to determine if
an error is an EsError. This check failed when the package was not
included in `ui-shared-deps` because each plugin got its own copy of
`kbn/search-error` plugin. This meant that `data` plugin had its own
copy of `EsError` class when the error is generated, then `discover`
plugin had its own copy of `EsError` class when the instanceof check
occurs. `instanceof` check unexpectedly returned false in this case.
Moving plugin to `ui-shared-deps` results in a single instance of the
plugin. Thanks @mistic for the help with moving package into
`ui-shared-deps`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
2023-12-07 10:39:19 -07:00
Coen Warmer
7d990cf749
AI Assistant Management Plugin + Knowledge Base Management (#171933)
## Summary

This PR adds a bunch of plugins to help manage AI Assistant Management
settings.

It offers a 'selection' plugin inside Stack Management where a user can
select which AI Assistant she wants to manage.
The Security team can hook into this one, so settings for both AI
Assistants can be accessed from inside one place inside Stack
Management.

This PR also adds the plugin to manage settings for the AI Assistant for
Observability, including Knowledge Base management. This plugin is
available both in Stack Management (stateful) and Project Settings
(serverless).

## What it looks like

51392ec5-05c9-4947-9bf2-810d8d0b7525


## Detailed
1. **Adds a Stack Management plugin**
(`/src/plugins/ai_assistant_management/selection`). Its primary function
is to render a selection screen to help users navigate to the settings
plugin for the AI Assistant for a specific solution. This plugin is
displayed in Stack Management, which is only available in stateful
versions of Kibana.

2. **Adds a AI Assistant for Observability Settings plugin**
(`/src/plugins/ai_assistant_management/observability`). This plugin
allows management of specific Observability AI Assistant settings. It is
available in stateful versions of Kibana (via the aforementioned Stack
Management plugin) or in serverless versions via Project Management.

3. **Knowledge Base management for Observability AI Assistant**: The AI
Assistant for Observability Settings plugin has a Knowledge Base tab,
which allows users to add / read / update / delete and bulk import
entries into the Knowledge Base of the Observability AI Assistant.

4. **Moving of KB endpoints in Observability AI Assistant plugin**: KB
endpoints and functions were located in the same folder. As this PR adds
new endpoints for the KB for CRUD operations, it also moves the existing
ones from the function folder into a dedicated one so there's a clearer
distinction between kb and functions.

5. **Adding of GenAI Connector inside Chat Flyout**: If the user has
admin rights, it is possible to set up a GenAI connector from within the
Observability AI Assistant Chat Flyout. This provides a faster and more
seamless onboarding experience. If the user does not, she will be
redirected to the Settings page.

## Bug fixes
* Fixes chat item styling issues (padding, background color).

## How to test
* Check if the Stack Management plugin works on stateful
* Check if the AI Assistant Settings plugin works on stateful +
serverless
* Check if CRUD operations on KB work
* Check if searching on KB entries work
* Check if its possible to navigate to KB tab directly
(`app/management/kibana/aiAssistantManagementObservability?tab=knowledge_base`)


## Todo
- [x] Add sorting to getEntries
- [x] Add params for tab routing
- [x] Add unit tests
- [ ] Add API tests
- [ ] Add fallback for already indexed entries when searching

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-05 16:07:52 -06:00
Saarika Bhasi
7ecd525a02
[Search] Move enterprise_search index documents to common package (#172211)
This PR: 
* extracts `enterprise_search` index documents component to common
package.
* Uses EUI pagination, converting Elasticsearch`from` & `size` to EUI
pagination standard for documents list


### Screen Recording


f585d9cc-f92c-44f4-aead-23c75c107a0f


### 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] [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-12-05 10:33:15 -05:00
Jiawei Wu
e4805fc9e0
[RAM][Maintenance Window] Maintenance window scoped query frontend changes (#171949)
## Summary
Partially resolves: https://github.com/elastic/kibana/issues/164255,
this is 2/3 of the scoped query changes.

Maintenance window scoped query frontend changes. Adds the ability to
add and edit scoped query for maintenance windows. Due to limitations
with the alerts search bar and each solution fetches AAD fields, we only
allow users to associate scoped query with 1 category (manangement,
o11y, or security solution). The intended usage in this case is for the
user to create multiple maintenance windows if they wish to apply scoped
queries to multiple solutions.

### To test:
go to
`x-pack/plugins/alerting/public/pages/maintenance_windows/constants.ts`
and set `IS_SCOPED_QUERY_ENABLED` to `true`

### Scoped query off, multiple category allowed:

![image](dbf03e8e-f9bd-449c-8d23-0b474fe5a9c4)

### Scoped query on, multiple category disallowed:

![image](368f954a-7671-410b-839b-77f0420f26fa)

### 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>
2023-12-04 15:18:33 -08:00
Rachel Shen
4a0b967e38
Reporting packages for export types (#162845)
## Summary
This PR refactors the export type classes into their own packages to be
then instantiated in the reporting plugin. This will reduce bloat in the
central reporting plugin.

**Main packages**
- `kbn/reporting-export-types-{png,pdf,csv}` are server packages with
export type declarations
- `kbn/reporting-export-types-{png,pdf,csv}-common` are shared common
packages with type declarations and constants

**Other changes**
 - Remove `reporting.getScreenshots()`
 - Remove duplicated `schema_utils.ts`
 - Consolidate `JOB_STATUS` declaration as an enum

<img width="1063" alt="image"
src="bced8321-93c5-4ebd-b31e-1fd946166241">

### 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]
[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>
Co-authored-by: Timothy Sullivan <tsullivan@elastic.co>
2023-11-15 10:48:00 -07:00
Julia Rechkunova
145cc8f13b
[Discover] Show "unsaved changes" label when in unsaved state of saved search (#169548)
- Resolves https://github.com/elastic/kibana/issues/135887

## Summary

This PR adds "Unsaved changes" badge to Discover for modified saved
searches. It also removes "Reset search" button from the histogram area.
Code for the badge is added to a new package
`@kbn/unsaved-changes-badge`.

<img width="600" alt="Screenshot 2023-10-23 at 18 05 34"
src="ad200a28-79e1-4cc5-8e28-6352d4b85322">

![Oct-23-2023
18-06-39](cacf4ff2-525c-4759-aba9-34ce75089ddd)


### 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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-13 13:36:25 +01:00
Julia Rechkunova
4f9e2bdf19
[Discover] Show field tokens in the grid header (#167179)
- Resolves https://github.com/elastic/kibana/issues/166906

## Summary

This PR adds field tokens to column header for the grid.

There are also additional necessary changes:
- field utils (name, description, icon) were moved from
`@kbn/unified-field-list` and `@kbn/discover-utils` to its own new
package `@kbn/field-utils`
- Unified Data Table and Unified Doc Viewer got a new prop `columnTypes`
which allows to render correct field icons for ES|QL searches (before
types were derived from the data view fields which could be misleading
in text-based searches as users can customize field names via query)

<img width="600" alt="Screenshot 2023-09-25 at 19 30 21"
src="388de9bb-94f7-4d3e-878a-ca0da99fcec2">


### 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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Davis McPhee <davis.mcphee@elastic.co>
2023-10-05 14:02:13 +02:00
Hannah Mudge
9e8312f2e4
[Dashboard Navigation] Make links panel available under technical preview (#166896)
## Summary
This PR wraps up the work the @elastic/kibana-presentation team has done
to finish the MVP of [Phase
1](https://github.com/elastic/kibana/issues/154354) of the `Link`
embeddable, which enables users to add panels to their dashboard that
contain links to other dashboards + external links - with respect to
dashboard links, we give the author control over which pieces of context
should be kept across dashboards so that things like filter pills,
queries, and time ranges are not lost. This marks a huge improvement in
dashboard navigation overall, which was previously only available via a
variety of different workarounds including (but not limited to):
- Creating (essentially) a `noop` dashboard-to-dashboard drilldown 
- Using markdown panels with hard Dashboard links, which are prone to
break across updates
- Avoiding navigation all together, which resulted in large,
slow-to-load dashboards.

As an added benefit, because these panels contain **references** to each
dashboard rather than hard links, (1) unlike markdown links, they should
not break after updates and (2) if a links panel is exported and
imported into another space or instance, all of the dashboards it links
to will also be imported.



1a86b713-47e7-4db9-8a04-29d41b13681a

> **Note**
> 🔉 The above video has audio! Turn on your sound for the best
experience.

### Note about this PR
- A majority of this work was done on a feature branch, with thorough
reviews from @andreadelrio on behalf of @elastic/kibana-design along the
way. Therefore, while feedback on the design is encouraged, any large
concerns brought up in this PR should be filed as separate issues and
addressed in follow-up PRs.
- This PR contains work for giving embeddables control over their own
panel size / default positioning on the dashboard. This was especially
important for the links panel, since we assume that (a) most links
panels would be located somewhere near the top of the dashboard and (b)
the horizontal links panel should have a different default "shape"
(longer than it is tall) than the vertical panel (taller than it is
long).
- This PR also contains work for caching dashboard saved objects, which
makes navigation much more seamless.

### Flaky Test Runner
-
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3251


![image](7616443e-0cb0-43ce-a1d0-41f8bee6cbfc)


### 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)
- [ ]
~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~ This will
be addressed in a follow up:
https://github.com/elastic/kibana/issues/166750
- [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 - ~Units tests
are added, functional tests are forthcoming~ Edit: All tests are in.
- [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)

### 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: Nick Peihl <nick.peihl@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
Co-authored-by: Devon Thomson <devon.thomson@elastic.co>
Co-authored-by: Nick Peihl <nickpeihl@gmail.com>
Co-authored-by: Gerard Soldevila <gerard.soldevila@elastic.co>
2023-09-29 08:25:51 -06:00
Sébastien Loix
92a92fff67
[Cloud] ES endpoint discovery (#167122) 2023-09-28 04:20:53 -07:00
Drew Tate
172de682c5
[Event annotations] Individual annotation editing from library (#163346)
## Summary

Resolve https://github.com/elastic/kibana/issues/158774
Part of https://github.com/elastic/kibana/issues/159053

<img width="1920" alt="Screenshot 2023-09-13 at 2 00 25 PM"
src="69cfe07e-d442-462b-91c5-395d6040c383">

<img width="1920" alt="Screenshot 2023-09-13 at 2 00 09 PM"
src="260aedbe-31d0-415a-b387-10a9b13bf9a6">

<img width="1920" alt="Screenshot 2023-09-13 at 2 01 07 PM"
src="9672010b-d49b-4041-acf1-33d3baec1e9a">


### Known issues
- [ ] ~Responsive layout~ **Proposal:** don't optimize for mobile
- [x] Recovering embeddable from problematic data view state
- [x] margin around dimension buttons
- [x] Functional test coverage

### 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]
[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/))
- [ ] 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))
- [ ] 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: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-09-20 10:09:17 +03:00
Kerry Gallagher
afcdc59348
[Logs+] Extract custom integration resources to package (#165510)
## Summary 

This closes #163788.

## High level overview

- Adds a new `kbn-custom-integrations` package.
- This package adds a new top level custom integrations state machine,
which manages a child create custom integration state machine. In the
future we will have additional modes (such as adding a dataset to an
existing integration, and various "uplift" flows).
- Adds connected (to the machine) components that consumers can use to
facilitate custom integration workflows.
- Adds a `kbn-xstate-utils` package (as these utils were in 2 plugins
and now 1 package).
- Replaces the integration creation inside of the onboarding wizard flow
with this package.
- At the moment this is locked down to `logs`, and one dataset, but it
can be easily extended in the future to support all types and multiple
datasets. The state machine is ready, it just needs exposed in the UI.
- Some thought has gone in to how this will work with multiple "modes",
and the foundations are there (imagining that certain types will be
unions etc), however it's worth not getting too bogged down in those
specific implementation details as I'd rather base that evolution on the
real world usage when we have it.

The Configure integration section should more or less work the same as
before.

![Screenshot 2023-09-05 at 16 24
44](8891dc0f-0ba2-48e0-83ac-99336369bc50)

## Testing

- When utilising the onboarding flow for custom logs at
`/app/observabilityOnboarding/customLogs` can you:
- Create a custom integration? (It's worth verifying the network
requests, and the assets are installed).
- If you navigate forward, then back, make a change to the integration
fields, and navigate forward again is the previously created integration
deleted?
- Is the success callout with the integration name shown on the next
wizard panel?
  - Do field validations work?
- Are errors displayed when you try to create an integration with a name
that already exists?
- Can you retry when there is a server error? (you can block network
requests to the custom integrations API to test this)

## Screenshots

![Screenshot 2023-09-06 at 10 51
35](95cd895c-02a3-482a-af35-b23f30dcba56)

![Screenshot 2023-09-06 at 10 51
57](9848dfe6-dae8-43b4-892e-bcfe199248f2)

![Screenshot 2023-09-06 at 10 49
40](2cb52e17-bba9-4901-bf77-9e12519f36a9)

![Screenshot 2023-09-06 at 10 52
21](4d871ccb-0948-46ee-a095-d1b60fb63d50)

## State machine diagram

(The top level management machine is super basic, so this is just the
create machine)

![Screenshot 2023-09-08 at 16 30
26](ccbaa270-e450-4eeb-b8cb-8ae9a41afa39)

## Followups

- Tests (the current onboarding UI implementation doesn't have tests so
whilst it's not ideal technically this coverage stays the same)
- Storybook 
- Replace other plugins' usage with xstate-utils (not urgent)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Yngrid Coello <yngrid.coello@elastic.co>
2023-09-12 20:22:25 +01:00
Sander Philipse
b335c3abbc
[Search] Extract connectors to package (#165590)
## Summary

This moves connectors functions to a shared package so Serverless Search
and Enterprise Search can both use it.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-06 14:33:05 +02:00
Yuliia Naumenko
8fb5a651a0
Extracted DiscoverGrid to a package named @kbn/unified-data-table as UnifiedDataTable component (#163211)
## Summary

Current PR includes the next set of changes:

1. Moved `DiscoverGrid` component to a package `@kbn/unified-data-table`
and added `@elastic/kibana-data-discovery` as code owners.
2. Changed `@kbn/unified-data-table` package naming for data grid
related components and methods to correspond `UnifiedDataTable` instead
of `Discover`.

3. Moved hooks `useColumns` and `useRowHeightsOptions` to a package as
its logic belongs to `UnifiedDataTable`.
4. Renamed `DiscoverGridContext` to `UnifiedDataTableContext`.
5. Extended `UnifiedDataTable` interface and functionality with the next
customization options:
- `renderDocumentView?: (displayedRows:
DataTableRecord[],displayedColumns: string[]) => JSX.Element |
undefined;` - callback to render DocumentView when the document is
expanded
- `configRowHeight?: number;` - optional value for providing
configuration setting for UnifiedDataTable rows height
- `showMultiFields?: boolean;` - optional value for providing
configuration setting for enabling to display the complex fields in the
table. Default is true.
- `maxDocFieldsDisplayed?: number;` - optional value for providing
configuration setting for maximum number of document fields to display
in the table. Default is 50.
- `externalControlColumns?: EuiDataGridControlColumn[];` - optional
value for providing EuiDataGridControlColumn list of the additional
leading control columns. UnifiedDataTable includes two control columns:
Open Details and Select.
<img width="522" alt="Screenshot 2023-08-22 at 2 26 57 PM"
src="d796b9c8-2fef-4bcc-a3c9-9f5cc6349ab9">

- `externalAdditionalControls?: React.ReactNode;` - optional value for
providing the additional controls available in the UnifiedDataTable
toolbar to manage it's records or state. UnifiedDataTable includes
Columns, Sorting and Bulk Actions.
<img width="673" alt="Screenshot 2023-08-22 at 2 40 28 PM"
src="f7ac0c87-5310-49dd-9084-1ce01ca0f366">

- `rowsPerPageOptions?: number[];` - optional list of number type values
to set custom UnifiedDataTable paging options to display the records per
page.
- `renderCustomGridBody?: (args: EuiDataGridCustomBodyProps) =>
React.ReactNode;` - An optional function called to completely customize
and control the rendering of EuiDataGrid's body and cell placement.
<img width="1658" alt="Screenshot 2023-08-22 at 2 50 27 PM"
src="14adc18d-73af-40f5-9859-b3c708e265b1">

- `trailingControlColumns?: EuiDataGridControlColumn[];` - optional list
of the `EuiDataGridControlColumn` type for setting trailing control
columns standard for `EuiDataGrid`.
- `visibleCellActions?: number;` - optional value for a custom number of
the visible cell actions in the table
<img width="497" alt="Screenshot 2023-08-22 at 2 45 49 PM"
src="57ef3ad9-7401-46bb-9b38-cc8cca2e6a24">

- `externalCustomRenderers?: Record<string,(props:
EuiDataGridCellValueElementProps) => React.ReactNode>;` - an optional
settings for a specified fields rendering like links. Applied only for
the listed fields rendering:
<img width="1121" alt="Screenshot 2023-08-22 at 2 51 07 PM"
src="77501eae-3046-4a2c-90e1-2db487c21e2c">

- `consumer` - optional string value for the name of the
`UnifiedDataTable` consumer component or application.
6. Extended `UnifiedDataGrid` services with the two additional: 
    `storage: Storage;`
    `data: DataPublicPluginStart; `
replaced `core: CoreStart;` with `theme: ThemeServiceStart;`, because
`core` is used only to get `theme`
7. Replaced `DocumentView` property with `renderDocumentView?:
(displayedRows: DataTableRecord[],displayedColumns: string[]) =>
JSX.Element | undefined;` callback function, which allows not to use
`DiscoverGridFlyout` definition for the documents rendering.
```
    /**
   * Document detail view component
   */
  DocumentView?: typeof DiscoverGridFlyout;
```
8. Removed the next properties from the data table interface, because it
was used to render DiscoverGridFlyout:
```
   /**
   * Filters applied by saved search embeddable
   */
  filters?: Filter[];
  /**
   * Query applied by KQL bar or text based editor
   */
  query?: Query | AggregateQuery;
  /**
   * Saved search id used for links to single doc and surrounding docs in the flyout
   */
  savedSearchId?: string;
```
9. Added usage examples and interface description to README file.
10. Changed grid styles naming from `.dscDiscoverGrid*` to
`.udtDataTable*`
11. Migrated discover plugin to use `UnifiedDataTable` instead of
`DiscoverGrid`

Extra changes were needed to avoid the circular dependancies:
- moved `DocViewFilterFn` and `FieldMapping` from discover plugin to
`packages/kbn-discover-utils/src/types.ts`
- added own `export type SortOrder = [string, string];` to avoid deps
for saved-search plugin

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-01 23:02:53 -07:00
Lukas Olson
09cd69d386
[UnifiedDocViewer] Move Discover doc viewer into plugin/package (#162847)
## Summary

Replaces https://github.com/elastic/kibana/pull/154012.

Moves the Discover doc viewer component into a new plugin/package,
`@kbn/unified-doc-viewer` and `@kbn/unified-doc-viewer-plugin`.

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

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&mdash;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&mdash;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>
Co-authored-by: Shahzad <shahzad31comp@gmail.com>
2023-08-31 11:46:59 -07:00
Efe Gürkan YALAMAN
1e7efae56a
[Enterprise Search] Reuse serverless panels on Enterprise Search (#163179)
## Summary

Reuse Serverless panels for API index overview. 
Updated Enterprise Search overview to latests designs.

Note: There will be another PR for layout changes on overview
afterwards.





51537e57-e822-4b9f-b9ed-49d82d192690


a3696897-40a5-4cb3-9fe6-53ce5b8f560f


de752063-04ff-42a3-8538-7fb10a9df1ca

![Screenshot 2023-08-09 at 01 55
33](083504c4-7fa6-424b-a833-89dd73c61e49)



### 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))
- [ ] 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: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2023-08-11 19:00:40 +02:00
Julia Rechkunova
c97d4960bf
[Discover] Inline shard failures warnings (#161271)
- Closes https://github.com/elastic/kibana/issues/155216

## Summary

This PR replaces shard falures toasts with inline warnings in Discover.

- [x] Intercept shard failures in Discover main app
- [x] Show inline warnings above the grid instead
- [x] Handle NoResultsFound case too
- [x] Implement for Discover context app
- [x] Implement for saved search embeddable on Dashboard
- [x] Can we inline timeouts too?
- [x] Check SQL view
- [x] Add tests


Discover view with shard failures
<img width="400" alt="Screenshot 2023-07-06 at 14 23 48"
src="a0799aa0-9d2e-42ee-b89b-e0e1180220a5">

Discover view with shard failures (and no results)
<img width="400" alt="Screenshot 2023-07-07 at 13 24 50"
src="28dc2bad-9776-4aa9-8f51-219d1c87487a">

Dashboard view with shard failures
<img width="400" alt="Screenshot 2023-07-06 at 16 15 49"
src="2a68c19a-1ca8-4f10-a9f5-4aa56f9160b0">

Surrounding documents view with shard failures
<img width="400" alt="Screenshot 2023-07-10 at 17 26 31"
src="ade63cfe-a1c2-4c22-8823-58dcfef9357f">

Discover view with timeouts
<img width="400" alt="Screenshot 2023-07-07 at 16 47 27"
src="0101be19-a555-4f96-b963-7fe418d51fb5">

Dashboard view with timeouts
<img width="400" alt="Screenshot 2023-07-07 at 16 48 18"
src="82979365-4129-4385-8a13-9c139e1acbf1">

Surrounding documents view with timeouts
<img width="400" alt="Screenshot 2023-07-11 at 15 03 41"
src="0ea41b79-ac6b-4456-9cfa-0d038b10da7d">

## Testing

For testing please uncomment
3f102cf688/src/plugins/data/common/search/search_source/search_source.ts (L922)
or
3f102cf688/src/plugins/data/common/search/search_source/search_source.ts (L547)
and switch to `kibana*` data view.


### 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] [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: Davis McPhee <davismcphee@hotmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-10 13:49:45 +02:00
Clint Andrew Hall
477505a2dd
[context] Unify Contexts, deprecate others (#161914)
> Pre-req for https://github.com/elastic/kibana/issues/56406

## Summary

We've had a long-standing problem in Kibana around our use of React
context, particularly with EUI and i18n. There hasn't existed an
idempotent context structure, and that has lead to a lot of unexpected
results, (e.g. missing translations, inconsistent dark mode, excess
context providers, etc).

The biggest change coming from this PR is knowing exactly which provider
to use in a particular use case. This means, for example,
`ReactDOM.render` calls won't be missing `i18n` or `theme` due to a
missing context. It also allows consumers to use `darkMode` without
having to read the `uiSetting` themselves, instead allowing the context
to do it for them.

We also haven't been honoring the intended [`EuiProvider`
API](https://eui.elastic.co/#/utilities/provider#theming-and-global-styles)...
in some cases we've been creating and re-creating the Emotion caches,
often by copy/paste of the cache code. We've also been nesting
`EuiThemeProvider` contexts unnecessarily-- thinking we need to render a
theme provider in an isolated component-- which renders an additional
`span` element into the DOM.

This PR attempts to address this inconsistency by creating a set of
context providers divided by use case:


![diagram](e01c6296-1b7a-4639-ae96-946866950efe)

### `KibanaRootContextProvider`
A root context provider for Kibana. This is the top level context
provider that wraps the entire application. It is responsible for
initializing all of the other contexts and providing them to the
application. It's provided as a package for specific use cases, (e.g.
the `RenderingService`, cases where we replace the entire page content,
Storybook, testing, etc), but not intended for plugins.

### `KibanaRenderContextProvider`
A render context provider for Kibana. This context is designed to be
used with ad-hoc renders of React components, (usually with
`ReactDOM.render`).

### `KibanaThemeContextProvider`
A theme context provider for Kibana. A corollary to EUI's
`EuiThemeProvider`, it uses Kibana services to ensure the EUI Theme is
customized correctly.

### (deprecated) `KibanaStyledComponentsThemeProvider`
A styled components theme provider for Kibana. This package is supplied
for compatibility with legacy code, but should not be used in new code.

## Deprecation strategy
This PR does *not* change any use of context by consumers. It maps the
existing contexts in `kibanaReact` to the new contexts, (along with the
loose API). This means that we won't have completely fixed all of our
dark mode issues yet. But this is necessary to keep this PR focused on
the change, rather than drawing in a lot of teams to review individual
uses.

We should, however, see an immediate performance improvement in the UI
from the reduction in `EuiProvider` calls.

## Open questions
- [ ] Does it make sense to expose a `useTheme` hook from
`@kbn/react-kibana-context-theme` to replace `useEuiTheme`?

## Next steps
- [ ] Update deprecated uses to new contexts.
- [ ] Audit and update calls to `ReactDOM.render`.
- [ ] Add ESLint rule to warn for use of EUI contexts.
- [ ] Delete code from `kibanaReact`.
2023-07-28 09:30:08 -07:00
Lukas Olson
a2a14cf5d1
Move more shared utils into @kbn/discover-utils (#162096)
## Summary

Requires https://github.com/elastic/kibana/pull/162004.

Moves some other shared utils (`formatFieldValue`, `formatHit`,
`getIgnoredReason`, `getShouldShowFieldHandler`) into the
`@kbn/discover-utils` package.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-20 11:07:38 -07:00
Drew Tate
092e988df2
[Lens][Event annotations] Move logic into packages (#161500) 2023-07-19 09:46:57 -05:00
Lukas Olson
2a689fa787
Create @kbn/discover-utils package (#162004)
## Summary

Creates a shared package for Discover utils/services/hooks,
`@kbn/discover-utils`. Moves a couple of utils there
(`buildDataTableRecord`/`getDocId`). This will be the future home for
many services/utils that are shared between the Discover app and its
packaged components (like unified field list, unified histogram, etc.)

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-18 13:34:09 -07:00
Ignacio Rivas
ec620e7fb3
[Deployment Management] Add cards navigation in management landing page for serverless (#160096) 2023-06-30 11:27:56 +02:00
Julia Rechkunova
7f0d57d9fd
[UnifiedFieldList] Convert from a plugin into a package (#158718)
- 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>
2023-06-23 14:28:12 +02:00
Sébastien Loix
fb41ca56f9
[SharedUxChromeNavigation] Use deeplink id instead of href (#159125) 2023-06-13 10:10:10 -07:00
Stratoula Kalafateli
0975ebabd1
[Text based languages] Creates editor reusable component (#158008)
## Summary

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

This PR:
- Moves the editor from unified-search to a standalone package
- The editor has now a core ui settings dependency but is going to have
an expressions dependency too when merged with the ESQL branch
- Adds a new plugin (text-based-languages) which is used to pass the
dependencies on the package. The user can either use this plugin without
giving any dependencies or use the package with passing the dependecies
on the KibanaContextProvider.
- Adds storybook for the editor (I used the mdx stories as we did on the
random sampling package)

<img width="1668" alt="image"
src="763a3112-1ae5-49bb-81f3-acd02892e402">


### Checklist

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-05-22 14:27:38 +03:00
Marco Liberati
ca780c526a
[Lens] New random sampling shared plugin (#155068)
## Summary

A new plugin to share the Random sampling logic across Kibana apps.
As starting point it contains the Random Sampling Icon + the setting
slider.

<img width="788" alt="Screenshot 2023-04-18 at 11 03 36"
src="https://user-images.githubusercontent.com/924948/232743718-9fad0308-9c21-4bd7-901f-9634ac3486ad.png">

### 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&mdash;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&mdash;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>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-05-02 10:30:46 +02:00