diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/formula.scss b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/formula.scss index 8e886f22a2558e..0a3e78351e9ee7 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/formula.scss +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/formula.scss @@ -108,19 +108,23 @@ } .lnsFormula__docsSidebar { - height: 100%; + background: $euiColorLightestShade; +} + +.lnsFormula__docsSidebarInner { + min-height: 0; + + & > * + * { + border-top: $euiBorderThin; + } } .lnsFormula__docsSearch { - border: none; - border-bottom: $euiBorderThin; - box-shadow: none; - border-radius: 0; + padding: $euiSizeS; } .lnsFormula__docsNav { @include euiYScroll; - background: $euiColorLightestShade; } .lnsFormula__docsNavGroup { diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/formula_help.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/formula_help.tsx index 0ee81e7f381614..cfcd6b24f3f3da 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/formula_help.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/editor/formula_help.tsx @@ -15,12 +15,12 @@ import { EuiText, EuiListGroupItem, EuiListGroup, - EuiMarkdownFormat, EuiTitle, EuiButtonIcon, EuiFieldSearch, EuiHighlight, } from '@elastic/eui'; +import { Markdown } from '../../../../../../../../../src/plugins/kibana_react/public'; import { IndexPattern } from '../../../../types'; import { tinymathFunctions } from '../util'; import { getPossibleFunctions } from './math_completion'; @@ -56,7 +56,7 @@ function FormulaHelp({ const helpGroups: Array<{ label: string; - description?: JSX.Element; + description?: string; items: Array<{ label: string; description?: JSX.Element }>; }> = []; @@ -71,14 +71,10 @@ function FormulaHelp({ label: i18n.translate('xpack.lens.formulaDocumentation.elasticsearchSection', { defaultMessage: 'Elasticsearch', }), - description: ( - - {i18n.translate('xpack.lens.formulaDocumentation.elasticsearchSectionDescription', { - defaultMessage: - 'These functions will be executed on the raw documents for each row of the resulting table, aggregating all documents matching the break down dimensions into a single value.', - })} - - ), + description: i18n.translate('xpack.lens.formulaDocumentation.elasticsearchSectionDescription', { + defaultMessage: + 'These functions will be executed on the raw documents for each row of the resulting table, aggregating all documents matching the break down dimensions into a single value.', + }), items: [], }); @@ -97,15 +93,12 @@ function FormulaHelp({ label: key, description: ( <> - -

- {key}({operationDefinitionMap[key].documentation?.signature}) -

-
+

+ {key}({operationDefinitionMap[key].documentation?.signature}) +

+ {operationDefinitionMap[key].documentation?.description ? ( - - {operationDefinitionMap[key].documentation!.description} - + ) : null} ), @@ -116,13 +109,12 @@ function FormulaHelp({ label: i18n.translate('xpack.lens.formulaDocumentation.columnCalculationSection', { defaultMessage: 'Column-wise calculation', }), - description: ( - - {i18n.translate('xpack.lens.formulaDocumentation.columnCalculationSectionDescription', { - defaultMessage: - 'These functions will be executed for reach row of the resulting table, using data from cells from other rows as well as the current value.', - })} - + description: i18n.translate( + 'xpack.lens.formulaDocumentation.columnCalculationSectionDescription', + { + defaultMessage: + 'These functions will be executed for reach row of the resulting table, using data from cells from other rows as well as the current value.', + } ), items: [], }); @@ -140,15 +132,12 @@ function FormulaHelp({ label: key, description: ( <> - -

- {key}({operationDefinitionMap[key].documentation?.signature}) -

-
+

+ {key}({operationDefinitionMap[key].documentation?.signature}) +

+ {operationDefinitionMap[key].documentation?.description ? ( - - {operationDefinitionMap[key].documentation!.description} - + ) : null} ), @@ -163,14 +152,10 @@ function FormulaHelp({ label: i18n.translate('xpack.lens.formulaDocumentation.mathSection', { defaultMessage: 'Math', }), - description: ( - - {i18n.translate('xpack.lens.formulaDocumentation.mathSectionDescription', { - defaultMessage: - 'These functions will be executed for reach row of the resulting table using single values from the same row calculated using other functions.', - })} - - ), + description: i18n.translate('xpack.lens.formulaDocumentation.mathSectionDescription', { + defaultMessage: + 'These functions will be executed for reach row of the resulting table using single values from the same row calculated using other functions.', + }), items: [], }); @@ -194,10 +179,9 @@ function FormulaHelp({ label, description: ( <> - -

{getFunctionSignatureLabel(label, operationDefinitionMap)}

-
- {`${description}${examples}`} +

{getFunctionSignatureLabel(label, operationDefinitionMap)}

+ + ), }; @@ -238,16 +222,14 @@ function FormulaHelp({ responsive={false} alignItems="stretch" > - + - + { setSearchText(e.target.value); @@ -257,7 +239,8 @@ function FormulaHelp({ })} /> - + + {helpGroups.map((helpGroup, index) => { return (