kibana/test/examples
Kibana Machine adf6b7dced
[8.x] [OneDiscover] Contextual App Menu Extension Point (#195448) (#198320)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[OneDiscover] Contextual App Menu Extension Point
(#195448)](https://github.com/elastic/kibana/pull/195448)

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

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

<!--BACKPORT [{"author":{"name":"Julia
Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2024-10-30T12:35:15Z","message":"[OneDiscover]
Contextual App Menu Extension Point (#195448)\n\n- Closes
https://github.com/elastic/kibana/issues/194269\r\n\r\n##
Summary\r\n\r\nThis PR introduces a new extension point `getAppMenu`
which allows to:\r\n- add custom App Menu items (as a button or a
submenu with more actions)\r\n- extend Alerts menu item with more custom
actions\r\n\r\nAdditionally, this PR rearranges the existing Discover
menu items. The\r\nprimary actions are rendered as an icon only
now.\r\n\r\n![Oct-16-2024\r\n17-43-29](https://github.com/user-attachments/assets/dbb67513-05bb-43a4-bd7b-cf958c58a167)\r\n\r\n\r\nThe
example usage of the new extension point can be found
in\r\ne7964f08e3/src/plugins/discover/public/context_awareness/profile_providers/example/example_data_source_profile/profile.tsx (L81-L168)\r\n\r\n###
For testing with the example profile\r\n\r\n1. Add
`discover.experimental.enabledProfiles:
['example-root-profile',\r\n'example-data-source-profile',
'example-document-profile']` to\r\n`kibana.dev.yml`\r\n2. Run the
following in DevTools\r\n```\r\nPOST _aliases\r\n{\r\n \"actions\":
[\r\n {\r\n \"add\": {\r\n \"index\": \"kibana_sample_data_logs\",\r\n
\"alias\": \"my-example-logs\"\r\n }\r\n }\r\n ]\r\n}\r\n```\r\n3.
Create and use Data View with `my-custom-logs` index pattern\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] This
renders correctly on smaller devices using a responsive\r\nlayout. (You
can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[x] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Davis McPhee <davis.mcphee@elastic.co>\r\nCo-authored-by: Davis McPhee
<davismcphee@hotmail.com>","sha":"811a23830bb60b7b56e08060bc9742fd232a5a8e","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:DataDiscovery","backport:prev-minor","Project:OneDiscover"],"title":"[OneDiscover]
Contextual App Menu Extension
Point","number":195448,"url":"https://github.com/elastic/kibana/pull/195448","mergeCommit":{"message":"[OneDiscover]
Contextual App Menu Extension Point (#195448)\n\n- Closes
https://github.com/elastic/kibana/issues/194269\r\n\r\n##
Summary\r\n\r\nThis PR introduces a new extension point `getAppMenu`
which allows to:\r\n- add custom App Menu items (as a button or a
submenu with more actions)\r\n- extend Alerts menu item with more custom
actions\r\n\r\nAdditionally, this PR rearranges the existing Discover
menu items. The\r\nprimary actions are rendered as an icon only
now.\r\n\r\n![Oct-16-2024\r\n17-43-29](https://github.com/user-attachments/assets/dbb67513-05bb-43a4-bd7b-cf958c58a167)\r\n\r\n\r\nThe
example usage of the new extension point can be found
in\r\ne7964f08e3/src/plugins/discover/public/context_awareness/profile_providers/example/example_data_source_profile/profile.tsx (L81-L168)\r\n\r\n###
For testing with the example profile\r\n\r\n1. Add
`discover.experimental.enabledProfiles:
['example-root-profile',\r\n'example-data-source-profile',
'example-document-profile']` to\r\n`kibana.dev.yml`\r\n2. Run the
following in DevTools\r\n```\r\nPOST _aliases\r\n{\r\n \"actions\":
[\r\n {\r\n \"add\": {\r\n \"index\": \"kibana_sample_data_logs\",\r\n
\"alias\": \"my-example-logs\"\r\n }\r\n }\r\n ]\r\n}\r\n```\r\n3.
Create and use Data View with `my-custom-logs` index pattern\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] This
renders correctly on smaller devices using a responsive\r\nlayout. (You
can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[x] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Davis McPhee <davis.mcphee@elastic.co>\r\nCo-authored-by: Davis McPhee
<davismcphee@hotmail.com>","sha":"811a23830bb60b7b56e08060bc9742fd232a5a8e"}},"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/195448","number":195448,"mergeCommit":{"message":"[OneDiscover]
Contextual App Menu Extension Point (#195448)\n\n- Closes
https://github.com/elastic/kibana/issues/194269\r\n\r\n##
Summary\r\n\r\nThis PR introduces a new extension point `getAppMenu`
which allows to:\r\n- add custom App Menu items (as a button or a
submenu with more actions)\r\n- extend Alerts menu item with more custom
actions\r\n\r\nAdditionally, this PR rearranges the existing Discover
menu items. The\r\nprimary actions are rendered as an icon only
now.\r\n\r\n![Oct-16-2024\r\n17-43-29](https://github.com/user-attachments/assets/dbb67513-05bb-43a4-bd7b-cf958c58a167)\r\n\r\n\r\nThe
example usage of the new extension point can be found
in\r\ne7964f08e3/src/plugins/discover/public/context_awareness/profile_providers/example/example_data_source_profile/profile.tsx (L81-L168)\r\n\r\n###
For testing with the example profile\r\n\r\n1. Add
`discover.experimental.enabledProfiles:
['example-root-profile',\r\n'example-data-source-profile',
'example-document-profile']` to\r\n`kibana.dev.yml`\r\n2. Run the
following in DevTools\r\n```\r\nPOST _aliases\r\n{\r\n \"actions\":
[\r\n {\r\n \"add\": {\r\n \"index\": \"kibana_sample_data_logs\",\r\n
\"alias\": \"my-example-logs\"\r\n }\r\n }\r\n ]\r\n}\r\n```\r\n3.
Create and use Data View with `my-custom-logs` index pattern\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] This
renders correctly on smaller devices using a responsive\r\nlayout. (You
can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[x] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Davis McPhee <davis.mcphee@elastic.co>\r\nCo-authored-by: Davis McPhee
<davismcphee@hotmail.com>","sha":"811a23830bb60b7b56e08060bc9742fd232a5a8e"}}]}]
BACKPORT-->

Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
2024-10-30 09:25:31 -05:00
..
bfetch_explorer Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
content_management Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
data_view_field_editor_example Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
discover_customization_examples [8.x] [OneDiscover] Contextual App Menu Extension Point (#195448) (#198320) 2024-10-30 09:25:31 -05:00
error_boundary Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
expressions_explorer [Dashboard] Remove library and drilldown notifications (#190797) 2024-09-09 14:11:15 -07:00
field_formats Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
hello_world Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
partial_results Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
response_stream Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
routing Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
search Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
state_sync Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
ui_actions [Dashboard] Remove library and drilldown notifications (#190797) 2024-09-09 14:11:15 -07:00
unified_field_list_examples Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
config.js Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
README.md Add top level examples folder and command to run, --run-examples. (#52027) 2019-12-10 18:02:03 -05:00

Example plugin functional tests

This folder contains functional tests for the example plugins.

Run the test

To run these tests during development you can use the following commands:

# Start the test server (can continue running)
node scripts/functional_tests_server.js --config test/examples/config.js
# Start a test run
node scripts/functional_test_runner.js --config test/examples/config.js

Run Kibana with a test plugin

In case you want to start Kibana with the example plugins, you can just run:

yarn start --run-examples