diff --git a/x-pack/plugins/lens/public/app_plugin/app.scss b/x-pack/plugins/lens/public/app_plugin/app.scss index b2b63015deef3..00245384ec8b4 100644 --- a/x-pack/plugins/lens/public/app_plugin/app.scss +++ b/x-pack/plugins/lens/public/app_plugin/app.scss @@ -5,19 +5,15 @@ } .lnsApp { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; + flex: 1 1 auto; display: flex; flex-direction: column; height: 100%; overflow: hidden; -} -.lnsApp__header { - border-bottom: $euiBorderThin; + > .kbnTopNavMenu__wrapper { + border-bottom: $euiBorderThin; + } } .lnsApp__frame { diff --git a/x-pack/plugins/lens/public/app_plugin/app.tsx b/x-pack/plugins/lens/public/app_plugin/app.tsx index f137047cfc871..077456423ac4d 100644 --- a/x-pack/plugins/lens/public/app_plugin/app.tsx +++ b/x-pack/plugins/lens/public/app_plugin/app.tsx @@ -648,68 +648,66 @@ export function App({ return ( <>
-
- { - const { dateRange, query } = payload; - const currentRange = data.query.timefilter.timefilter.getTime(); - if (dateRange.from !== currentRange.from || dateRange.to !== currentRange.to) { - data.query.timefilter.timefilter.setTime(dateRange); - trackUiEvent('app_date_change'); - } else { - // Query has changed, renew the session id. - // Time change will be picked up by the time subscription - setState((s) => ({ - ...s, - searchSessionId: startSession(), - })); - trackUiEvent('app_query_change'); - } - setState((s) => ({ - ...s, - query: query || s.query, - })); - }} - onSaved={(savedQuery) => { - setState((s) => ({ ...s, savedQuery })); - }} - onSavedQueryUpdated={(savedQuery) => { - const savedQueryFilters = savedQuery.attributes.filters || []; - const globalFilters = data.query.filterManager.getGlobalFilters(); - data.query.filterManager.setFilters([...globalFilters, ...savedQueryFilters]); - setState((s) => ({ - ...s, - savedQuery: { ...savedQuery }, // Shallow query for reference issues - query: savedQuery.attributes.query, - })); - }} - onClearSavedQuery={() => { - data.query.filterManager.setFilters(data.query.filterManager.getGlobalFilters()); + { + const { dateRange, query } = payload; + const currentRange = data.query.timefilter.timefilter.getTime(); + if (dateRange.from !== currentRange.from || dateRange.to !== currentRange.to) { + data.query.timefilter.timefilter.setTime(dateRange); + trackUiEvent('app_date_change'); + } else { + // Query has changed, renew the session id. + // Time change will be picked up by the time subscription setState((s) => ({ ...s, - savedQuery: undefined, - filters: data.query.filterManager.getGlobalFilters(), - query: data.query.queryString.getDefaultQuery(), + searchSessionId: startSession(), })); - }} - query={state.query} - dateRangeFrom={fromDate} - dateRangeTo={toDate} - indicateNoData={state.indicateNoData} - /> -
+ trackUiEvent('app_query_change'); + } + setState((s) => ({ + ...s, + query: query || s.query, + })); + }} + onSaved={(savedQuery) => { + setState((s) => ({ ...s, savedQuery })); + }} + onSavedQueryUpdated={(savedQuery) => { + const savedQueryFilters = savedQuery.attributes.filters || []; + const globalFilters = data.query.filterManager.getGlobalFilters(); + data.query.filterManager.setFilters([...globalFilters, ...savedQueryFilters]); + setState((s) => ({ + ...s, + savedQuery: { ...savedQuery }, // Shallow query for reference issues + query: savedQuery.attributes.query, + })); + }} + onClearSavedQuery={() => { + data.query.filterManager.setFilters(data.query.filterManager.getGlobalFilters()); + setState((s) => ({ + ...s, + savedQuery: undefined, + filters: data.query.filterManager.getGlobalFilters(), + query: data.query.queryString.getDefaultQuery(), + })); + }} + query={state.query} + dateRangeFrom={fromDate} + dateRangeTo={toDate} + indicateNoData={state.indicateNoData} + /> {(!state.isLoading || state.persistedDoc) && ( + {indicatorIcon} {children} diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.scss b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.scss index 5947d62540a0d..91cd706ea77d1 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.scss +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.scss @@ -6,11 +6,15 @@ @include euiFlyout; // But with custom positioning to keep it within the sidebar contents position: absolute; - right: 0; left: 0; - top: 0; - bottom: 0; animation: euiFlyout $euiAnimSpeedNormal $euiAnimSlightResistance; + @include euiBreakpoint('l', 'xl') { + top: 0 !important; + height: 100% !important; + } + @include euiBreakpoint('xs', 's', 'm') { + @include euiFlyout; + } } .lnsDimensionContainer__footer { @@ -49,3 +53,7 @@ background-color: transparent; } } + +.lnsBody--overflowHidden { + overflow: hidden; +} \ No newline at end of file diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.tsx index f66e8ba87e8e8..b8d3170b3e165 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.tsx @@ -61,6 +61,17 @@ export function DimensionContainer({ [closeFlyout] ); + useEffect(() => { + if (isOpen) { + document.body.classList.add('lnsBody--overflowHidden'); + } else { + document.body.classList.remove('lnsBody--overflowHidden'); + } + return () => { + document.body.classList.remove('lnsBody--overflowHidden'); + }; + }); + return isOpen ? ( @@ -68,7 +79,7 @@ export function DimensionContainer({
* { + flex-basis: 100%; + } + > .lnsFrameLayout__sidebar { + min-height: $euiSizeL * 15; + } + } +} + +.visEditor { + @include flexParent(); + + height: 100%; + + @include euiBreakpoint('xs', 's', 'm') { + .visualization { + // While we are on a small screen the visualization is below the + // editor. In this cases it needs a minimum height, since it would otherwise + // maybe end up with 0 height since it just gets the flexbox rest of the screen. + min-height: $euiSizeL * 15; + } + } + + /* 1. Without setting this to 0 you will run into a bug where the filter bar modal is hidden under +a tilemap in an iframe: https://github.com/elastic/kibana/issues/16457 */ + > .visualize { + height: 100%; + flex: 1 1 auto; + display: flex; + z-index: 0; /* 1 */ + } } .lnsFrameLayout__pageBody { @@ -51,6 +88,10 @@ max-width: $euiFormMaxWidth + $euiSizeXXL; max-height: 100%; + @include euiBreakpoint('xs', 's', 'm') { + max-width: 100%; + } + .lnsConfigPanel { @include euiScrollBar; padding: $euiSize $euiSizeXS $euiSize $euiSize; @@ -58,5 +99,10 @@ overflow-y: scroll; padding-left: $euiFormMaxWidth + $euiSize; margin-left: -$euiFormMaxWidth; + + @include euiBreakpoint('xs', 's', 'm') { + padding-left: $euiSize; + margin-left: 0; + } } } diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/change_indexpattern.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/change_indexpattern.tsx index 2ee4fe24a06fc..0a41e7e65212a 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/change_indexpattern.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/change_indexpattern.tsx @@ -59,7 +59,7 @@ export function ChangeIndexPattern({ return ( <> setPopoverIsOpen(false)} @@ -67,7 +67,7 @@ export function ChangeIndexPattern({ panelPaddingSize="s" ownFocus > -
+
{i18n.translate('xpack.lens.indexPattern.changeIndexPatternTitle', { defaultMessage: 'Change index pattern', diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.scss b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.scss index bfb1106f5080e..d3320714a65cd 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.scss +++ b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.scss @@ -42,3 +42,7 @@ margin-right: $euiSizeS; } } + +.lnsChangeIndexPatternPopover { + width: 320px; +} \ No newline at end of file diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx index 9fd389d4e65d3..4839d9388253b 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx @@ -604,6 +604,7 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({ gutterSize="s" alignItems="center" className="lnsInnerIndexPatternDataPanel__header" + responsive={false} > - + {formatted === '' ? ( @@ -702,7 +707,7 @@ function FieldItemPopoverContents(props: State & FieldItemProps) { })} {otherCount ? ( <> - + {i18n.translate('xpack.lens.indexPattern.otherDocsLabel', { diff --git a/x-pack/plugins/lens/public/pie_visualization/toolbar.tsx b/x-pack/plugins/lens/public/pie_visualization/toolbar.tsx index e3bd54032a93c..aa48986832056 100644 --- a/x-pack/plugins/lens/public/pie_visualization/toolbar.tsx +++ b/x-pack/plugins/lens/public/pie_visualization/toolbar.tsx @@ -125,7 +125,7 @@ export function PieToolbar(props: VisualizationToolbarProps + +