kibana/packages
Hannah Mudge 8eaebb6d47
[Dashboard Navigation] Add Links to Visualization library (#170810)
Closes https://github.com/elastic/kibana/issues/162840

## Summary

This PR adds a visualization alias for the new Links embeddable so that
all Links library items can be managed/edited from the Visualization
library, like so:


8541506b-cfdd-4a2f-8bc2-841220def7a3

However, in order to get the above working, it was unfortunately not as
simple as just adding a visualization alias. Because the Links
embeddable does not have a dedicated editing app (all editing/creation
is done through a flyout), the usual `aliasPath` + `aliasApp` redirect
that happens for editing an alias did not work in this case.

To get around this, I've had to make changes to how aliases are
registered, as well as both the Visualization `VisualizeListing`
component and the generic `TableListViewTableComp` content management
component:

- **Summary of visualization alias changes:**

First off, I made changes to the typing of aliases - specifically,
rather than taking two independent `aliasPath` and `aliasApp` props,
I've combined them into a singular `alias` prop which will either be of
type `{ alias: string; path: string; }` or `{ embeddableType: string;
}`. This makes it easier to determine (a) whether a visualization is of
type `BaseVisType` or `VisTypeAlias` and (b) if it **is** of type
`VisTypeAlias`, how the editing of that vis should be handled.
Specifically, if `alias` is of type `{ alias: string; path: string; }`,
then it is a normal visualization and behaviour should be the same as it
was previously; however, if it is of type `{ embeddableType: string; }`,
then this is an **inline** alias - i.e. editing should be done inline
via the embeddable factory's edit method.

- **Summary of `VisualizeListing`  changes**

The primary changes here were made to the `editItem` callback -
specifically, if the fetched saved object has neither an `editApp` nor
an `editUrl`, then it will now try to fetch the embeddable factory for
the given saved object type and, if this factory exists, it will call
the `getExplicitInput` method in order to handle editing.

- **Summary of `TableListViewTableComp` changes**

Previously, an error would be thrown if both a `getDetailViewLink` and
an `onClickTitle` prop were provided - while I understand the original
reasoning for adding this catch, this no longer works if we want to
support inline editing like this. In this case, I needed **only** the
Link embeddable items to have an `onClick` while keeping the behaviour
for other visualizations the same (i.e. all other visualization types
should continue to link off to their specific editor apps) - however,
since this method is not provided **per item**, I had no way of making
an exception for just one specific item type.

Therefore, to get around this, it is now considered to be valid for
**both** the `getDetailViewLink` and `onClickTitle` props to be defined
for the `TableListViewTableComp` component. In order to prevent conflict
between the two props, I have made it so that, if both are provided,
`getDetailViewLink` **always takes precedence** over `onClickTitle` - in
this case, `onClickTitle` will **only** be called if `getDetailViewLink`
returns `undefined` for a given item. I have added a comment to
hopefully make this clear for consumers.

### 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
- [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)
2023-11-22 10:37:27 -07:00
..
analytics FullStory: use debounce before updating Page Vars (#171450) 2023-11-21 13:46:13 +00:00
cloud [Cloud] Endpoint modal - fix label height (#169249) 2023-10-18 10:11:53 -07:00
content-management [Dashboard Navigation] Add Links to Visualization library (#170810) 2023-11-22 10:37:27 -07:00
core ApiKey auth should be set in the Authorization header (#171496) 2023-11-23 04:15:37 +11:00
deeplinks Update new codeowners for Obs team changes (#170182) 2023-11-08 14:30:17 +00:00
default-nav Improve ML serverless breadcrumbs for oblt and security (#169513) 2023-10-25 11:42:45 +02:00
home [HTTP] Add server/browser side http.staticAssets service (#171003) 2023-11-16 08:13:00 -07:00
kbn-ace Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-alerts-as-data-utils [Response Ops] Onboard metric threshold rule type to use framework alerts as data (#166664) 2023-10-18 12:09:23 -04:00
kbn-alerts-ui-shared [RAM][Maintenance Window] Add categories to banner title (#169704) 2023-10-25 16:34:31 -07:00
kbn-ambient-common-types Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-ambient-ftr-types [codeowners] add appex-qa for ftr-related packages (#155230) 2023-05-24 08:53:09 +02:00
kbn-ambient-storybook-types Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-ambient-ui-types Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-analytics Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-apm-config-loader [APM Tracing config] Allow per-service overrides (#166184) 2023-09-19 12:49:37 +02:00
kbn-apm-synthtrace [ObsUX] Add Missing transaction warning if there are Transactions or Spans with a parent.id that doesn't exist in the trace (#171196) 2023-11-20 17:33:11 +01:00
kbn-apm-synthtrace-client [Logs onboarding] Using logsSynthtrace in api integration tests (#171510) 2023-11-20 08:08:20 -07:00
kbn-apm-utils Update new codeowners for Obs team changes (#170182) 2023-11-08 14:30:17 +00:00
kbn-axe-config Updating axe-core to latest (#144940) 2023-03-29 00:06:25 +05:30
kbn-babel-preset [Defend workflows] [On-week] Migrate osquery from styled-components to @emotion (#161179) 2023-08-02 19:18:10 +02:00
kbn-babel-register [kbn/babel-register] improve cache performance (#150261) 2023-02-06 19:50:42 -07:00
kbn-babel-transform [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
kbn-bazel-runner chore(NA): remove a small change to trigger risk-free backport (#160810) 2023-06-28 21:08:33 +01:00
kbn-calculate-auto feat(slo): add events chart (#170896) 2023-11-16 15:19:57 -05:00
kbn-cases-components [Cases] Version cases and comment domain and apis (#161954) 2023-07-26 06:09:10 -07:00
kbn-cell-actions [Security Solution][Lens] Check filter action type to hide default filter actions in visualizations (#171284) 2023-11-20 15:33:31 +01:00
kbn-chart-icons [Lens] fix inconsistent annotation icon styles (#159542) 2023-06-21 09:18:48 +02:00
kbn-check-mappings-update-cli revert(slo): enrich policy and reset api (#171420) 2023-11-16 13:10:03 -05:00
kbn-ci-stats-core Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-ci-stats-performance-metrics Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-ci-stats-reporter [Ops] Upgrade to axios 1.4 (#163732) 2023-08-22 11:47:48 +02:00
kbn-ci-stats-shipper-cli [ci-stats] move shipper to a package, validate limits in on-merge job (#149474) 2023-01-25 08:20:40 -07:00
kbn-cli-dev-mode Enables preventing access to internal APIs (#156935) 2023-05-10 04:25:15 -07:00
kbn-coloring [Lens] Fixes color mappings special tockens i18n (#168152) 2023-10-06 12:21:41 +03:00
kbn-config [On-Week] Hot update of APM/EBT labels (#157093) 2023-08-31 14:36:20 +02:00
kbn-config-mocks [On-Week] Hot update of APM/EBT labels (#157093) 2023-08-31 14:36:20 +02:00
kbn-config-schema Minor reduce perf optimizations (#170922) 2023-11-10 07:45:51 -07:00
kbn-content-management-utils Migrate visualization, annotation, graph to saved_object_content_storage (#168520) 2023-10-13 21:57:26 -05:00
kbn-crypto [osquery] Setup E2E against Serverless ES, Kibana, Fleet server standalone and Elastic agents in Docker (#165415) 2023-09-29 03:33:06 -07:00
kbn-crypto-browser Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-custom-icons [ObsInfra][APM] Extract agent utils and custom icons (#170968) 2023-11-20 16:39:42 +01:00
kbn-custom-integrations Update new codeowners for Obs team changes (#170182) 2023-11-08 14:30:17 +00:00
kbn-cypress-config Revert "Upgrade EUI to v88.3.0 (#166292)" 2023-09-18 18:37:13 -05:00
kbn-data-service [UnifiedFieldList] Convert from a plugin into a package (#158718) 2023-06-23 14:28:12 +02:00
kbn-datemath [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
kbn-dev-cli-errors Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-dev-cli-runner [Ops] Snapshot saved object migrations (#167983) 2023-10-11 09:47:15 +02:00
kbn-dev-proc-runner Fix typecheck foundations (#167060) 2023-09-25 16:28:56 -07:00
kbn-dev-utils [osquery] Setup E2E against Serverless ES, Kibana, Fleet server standalone and Elastic agents in Docker (#165415) 2023-09-29 03:33:06 -07:00
kbn-discover-utils [Discover] Show field tokens in the grid header (#167179) 2023-10-05 14:02:13 +02:00
kbn-doc-links [Fleet] Improve UX for policy secrets (#171405) 2023-11-16 12:35:19 -07:00
kbn-docs-utils chore: update elastic-agent-nodejs to v4 (#165483) 2023-09-13 12:56:39 +02:00
kbn-dom-drag-drop [Discover] Redesign for the grid, panels and sidebar v1 (#165866) 2023-09-12 08:51:34 +02:00
kbn-ebt-tools Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-ecs Revert "[Security Solution] Update ecs package to latest ecs definiti… (#168864) 2023-10-13 09:30:34 -07:00
kbn-elastic-agent-utils [ObsInfra][APM] Extract agent utils and custom icons (#170968) 2023-11-20 16:39:42 +01:00
kbn-es Revert "Upgrade to Node.js 20 (#162696)" 2023-11-21 07:15:23 -06:00
kbn-es-archiver Revert "Upgrade to Node.js 20 (#162696)" 2023-11-21 07:15:23 -06:00
kbn-es-errors Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-es-query [ES|QL] fixes getIndexPatternFromESQLQuery for comma separated indices (#169562) 2023-10-24 03:13:48 -07:00
kbn-es-types Update new codeowners for Obs team changes (#170182) 2023-11-08 14:30:17 +00:00
kbn-eslint-config Add ESLint rule for Translations (#168001) 2023-10-16 18:34:50 +02:00
kbn-eslint-plugin-disable Clean up imports of ESLint types (#162436) 2023-07-25 10:09:55 +02:00
kbn-eslint-plugin-eslint Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-eslint-plugin-i18n Update new codeowners for Obs team changes (#170182) 2023-11-08 14:30:17 +00:00
kbn-eslint-plugin-imports [Ops] Fix @kbn/imports/no_unused_imports rule (#164870) 2023-08-26 01:13:57 +02:00
kbn-eslint-plugin-telemetry Update new codeowners for Obs team changes (#170182) 2023-11-08 14:30:17 +00:00
kbn-event-annotation-common [Lens][Event annotations] Move logic into packages (#161500) 2023-07-19 09:46:57 -05:00
kbn-event-annotation-components [Discover] Show field tokens in the grid header (#167179) 2023-10-05 14:02:13 +02:00
kbn-expandable-flyout Expandable flyout width (#170078) 2023-11-16 12:56:36 -06:00
kbn-expect [codeowners] add appex-qa for ftr-related packages (#155230) 2023-05-24 08:53:09 +02:00
kbn-failed-test-reporter-cli [Ops] Upgrade to axios 1.4 (#163732) 2023-08-22 11:47:48 +02:00
kbn-field-types Update codeowners to move AppServices packages to DataDiscovery (#149065) 2023-01-18 13:34:28 -07:00
kbn-field-utils [Discover] Update mapping conflict popover with types list (#169855) 2023-10-27 10:03:59 +02:00
kbn-find-used-node-modules [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
kbn-flot-charts Fix useless regex escapes (#150043) 2023-02-07 09:58:47 -07:00
kbn-ftr-common-functional-services [ftr] fix test users for serverless (#161280) 2023-07-10 10:09:07 +02:00
kbn-ftr-screenshot-filename [codeowners] add appex-qa for ftr-related packages (#155230) 2023-05-24 08:53:09 +02:00
kbn-generate Remove kibana-design from the ultimate rule for scss files. (#157493) 2023-05-12 10:01:47 -05:00
kbn-generate-console-definitions [Console] Generate autocomplete definitions from ES specification (#163301) 2023-08-15 11:30:39 +02:00
kbn-generate-csv Reporting packages for export types (#162845) 2023-11-15 10:48:00 -07:00
kbn-get-repo-files [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
kbn-guided-onboarding [Guided onboarding] Updating search solution items. (#166953) 2023-09-25 18:02:33 +02:00
kbn-handlebars Upgrade handlebars from v4.7.7 to v4.7.8 (#171511) 2023-11-20 07:26:16 -07:00
kbn-hapi-mocks [HTTP] Allow for internal requests to also specify special query param elasticInternalOrigin (#163796) 2023-08-21 11:55:33 +02:00
kbn-health-gateway-server Change the health gateway to use the status API (#160125) 2023-06-26 02:34:00 -07:00
kbn-i18n Minor reduce perf optimizations (#170922) 2023-11-10 07:45:51 -07:00
kbn-i18n-react Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-import-locator [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
kbn-import-resolver Fix @kbn/import-resolver detection of nested node_modules (#162391) 2023-07-25 10:09:05 +02:00
kbn-interpreter Fix eslint rule for restricting certain lodash imports (#151023) 2023-02-16 08:35:09 -07:00
kbn-io-ts-utils [Log Stream] Support date nanos (#170308) 2023-11-13 14:51:33 +01:00
kbn-jest-serializers Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-journeys [Lens] Show icons/titles instead of previews in suggestions panel (#166808) 2023-10-03 12:51:36 +02:00
kbn-json-ast [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
kbn-kibana-manifest-schema implement "plugin" package type (#149370) 2023-01-30 10:47:53 -07:00
kbn-language-documentation-popover Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-lens-embeddable-utils [AO][SERVERLESS] Use Lens as the Custom Threshold rule preview chart (#169007) 2023-11-16 12:57:08 +01:00
kbn-lint-packages-cli [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
kbn-lint-ts-projects-cli [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
kbn-logging Replace ecs package with ecs-typescript generated code (#148804) 2023-01-26 07:10:32 +01:00
kbn-logging-mocks Limit download concurrency for files within Kibana (#168601) 2023-10-30 12:28:11 +01:00
kbn-managed-vscode-config Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-managed-vscode-config-cli Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-management [fix] Advanced Settings showing NaN due to missing category counts (#171332) 2023-11-20 00:53:59 -05:00
kbn-mapbox-gl [maps] fix layer shows no data instead of error (#170084) 2023-11-06 17:00:15 -07:00
kbn-monaco [ES|QL] Navigate to create new policy page from the editor (#167012) 2023-09-27 02:58:06 -07:00
kbn-object-versioning [CM] Onboard maps to cross-type search (#155148) 2023-04-21 07:41:08 -07:00
kbn-openapi-generator [Security Solution] Migrate remaining public Detection Engine APIs to OpenAPI and code generation (#170330) 2023-11-08 11:58:28 +01:00
kbn-optimizer [Security Solution] Do not install prerelease endpoint in serverless (#170975) 2023-11-13 12:47:49 -05:00
kbn-optimizer-webpack-helpers Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-osquery-io-ts-types [EDR Workflows] Osquery Timeout (#169925) 2023-11-15 05:37:11 -07:00
kbn-peggy Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-peggy-loader Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-performance-testing-dataset-extractor [performance] use journey own ftr config to run scalability test (#152596) 2023-03-07 13:20:21 +01:00
kbn-picomatcher Implement package linter (#148496) 2023-01-09 16:49:29 -07:00
kbn-plugin-generator async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
kbn-plugin-helpers Remove webpack compression plugin on v4 (#170203) 2023-11-02 17:11:48 +00:00
kbn-profiling-utils Update new codeowners for Obs team changes (#170182) 2023-11-08 14:30:17 +00:00
kbn-react-field Add new sparse vector and dense vector icons (#169493) 2023-10-24 02:05:57 -07:00
kbn-repo-file-maps [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
kbn-repo-info Add build_date to kbn:api/status (#157905) 2023-05-25 10:21:47 -07:00
kbn-repo-linter Implement package linter (#148496) 2023-01-09 16:49:29 -07:00
kbn-repo-packages [Core plugin system] Add dynamic contract resolving (#167113) 2023-10-24 02:32:09 -07:00
kbn-repo-path [packages] prevent and remove basename collisions for js/ts code (#148835) 2023-01-12 12:29:30 -07:00
kbn-repo-source-classifier fix(NA): source classifier to indentify xml as static files (#164109) 2023-08-17 00:53:59 +01:00
kbn-repo-source-classifier-cli [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
kbn-reporting Reporting packages for export types (#162845) 2023-11-15 10:48:00 -07:00
kbn-resizable-layout [testing] replace testing-library/dom package with testing-library/react (#170594) 2023-11-08 15:53:48 +01:00
kbn-rison [Security Solution] Global query string functionality improvements (#147218) 2023-01-05 18:02:12 +01:00
kbn-rrule [RAM] Remove third party RRule library, replace with own timezone-compliant lib (#152873) 2023-07-02 17:03:45 -04:00
kbn-rule-data-utils [ML] Show alerts data on the Anomaly timeline (#167998) 2023-11-10 05:07:04 -07:00
kbn-safer-lodash-set Fix eslint rule for restricting certain lodash imports (#151023) 2023-02-16 08:35:09 -07:00
kbn-saved-objects-settings [Content Management] Remove dep from content_management -> saved_object_finder (#155013) 2023-04-17 16:25:58 +02:00
kbn-search-api-panels [Serverless Search] Update Getting Ingest Data section (#171035) 2023-11-22 12:06:58 -05:00
kbn-search-connectors [Enterprise Search] Set run ML inference default setting to true (#171204) 2023-11-15 12:06:51 -05:00
kbn-search-response-warnings [maps] display incomplete results warning in layer legend (#171144) 2023-11-16 12:09:43 -07:00
kbn-securitysolution-autocomplete Upgrade EUI to v89.0.0 (#168396) 2023-10-11 14:36:52 -05:00
kbn-securitysolution-ecs [Security Solution][Detection Alerts] Alert tagging (#157786) 2023-06-20 22:04:52 -04:00
kbn-securitysolution-es-utils [Security Solution] Migrate Rules schema to OpenAPI (#167999) 2023-10-27 18:00:10 +02:00
kbn-securitysolution-exception-list-components [testing] replace testing-library/dom package with testing-library/react (#170594) 2023-11-08 15:53:48 +01:00
kbn-securitysolution-grouping Upgrade EUI to v88.2.0 (#165790) 2023-09-12 08:51:07 -07:00
kbn-securitysolution-hook-utils [Security Solution] Clean up CODEOWNERS and other files for the Detection Engine team (#159729) 2023-06-14 10:39:50 -07:00
kbn-securitysolution-io-ts-alerting-types [Security Solution][Detection Engine] adds ES|QL rule type to Security Detections rules (#165450) 2023-09-30 09:45:34 +01:00
kbn-securitysolution-io-ts-list-types [Security Solution][Detection Engine] move lists to data stream (#162508) 2023-08-23 19:42:57 +01:00
kbn-securitysolution-io-ts-types [Security Solution] Added OpenAPI schema definitions for rules management (#162641) 2023-08-04 17:13:20 +02:00
kbn-securitysolution-io-ts-utils [Security Solution] Explicit request and response schemas for rules management endpoints (#162324) 2023-07-26 18:00:55 +02:00
kbn-securitysolution-list-api [Security Solution][Endpoint] Adapt exception list api calls to versioned router (#165658) 2023-09-07 17:35:15 +02:00
kbn-securitysolution-list-constants [Security Solution][Detection Engine] move lists to data stream (#162508) 2023-08-23 19:42:57 +01:00
kbn-securitysolution-list-hooks [Security Solution][Detection Engine] move lists to data stream (#162508) 2023-08-23 19:42:57 +01:00
kbn-securitysolution-list-utils [Security Solution][EDR Workflows] Remove the filter on Endpoint Exceptions and Event Filters creation to allow more user flexibility (#162193) 2023-08-03 12:53:17 -04:00
kbn-securitysolution-rules [Security Solution][Detection Engine] adds ES|QL rule type to Security Detections rules (#165450) 2023-09-30 09:45:34 +01:00
kbn-securitysolution-t-grid Upgrade EUI to v86.0.0 (#163088) 2023-08-14 15:45:09 -05:00
kbn-securitysolution-utils [Security Solution][Detection Engine] adds ES|QL rule type to Security Detections rules (#165450) 2023-09-30 09:45:34 +01:00
kbn-server-http-tools Enables preventing access to internal APIs (#156935) 2023-05-10 04:25:15 -07:00
kbn-server-route-repository Update new codeowners for Obs team changes (#170182) 2023-11-08 14:30:17 +00:00
kbn-set-map [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
kbn-shared-svg Update new codeowners for Obs team changes (#170182) 2023-11-08 14:30:17 +00:00
kbn-shared-ux-utility Integrate Event-Based Telemetry in KibanaErrorBoundary (#169895) 2023-11-03 12:55:00 -07:00
kbn-some-dev-log Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-sort-package-json [sort-package-json] always ensure 2-space indent is used 2023-01-10 10:39:48 -07:00
kbn-spec-to-console [Console] Update dynamic parameters for the new script (#162917) 2023-08-04 06:42:41 -07:00
kbn-std Minor reduce perf optimizations (#170922) 2023-11-10 07:45:51 -07:00
kbn-stdio-dev-helpers Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-storybook Integrate Event-Based Telemetry in KibanaErrorBoundary (#169895) 2023-11-03 12:55:00 -07:00
kbn-subscription-tracking [kbn] Subscription tracking (cont.) (#157392) 2023-09-18 18:27:16 +02:00
kbn-telemetry-tools [Telemetry Tools] Add support for ExportSpecifier in constrains (#171111) 2023-11-13 11:35:39 -07:00
kbn-test [Discover] Address issue with defaultColumns when changing data views (#168994) 2023-11-16 10:04:06 +01:00
kbn-test-jest-helpers [Lens] Add custom formatter within the Lens editor (#158468) 2023-06-13 13:08:07 +02:00
kbn-test-subj-selector [codeowners] add appex-qa for ftr-related packages (#155230) 2023-05-24 08:53:09 +02:00
kbn-text-based-editor ES|QL in-product help: DATE_TRUNC arg order (#171270) 2023-11-15 13:39:24 +01:00
kbn-timelion-grammar Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-tinymath Remove eslint-plugin-prefer-object-spread dependency (#162439) 2023-07-25 10:04:44 +02:00
kbn-tooling-log Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-ts-projects [Synthetics/Uptime] Separate e2e tests by app (#152197) 2023-06-07 17:33:56 +02:00
kbn-ts-type-check-cli Fix typecheck foundations (#167060) 2023-09-25 16:28:56 -07:00
kbn-typed-react-router-config Update new codeowners for Obs team changes (#170182) 2023-11-08 14:30:17 +00:00
kbn-ui-actions-browser [UnifiedFieldList] Convert from a plugin into a package (#158718) 2023-06-23 14:28:12 +02:00
kbn-ui-shared-deps-npm Upgrade EUI to v88.3.0 (#166676) 2023-09-20 08:03:02 -05:00
kbn-ui-shared-deps-src KibanaErrorBoundary initial implementation (#168754) 2023-10-23 07:47:30 -07:00
kbn-ui-theme Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-unified-data-table [Discover] Show "unsaved changes" label when in unsaved state of saved search (#169548) 2023-11-13 13:36:25 +01:00
kbn-unified-doc-viewer [ES|QL] Enables the addition of columns from the doc viewer (#171083) 2023-11-17 14:05:03 +02:00
kbn-unified-field-list [Data Discovery] Run Data Discovery functional tests in Serverless (#164656) 2023-11-17 00:35:19 -04:00
kbn-unsaved-changes-badge [Discover] Show "unsaved changes" label when in unsaved state of saved search (#169548) 2023-11-13 13:36:25 +01:00
kbn-url-state [Security Solution] Fix missing hash in sync to url (#166847) 2023-09-22 10:23:50 +02:00
kbn-use-tracked-promise Update new codeowners for Obs team changes (#170182) 2023-11-08 14:30:17 +00:00
kbn-user-profile-components Upgrade EUI to v90.0.0 (#170179) 2023-11-03 10:19:31 -07:00
kbn-utility-types [Serverless][Security Solution][Endpoint] Restrict endpoint exceptions on serverless via plugin sub-features (#164107) 2023-08-31 13:35:42 +02:00
kbn-utility-types-jest [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
kbn-utils Revert "Custom path for data directory configuration is ignored (#157… (#158325) 2023-05-23 14:22:35 -07:00
kbn-validate-next-docs-cli [validate-next-docs] declare how github urls are determined 2023-02-10 10:54:20 -06:00
kbn-visualization-ui-components [Lens] [Unified Search] Fix field truncation on Combo boxes (#170889) 2023-11-15 15:36:08 +01:00
kbn-web-worker-stub Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
kbn-whereis-pkg-cli [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
kbn-xstate-utils Update new codeowners for Obs team changes (#170182) 2023-11-08 14:30:17 +00:00
kbn-yarn-lock-validator [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
kbn-zod-helpers [Security Solution] Migrate remaining public Detection Engine APIs to OpenAPI and code generation (#170330) 2023-11-08 11:58:28 +01:00
react Integrate Event-Based Telemetry in KibanaErrorBoundary (#169895) 2023-11-03 12:55:00 -07:00
serverless Update new codeowners for Obs team changes (#170182) 2023-11-08 14:30:17 +00:00
shared-ux Remove legacy toolbar component (#170761) 2023-11-15 14:34:07 +01:00
README.md create @kbn/ui-actions-browser package (#149202) 2023-01-19 18:28:07 +01:00

Kibana-related packages

This folder contains packages that are intended for use in Kibana and Kibana plugins.

tl;dr:

  • Don't publish to npm registry
  • Always use the @kbn namespace
  • Always set "private": true in package.json

Using these packages

We no longer publish these packages to the npm registry. Now, instead of specifying a version when including these packages, we rely on yarn workspaces, which sets up a symlink to the package.

For example if you want to use the @kbn/i18n package in Kibana itself, you can specify the dependency like this:

"@kbn/i18n": "1.0.0"

However, if you want to use this from a Kibana plugin, you need to use a link: dependency and account for the relative location of the Kibana repo, so it would instead be:

"@kbn/i18n": "link:../../kibana/packages/kbn-i18n"

then run yarn kbn bootstrap from the plugin directory.

Creating a new package

Run the following command from the root of the Kibana repo:

node scripts/generate package @kbn/<PACKAGE_NAME> --web --owner @elastic/<TEAM_NAME>

Unit tests for a package

Currently there is only one tool being used in order to test packages which is Jest. Below we will explain how it should be done.

Jest

A package should follow the pattern of having .test.js files as siblings of the source code files, and these run by Jest.

A package using the .test.js naming convention will have those tests automatically picked up by Jest and run by the unit test runner, currently mapped to the Kibana test script in the root package.json.

  • yarn test runs all unit tests.
  • yarn jest runs all Jest tests in Kibana.

In order for the plugin or package to use Jest, a jest.config.js file must be present in it's root. However, there are safeguards for this in CI should a test file be added without a corresponding config file.


Each package can also specify its own test script in the package's package.json, for cases where you'd prefer to run the tests from the local package directory.