Skip to content

Commit

Permalink
Merge branch 'main' into remove-extra-overview
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 authored Sep 23, 2024
2 parents 7c351c9 + 2106df3 commit 073a4d6
Show file tree
Hide file tree
Showing 131 changed files with 2,796 additions and 2,310 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
Binary file removed docs/user/reporting/images/embed-code-public-url.png
Binary file not shown.
Binary file removed docs/user/reporting/images/permalink-public-url.png
Binary file not shown.
104 changes: 41 additions & 63 deletions docs/user/reporting/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,40 @@
:frontmatter-description: {kib} provides you with several options to share *Discover* saved searches, dashboards, *Visualize Library* visualizations, and *Canvas* workpads with others, or on a website.
:frontmatter-tags-products: [kibana]

{kib} provides you with several options to share *Discover* saved searches, dashboards, *Visualize Library* visualizations, and *Canvas* workpads.
{kib} provides you with several options to share *Discover* saved searches, dashboards, *Visualize Library* visualizations, and *Canvas* workpads. These sharing options are available from the *Share* menu in the toolbar.

You access the options from the *Share* menu in the toolbar. The sharing options include the following:
[float]
[[share-a-direct-link]]
== Share with a direct link

* *PDF Reports* — Generate and download PDF files of dashboards, visualizations, and *Canvas* workpads. PDF reports are a link:https://www.elastic.co/subscriptions[subscription feature].
You can share direct links to saved searches, dashboards, and visualizations. When clicking **Share**, look for the **Links** tab to get the shareable link and copy it.

* *PNG Reports* — Generate and download PNG files of dashboards and visualizations. PNG reports are a link:https://www.elastic.co/subscriptions[subscription feature].
TIP: When sharing an object with unsaved changes, you get a temporary link that might break in the future, for example in case of upgrade. Save the object to get a permanent link instead.

* *CSV Reports* &mdash; Generate CSV reports of saved searches. <<csv-limitations,Certain limitations apply>>.
To access the object shared with the link, users need to authenticate.

* *CSV Download* &mdash; Generate and download CSV files of *Lens* visualizations.
Anonymous users can also access the link if you have configured <<anonymous-authentication,Anonymous authentication>> and your anonymous service account has privileges to access what you want to share.

* *Get links* &mdash; Share direct links to saved searches, dashboards, and visualizations.
image::https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blt49f2b5a80ec89a34/66b9e919af508f4ac182c194/share-dashboard.gif[getting a shareable link for a dashboard]

* *Download as JSON* &mdash; Generate and download JSON files of *Canvas* workpads.
[float]
[[manually-generate-reports]]
== Export as a file

* beta[] *Share on a website* &mdash; Download and securely share *Canvas* workpads on any website.
NOTE: For more information on how to configure reporting in {kib}, refer to <<secure-reporting,Configure reporting in {kib}>>

* *Embed code* &mdash; Embed fully interactive dashboards as an iframe on web pages.
Create and download PDF, PNG, or CSV reports of saved searches, dashboards, visualizations, and workpads.

[[reporting-on-cloud-resource-requirements]]
NOTE: For Elastic Cloud deployments, {kib} instances require a minimum of 2GB RAM to generate PDF or PNG reports. To
change {kib} sizing, {ess-console}[edit the deployment].
* *PDF* &mdash; Generate and download PDF files of dashboards, visualizations, and *Canvas* workpads. PDF reports are a link:https://www.elastic.co/subscriptions[subscription feature].

For more information on how to configure reporting in {kib}, refer to <<secure-reporting,Configure reporting in {kib}>>
* *PNG* &mdash; Generate and download PNG files of dashboards and visualizations. PNG reports are a link:https://www.elastic.co/subscriptions[subscription feature].

[float]
[[manually-generate-reports]]
== Create reports
* *CSV Reports* &mdash; Generate CSV reports of saved searches. <<csv-limitations,Certain limitations apply>>.

* *CSV Download* &mdash; Generate and download CSV files of *Lens* visualizations.

* *Download as JSON* &mdash; Generate and download JSON files of *Canvas* workpads.

Create and download PDF, PNG, or CSV reports of saved searches, dashboards, visualizations, and workpads.

[[reporting-layout-sizing]]
The layout and size of the report depends on what you are sharing.
Expand All @@ -55,17 +58,19 @@ image::user/reporting/images/shareable-container.png["Shareable Container"]

. From the toolbar, click *Share*, then select the report option.

* If you are creating dashboard PDFs, select *Optimize for printing* to create printer-friendly PDFs with multiple A4 portrait pages and two visualizations per page.
* If you are creating dashboard PDFs, select *For printing* to create printer-friendly PDFs with multiple A4 portrait pages and two visualizations per page.
+
NOTE: When you create a dashboard report that includes a data table or saved search, the PDF includes only the visible data.

* If you are creating workpad PDFs, select *Full page layout* to create PDFs without margins that surround the workpad.

. Generate the report.
. Generate the report by clicking **Export file**, **Generate CSV**, or **Generate PDF**, depending on the object you want to export.
+
NOTE: You can use the *Copy POST URL* option instead to generate the report from outside Kibana or from Watcher.

. When the report generates, a message appears. On the message, click **Download report**.
. A message appears, indicating that the report is in the export queue.

. To view and manage reports, open the main menu, then click *Stack Management > Reporting*.
You can then download it from that message, or go to the *Stack Management > Reporting* page to view and access all of your reports.

NOTE: In "stateful" deployments, reports are stored in {es} and managed by the `kibana-reporting` {ilm}
({ilm-init}) policy. By default, the policy stores reports forever. To learn more about {ilm-init} policies, refer
Expand All @@ -83,33 +88,6 @@ include::reporting-csv-limitations.asciidoc[]

include::reporting-pdf-limitations.asciidoc[]

[float]
[[share-a-direct-link]]
== Share direct links

Create and share direct links to saved searches, dashboards, and visualizations. To access the shared object, authentication is required.

. Open the main menu, then open the saved search, dashboard, or visualization you want to share.

. From the toolbar, click *Share*, then select *Get links*.

. Specify how you want to generate the link:

* To display only the current state of the object, select *Snapshot*.

* To display up-to-date changes, select *Saved object*.

* To generate a shortened link, select *Short URL*.

* To automatically log in anonymous users when you have multiple authentication providers enabled, select *Public URL*.
+
[role="screenshot"]
image::images/permalink-public-url.png[Permalink share menu with Public URL option highlighted]
+
NOTE: *Public URL* is available only when anonymous access is configured and your anonymous service account has privileges to access what you want to share. For more information, refer to <<anonymous-authentication,Anonymous authentication>>.

. Click *Copy link*.

[float]
[[download-as-json]]
== Create JSON files
Expand All @@ -122,6 +100,18 @@ Create and share JSON files for workpads.

. From the toolbar, click *Share*, then select *Download as JSON*.

[float]
== Embed outside of {kib}

* beta[] *Share on a website* &mdash; Download and securely share *Canvas* workpads on any website.

* *Embed code* &mdash; Embed fully interactive dashboards as an iframe on web pages.

[[reporting-on-cloud-resource-requirements]]
NOTE: For Elastic Cloud deployments, {kib} instances require a minimum of 2GB RAM to generate PDF or PNG reports. To
change {kib} sizing, {ess-console}[edit the deployment].


[float]
[[add-workpad-website]]
== Share workpads on a website
Expand Down Expand Up @@ -154,24 +144,12 @@ For information about granting access to embedded dashboards, refer to <<kibana-

. Click *Share > Embed code*.

. Specify how you want to generate the code:

* To display the current state, select *Snapshot*.

* To display up-to-date changes, select *Saved object*.
. Specify which parts of the dashboard you want to include: Top menu, query, time filter, and filter bar.

* Select the dashboard components you want to share.
. Click *Copy embed code*.

* To generate a shortened link, select *Short URL*.

* To automatically log in anonymous users when you have multiple authentication providers enabled, select *Public URL*.
+
[role="screenshot"]
image::images/embed-code-public-url.png[Embed code share menu with Public URL option highlighted]
+
NOTE: *Public URL* is available only when anonymous access is configured and your anonymous service account has privileges to access what you want to embed. For more information, refer to <<anonymous-authentication,Anonymous authentication>>.

. Click *Copy iFrame code*.

--

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
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 073a4d6

Please sign in to comment.