From 9940dfa1a2da95bcbd299f6c05e891909c2e0aa3 Mon Sep 17 00:00:00 2001 From: Ashwin P Chandran Date: Wed, 4 Oct 2023 04:18:19 +0000 Subject: [PATCH] Fixes mobile layout Signed-off-by: Ashwin P Chandran --- .../config/global_selectors.json | 3 +- .../config/restricted_properties.json | 4 +-- .../public/components/app_container.scss | 5 +++ .../components/sidebar/discover_field.scss | 16 +++++----- .../components/sidebar/discover_field.tsx | 2 +- .../components/sidebar/discover_sidebar.scss | 5 +++ .../canvas/discover_canvas.scss | 31 +++++++++++++++++++ 7 files changed, 54 insertions(+), 12 deletions(-) diff --git a/packages/osd-stylelint-config/config/global_selectors.json b/packages/osd-stylelint-config/config/global_selectors.json index d89561a04cbc..ef2ec5f9252b 100644 --- a/packages/osd-stylelint-config/config/global_selectors.json +++ b/packages/osd-stylelint-config/config/global_selectors.json @@ -23,7 +23,8 @@ "src/plugins/vis_builder/public/application/components/searchable_dropdown.scss", "src/plugins/vis_builder/public/application/components/side_nav.scss", "packages/osd-ui-framework/src/components/button/button_group/_button_group.scss", - "src/plugins/discover/public/application/components/data_grid/data_grid_table_cell_value.scss" + "src/plugins/discover/public/application/components/data_grid/data_grid_table_cell_value.scss", + "src/plugins/discover/public/application/view_components/canvas/discover_canvas.scss" ] } } \ No newline at end of file diff --git a/packages/osd-stylelint-config/config/restricted_properties.json b/packages/osd-stylelint-config/config/restricted_properties.json index d229764c8d88..5b1262328200 100644 --- a/packages/osd-stylelint-config/config/restricted_properties.json +++ b/packages/osd-stylelint-config/config/restricted_properties.json @@ -2,7 +2,6 @@ "font-family": { "explanation": "All \"font-family\" styles should be inherited from OUI themes and components. Remove the rule.", "approved": [ - "src/plugins/discover_legacy/public/application/_discover.scss", "src/plugins/maps_legacy/public/map/_leaflet_overrides.scss", "src/plugins/maps_legacy/public/map/_legend.scss", "src/plugins/opensearch_dashboards_legacy/public/font_awesome/font_awesome.scss", @@ -12,8 +11,7 @@ "src/plugins/data/public/ui/typeahead/_suggestion.scss", "src/plugins/vis_type_timeseries/public/application/components/_error.scss", "packages/osd-ui-framework/src/components/form/check_box/_check_box.scss", - "src/plugins/discover/public/application/components/doc_viewer/doc_viewer.scss", - "src/plugins/discover_legacy/public/application/components/doc_viewer/doc_viewer.scss" + "src/plugins/discover/public/application/components/doc_viewer/doc_viewer.scss" ] } } \ No newline at end of file diff --git a/src/plugins/data_explorer/public/components/app_container.scss b/src/plugins/data_explorer/public/components/app_container.scss index d289e7d4be3e..d5b6df038208 100644 --- a/src/plugins/data_explorer/public/components/app_container.scss +++ b/src/plugins/data_explorer/public/components/app_container.scss @@ -3,6 +3,11 @@ $osdHeaderOffset: $euiHeaderHeightCompensation; .deSidebar { max-width: 462px; min-width: 400px; + + @include ouiBreakpoint("xs", "s", "m") { + max-width: initial; + width: 100%; + } } .deLayout { diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field.scss b/src/plugins/discover/public/application/components/sidebar/discover_field.scss index 5512136431b4..39cacdcd0c97 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field.scss +++ b/src/plugins/discover/public/application/components/sidebar/discover_field.scss @@ -3,16 +3,18 @@ max-width: 300px; } -.dscSidebarField__actionButton { - opacity: 0; - transition: opacity $ouiAnimSpeedExtraFast; +.dscSidebarField { + &__actionButton { + opacity: 0; + transition: opacity $euiAnimSpeedFast; - &:hover, - &:focus { - opacity: 1; + @include ouiBreakpoint("xs", "s", "m") { + opacity: 1; + } } - @include ouiBreakpoint("xs", "s", "m") { + &:hover &__actionButton, + &:focus &__actionButton { opacity: 1; } } diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field.tsx b/src/plugins/discover/public/application/components/sidebar/discover_field.tsx index a924191c88f1..b7aa9cf7b36e 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field.tsx +++ b/src/plugins/discover/public/application/components/sidebar/discover_field.tsx @@ -195,7 +195,7 @@ export const DiscoverField = ({ } return ( - + .euiFlexItem { + width: 100% !important; + + &:first-child { + order: 1; + } + } + + .osdQueryBar__datePickerWrapper { + max-width: initial; + width: 100%; + + .euiSuperDatePicker__flexWrapper { + width: auto; + } + } + } + } +}