Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Controls] Migrate range slider to EuiDualRange and make styling consistent across all controls #162651

Merged
merged 53 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
e817a1b
Partial migration to `EuiDualRange`
Heenawter Jul 27, 2023
d4385c5
Clean up
Heenawter Jul 27, 2023
ff98c92
Switch to single component and clean up
Heenawter Jul 27, 2023
4c1ff4e
Starting migration for options list
Heenawter Jul 27, 2023
0b260db
Move "Allow expensive queries" warning and remove title
Heenawter Jul 27, 2023
80207fb
Change styling of time slider
Heenawter Jul 28, 2023
eefaa7a
Add missing `data-test-subj`s + fix linting
Heenawter Jul 28, 2023
f14743e
Remove the unused translations
Heenawter Jul 28, 2023
1c3450e
Fix test
Heenawter Jul 31, 2023
2e888b1
Move `sort` to another row for small popover
Heenawter Jul 31, 2023
8c26f97
Fix linting
Heenawter Jul 31, 2023
a1c2ded
Re-add width test
Heenawter Jul 31, 2023
038a2bb
Fix react errors + styling of range slider placeholder
Heenawter Aug 1, 2023
4510813
Fix range slider functional tests
Heenawter Aug 1, 2023
cb24d5e
Clean up range slider min max logic
Heenawter Aug 1, 2023
31d34d5
Adding levels + adjust min/max as necessary based on selections
Heenawter Aug 2, 2023
be446d2
Clean up
Heenawter Aug 3, 2023
3a38b5a
Fix colouring of sort button
Heenawter Aug 3, 2023
492428c
Fix functional tests
Heenawter Aug 3, 2023
f8c41b7
Fix width of label on small options list
Heenawter Aug 3, 2023
dabba55
Fix label tooltip v2
Heenawter Aug 3, 2023
cf543ff
Fix race condition on min/max update
Heenawter Aug 4, 2023
ca31cf8
Merge branch 'main' into switch-to-dual-range_2023-05-15
Heenawter Aug 4, 2023
48455eb
Merge branch 'main' into switch-to-dual-range_2023-05-15
Heenawter Aug 4, 2023
67e3d38
Add `.only` - not sure if it will work
Heenawter Aug 4, 2023
99d2fef
Switch back to regular popover?
Heenawter Aug 4, 2023
c19bb61
Test options list control
Heenawter Aug 4, 2023
d68d2fa
Undo switch to regular popover
Heenawter Aug 4, 2023
9e1b264
Remove `.only`
Heenawter Aug 4, 2023
8204667
Merge branch 'main' into switch-to-dual-range_2023-05-15
Heenawter Aug 4, 2023
5e9e8f4
Merge branch 'main' into switch-to-dual-range_2023-05-15
Heenawter Aug 7, 2023
d44f272
fix: security solution controls layout
logeekal Aug 7, 2023
3ae4375
fix: better tests
logeekal Aug 8, 2023
2dca722
Merge branch 'main' into switch-to-dual-range_2023-05-15
logeekal Aug 8, 2023
c11f5f5
refactor: remove focused test
logeekal Aug 8, 2023
2c66ef6
Merge branch 'main' into switch-to-dual-range_2023-05-15
Heenawter Aug 9, 2023
b31a2fe
Fix badge colour
Heenawter Aug 9, 2023
bbe76f4
Move back to regular `EuiPopover` for options list + fix time slider …
Heenawter Aug 11, 2023
99045b6
Revert changes to options list popover width test
Heenawter Aug 11, 2023
98de50a
Merge branch 'main' into switch-to-dual-range_2023-05-15
Heenawter Aug 11, 2023
46ff7ea
Merge branch 'main' into switch-to-dual-range_2023-05-15
Heenawter Aug 14, 2023
a6ed8ef
Remove commented out `attachToAnchor`
Heenawter Aug 14, 2023
d3eeaad
Merge branch 'switch-to-dual-range_2023-05-15' of github.com:heenawte…
Heenawter Aug 14, 2023
955d0b8
Merge branch 'main' into switch-to-dual-range_2023-05-15
Heenawter Aug 14, 2023
01d73f9
Merge branch 'main' into switch-to-dual-range_2023-05-15
Heenawter Aug 14, 2023
89d3f11
Merge branch 'main' into switch-to-dual-range_2023-05-15
Heenawter Aug 14, 2023
9fd557d
Merge branch 'main' into switch-to-dual-range_2023-05-15
kibanamachine Aug 14, 2023
c34b736
Merge branch 'main' into switch-to-dual-range_2023-05-15
logeekal Aug 15, 2023
a45f725
fix: disable flaky test
logeekal Aug 15, 2023
e3cbbdc
Merge branch 'main' of github.com:elastic/kibana into switch-to-dual-…
Heenawter Aug 15, 2023
c742433
Merge branch 'main' into switch-to-dual-range_2023-05-15
Heenawter Aug 15, 2023
39a43e5
Merge branch 'main' into switch-to-dual-range_2023-05-15
logeekal Aug 16, 2023
f50cc5c
Merge branch 'main' into switch-to-dual-range_2023-05-15
Heenawter Aug 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const SortableControlInner = forwardRef<
data-test-subj={`control-frame`}
data-render-complete="true"
className={classNames('controlFrameWrapper', {
'controlFrameWrapper--grow': grow,
'controlFrameWrapper-isDragging': isDragging,
'controlFrameWrapper-isEditable': isEditable,
'controlFrameWrapper--small': width === 'small',
Expand Down
27 changes: 13 additions & 14 deletions src/plugins/controls/public/control_group/control_group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,17 @@ $controlMinWidth: $euiSize * 14;
}
}

.controlFrame__labelToolTip {
max-width: 40%;
}

.controlFrameWrapper {
flex-basis: auto;
position: relative;

&.controlFrameWrapper-isEditable {
.controlFrame__formControlLayoutLabel {
padding-left: 0;
}
.controlFrame__labelToolTip {
max-width: 40%;
}

&:not(.controlFrameWrapper-isEditable) {
.controlFrameFormControlLayout--twoLine .euiFormControlLayout__childrenWrapper {
border-radius: $euiBorderRadius 0 0 $euiBorderRadius;
&-isEditable {
.controlFrame__formControlLayoutLabel {
padding-left: 0;
}
}

Expand All @@ -113,10 +107,9 @@ $controlMinWidth: $euiSize * 14;
.controlFrame__control {
height: 100%;
transition: opacity .1s;
background-color: $euiFormBackgroundColor !important;

&.controlFrame--twoLine {
width: 100%;
}
@include euiFormControlSideBorderRadius($euiFormControlBorderRadius, $side: 'right', $internal: true);
}

.controlFrame--controlLoading {
Expand All @@ -130,6 +123,12 @@ $controlMinWidth: $euiSize * 14;
&--small {
width: $smallControl;
min-width: $smallControl;

&:not(.controlFrameWrapper--grow) {
.controlFrame__labelToolTip {
max-width: 20%;
}
}
Heenawter marked this conversation as resolved.
Show resolved Hide resolved
}

&--medium {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,117 +1,101 @@
.optionsList__anchorOverride {
display:block;
}

.optionsList__popoverOverride {
.optionsList--filterGroup {
width: 100%;
height: 100%;
}
height: $euiSizeXXL;
background-color: transparent;

.optionsList__actions {
padding: $euiSizeS;
padding-bottom: 0;
border-bottom: $euiBorderThin;
border-color: darken($euiColorLightestShade, 2%);
box-shadow: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-top-right-radius: $euiBorderRadius - 1px;
border-bottom-right-radius: $euiBorderRadius - 1px;

.optionsList__actionsRow {
margin: ($euiSizeS / 2) 0 !important;
.optionsList--filterBtn {
border-radius: 0 !important;
height: $euiButtonHeight;

.optionsList__actionBarDivider {
height: $euiSize;
border-right: $euiBorderThin;
&.optionsList--filterBtnPlaceholder {
color: $euiTextSubduedColor;
font-weight: $euiFontWeightRegular;
}
}
}

.optionsList__popoverTitle {
display: flex;
align-items: center;
justify-content: space-between;
}
.optionsList__filterInvalid {
color: $euiTextSubduedColor;
text-decoration: line-through;
margin-left: $euiSizeS;
font-weight: $euiFontWeightRegular;
}

.optionsList__filterInvalid {
color: $euiTextSubduedColor;
text-decoration: line-through;
margin-left: $euiSizeS;
font-weight: $euiFontWeightRegular;
}
.optionsList__negateLabel {
font-weight: bold;
font-size: $euiSizeM;
color: $euiColorDanger;
}

.optionsList__existsFilter {
font-style: italic;
.euiFilterButton__text-hasNotification {
flex-grow: 1;
justify-content: space-between;
width: 0;
}
}
}

.optionsList__loadMore {
font-style: italic;
.optionsList--sortPopover {
width: $euiSizeXL * 7;
}

.optionsList__negateLabel {
font-weight: bold;
font-size: $euiSizeM;
color: $euiColorDanger;
.optionsList__existsFilter {
font-style: italic;
}

.optionsList__actionBarFirstBadge {
margin-left: $euiSizeS;
.optionsList__popoverOverride {
@include euiBottomShadowMedium;
filter: none; // overwrite the default popover shadow
transform: translateY(-$euiSizeS) translateX(0); // prevent "slide in" animation on open/close
}

.optionsList-control-ignored-selection-title {
padding-left: $euiSizeS;
}
.optionsList__popover {
.optionsList__actions {
padding: $euiSizeS;
padding-bottom: 0;
border-bottom: $euiBorderThin;
border-color: darken($euiColorLightestShade, 2%);

.optionsList__selectionInvalid {
text-decoration: line-through;
color: $euiTextSubduedColor;
}
.optionsList__sortButton {
box-shadow: inset 0 0 0 $euiBorderWidthThin $euiFormBorderColor;
background-color: $euiFormBackgroundColor;
}
Heenawter marked this conversation as resolved.
Show resolved Hide resolved

.optionsList--filterBtnWrapper {
height: 100%;
}
.optionsList__actionsRow {
margin: ($euiSizeS / 2) 0 !important;

.optionsList--filterBtn {
.euiFilterButton__text-hasNotification {
flex-grow: 1;
justify-content: space-between;
width: 0;
}
&.optionsList--filterBtnPlaceholder {
.euiFilterButton__textShift {
color: $euiTextSubduedColor;
.optionsList__actionBarDivider {
height: $euiSize;
border-right: $euiBorderThin;
}
}
}
}

.optionsList--filterGroupSingle {
box-shadow: none;
height: 100%;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-top-right-radius: $euiBorderRadius - 1px;
border-bottom-right-radius: $euiBorderRadius - 1px;
}

.optionsList--filterGroup {
width: 100%;
}

.optionsList--hiddenEditorForm {
margin-left: $euiSizeXXL + $euiSizeM;
}
.optionsList-control-ignored-selection-title {
padding-left: $euiSizeS;
}

.optionsList--sortPopover {
width: $euiSizeXL * 7;
}
.optionsList__selectionInvalid {
text-decoration: line-through;
color: $euiTextSubduedColor;
}

.optionslist--loadingMoreGroupLabel {
text-align: center;
padding: $euiSizeM;
font-style: italic;
height: $euiSizeXXL !important;
}
.optionslist--loadingMoreGroupLabel {
text-align: center;
padding: $euiSizeM;
font-style: italic;
height: $euiSizeXXL !important;
}

.optionslist--endOfOptionsGroupLabel {
text-align: center;
font-size: $euiSizeM;
height: auto !important;
color: $euiTextSubduedColor;
padding: $euiSizeM;
}
.optionslist--endOfOptionsGroupLabel {
text-align: center;
font-size: $euiSizeM;
height: auto !important;
color: $euiTextSubduedColor;
padding: $euiSizeM;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ export const OptionsListControl = ({
<EuiPopover
ownFocus
button={button}
hasArrow={false}
repositionOnScroll
isOpen={isPopoverOpen}
panelPaddingSize="none"
anchorPosition="downCenter"
initialFocus={'[data-test-subj=optionsList-control-search-input]'}
className="optionsList__popoverOverride"
closePopover={() => optionsList.dispatch.setPopoverOpen(false)}
anchorClassName="optionsList__anchorOverride"
aria-label={OptionsListStrings.popover.getAriaLabel(fieldName)}
panelClassName="optionsList__popoverOverride"
>
<OptionsListPopover
width={dimensions.width}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
* Side Public License, v 1.
*/

import React, { useState } from 'react';
import { isEmpty } from 'lodash';
import React, { useState } from 'react';

import { OptionsListStrings } from './options_list_strings';
import { OptionsListPopoverTitle } from './options_list_popover_title';
import { useOptionsList } from '../embeddable/options_list_embeddable';
import { OptionsListPopoverFooter } from './options_list_popover_footer';
import { OptionsListPopoverActionBar } from './options_list_popover_action_bar';
import { OptionsListPopoverSuggestions } from './options_list_popover_suggestions';
import { OptionsListPopoverInvalidSelections } from './options_list_popover_invalid_selections';
import { useOptionsList } from '../embeddable/options_list_embeddable';

export interface OptionsListPopoverProps {
width: number;
Expand Down Expand Up @@ -47,12 +46,11 @@ export const OptionsListPopover = ({
<>
<div
id={`control-popover-${id}`}
className={'optionsList__popover'}
style={{ width, minWidth: 300 }}
data-test-subj={`optionsList-control-popover`}
aria-label={OptionsListStrings.popover.getAriaLabel(fieldName)}
>
<OptionsListPopoverTitle />

{field?.type !== 'boolean' && !hideActionBar && (
<OptionsListPopoverActionBar
showOnlySelected={showOnlySelected}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,17 @@ export const OptionsListPopoverActionBar = ({
const searchString = optionsList.select((state) => state.componentState.searchString);
const invalidSelections = optionsList.select((state) => state.componentState.invalidSelections);

const hideSort = optionsList.select((state) => state.explicitInput.hideSort);
const searchTechnique = optionsList.select((state) => state.explicitInput.searchTechnique);

const allowExpensiveQueries = optionsList.select(
(state) => state.componentState.allowExpensiveQueries
);

const hideSort = optionsList.select((state) => state.explicitInput.hideSort);

return (
<div className="optionsList__actions">
<EuiFormRow fullWidth>
<EuiFlexGroup gutterSize="xs" alignItems="center" responsive={false}>
<EuiFlexGroup className="optionsList__searchSortRow" gutterSize="xs" responsive={false}>
<EuiFlexItem grow={true}>
<EuiFieldSearch
isInvalid={!searchString.valid}
Expand All @@ -68,7 +67,7 @@ export const OptionsListPopoverActionBar = ({
/>
</EuiFlexItem>
{!hideSort && (
<EuiFlexItem grow={false}>
<EuiFlexItem className="optionsList__sortButtonWrapper" grow={false}>
<OptionsListPopoverSortingButton showOnlySelected={showOnlySelected} />
</EuiFlexItem>
)}
Expand Down
Loading