diff --git a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/suggestion_panel.scss b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/suggestion_panel.scss index 3c455ef2aca42..d7bc2cbee8d90 100644 --- a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/suggestion_panel.scss +++ b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/suggestion_panel.scss @@ -10,25 +10,20 @@ } .lnsSuggestionsPanel__title { - margin: $euiSizeS 0 $euiSizeXS; + margin-left: $euiSizeXS / 2; } .lnsSuggestionsPanel__suggestions { @include euiScrollBar; @include lnsOverflowShadowHorizontal; padding-top: $euiSizeXS; - overflow-x: auto; + overflow-x: scroll; overflow-y: hidden; display: flex; // Padding / negative margins to make room for overflow shadow padding-left: $euiSizeXS; margin-left: -$euiSizeXS; - - // Add margin to the next of the same type - > * + * { - margin-left: $euiSizeS; - } } // These sizes also match canvas' page thumbnails for consistency @@ -39,12 +34,13 @@ $lnsSuggestionWidth: 150px; flex: 0 0 auto; width: $lnsSuggestionWidth !important; height: $lnsSuggestionHeight; - // Allows the scrollbar to stay flush to window - margin-bottom: $euiSize; + margin-right: $euiSizeS; + margin-left: $euiSizeXS / 2; + margin-bottom: $euiSizeXS / 2; } -.lnsSuggestionPanel__button--selected { - background-color: gray; +.lnsSuggestionPanel__button-isSelected { + @include euiFocusRing; } .lnsSidebar__suggestionIcon { @@ -61,3 +57,21 @@ $lnsSuggestionWidth: 150px; height: $lnsSuggestionHeight - $euiSize; pointer-events: none; } + +.lnsSuggestionChartWrapper--withLabel { + height: $lnsSuggestionHeight - $euiSizeL; +} + +.lnsSuggestionPanel__buttonLabel { + @include euiFontSizeXS; + display: block; + font-weight: $euiFontWeightBold; + text-align: center; + flex-grow: 0; +} + +/* TYPES */ +.lnsSuggestionChartWrapper--visMetric { + padding-left: $euiSizeS; + padding-right: $euiSizeS; +} diff --git a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/suggestion_panel.tsx b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/suggestion_panel.tsx index e2ac4ee5895e8..17ef410aca2bb 100644 --- a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/suggestion_panel.tsx +++ b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/suggestion_panel.tsx @@ -7,7 +7,16 @@ import _ from 'lodash'; import React, { useState, useEffect, useMemo } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiIcon, EuiTitle, EuiPanel, EuiIconTip, EuiToolTip, EuiButton } from '@elastic/eui'; +import { + EuiIcon, + EuiTitle, + EuiPanel, + EuiIconTip, + EuiToolTip, + EuiFlexGroup, + EuiFlexItem, + EuiButtonEmpty, +} from '@elastic/eui'; import { toExpression, Ast } from '@kbn/interpreter/common'; import { i18n } from '@kbn/i18n'; import classNames from 'classnames'; @@ -62,7 +71,7 @@ const SuggestionPreview = ({ ) : previewExpression ? ( { // eslint-disable-next-line no-console @@ -93,9 +104,9 @@ const SuggestionPreview = ({ }} /> ) : ( -
+ -
+ )}
@@ -163,20 +174,37 @@ function InnerSuggestionPanel({ return (
- -

- - {stagedPreview && - '(Previewing a suggestion currently, you can go back to your previous state)'} -

-
+ + + +

+ +

+
+
+ {stagedPreview && ( + + { + dispatch({ + type: 'SUBMIT_SUGGESTION', + }); + }} + > + Confirm and reload suggestions + + + )} +
+
- Current visualization +
+ <- Render vis here -> +
+ Current
+ {suggestions.map((suggestion, index) => { return ( ); })} - {stagedPreview && ( - { - dispatch({ - type: 'SUBMIT_SUGGESTION', - }); - }} - > - Show more suggestions - - )}
); diff --git a/x-pack/legacy/plugins/lens/public/metric_visualization_plugin/auto_scale.tsx b/x-pack/legacy/plugins/lens/public/metric_visualization_plugin/auto_scale.tsx index 9ca58c1944803..ef7f7752054ec 100644 --- a/x-pack/legacy/plugins/lens/public/metric_visualization_plugin/auto_scale.tsx +++ b/x-pack/legacy/plugins/lens/public/metric_visualization_plugin/auto_scale.tsx @@ -75,6 +75,7 @@ export class AutoScale extends React.Component { maxWidth: '100%', maxHeight: '100%', overflow: 'hidden', + lineHeight: 1.5, }} >
table.rows.length === 0)) { const icon: IconType = layers.length > 0 ? getIconForSeriesType(layers[0].seriesType) : 'bar'; return ( - - + +

- - - - - - - +

+

+ +

+
); }