Skip to content

Commit

Permalink
Merge branch 'main' into fix/rule-condition-chart-equation
Browse files Browse the repository at this point in the history
  • Loading branch information
benakansara authored Sep 23, 2024
2 parents f7578a8 + e6e170e commit f6508c7
Show file tree
Hide file tree
Showing 309 changed files with 7,222 additions and 5,140 deletions.
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/storybooks/build_and_upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const STORYBOOKS = [
'language_documentation_popover',
'unified_search',
'random_sampling',
'text_based_editor',
'esql_editor',
];

const GITHUB_CONTEXT = 'Build and Publish Storybooks';
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ src/plugins/esql @elastic/kibana-esql
packages/kbn-esql-ast @elastic/kibana-esql
examples/esql_ast_inspector @elastic/kibana-esql
src/plugins/esql_datagrid @elastic/kibana-esql
packages/kbn-esql-editor @elastic/kibana-esql
packages/kbn-esql-utils @elastic/kibana-esql
packages/kbn-esql-validation-autocomplete @elastic/kibana-esql
examples/esql_validation_example @elastic/kibana-esql
Expand Down Expand Up @@ -919,7 +920,6 @@ test
x-pack/test
x-pack/performance @elastic/appex-qa
x-pack/examples/testing_embedded_lens @elastic/kibana-visualizations
packages/kbn-text-based-editor @elastic/kibana-esql
x-pack/examples/third_party_lens_navigation_prompt @elastic/kibana-visualizations
x-pack/examples/third_party_vis_lens_example @elastic/kibana-visualizations
x-pack/plugins/threat_intelligence @elastic/security-threat-hunting-investigations
Expand Down
2 changes: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"presentationUtil": "src/plugins/presentation_util",
"randomSampling": "x-pack/packages/kbn-random-sampling",
"reactPackages": "packages/react",
"textBasedEditor": "packages/kbn-text-based-editor",
"esqlEditor": "packages/kbn-esql-editor",
"esqlUtils": "packages/kbn-esql-utils",
"reporting": "packages/kbn-reporting",
"savedObjects": "src/plugins/saved_objects",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions docs/user/dashboard/use-dashboards.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ The *Exists* query returns all documents that contain an indexed value for the f

. To display only the options you selected in the dropdown, click image:images/dashboard_showOnlySelectedOptions_8.3.0.png[The icon to display only the options you have selected in the Options list].

[role="screenshot"]
image::images/dashboard_controlsOptionsList_8.7.0.png[Options list control]

[float]
[[filter-the-data-with-range-slider-controls]]
==== Filter the data with Range slider controls
Expand All @@ -91,6 +94,9 @@ The dashboard displays only the data for the range of values you specified.

. To clear the specified values, click image:images/dashboard_controlsClearSelections_8.3.0.png[The icon to clear all specified values in the Range slider].

[role="screenshot"]
image::images/dashboard_controlsRangeSlider_8.3.0.png[Range slider control]

[float]
[[filter-the-data-with-time-slider-controls]]
==== Filter the data with time slider controls
Expand All @@ -106,9 +112,17 @@ Filter the data within a specified range of time.

. To clear the specified values, click image:images/dashboard_controlsClearSelections_8.3.0.png[The icon to clear all specified values in the Range slider].

[role="screenshot"]
image::images/dashboard_timeSliderControl_8.7.0.gif[Time slider control]

[float]
=== Use filter pills

Use filter pills to focus in on the specific data you want.

[role="screenshot"]
image::images/dashboard_filter_pills_8.15.0.png[Filter pills, width=50%]

[float]
==== Add pills by interacting with visualizations

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@
"@kbn/esql-ast": "link:packages/kbn-esql-ast",
"@kbn/esql-ast-inspector-plugin": "link:examples/esql_ast_inspector",
"@kbn/esql-datagrid": "link:src/plugins/esql_datagrid",
"@kbn/esql-editor": "link:packages/kbn-esql-editor",
"@kbn/esql-utils": "link:packages/kbn-esql-utils",
"@kbn/esql-validation-autocomplete": "link:packages/kbn-esql-validation-autocomplete",
"@kbn/esql-validation-example-plugin": "link:examples/esql_validation_example",
Expand Down Expand Up @@ -919,7 +920,6 @@
"@kbn/telemetry-test-plugin": "link:test/plugin_functional/plugins/telemetry",
"@kbn/test-feature-usage-plugin": "link:x-pack/test/licensing_plugin/plugins/test_feature_usage",
"@kbn/testing-embedded-lens-plugin": "link:x-pack/examples/testing_embedded_lens",
"@kbn/text-based-editor": "link:packages/kbn-text-based-editor",
"@kbn/third-party-lens-navigation-prompt-plugin": "link:x-pack/examples/third_party_lens_navigation_prompt",
"@kbn/third-party-vis-lens-example-plugin": "link:x-pack/examples/third_party_vis_lens_example",
"@kbn/threat-intelligence-plugin": "link:x-pack/plugins/threat_intelligence",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,14 @@ export function registerRoutes({
maxImportPayloadBytes: config.maxImportPayloadBytes,
coreUsageData,
logger,
access: internalOnServerless,
});
registerLegacyExportRoute(legacyRouter, {
kibanaVersion,
coreUsageData,
logger,
access: internalOnServerless,
});
registerLegacyExportRoute(legacyRouter, { kibanaVersion, coreUsageData, logger });

const internalRouter = http.createRouter<InternalSavedObjectsRequestHandlerContext>(
'/internal/saved_objects/'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import moment from 'moment';
import { schema } from '@kbn/config-schema';
import type { Logger } from '@kbn/logging';
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { RouteAccess } from '@kbn/core-http-server';
import type { InternalSavedObjectRouter } from '../../internal_types';
import { exportDashboards } from './lib';

Expand All @@ -20,7 +21,13 @@ export const registerLegacyExportRoute = (
kibanaVersion,
coreUsageData,
logger,
}: { kibanaVersion: string; coreUsageData: InternalCoreUsageDataSetup; logger: Logger }
access,
}: {
kibanaVersion: string;
coreUsageData: InternalCoreUsageDataSetup;
logger: Logger;
access: RouteAccess;
}
) => {
router.get(
{
Expand All @@ -31,6 +38,7 @@ export const registerLegacyExportRoute = (
}),
},
options: {
access,
tags: ['api'],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { schema } from '@kbn/config-schema';
import type { Logger } from '@kbn/logging';
import type { SavedObject } from '@kbn/core-saved-objects-server';
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { RouteAccess } from '@kbn/core-http-server';
import type { InternalSavedObjectRouter } from '../../internal_types';
import { importDashboards } from './lib';

Expand All @@ -20,7 +21,13 @@ export const registerLegacyImportRoute = (
maxImportPayloadBytes,
coreUsageData,
logger,
}: { maxImportPayloadBytes: number; coreUsageData: InternalCoreUsageDataSetup; logger: Logger }
access,
}: {
maxImportPayloadBytes: number;
coreUsageData: InternalCoreUsageDataSetup;
logger: Logger;
access: RouteAccess;
}
) => {
router.post(
{
Expand All @@ -38,6 +45,7 @@ export const registerLegacyImportRoute = (
}),
},
options: {
access,
tags: ['api'],
body: {
maxBytes: maxImportPayloadBytes,
Expand Down
10 changes: 0 additions & 10 deletions packages/kbn-cli-dev-mode/src/dev_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,6 @@ export class DevServer {
this.phase$.next('listening');
this.ready$.next(true);
}

// TODO: remove this once Pier is done migrating log rotation to KP
if (msg === 'RELOAD_LOGGING_CONFIG_FROM_SERVER_WORKER') {
// When receive that event from server worker
// forward a reloadLoggingConfig message to parent
// and child proc. This is only used by LogRotator service
// when the cluster mode is enabled
process.emit('message' as any, { reloadLoggingConfig: true } as any);
proc.send({ reloadLoggingConfig: true });
}
}),
takeUntil(exit$)
);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# @kbn/text-based-editor
# @kbn/esql-editor

Contains the editor for text based languages. Specifically for:
- ESQL, with autocomplete and syntax highlighting
- SQL, with syntax highlighting

---

Contains the ESQL editor with the autocomplete and the autosuggest functionality (based on atlr).
The antlr code can be found in packages/kbn-monaco/src/esql

A **monaco** based editor that is part of the unified search experience. It is rendered for all the applications that support text-based languages.
In order to enable text based languages on your unified search bar add `textBasedLanguages: ['SQL', 'ESQL', '...']` to the dataViewPicker properties.
In order to enable text based languages on your unified search bar add `textBasedLanguages: ['ESQL', '...']` to the dataViewPicker properties.


## Languages supported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export type { TextBasedLanguagesEditorProps } from './src/types';
export type { ESQLEditorProps } from './src/types';
export { fetchFieldsFromESQL } from './src/fetch_fields_from_esql';
import { TextBasedLanguagesEditor } from './src/text_based_languages_editor';
import { ESQLEditor } from './src/esql_editor';

// React.lazy support
// eslint-disable-next-line import/no-default-export
export default TextBasedLanguagesEditor;
export default ESQLEditor;
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-text-based-editor'],
setupFilesAfterEnv: ['<rootDir>/packages/kbn-text-based-editor/setup_tests.ts'],
roots: ['<rootDir>/packages/kbn-esql-editor'],
setupFilesAfterEnv: ['<rootDir>/packages/kbn-esql-editor/setup_tests.ts'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-browser",
"id": "@kbn/text-based-editor",
"id": "@kbn/esql-editor",
"owner": "@elastic/kibana-esql",
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@kbn/text-based-editor",
"name": "@kbn/esql-editor",
"private": true,
"version": "1.0.0",
"license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs/blocks';
import { I18nProvider } from '@kbn/i18n-react';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { TextBasedLanguagesEditor } from '../text_based_languages_editor';
import { ESQLEditor } from '../esql_editor';


export const Template = (args) =>
Expand All @@ -12,19 +12,19 @@ export const Template = (args) =>
uiSettings: { get: () => {} },
}}
>
<TextBasedLanguagesEditor {...args} />
<ESQLEditor {...args} />
</KibanaContextProvider>
</I18nProvider>;

<Meta
title="Text based languages editor"
component={TextBasedLanguagesEditor}
component={ESQLEditor}
/>


# Overview

The TextBasedLanguagesEditor component is a reusable component and can be used to support text based languages in your application (SQL, ESQL):
The ESQLEditor component is a reusable component and can be used to support text based languages in your application (SQL, ESQL):

<Canvas>
<Story
Expand Down Expand Up @@ -71,4 +71,4 @@ When there are errors to the query the UI displays the errors to the editor:

The component exposes the following properties:

<ArgsTable story="expanded mode"/>
<ArgsTable story="expanded mode"/>../esql_editor
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ const getConstsByType = (type: 'error' | 'warning', count: number) => {
if (type === 'error') {
return {
color: 'danger',
message: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.errorCount', {
message: i18n.translate('esqlEditor.query.errorCount', {
defaultMessage: '{count} {count, plural, one {error} other {errors}}',
values: { count },
}),
label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.errorsTitle', {
label: i18n.translate('esqlEditor.query.errorsTitle', {
defaultMessage: 'Errors',
}),
};
} else {
return {
color: 'warning',
message: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.warningCount', {
message: i18n.translate('esqlEditor.query.warningCount', {
defaultMessage: '{count} {count, plural, one {warning} other {warnings}}',
values: { count },
}),
label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.warningsTitle', {
label: i18n.translate('esqlEditor.query.warningsTitle', {
defaultMessage: 'Warnings',
}),
};
Expand Down Expand Up @@ -79,14 +79,14 @@ function ErrorsWarningsContent({
<EuiIcon type={type} color={color} size="s" />
</EuiFlexItem>
<EuiFlexItem style={{ whiteSpace: 'nowrap' }}>
{i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.lineNumber', {
{i18n.translate('esqlEditor.query.lineNumber', {
defaultMessage: 'Line {lineNumber}',
values: { lineNumber: item.startLineNumber },
})}
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem grow={false} className="TextBasedLangEditor_errorMessage">
<EuiFlexItem grow={false} className="ESQLEditor_errorMessage">
{item.message}
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export function SubmitFeedbackComponent({ isSpaceReduced }: { isSpaceReduced?: b
href={FEEDBACK_LINK}
external={false}
target="_blank"
data-test-subj="TextBasedLangEditor-feedback-link"
data-test-subj="ESQLEditor-feedback-link"
>
<EuiToolTip
position="top"
content={i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.feedback', {
content={i18n.translate('esqlEditor.query.feedback', {
defaultMessage: 'Feedback',
})}
>
Expand Down Expand Up @@ -57,9 +57,9 @@ export function SubmitFeedbackComponent({ isSpaceReduced }: { isSpaceReduced?: b
font-size: 12px;
margin-right: ${euiTheme.size.m};
`}
data-test-subj="TextBasedLangEditor-feedback-link"
data-test-subj="ESQLEditor-feedback-link"
>
{i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.submitFeedback', {
{i18n.translate('esqlEditor.query.submitFeedback', {
defaultMessage: 'Submit feedback',
})}
</EuiLink>
Expand Down
Loading

0 comments on commit f6508c7

Please sign in to comment.