kibana/x-pack/plugins/graph
Kibana Machine 7a623a822f
[8.8] fix console errors in inspector (#156894) (#157748)
# Backport

This will backport the following commits from `main` to `8.8`:
- [fix console errors in inspector
(#156894)](https://github.com/elastic/kibana/pull/156894)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2023-05-15T15:02:27Z","message":"fix
console errors in inspector (#156894)\n\nSteps to view problem\r\n*
install sample data set\r\n* Open lens visualization\r\n* Open
inspector. Notice console errors\r\n<img width=\"300\" alt=\"Screen Shot
2023-05-05 at 11 03 25
AM\"\r\nsrc=\"https://user-images.githubusercontent.com/373691/236521366-d8fb9302-e93b-4047-a0bf-d7c09dcc3ffb.png\">\r\n\r\nhttps://github.com/elastic/eui/pull/6566
removed `closeButtonAriaLabel`\r\nprop from
[EuiFlyout](https://elastic.github.io/eui/#/layout/flyout) EUI\r\n75.0.0
(Effecting 8.8 and 8.9). FlyoutService spreads options
into\r\n`EuiFlyout`, resulting in `closeButtonAriaLabel` getting added
to dom\r\nand causing error.\r\n\r\n`OverlayFlyoutOpenOptions` type
added by\r\nhttps://github.com/elastic/kibana/issues/37894. I
replaced\r\n`OverlayFlyoutOpenOptions` with `EuiFlyoutProps` to make it
more clear\r\nwhat props are accepted and provide stronger typing that
stays in sync\r\nwith EUI
typings\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"b803ba9d7b69250d8bfb0567919128f954c1e935","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Inspector","Team:Presentation","release_note:skip","v8.8.0","v8.9.0"],"number":156894,"url":"https://github.com/elastic/kibana/pull/156894","mergeCommit":{"message":"fix
console errors in inspector (#156894)\n\nSteps to view problem\r\n*
install sample data set\r\n* Open lens visualization\r\n* Open
inspector. Notice console errors\r\n<img width=\"300\" alt=\"Screen Shot
2023-05-05 at 11 03 25
AM\"\r\nsrc=\"https://user-images.githubusercontent.com/373691/236521366-d8fb9302-e93b-4047-a0bf-d7c09dcc3ffb.png\">\r\n\r\nhttps://github.com/elastic/eui/pull/6566
removed `closeButtonAriaLabel`\r\nprop from
[EuiFlyout](https://elastic.github.io/eui/#/layout/flyout) EUI\r\n75.0.0
(Effecting 8.8 and 8.9). FlyoutService spreads options
into\r\n`EuiFlyout`, resulting in `closeButtonAriaLabel` getting added
to dom\r\nand causing error.\r\n\r\n`OverlayFlyoutOpenOptions` type
added by\r\nhttps://github.com/elastic/kibana/issues/37894. I
replaced\r\n`OverlayFlyoutOpenOptions` with `EuiFlyoutProps` to make it
more clear\r\nwhat props are accepted and provide stronger typing that
stays in sync\r\nwith EUI
typings\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"b803ba9d7b69250d8bfb0567919128f954c1e935"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156894","number":156894,"mergeCommit":{"message":"fix
console errors in inspector (#156894)\n\nSteps to view problem\r\n*
install sample data set\r\n* Open lens visualization\r\n* Open
inspector. Notice console errors\r\n<img width=\"300\" alt=\"Screen Shot
2023-05-05 at 11 03 25
AM\"\r\nsrc=\"https://user-images.githubusercontent.com/373691/236521366-d8fb9302-e93b-4047-a0bf-d7c09dcc3ffb.png\">\r\n\r\nhttps://github.com/elastic/eui/pull/6566
removed `closeButtonAriaLabel`\r\nprop from
[EuiFlyout](https://elastic.github.io/eui/#/layout/flyout) EUI\r\n75.0.0
(Effecting 8.8 and 8.9). FlyoutService spreads options
into\r\n`EuiFlyout`, resulting in `closeButtonAriaLabel` getting added
to dom\r\nand causing error.\r\n\r\n`OverlayFlyoutOpenOptions` type
added by\r\nhttps://github.com/elastic/kibana/issues/37894. I
replaced\r\n`OverlayFlyoutOpenOptions` with `EuiFlyoutProps` to make it
more clear\r\nwhat props are accepted and provide stronger typing that
stays in sync\r\nwith EUI
typings\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"b803ba9d7b69250d8bfb0567919128f954c1e935"}}]}]
BACKPORT-->

Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
2023-05-15 09:16:17 -07:00
..
common fix all violations 2022-04-16 01:37:30 -05:00
public [8.8] fix console errors in inspector (#156894) (#157748) 2023-05-15 09:16:17 -07:00
server Split the .kibana saved objects index into multiple indices (#154888) 2023-04-25 09:43:42 +02:00
config.ts [Breaking] Remove deprecated enabled settings from plugins. (#113495) 2021-10-17 16:54:30 +01:00
jest.config.js [jest] update config files to get coverage per plugin (#111299) 2021-09-09 08:14:56 +02:00
kibana.jsonc [Graph] Replace SavedObjectsFinder component (#152432) 2023-03-02 16:12:32 +01:00
README.md [ftr] automatically determine config run order (#130983) 2022-05-04 17:05:58 -05:00
tsconfig.json Split the .kibana saved objects index into multiple indices (#154888) 2023-04-25 09:43:42 +02:00

Graph app

This is the main source folder of the Graph plugin. It contains all of the Kibana server and client source code. x-pack/test/functional/apps/graph contains additional functional tests.

Graph shows only up in the side bar if your server is running on a platinum or trial license. You can activate a trial license in Management > License Management.

Common commands

  • Run tests yarn test:jest x-pack/plugins/graph --watch
  • Run type check node scripts/type_check.js --project=x-pack/tsconfig.json
  • Run linter node scripts/eslint.js x-pack/plugins/graph
  • Run functional tests (make sure to stop dev server)
    • Server node ./scripts/functional_tests_server.js --config x-pack/test/functional/apps/graph/config.ts
    • Tests node scripts/functional_test_runner.js --config x-pack/test/functional/apps/graph/config.ts

Folder structure

Client public/

Currently state handled by react/redux/saga and the core mutable GraphWorkspace instance, which managing the nodes and edges state. It should be rewritten in typescript and integrated into redux store.

  • apps/ contains all graph app routes
  • components/ contains react components for various parts of the interface. Components can hold local UI state (e.g. current form data), everything else should be passed in from the caller. Styles should reside in a component-specific stylesheet
  • services/ contains the core workspace logic and functions that encapsule other parts of Kibana. Stateful dependencies are passed in from the outside. Components should not rely on services directly but have callbacks passed in. Once the migration to redux/saga is complete, only sagas will use services
  • helpers/ contains side effect free helper functions that can be imported and used from components and services
  • state_management/ contains reducers, action creators, selectors and sagas. It also exports the central store creator
    • Each file covers one functional area (e.g. handling of fields, handling of url templates...)
    • Generally there is no file separation between reducers, action creators, selectors and sagas of the same functional area
    • Sagas may contain cross-references between multiple functional areas (e.g. the loading saga sets fields and meta data). Because of this it is possible that circular imports occur. In this case the sagas are moved to a separate file <functional area>.sagas.ts.
  • types/ contains type definitions for unmigrated GraphWorkspace methods
  • router.tsx is the central entrypoint of the app

Server server/

The Graph server is only forwarding requests to Elasticsearch API and contains very little logic. It will be rewritten soon.