From e2e4e6dfece81fbaa044a74d55ca01aa749587d1 Mon Sep 17 00:00:00 2001 From: Wylie Conlon Date: Wed, 9 Jun 2021 13:20:38 -0400 Subject: [PATCH] Update from design feedback --- .../dimension_panel/dimension_editor.scss | 8 ++++ .../dimension_panel/dimension_editor.tsx | 37 ++++++++-------- .../formula/editor/formula_editor.tsx | 43 +++++++++++-------- 3 files changed, 52 insertions(+), 36 deletions(-) diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.scss b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.scss index 3fb5e3c39498a..1b470fdd89a09 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.scss +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.scss @@ -2,6 +2,14 @@ height: 100%; } +.lnsIndexPatternDimensionEditor__header { + position: sticky; + top: 0; + background: $euiColorEmptyShade; + // Raise it above the elements that are after it in DOM order + z-index: $euiZLevel1; +} + .lnsIndexPatternDimensionEditor-isFullscreen { position: absolute; left: 0; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx index 198b285bc2ea8..821129b84543a 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx @@ -344,25 +344,24 @@ export function DimensionEditor(props: DimensionEditorProps) { const quickFunctions = ( <> -
- {temporaryQuickFunction && selectedColumn?.operationType === 'formula' && ( - <> - + +

+ {i18n.translate('xpack.lens.indexPattern.formulaWarningText', { + defaultMessage: 'Picking a quick function will erase your formula.', })} - color="warning" - > -

- {i18n.translate('xpack.lens.indexPattern.formulaWarningText', { - defaultMessage: 'Picking a quick function will erase your formula.', - })} -

-
- - - )} +

+
+ + )} +
{i18n.translate('xpack.lens.indexPattern.functionsLabel', { defaultMessage: 'Select a function', @@ -636,7 +635,7 @@ export function DimensionEditor(props: DimensionEditorProps) { return (
{!isFullscreen && operationSupportMatrix.operationWithoutField.has('formula') ? ( - + setIsHelpOpen(false)} ownFocus={false} button={ - setIsHelpOpen(!isHelpOpen)} iconType="help" color="text" size="s" + aria-label={i18n.translate( + 'xpack.lens.formula.editorHelpInlineShowToolTip', + { + defaultMessage: 'Show function reference', + } + )} /> } > @@ -726,36 +732,39 @@ export function FormulaEditor({ { setIsWarningOpen(!isWarningOpen); }} > - {errorCount ? ( - - {' '} - {i18n.translate('xpack.lens.formulaErrorCount', { + {errorCount + ? i18n.translate('xpack.lens.formulaErrorCount', { defaultMessage: '{count} {count, plural, one {error} other {errors}}', values: { count: errorCount }, - })} - - ) : null} - {warningCount ? ( - - {' '} - {i18n.translate('xpack.lens.formulaWarningCount', { + }) + : null} + {warningCount + ? i18n.translate('xpack.lens.formulaWarningCount', { defaultMessage: '{count} {count, plural, one {warning} other {warnings}}', values: { count: warningCount }, - })} - - ) : null} + }) + : null} } > - {warnings.map(({ message }, index) => ( + {warnings.map(({ message, severity }, index) => (
- {message} + + {message} +
))}