mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 10:40:07 -04:00
[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>
This commit is contained in:
parent
2bf4ed4813
commit
7f0d57d9fd
231 changed files with 406 additions and 362 deletions
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
|
@ -302,6 +302,7 @@ x-pack/plugins/dashboard_enhanced @elastic/kibana-presentation
|
||||||
src/plugins/dashboard @elastic/kibana-presentation
|
src/plugins/dashboard @elastic/kibana-presentation
|
||||||
src/plugins/data @elastic/kibana-visualizations @elastic/kibana-data-discovery
|
src/plugins/data @elastic/kibana-visualizations @elastic/kibana-data-discovery
|
||||||
test/plugin_functional/plugins/data_search @elastic/kibana-app-services
|
test/plugin_functional/plugins/data_search @elastic/kibana-app-services
|
||||||
|
packages/kbn-data-service @elastic/kibana-visualizations @elastic/kibana-data-discovery
|
||||||
src/plugins/data_view_editor @elastic/kibana-data-discovery
|
src/plugins/data_view_editor @elastic/kibana-data-discovery
|
||||||
examples/data_view_field_editor_example @elastic/kibana-app-services
|
examples/data_view_field_editor_example @elastic/kibana-app-services
|
||||||
src/plugins/data_view_field_editor @elastic/kibana-data-discovery
|
src/plugins/data_view_field_editor @elastic/kibana-data-discovery
|
||||||
|
@ -719,8 +720,8 @@ test/plugin_functional/plugins/ui_settings_plugin @elastic/kibana-core
|
||||||
packages/kbn-ui-shared-deps-npm @elastic/kibana-operations
|
packages/kbn-ui-shared-deps-npm @elastic/kibana-operations
|
||||||
packages/kbn-ui-shared-deps-src @elastic/kibana-operations
|
packages/kbn-ui-shared-deps-src @elastic/kibana-operations
|
||||||
packages/kbn-ui-theme @elastic/kibana-operations
|
packages/kbn-ui-theme @elastic/kibana-operations
|
||||||
|
packages/kbn-unified-field-list @elastic/kibana-data-discovery
|
||||||
examples/unified_field_list_examples @elastic/kibana-data-discovery
|
examples/unified_field_list_examples @elastic/kibana-data-discovery
|
||||||
src/plugins/unified_field_list @elastic/kibana-data-discovery
|
|
||||||
src/plugins/unified_histogram @elastic/kibana-data-discovery
|
src/plugins/unified_histogram @elastic/kibana-data-discovery
|
||||||
src/plugins/unified_search @elastic/kibana-visualizations
|
src/plugins/unified_search @elastic/kibana-visualizations
|
||||||
x-pack/plugins/upgrade_assistant @elastic/platform-deployment-management
|
x-pack/plugins/upgrade_assistant @elastic/platform-deployment-management
|
||||||
|
|
|
@ -93,7 +93,7 @@
|
||||||
"statusPage": "src/legacy/core_plugins/status_page",
|
"statusPage": "src/legacy/core_plugins/status_page",
|
||||||
"telemetry": ["src/plugins/telemetry", "src/plugins/telemetry_management_section"],
|
"telemetry": ["src/plugins/telemetry", "src/plugins/telemetry_management_section"],
|
||||||
"timelion": ["src/plugins/vis_types/timelion"],
|
"timelion": ["src/plugins/vis_types/timelion"],
|
||||||
"uiActions": "src/plugins/ui_actions",
|
"uiActions": ["src/plugins/ui_actions", "packages/kbn-ui-actions-browser"],
|
||||||
"uiActionsEnhanced": "src/plugins/ui_actions_enhanced",
|
"uiActionsEnhanced": "src/plugins/ui_actions_enhanced",
|
||||||
"uiActionsExamples": "examples/ui_action_examples",
|
"uiActionsExamples": "examples/ui_action_examples",
|
||||||
"usageCollection": "src/plugins/usage_collection",
|
"usageCollection": "src/plugins/usage_collection",
|
||||||
|
@ -114,7 +114,7 @@
|
||||||
"visualizations": "src/plugins/visualizations",
|
"visualizations": "src/plugins/visualizations",
|
||||||
"visualizationUiComponents": "src/plugins/visualization_ui_components",
|
"visualizationUiComponents": "src/plugins/visualization_ui_components",
|
||||||
"unifiedSearch": "src/plugins/unified_search",
|
"unifiedSearch": "src/plugins/unified_search",
|
||||||
"unifiedFieldList": "src/plugins/unified_field_list",
|
"unifiedFieldList": "packages/kbn-unified-field-list",
|
||||||
"unifiedHistogram": "src/plugins/unified_histogram"
|
"unifiedHistogram": "src/plugins/unified_histogram"
|
||||||
},
|
},
|
||||||
"translations": []
|
"translations": []
|
||||||
|
|
|
@ -332,10 +332,6 @@ In general this plugin provides:
|
||||||
|Registers commercially licensed generic actions like per panel time range and contains some code that supports drilldown work.
|
|Registers commercially licensed generic actions like per panel time range and contains some code that supports drilldown work.
|
||||||
|
|
||||||
|
|
||||||
|{kib-repo}blob/{branch}/src/plugins/unified_field_list/README.md[unifiedFieldList]
|
|
||||||
|This Kibana plugin contains components and services for field list UI (as in fields sidebar on Discover and Lens pages).
|
|
||||||
|
|
||||||
|
|
||||||
|{kib-repo}blob/{branch}/src/plugins/unified_histogram/README.md[unifiedHistogram]
|
|{kib-repo}blob/{branch}/src/plugins/unified_histogram/README.md[unifiedHistogram]
|
||||||
|Unified Histogram is a UX Building Block including a layout with a resizable histogram and a main display.
|
|Unified Histogram is a UX Building Block including a layout with a resizable histogram and a main display.
|
||||||
It manages its own state and data fetching, and can easily be dropped into pages with minimal setup.
|
It manages its own state and data fetching, and can easily be dropped into pages with minimal setup.
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
"inspector",
|
"inspector",
|
||||||
"kibanaUtils",
|
"kibanaUtils",
|
||||||
"unifiedSearch",
|
"unifiedSearch",
|
||||||
"unifiedFieldList",
|
|
||||||
"data",
|
"data",
|
||||||
"dataViews",
|
"dataViews",
|
||||||
"dataViewFieldEditor",
|
"dataViewFieldEditor",
|
||||||
|
|
|
@ -28,7 +28,7 @@ import {
|
||||||
hasQuerySubscriberData,
|
hasQuerySubscriberData,
|
||||||
RenderFieldItemParams,
|
RenderFieldItemParams,
|
||||||
useQuerySubscriber,
|
useQuerySubscriber,
|
||||||
} from '@kbn/unified-field-list-plugin/public';
|
} from '@kbn/unified-field-list';
|
||||||
import { generateFilters } from '@kbn/data-plugin/public';
|
import { generateFilters } from '@kbn/data-plugin/public';
|
||||||
import type { CoreStart } from '@kbn/core-lifecycle-browser';
|
import type { CoreStart } from '@kbn/core-lifecycle-browser';
|
||||||
import type { AppPluginStartDependencies } from './types';
|
import type { AppPluginStartDependencies } from './types';
|
||||||
|
|
|
@ -26,7 +26,7 @@ import {
|
||||||
useExistingFieldsFetcher,
|
useExistingFieldsFetcher,
|
||||||
useGroupedFields,
|
useGroupedFields,
|
||||||
useQuerySubscriber,
|
useQuerySubscriber,
|
||||||
} from '@kbn/unified-field-list-plugin/public';
|
} from '@kbn/unified-field-list';
|
||||||
import { FieldListItem, FieldListItemProps } from './field_list_item';
|
import { FieldListItem, FieldListItemProps } from './field_list_item';
|
||||||
|
|
||||||
export interface FieldListSidebarProps {
|
export interface FieldListSidebarProps {
|
||||||
|
|
|
@ -58,7 +58,7 @@ export class UnifiedFieldListExamplesPlugin
|
||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'README',
|
label: 'README',
|
||||||
href: 'https://github.com/elastic/kibana/tree/main/src/plugins/unified_field_list/README.md',
|
href: 'https://github.com/elastic/kibana/tree/main/packages/kbn-unified-field-list/README.md',
|
||||||
iconType: 'logoGithub',
|
iconType: 'logoGithub',
|
||||||
target: '_blank',
|
target: '_blank',
|
||||||
size: 's',
|
size: 's',
|
||||||
|
|
|
@ -23,10 +23,10 @@
|
||||||
"@kbn/i18n-react",
|
"@kbn/i18n-react",
|
||||||
"@kbn/i18n",
|
"@kbn/i18n",
|
||||||
"@kbn/dom-drag-drop",
|
"@kbn/dom-drag-drop",
|
||||||
"@kbn/unified-field-list-plugin",
|
|
||||||
"@kbn/core-lifecycle-browser",
|
"@kbn/core-lifecycle-browser",
|
||||||
"@kbn/charts-plugin",
|
"@kbn/charts-plugin",
|
||||||
"@kbn/field-formats-plugin",
|
"@kbn/field-formats-plugin",
|
||||||
"@kbn/data-view-field-editor-plugin",
|
"@kbn/data-view-field-editor-plugin",
|
||||||
|
"@kbn/unified-field-list",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -348,6 +348,7 @@
|
||||||
"@kbn/dashboard-plugin": "link:src/plugins/dashboard",
|
"@kbn/dashboard-plugin": "link:src/plugins/dashboard",
|
||||||
"@kbn/data-plugin": "link:src/plugins/data",
|
"@kbn/data-plugin": "link:src/plugins/data",
|
||||||
"@kbn/data-search-plugin": "link:test/plugin_functional/plugins/data_search",
|
"@kbn/data-search-plugin": "link:test/plugin_functional/plugins/data_search",
|
||||||
|
"@kbn/data-service": "link:packages/kbn-data-service",
|
||||||
"@kbn/data-view-editor-plugin": "link:src/plugins/data_view_editor",
|
"@kbn/data-view-editor-plugin": "link:src/plugins/data_view_editor",
|
||||||
"@kbn/data-view-field-editor-example-plugin": "link:examples/data_view_field_editor_example",
|
"@kbn/data-view-field-editor-example-plugin": "link:examples/data_view_field_editor_example",
|
||||||
"@kbn/data-view-field-editor-plugin": "link:src/plugins/data_view_field_editor",
|
"@kbn/data-view-field-editor-plugin": "link:src/plugins/data_view_field_editor",
|
||||||
|
@ -709,8 +710,8 @@
|
||||||
"@kbn/ui-shared-deps-npm": "link:packages/kbn-ui-shared-deps-npm",
|
"@kbn/ui-shared-deps-npm": "link:packages/kbn-ui-shared-deps-npm",
|
||||||
"@kbn/ui-shared-deps-src": "link:packages/kbn-ui-shared-deps-src",
|
"@kbn/ui-shared-deps-src": "link:packages/kbn-ui-shared-deps-src",
|
||||||
"@kbn/ui-theme": "link:packages/kbn-ui-theme",
|
"@kbn/ui-theme": "link:packages/kbn-ui-theme",
|
||||||
|
"@kbn/unified-field-list": "link:packages/kbn-unified-field-list",
|
||||||
"@kbn/unified-field-list-examples-plugin": "link:examples/unified_field_list_examples",
|
"@kbn/unified-field-list-examples-plugin": "link:examples/unified_field_list_examples",
|
||||||
"@kbn/unified-field-list-plugin": "link:src/plugins/unified_field_list",
|
|
||||||
"@kbn/unified-histogram-plugin": "link:src/plugins/unified_histogram",
|
"@kbn/unified-histogram-plugin": "link:src/plugins/unified_histogram",
|
||||||
"@kbn/unified-search-plugin": "link:src/plugins/unified_search",
|
"@kbn/unified-search-plugin": "link:src/plugins/unified_search",
|
||||||
"@kbn/upgrade-assistant-plugin": "link:x-pack/plugins/upgrade_assistant",
|
"@kbn/upgrade-assistant-plugin": "link:x-pack/plugins/upgrade_assistant",
|
||||||
|
|
3
packages/kbn-data-service/README.md
Normal file
3
packages/kbn-data-service/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# @kbn/data-service
|
||||||
|
|
||||||
|
A package version of `data` plugin.
|
12
packages/kbn-data-service/index.ts
Normal file
12
packages/kbn-data-service/index.ts
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
/*
|
||||||
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||||
|
* or more contributor license agreements. Licensed under the Elastic License
|
||||||
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||||
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||||
|
* Side Public License, v 1.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export type { GetConfigFn } from './src/types';
|
||||||
|
export { UI_SETTINGS } from './src/constants';
|
||||||
|
export { getEsQueryConfig } from './src/es_query';
|
||||||
|
export { tabifyDocs, flattenHit } from './src/search/tabify';
|
|
@ -8,9 +8,6 @@
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
preset: '@kbn/test',
|
preset: '@kbn/test',
|
||||||
rootDir: '../../..',
|
rootDir: '../..',
|
||||||
roots: ['<rootDir>/src/plugins/unified_field_list'],
|
roots: ['<rootDir>/packages/kbn-data-service'],
|
||||||
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/src/plugins/unified_field_list',
|
|
||||||
coverageReporters: ['text', 'html'],
|
|
||||||
collectCoverageFrom: ['<rootDir>/src/plugins/unified_field_list/public/**/*.{ts,tsx}'],
|
|
||||||
};
|
};
|
8
packages/kbn-data-service/kibana.jsonc
Normal file
8
packages/kbn-data-service/kibana.jsonc
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"type": "shared-common",
|
||||||
|
"id": "@kbn/data-service",
|
||||||
|
"owner": [
|
||||||
|
"@elastic/kibana-visualizations",
|
||||||
|
"@elastic/kibana-data-discovery"
|
||||||
|
]
|
||||||
|
}
|
7
packages/kbn-data-service/package.json
Normal file
7
packages/kbn-data-service/package.json
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"name": "@kbn/data-service",
|
||||||
|
"private": true,
|
||||||
|
"version": "1.0.0",
|
||||||
|
"license": "SSPL-1.0 OR Elastic License 2.0",
|
||||||
|
"sideEffects": false
|
||||||
|
}
|
34
packages/kbn-data-service/src/constants.ts
Normal file
34
packages/kbn-data-service/src/constants.ts
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
/*
|
||||||
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||||
|
* or more contributor license agreements. Licensed under the Elastic License
|
||||||
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||||
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||||
|
* Side Public License, v 1.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const UI_SETTINGS = {
|
||||||
|
META_FIELDS: 'metaFields',
|
||||||
|
DOC_HIGHLIGHT: 'doc_table:highlight',
|
||||||
|
QUERY_STRING_OPTIONS: 'query:queryString:options',
|
||||||
|
QUERY_ALLOW_LEADING_WILDCARDS: 'query:allowLeadingWildcards',
|
||||||
|
SEARCH_QUERY_LANGUAGE: 'search:queryLanguage',
|
||||||
|
SORT_OPTIONS: 'sort:options',
|
||||||
|
COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX: 'courier:ignoreFilterIfFieldNotInIndex',
|
||||||
|
COURIER_SET_REQUEST_PREFERENCE: 'courier:setRequestPreference',
|
||||||
|
COURIER_CUSTOM_REQUEST_PREFERENCE: 'courier:customRequestPreference',
|
||||||
|
COURIER_MAX_CONCURRENT_SHARD_REQUESTS: 'courier:maxConcurrentShardRequests',
|
||||||
|
SEARCH_INCLUDE_FROZEN: 'search:includeFrozen',
|
||||||
|
SEARCH_TIMEOUT: 'search:timeout',
|
||||||
|
HISTOGRAM_BAR_TARGET: 'histogram:barTarget',
|
||||||
|
HISTOGRAM_MAX_BARS: 'histogram:maxBars',
|
||||||
|
HISTORY_LIMIT: 'history:limit',
|
||||||
|
TIMEPICKER_REFRESH_INTERVAL_DEFAULTS: 'timepicker:refreshIntervalDefaults',
|
||||||
|
TIMEPICKER_QUICK_RANGES: 'timepicker:quickRanges',
|
||||||
|
TIMEPICKER_TIME_DEFAULTS: 'timepicker:timeDefaults',
|
||||||
|
FILTERS_PINNED_BY_DEFAULT: 'filters:pinnedByDefault',
|
||||||
|
FILTERS_EDITOR_SUGGEST_VALUES: 'filterEditor:suggestValues',
|
||||||
|
AUTOCOMPLETE_USE_TIMERANGE: 'autocomplete:useTimeRange',
|
||||||
|
AUTOCOMPLETE_VALUE_SUGGESTION_METHOD: 'autocomplete:valueSuggestionMethod',
|
||||||
|
DATE_FORMAT: 'dateFormat',
|
||||||
|
DATEFORMAT_TZ: 'dateFormat:tz',
|
||||||
|
} as const;
|
|
@ -9,7 +9,7 @@
|
||||||
import { get } from 'lodash';
|
import { get } from 'lodash';
|
||||||
import { getEsQueryConfig } from './get_es_query_config';
|
import { getEsQueryConfig } from './get_es_query_config';
|
||||||
import { IUiSettingsClient } from '@kbn/core/public';
|
import { IUiSettingsClient } from '@kbn/core/public';
|
||||||
import { UI_SETTINGS } from '..';
|
import { UI_SETTINGS } from '../constants';
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
get(item: string) {
|
get(item: string) {
|
|
@ -7,7 +7,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { EsQueryConfig } from '@kbn/es-query';
|
import { EsQueryConfig } from '@kbn/es-query';
|
||||||
import { GetConfigFn, UI_SETTINGS } from '..';
|
import { GetConfigFn } from '../types';
|
||||||
|
import { UI_SETTINGS } from '../constants';
|
||||||
|
|
||||||
interface KibanaConfig {
|
interface KibanaConfig {
|
||||||
get: GetConfigFn;
|
get: GetConfigFn;
|
2
src/plugins/unified_field_list/common/types/index.ts → packages/kbn-data-service/src/es_query/index.ts
Executable file → Normal file
2
src/plugins/unified_field_list/common/types/index.ts → packages/kbn-data-service/src/es_query/index.ts
Executable file → Normal file
|
@ -6,4 +6,4 @@
|
||||||
* Side Public License, v 1.
|
* Side Public License, v 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export type { FieldStatsResponse, BucketedAggregation, NumberSummary } from './stats';
|
export { getEsQueryConfig } from './get_es_query_config';
|
2
src/plugins/unified_field_list/common/index.ts → packages/kbn-data-service/src/search/tabify/index.ts
Executable file → Normal file
2
src/plugins/unified_field_list/common/index.ts → packages/kbn-data-service/src/search/tabify/index.ts
Executable file → Normal file
|
@ -6,4 +6,4 @@
|
||||||
* Side Public License, v 1.
|
* Side Public License, v 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const PLUGIN_ID = 'unifiedFieldList';
|
export { tabifyDocs, flattenHit } from './tabify_docs';
|
19
packages/kbn-data-service/src/types.ts
Normal file
19
packages/kbn-data-service/src/types.ts
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||||
|
* or more contributor license agreements. Licensed under the Elastic License
|
||||||
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||||
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||||
|
* Side Public License, v 1.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If a service is being shared on both the client and the server, and
|
||||||
|
* the client code requires synchronous access to uiSettings, both client
|
||||||
|
* and server should wrap the core uiSettings services in a function
|
||||||
|
* matching this signature.
|
||||||
|
*
|
||||||
|
* This matches the signature of the public `core.uiSettings.get`, and
|
||||||
|
* should only be used in scenarios where async access to uiSettings is
|
||||||
|
* not possible.
|
||||||
|
*/
|
||||||
|
export type GetConfigFn = <T = any>(key: string, defaultOverride?: T) => T;
|
15
packages/kbn-data-service/tsconfig.json
Normal file
15
packages/kbn-data-service/tsconfig.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "target/types"
|
||||||
|
},
|
||||||
|
"include": ["*.ts", "src/**/*"],
|
||||||
|
"kbn_references": [
|
||||||
|
"@kbn/core",
|
||||||
|
"@kbn/es-query",
|
||||||
|
"@kbn/data-views-plugin",
|
||||||
|
"@kbn/field-formats-plugin",
|
||||||
|
"@kbn/expressions-plugin",
|
||||||
|
],
|
||||||
|
"exclude": ["target/**/*"]
|
||||||
|
}
|
|
@ -137,7 +137,6 @@ pageLoadAssetSize:
|
||||||
triggersActionsUi: 135613
|
triggersActionsUi: 135613
|
||||||
uiActions: 35121
|
uiActions: 35121
|
||||||
uiActionsEnhanced: 38494
|
uiActionsEnhanced: 38494
|
||||||
unifiedFieldList: 65500
|
|
||||||
unifiedHistogram: 19928
|
unifiedHistogram: 19928
|
||||||
unifiedSearch: 71059
|
unifiedSearch: 71059
|
||||||
upgradeAssistant: 81241
|
upgradeAssistant: 81241
|
||||||
|
|
|
@ -6,4 +6,16 @@
|
||||||
* Side Public License, v 1.
|
* Side Public License, v 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './src';
|
export * from './src/types';
|
||||||
|
export type { Trigger, RowClickContext } from './src/triggers';
|
||||||
|
export {
|
||||||
|
VISUALIZE_FIELD_TRIGGER,
|
||||||
|
visualizeFieldTrigger,
|
||||||
|
VISUALIZE_GEO_FIELD_TRIGGER,
|
||||||
|
visualizeGeoFieldTrigger,
|
||||||
|
ROW_CLICK_TRIGGER,
|
||||||
|
rowClickTrigger,
|
||||||
|
CATEGORIZE_FIELD_TRIGGER,
|
||||||
|
categorizeFieldTrigger,
|
||||||
|
defaultTrigger,
|
||||||
|
} from './src/triggers';
|
||||||
|
|
|
@ -7,3 +7,4 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './types';
|
export * from './types';
|
||||||
|
export * from './triggers';
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* Side Public License, v 1.
|
* Side Public License, v 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Trigger } from '.';
|
import { Trigger } from './trigger';
|
||||||
|
|
||||||
export const CATEGORIZE_FIELD_TRIGGER = 'CATEGORIZE_FIELD_TRIGGER';
|
export const CATEGORIZE_FIELD_TRIGGER = 'CATEGORIZE_FIELD_TRIGGER';
|
||||||
export const categorizeFieldTrigger: Trigger = {
|
export const categorizeFieldTrigger: Trigger = {
|
14
packages/kbn-ui-actions-browser/src/triggers/index.ts
Normal file
14
packages/kbn-ui-actions-browser/src/triggers/index.ts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
/*
|
||||||
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||||
|
* or more contributor license agreements. Licensed under the Elastic License
|
||||||
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||||
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||||
|
* Side Public License, v 1.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export * from './trigger';
|
||||||
|
export * from './row_click_trigger';
|
||||||
|
export * from './default_trigger';
|
||||||
|
export * from './visualize_field_trigger';
|
||||||
|
export * from './visualize_geo_field_trigger';
|
||||||
|
export * from './categorize_field_trigger';
|
|
@ -15,5 +15,8 @@
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"target/**/*"
|
"target/**/*"
|
||||||
],
|
],
|
||||||
"kbn_references": []
|
"kbn_references": [
|
||||||
|
"@kbn/i18n",
|
||||||
|
"@kbn/expressions-plugin",
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# unifiedFieldList
|
# @kbn/unified-field-list
|
||||||
|
|
||||||
This Kibana plugin contains components and services for field list UI (as in fields sidebar on Discover and Lens pages).
|
This Kibana package contains components and services for field list UI (as in fields sidebar on Discover and Lens pages).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
@ -6,24 +6,22 @@
|
||||||
* Side Public License, v 1.
|
* Side Public License, v 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { UnifiedFieldListPlugin } from './plugin';
|
export { FieldList, type FieldListProps } from './src/components/field_list';
|
||||||
export type { FieldStatsResponse, BucketedAggregation, NumberSummary } from '../common/types';
|
export { FieldListGrouped, type FieldListGroupedProps } from './src/components/field_list_grouped';
|
||||||
export { FieldList, type FieldListProps } from './components/field_list';
|
export { FieldListFilters, type FieldListFiltersProps } from './src/components/field_list_filters';
|
||||||
export { FieldListGrouped, type FieldListGroupedProps } from './components/field_list_grouped';
|
export { FieldIcon, type FieldIconProps, getFieldIconProps } from './src/components/field_icon';
|
||||||
export { FieldListFilters, type FieldListFiltersProps } from './components/field_list_filters';
|
export { FieldItemButton, type FieldItemButtonProps } from './src/components/field_item_button';
|
||||||
export { FieldIcon, type FieldIconProps, getFieldIconProps } from './components/field_icon';
|
|
||||||
export { FieldItemButton, type FieldItemButtonProps } from './components/field_item_button';
|
|
||||||
export type {
|
export type {
|
||||||
FieldTopValuesBucketProps,
|
FieldTopValuesBucketProps,
|
||||||
FieldTopValuesBucketParams,
|
FieldTopValuesBucketParams,
|
||||||
} from './components/field_stats';
|
} from './src/components/field_stats';
|
||||||
export { FieldTopValuesBucket } from './components/field_stats';
|
export { FieldTopValuesBucket } from './src/components/field_stats';
|
||||||
export type {
|
export type {
|
||||||
FieldStatsProps,
|
FieldStatsProps,
|
||||||
FieldStatsServices,
|
FieldStatsServices,
|
||||||
FieldStatsState,
|
FieldStatsState,
|
||||||
} from './components/field_stats';
|
} from './src/components/field_stats';
|
||||||
export { FieldStats } from './components/field_stats';
|
export { FieldStats } from './src/components/field_stats';
|
||||||
export {
|
export {
|
||||||
FieldPopover,
|
FieldPopover,
|
||||||
type FieldPopoverProps,
|
type FieldPopoverProps,
|
||||||
|
@ -31,7 +29,7 @@ export {
|
||||||
type FieldPopoverHeaderProps,
|
type FieldPopoverHeaderProps,
|
||||||
FieldPopoverFooter,
|
FieldPopoverFooter,
|
||||||
type FieldPopoverFooterProps,
|
type FieldPopoverFooterProps,
|
||||||
} from './components/field_popover';
|
} from './src/components/field_popover';
|
||||||
export {
|
export {
|
||||||
FieldVisualizeButton,
|
FieldVisualizeButton,
|
||||||
type FieldVisualizeButtonProps,
|
type FieldVisualizeButtonProps,
|
||||||
|
@ -39,18 +37,14 @@ export {
|
||||||
triggerVisualizeActions,
|
triggerVisualizeActions,
|
||||||
triggerVisualizeActionsTextBasedLanguages,
|
triggerVisualizeActionsTextBasedLanguages,
|
||||||
type VisualizeInformation,
|
type VisualizeInformation,
|
||||||
} from './components/field_visualize_button';
|
} from './src/components/field_visualize_button';
|
||||||
export { loadFieldStats } from './services/field_stats';
|
export { loadFieldStats } from './src/services/field_stats';
|
||||||
export { loadFieldExisting } from './services/field_existing';
|
export { loadFieldExisting } from './src/services/field_existing';
|
||||||
|
|
||||||
// This exports static code and TypeScript types,
|
|
||||||
// as well as, Kibana Platform `plugin()` initializer.
|
|
||||||
export function plugin() {
|
|
||||||
return new UnifiedFieldListPlugin();
|
|
||||||
}
|
|
||||||
export type {
|
export type {
|
||||||
UnifiedFieldListPluginSetup,
|
FieldStatsResponse,
|
||||||
UnifiedFieldListPluginStart,
|
BucketedAggregation,
|
||||||
|
NumberSummary,
|
||||||
AddFieldFilterHandler,
|
AddFieldFilterHandler,
|
||||||
FieldListGroups,
|
FieldListGroups,
|
||||||
FieldsGroupDetails,
|
FieldsGroupDetails,
|
||||||
|
@ -58,8 +52,8 @@ export type {
|
||||||
FieldListItem,
|
FieldListItem,
|
||||||
GetCustomFieldType,
|
GetCustomFieldType,
|
||||||
RenderFieldItemParams,
|
RenderFieldItemParams,
|
||||||
} from './types';
|
} from './src/types';
|
||||||
export { ExistenceFetchStatus, FieldsGroupNames } from './types';
|
export { ExistenceFetchStatus, FieldsGroupNames } from './src/types';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
useExistingFieldsFetcher,
|
useExistingFieldsFetcher,
|
||||||
|
@ -69,26 +63,26 @@ export {
|
||||||
type ExistingFieldsFetcherParams,
|
type ExistingFieldsFetcherParams,
|
||||||
type ExistingFieldsFetcher,
|
type ExistingFieldsFetcher,
|
||||||
type ExistingFieldsReader,
|
type ExistingFieldsReader,
|
||||||
} from './hooks/use_existing_fields';
|
} from './src/hooks/use_existing_fields';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
useGroupedFields,
|
useGroupedFields,
|
||||||
type GroupedFieldsParams,
|
type GroupedFieldsParams,
|
||||||
type GroupedFieldsResult,
|
type GroupedFieldsResult,
|
||||||
} from './hooks/use_grouped_fields';
|
} from './src/hooks/use_grouped_fields';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
useFieldFilters,
|
useFieldFilters,
|
||||||
type FieldFiltersParams,
|
type FieldFiltersParams,
|
||||||
type FieldFiltersResult,
|
type FieldFiltersResult,
|
||||||
} from './hooks/use_field_filters';
|
} from './src/hooks/use_field_filters';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
useQuerySubscriber,
|
useQuerySubscriber,
|
||||||
hasQuerySubscriberData,
|
hasQuerySubscriberData,
|
||||||
type QuerySubscriberResult,
|
type QuerySubscriberResult,
|
||||||
type QuerySubscriberParams,
|
type QuerySubscriberParams,
|
||||||
} from './hooks/use_query_subscriber';
|
} from './src/hooks/use_query_subscriber';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getFieldTypeName,
|
getFieldTypeName,
|
||||||
|
@ -96,4 +90,4 @@ export {
|
||||||
KNOWN_FIELD_TYPES,
|
KNOWN_FIELD_TYPES,
|
||||||
getFieldType,
|
getFieldType,
|
||||||
getFieldIconType,
|
getFieldIconType,
|
||||||
} from './utils/field_types';
|
} from './src/utils/field_types';
|
13
packages/kbn-unified-field-list/jest.config.js
Normal file
13
packages/kbn-unified-field-list/jest.config.js
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
/*
|
||||||
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||||
|
* or more contributor license agreements. Licensed under the Elastic License
|
||||||
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||||
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||||
|
* Side Public License, v 1.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../..',
|
||||||
|
roots: ['<rootDir>/packages/kbn-unified-field-list'],
|
||||||
|
};
|
6
packages/kbn-unified-field-list/kibana.jsonc
Normal file
6
packages/kbn-unified-field-list/kibana.jsonc
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"type": "shared-common",
|
||||||
|
"id": "@kbn/unified-field-list",
|
||||||
|
"description": "Contains functionality for the field list and field stats which can be integrated into apps",
|
||||||
|
"owner": "@elastic/kibana-data-discovery"
|
||||||
|
}
|
10
packages/kbn-unified-field-list/package.json
Normal file
10
packages/kbn-unified-field-list/package.json
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"name": "@kbn/unified-field-list",
|
||||||
|
"private": true,
|
||||||
|
"version": "1.0.0",
|
||||||
|
"license": "SSPL-1.0 OR Elastic License 2.0",
|
||||||
|
"sideEffects": [
|
||||||
|
"*.css",
|
||||||
|
"*.scss"
|
||||||
|
]
|
||||||
|
}
|
|
@ -6,11 +6,8 @@
|
||||||
* Side Public License, v 1.
|
* Side Public License, v 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import type { UiActionsStart, CategorizeFieldContext } from '@kbn/ui-actions-plugin/public';
|
||||||
type UiActionsStart,
|
import { CATEGORIZE_FIELD_TRIGGER } from '@kbn/ui-actions-browser/src/triggers';
|
||||||
CATEGORIZE_FIELD_TRIGGER,
|
|
||||||
CategorizeFieldContext,
|
|
||||||
} from '@kbn/ui-actions-plugin/public';
|
|
||||||
import type { DataViewField, DataView } from '@kbn/data-views-plugin/public';
|
import type { DataViewField, DataView } from '@kbn/data-views-plugin/public';
|
||||||
|
|
||||||
async function getCompatibleActions(
|
async function getCompatibleActions(
|
|
@ -15,7 +15,8 @@ import { ActionInternal } from '@kbn/ui-actions-plugin/public';
|
||||||
import { uiActionsPluginMock } from '@kbn/ui-actions-plugin/public/mocks';
|
import { uiActionsPluginMock } from '@kbn/ui-actions-plugin/public/mocks';
|
||||||
import { getFieldCategorizeButton } from './field_categorize_button';
|
import { getFieldCategorizeButton } from './field_categorize_button';
|
||||||
import { ACTION_CATEGORIZE_FIELD, CategorizeFieldContext } from '@kbn/ui-actions-plugin/public';
|
import { ACTION_CATEGORIZE_FIELD, CategorizeFieldContext } from '@kbn/ui-actions-plugin/public';
|
||||||
import { CATEGORIZE_FIELD_TRIGGER, TriggerContract } from '@kbn/ui-actions-plugin/public/triggers';
|
import { TriggerContract } from '@kbn/ui-actions-plugin/public/triggers';
|
||||||
|
import { CATEGORIZE_FIELD_TRIGGER } from '@kbn/ui-actions-browser';
|
||||||
|
|
||||||
const ORIGINATING_APP = 'test';
|
const ORIGINATING_APP = 'test';
|
||||||
const mockExecuteAction = jest.fn();
|
const mockExecuteAction = jest.fn();
|
|
@ -14,10 +14,10 @@ import {
|
||||||
RIGHT_ALIGNMENT,
|
RIGHT_ALIGNMENT,
|
||||||
euiScreenReaderOnly,
|
euiScreenReaderOnly,
|
||||||
} from '@elastic/eui';
|
} from '@elastic/eui';
|
||||||
import { DataView, DataViewField } from '@kbn/data-plugin/common';
|
import type { DataView, DataViewField } from '@kbn/data-views-plugin/common';
|
||||||
import { i18n } from '@kbn/i18n';
|
import { i18n } from '@kbn/i18n';
|
||||||
import { css } from '@emotion/react';
|
import { css } from '@emotion/react';
|
||||||
import type { NumberSummary } from '../../../common/types';
|
import type { NumberSummary } from '../../types';
|
||||||
|
|
||||||
interface SummaryTableItem {
|
interface SummaryTableItem {
|
||||||
key: string;
|
key: string;
|
|
@ -7,13 +7,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import {
|
import type { DataView, DataViewField } from '@kbn/data-views-plugin/common';
|
||||||
type DataView,
|
import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types';
|
||||||
type DataViewField,
|
import { getEsQueryConfig } from '@kbn/data-service/src/es_query';
|
||||||
ES_FIELD_TYPES,
|
|
||||||
getEsQueryConfig,
|
|
||||||
KBN_FIELD_TYPES,
|
|
||||||
} from '@kbn/data-plugin/common';
|
|
||||||
import type { IUiSettingsClient } from '@kbn/core/public';
|
import type { IUiSettingsClient } from '@kbn/core/public';
|
||||||
import type { DataViewsContract } from '@kbn/data-views-plugin/public';
|
import type { DataViewsContract } from '@kbn/data-views-plugin/public';
|
||||||
import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
|
import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
|
||||||
|
@ -36,7 +32,7 @@ import { i18n } from '@kbn/i18n';
|
||||||
import { buildEsQuery, Query, Filter, AggregateQuery } from '@kbn/es-query';
|
import { buildEsQuery, Query, Filter, AggregateQuery } from '@kbn/es-query';
|
||||||
import { showExamplesForField } from '../../services/field_stats/field_examples_calculator';
|
import { showExamplesForField } from '../../services/field_stats/field_examples_calculator';
|
||||||
import { OverrideFieldTopValueBarCallback } from './field_top_values_bucket';
|
import { OverrideFieldTopValueBarCallback } from './field_top_values_bucket';
|
||||||
import type { BucketedAggregation, NumberSummary } from '../../../common/types';
|
import type { BucketedAggregation, NumberSummary } from '../../types';
|
||||||
import {
|
import {
|
||||||
canProvideStatsForField,
|
canProvideStatsForField,
|
||||||
canProvideNumberSummaryForField,
|
canProvideNumberSummaryForField,
|
|
@ -12,7 +12,7 @@ import { mountWithIntl } from '@kbn/test-jest-helpers';
|
||||||
import type { DataView } from '@kbn/data-views-plugin/common';
|
import type { DataView } from '@kbn/data-views-plugin/common';
|
||||||
import { FieldTopValues, FieldTopValuesProps } from './field_top_values';
|
import { FieldTopValues, FieldTopValuesProps } from './field_top_values';
|
||||||
import { fieldFormatsServiceMock } from '@kbn/field-formats-plugin/public/mocks';
|
import { fieldFormatsServiceMock } from '@kbn/field-formats-plugin/public/mocks';
|
||||||
import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/data-plugin/common';
|
import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types';
|
||||||
|
|
||||||
describe('UnifiedFieldList <FieldTopValues />', () => {
|
describe('UnifiedFieldList <FieldTopValues />', () => {
|
||||||
let defaultProps: FieldTopValuesProps;
|
let defaultProps: FieldTopValuesProps;
|
|
@ -8,9 +8,8 @@
|
||||||
|
|
||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
import { euiPaletteColorBlind, EuiSpacer } from '@elastic/eui';
|
import { euiPaletteColorBlind, EuiSpacer } from '@elastic/eui';
|
||||||
import { DataView, DataViewField } from '@kbn/data-plugin/common';
|
import type { DataView, DataViewField } from '@kbn/data-views-plugin/common';
|
||||||
import type { BucketedAggregation } from '../../../common/types';
|
import type { AddFieldFilterHandler, BucketedAggregation } from '../../types';
|
||||||
import type { AddFieldFilterHandler } from '../../types';
|
|
||||||
import FieldTopValuesBucket from './field_top_values_bucket';
|
import FieldTopValuesBucket from './field_top_values_bucket';
|
||||||
import type { OverrideFieldTopValueBarCallback } from './field_top_values_bucket';
|
import type { OverrideFieldTopValueBarCallback } from './field_top_values_bucket';
|
||||||
|
|
|
@ -20,7 +20,7 @@ import {
|
||||||
VISUALIZE_GEO_FIELD_TRIGGER,
|
VISUALIZE_GEO_FIELD_TRIGGER,
|
||||||
VisualizeFieldContext,
|
VisualizeFieldContext,
|
||||||
} from '@kbn/ui-actions-plugin/public';
|
} from '@kbn/ui-actions-plugin/public';
|
||||||
import { TriggerContract } from '@kbn/ui-actions-plugin/public/triggers';
|
import type { TriggerContract } from '@kbn/ui-actions-plugin/public/triggers';
|
||||||
|
|
||||||
const ORIGINATING_APP = 'test';
|
const ORIGINATING_APP = 'test';
|
||||||
const mockExecuteAction = jest.fn();
|
const mockExecuteAction = jest.fn();
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue