diff --git a/src/plugins/controls/public/control_group/control_group.scss b/src/plugins/controls/public/control_group/control_group.scss index e797f3b421297..d22b51b9793eb 100644 --- a/src/plugins/controls/public/control_group/control_group.scss +++ b/src/plugins/controls/public/control_group/control_group.scss @@ -213,3 +213,12 @@ $controlMinWidth: $euiSize * 14; } } } + +.observability-slo { + .controlsWrapper { + min-height: $euiSize * 4; + } + .controlsFrame__draggable { + height: $euiButtonHeight; + } +} \ No newline at end of file diff --git a/src/plugins/controls/public/control_group/external_api/control_group_renderer.tsx b/src/plugins/controls/public/control_group/external_api/control_group_renderer.tsx index 1a5e01ff9ab07..5bde276a9f095 100644 --- a/src/plugins/controls/public/control_group/external_api/control_group_renderer.tsx +++ b/src/plugins/controls/public/control_group/external_api/control_group_renderer.tsx @@ -40,6 +40,7 @@ export interface ControlGroupRendererProps { timeRange?: TimeRange; query?: Query; dataLoading?: boolean; + className?: string; } export const ControlGroupRenderer = ({ @@ -50,6 +51,7 @@ export const ControlGroupRenderer = ({ query, viewMode, dataLoading, + className, }: ControlGroupRendererProps) => { const id = useMemo(() => uuidv4(), []); const [regenerateId, setRegenerateId] = useState(uuidv4()); @@ -187,6 +189,7 @@ export const ControlGroupRenderer = ({ }} hidePanelChrome panelProps={{ hideLoader: true }} + className={className} /> ); }; diff --git a/src/plugins/controls/public/options_list/components/options_list.scss b/src/plugins/controls/public/options_list/components/options_list.scss index f7175b74c792e..38e840859b044 100644 --- a/src/plugins/controls/public/options_list/components/options_list.scss +++ b/src/plugins/controls/public/options_list/components/options_list.scss @@ -98,3 +98,9 @@ padding: $euiSizeM; } } + +.observability-slo { + .optionsList--filterBtn { + height: $euiButtonHeight; + } +} \ No newline at end of file diff --git a/src/plugins/controls/public/react_controls/control_group/components/control_group.tsx b/src/plugins/controls/public/react_controls/control_group/components/control_group.tsx index f6259ddc95149..5fb9250997053 100644 --- a/src/plugins/controls/public/react_controls/control_group/components/control_group.tsx +++ b/src/plugins/controls/public/react_controls/control_group/components/control_group.tsx @@ -46,6 +46,7 @@ interface Props { }; hasUnappliedSelections: boolean; labelPosition: ControlStyle; + className?: string; } export function ControlGroup({ @@ -54,6 +55,7 @@ export function ControlGroup({ controlsManager, labelPosition, hasUnappliedSelections, + className, }: Props) { const [isInitialized, setIsInitialized] = useState(false); const [autoApplySelections, controlsInOrder] = useBatchedPublishingSubjects( @@ -154,6 +156,7 @@ export function ControlGroup({ controlsManager.setControlApi(id, controlApi); }} isControlGroupInitialized={isInitialized} + className={className} /> ))} diff --git a/src/plugins/controls/public/react_controls/control_group/components/control_panel.scss b/src/plugins/controls/public/react_controls/control_group/components/control_panel.scss index 6c25854aa97cc..ac62f55aa4647 100644 --- a/src/plugins/controls/public/react_controls/control_group/components/control_panel.scss +++ b/src/plugins/controls/public/react_controls/control_group/components/control_panel.scss @@ -68,4 +68,18 @@ .euiFormControlLayout__prepend { padding-inline-start: $euiSizeXS * .5; // skinny icon } +} + +.observability-slo { + .controlPanel { + height: $euiButtonHeight; + + &--labelWrapper { + height: 100%; + } + + .controlPanel--label { + height: 100%; + } + } } \ No newline at end of file diff --git a/src/plugins/controls/public/react_controls/control_group/components/control_panel.tsx b/src/plugins/controls/public/react_controls/control_group/components/control_panel.tsx index cbb7bf09fdab7..538895c785cc3 100644 --- a/src/plugins/controls/public/react_controls/control_group/components/control_panel.tsx +++ b/src/plugins/controls/public/react_controls/control_group/components/control_panel.tsx @@ -61,6 +61,7 @@ const DragHandle = ({ export const ControlPanel = ({ Component, uuid, + className, }: ControlPanelProps) => { const [api, setApi] = useState(null); const { @@ -157,12 +158,12 @@ export const ControlPanel = ControlGroupApi; onApiAvailable?: (api: ApiType) => void; isControlGroupInitialized: boolean; + className?: string; }) => { const cleanupFunction = useRef<(() => void) | null>(null); @@ -138,7 +140,7 @@ export const ControlRenderer = < return component && isControlGroupInitialized ? ( // @ts-expect-error - Component={component} uuid={uuid} /> + Component={component} uuid={uuid} className={className} /> ) : // Control group will not display controls until all controls are initialized null; }; diff --git a/src/plugins/controls/public/react_controls/control_group/get_control_group_factory.tsx b/src/plugins/controls/public/react_controls/control_group/get_control_group_factory.tsx index bc3fde2ebe829..0c187dbbcc3a6 100644 --- a/src/plugins/controls/public/react_controls/control_group/get_control_group_factory.tsx +++ b/src/plugins/controls/public/react_controls/control_group/get_control_group_factory.tsx @@ -76,7 +76,7 @@ export const getControlGroupEmbeddableFactory = (services: { autoApplySelections, ignoreParentSettings, } = initialRuntimeState; - + const isObservabilitySLO = await services.core.application.capabilities.apm; const autoApplySelections$ = new BehaviorSubject(autoApplySelections); const defaultDataViewId = await services.dataViews.getDefaultId(); const lastSavedControlsState$ = new BehaviorSubject( @@ -298,6 +298,7 @@ export const getControlGroupEmbeddableFactory = (services: { controlsManager={controlsManager} hasUnappliedSelections={hasUnappliedSelections} labelPosition={labelPosition} + className={isObservabilitySLO ? 'observability-slo' : undefined} /> ); }, diff --git a/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list.scss b/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list.scss index 029edd5a8a363..b6f572a30f460 100644 --- a/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list.scss +++ b/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list.scss @@ -88,3 +88,9 @@ padding: $euiSizeM; } } + +.observability-slo { + .optionsList--filterBtn { + height: $euiButtonHeight; + } +} diff --git a/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list_control.tsx b/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list_control.tsx index b82258cb510c4..2a1a85f8481ad 100644 --- a/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list_control.tsx +++ b/src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list_control.tsx @@ -35,8 +35,10 @@ import './options_list.scss'; export const OptionsListControl = ({ controlPanelClassName, + className, }: { controlPanelClassName: string; + className?: string; }) => { const popoverId = useMemo(() => htmlIdGenerator()(), []); const { api, stateManager, displaySettings } = useOptionsListContext(); @@ -174,7 +176,11 @@ export const OptionsListControl = ({ ); return ( - + - + ); }, diff --git a/src/plugins/controls/public/react_controls/controls/data_controls/range_slider/components/range_slider_control.tsx b/src/plugins/controls/public/react_controls/controls/data_controls/range_slider/components/range_slider_control.tsx index 16c7ad967e8df..b958c050b2a0a 100644 --- a/src/plugins/controls/public/react_controls/controls/data_controls/range_slider/components/range_slider_control.tsx +++ b/src/plugins/controls/public/react_controls/controls/data_controls/range_slider/components/range_slider_control.tsx @@ -33,6 +33,7 @@ interface Props { value: RangeValue | undefined; uuid: string; controlPanelClassName?: string; + className?: string; } export const RangeSliderControl: FC = ({ @@ -46,6 +47,7 @@ export const RangeSliderControl: FC = ({ value, uuid, controlPanelClassName, + className, }: Props) => { const rangeSliderRef = useRef(null); @@ -194,7 +196,7 @@ export const RangeSliderControl: FC = ({ min={displayedMin} max={displayedMax} isLoading={isLoading} - compressed + compressed={className === 'observability-slo' ? false : true} inputPopoverProps={{ className: controlPanelClassName, panelMinWidth: MIN_POPOVER_WIDTH, diff --git a/src/plugins/controls/public/react_controls/controls/timeslider_control/components/time_slider_anchored_range.tsx b/src/plugins/controls/public/react_controls/controls/timeslider_control/components/time_slider_anchored_range.tsx index 0ab4a467e8694..01d3b3dd9d0f3 100644 --- a/src/plugins/controls/public/react_controls/controls/timeslider_control/components/time_slider_anchored_range.tsx +++ b/src/plugins/controls/public/react_controls/controls/timeslider_control/components/time_slider_anchored_range.tsx @@ -19,6 +19,7 @@ interface Props { ticks: EuiRangeTick[]; timeRangeMin: number; timeRangeMax: number; + className?: string; } export function TimeSliderAnchoredRange(props: Props) { @@ -40,7 +41,7 @@ export function TimeSliderAnchoredRange(props: Props) { max={props.timeRangeMax} step={props.stepSize} ticks={props.ticks} - compressed + compressed={props.className !== 'observability-slo' ? false : true} /> ); } diff --git a/src/plugins/controls/public/react_controls/controls/timeslider_control/components/time_slider_sliding_window_range.tsx b/src/plugins/controls/public/react_controls/controls/timeslider_control/components/time_slider_sliding_window_range.tsx index aa699a3082ebd..103199814bd8b 100644 --- a/src/plugins/controls/public/react_controls/controls/timeslider_control/components/time_slider_sliding_window_range.tsx +++ b/src/plugins/controls/public/react_controls/controls/timeslider_control/components/time_slider_sliding_window_range.tsx @@ -18,6 +18,7 @@ interface Props { ticks: EuiRangeTick[]; timeRangeMin: number; timeRangeMax: number; + className?: string; } export function TimeSliderSlidingWindowRange(props: Props) { @@ -36,7 +37,7 @@ export function TimeSliderSlidingWindowRange(props: Props) { step={props.stepSize} ticks={props.ticks} isDraggable - compressed + compressed={props.className !== 'observability-slo' ? true : false} /> ); } diff --git a/src/plugins/controls/public/react_controls/controls/types.ts b/src/plugins/controls/public/react_controls/controls/types.ts index e45f0c0be7d98..d55f629703715 100644 --- a/src/plugins/controls/public/react_controls/controls/types.ts +++ b/src/plugins/controls/public/react_controls/controls/types.ts @@ -96,4 +96,5 @@ export interface ControlPanelProps< > { uuid: string; Component: PanelCompatibleComponent; + className?: string; } diff --git a/src/plugins/dashboard/public/dashboard_container/component/viewport/_dashboard_viewport.scss b/src/plugins/dashboard/public/dashboard_container/component/viewport/_dashboard_viewport.scss index f0c51724b551b..8f0639d30d493 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/viewport/_dashboard_viewport.scss +++ b/src/plugins/dashboard/public/dashboard_container/component/viewport/_dashboard_viewport.scss @@ -23,3 +23,9 @@ .dashboardViewport--screenshotMode .controlsWrapper--empty { display:none } + +.observability-slo { + .dshDashboardViewport-controls { + padding-bottom: $euiSizeXS; + } +} \ No newline at end of file diff --git a/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_renderer.tsx b/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_renderer.tsx index 054949650c343..9e4e42a132e6b 100644 --- a/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_renderer.tsx +++ b/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_renderer.tsx @@ -76,6 +76,7 @@ export const ReactEmbeddableRenderer = < * as it changes. This is **not** expected to change over the lifetime of the component. */ onAnyStateChange?: (state: SerializedPanelState) => void; + className?: string; }) => { const cleanupFunction = useRef<(() => void) | null>(null); const firstLoadCompleteTime = useRef(null); diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/burn_rate/alert_details/components/custom_panels/apm/embeddable_root.tsx b/x-pack/plugins/observability_solution/slo/public/components/slo/burn_rate/alert_details/components/custom_panels/apm/embeddable_root.tsx index c7f95d788e676..67c987fd882f4 100644 --- a/x-pack/plugins/observability_solution/slo/public/components/slo/burn_rate/alert_details/components/custom_panels/apm/embeddable_root.tsx +++ b/x-pack/plugins/observability_solution/slo/public/components/slo/burn_rate/alert_details/components/custom_panels/apm/embeddable_root.tsx @@ -84,6 +84,7 @@ export function APMEmbeddableRoot({ type={embeddableId} getParentApi={() => ({ getSerializedStateForChild: () => ({ rawState: input }) })} hidePanelChrome={true} + className="observability-slo" /> ); } diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/quick_filters.tsx b/x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/quick_filters.tsx index 82781a53612f3..a31dd32d6c816 100644 --- a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/quick_filters.tsx +++ b/x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/quick_filters.tsx @@ -55,6 +55,7 @@ export function QuickFilters({ return ( { builder.addOptionsListControl(