mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
## Summary **Reviewers: Please test the code paths affected by this PR. See the "Risks" section below.** Part of work for enabling "high contrast mode" in Kibana. See https://github.com/elastic/kibana/issues/176219. **Background:** Kibana will soon have a user profile setting to allow users to enable "high contrast mode." This setting will activate a flag with `<EuiProvider>` that causes EUI components to render with higher contrast visual elements. Consumer plugins and packages need to be updated selected places where `<EuiProvider>` is wrapped, to pass the `UserProfileService` service dependency from the CoreStart contract. **NOTE:** **EUI currently does not yet support the high-contrast mode flag**, but support for that is expected to come in around 2 weeks. These first PRs are simply preparing the code by wiring up the `UserProvideService`. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [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] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [medium/high] The implementor of this change did not manually test the affected code paths and relied on type-checking and functional tests to drive the changes. Code owners for this PR need to manually test the affected code paths. - [ ] [medium] The `UserProfileService` dependency comes from the CoreStart contract. If acquiring the service causes synchronous code to become asynchronous, check for race conditions or errors in rendering React components. Code owners for this PR need to manually test the affected code paths. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
common | ||
public | ||
server | ||
jest.config.js | ||
kibana.jsonc | ||
README.md | ||
tsconfig.json |
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
- Server
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 routescomponents/
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 stylesheetservices/
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 serviceshelpers/
contains side effect free helper functions that can be imported and used from components and servicesstate_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 unmigratedGraphWorkspace
methodsrouter.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.