Remove deprecated usages of EuiFormRow's display="columnCompressedSwitch" prop (#198709)

## Summary

This prop option has been deprecated as of
https://github.com/elastic/eui/pull/7968. `display="columnCompressed"`
now automatically accounts for EuiSwitches (via `:has` CSS) and the
extra prop option is no longer needed.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))

---------

Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
This commit is contained in:
Cee Chen 2024-11-06 10:18:43 -08:00 committed by GitHub
parent 08b83c55f6
commit 83a9acd79b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 43 additions and 46 deletions

View file

@ -386,7 +386,7 @@ const ConfigPanelGenericSwitch = ({
value: boolean;
onChange: (event: EuiSwitchEvent) => void;
}) => (
<EuiFormRow label={label} display="columnCompressedSwitch" fullWidth>
<EuiFormRow label={label} display="columnCompressed" fullWidth>
<EuiSwitch
compressed
label={label}

View file

@ -150,7 +150,7 @@ export function OverrideSwitch({
</EuiToolTip>
}
helpText={helpText}
display="columnCompressedSwitch"
display="columnCompressed"
hasChildLabel={false}
>
<EuiSwitch
@ -249,7 +249,7 @@ export function AttributesMenu({
</EuiFormRow>
) : null}
{isPieChart(currentAttributes) ? (
<EuiFormRow label="Show values" display="columnCompressedSwitch">
<EuiFormRow label="Show values" display="columnCompressed">
<EuiSwitch
label="As percentage"
name="switch"
@ -269,7 +269,7 @@ export function AttributesMenu({
</EuiFormRow>
) : null}
{isHeatmapChart(currentAttributes) ? (
<EuiFormRow label="Show values" display="columnCompressedSwitch">
<EuiFormRow label="Show values" display="columnCompressed">
<EuiSwitch
label="As percentage"
name="switch"
@ -287,7 +287,7 @@ export function AttributesMenu({
</EuiFormRow>
) : null}
{isGaugeChart(currentAttributes) ? (
<EuiFormRow label="Ticks visibility" display="columnCompressedSwitch">
<EuiFormRow label="Ticks visibility" display="columnCompressed">
<EuiSwitch
label="Show ticks"
name="switch"
@ -522,7 +522,7 @@ export function PanelMenu({
<EuiSpacer />
<EuiFormRow
label="Enable triggers"
display="columnCompressedSwitch"
display="columnCompressed"
helpText="This setting controls the interactivity of the chart: when disabled the chart won't bubble any event on user action."
>
<EuiSwitch
@ -538,7 +538,7 @@ export function PanelMenu({
</EuiFormRow>
<EuiFormRow
label="Enable default action"
display="columnCompressedSwitch"
display="columnCompressed"
helpText="When disabled the default panel actions (i.e. CSV download)"
>
<EuiSwitch
@ -589,7 +589,7 @@ export function PanelMenu({
</span>
</EuiToolTip>
}
display="columnCompressedSwitch"
display="columnCompressed"
helpText="Pass a consumer defined action to show in the panel context menu."
>
<EuiSwitch

View file

@ -28,7 +28,7 @@ const AlertsSettingsComponent = ({ knowledgeBase, setUpdatedKnowledgeBaseSetting
return (
<>
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
label={i18n.ALERTS_LABEL}
css={css`
.euiFormRow__labelWrapper {

View file

@ -149,7 +149,7 @@ export const KnowledgeBaseSettings: React.FC<Props> = React.memo(
<EuiHorizontalRule margin={'s'} />
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
label={i18n.KNOWLEDGE_BASE_LABEL}
css={css`
.euiFormRow__labelWrapper {

View file

@ -116,7 +116,7 @@ export const ExtendedTemplate: FunctionComponent<Props> = ({ onValueChange, argV
/>
</EuiFormRow>
<EuiSpacer size="s" />
<EuiFormRow label={strings.getValuesLabel()} display="columnCompressedSwitch">
<EuiFormRow label={strings.getValuesLabel()} display="columnCompressed">
<EuiSwitch
compressed
checked={showValues}

View file

@ -216,7 +216,7 @@ export const DataDriftView = ({
runAnalysisDisabled={!dataView || requiresWindowParameters}
>
<EuiFlexItem grow={false}>
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<EuiSwitch
label={showOnlyDriftedFieldsOptionLabel}
aria-label={showOnlyDriftedFieldsOptionLabel}

View file

@ -142,7 +142,7 @@ export class GeoUploadForm extends Component<Props, State> {
onIndexNameValidationEnd={this.props.onIndexNameValidationEnd}
/>
<EuiSpacer size="m" />
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<EuiToolTip
position="top"
content={i18n.translate('xpack.fileUpload.smallChunks.tooltip', {

View file

@ -684,9 +684,6 @@ export function LayerPanel(props: LayerPanelProps) {
{layerDatasource?.LayerSettingsComponent && (
<layerDatasource.LayerSettingsComponent {...layerDatasourceConfigProps} />
)}
{layerDatasource?.LayerSettingsComponent && visualizationLayerSettings.data ? (
<EuiSpacer size="m" />
) : null}
{activeVisualization?.LayerSettingsComponent && visualizationLayerSettings.data ? (
<activeVisualization.LayerSettingsComponent
{...{

View file

@ -111,7 +111,7 @@ export function AxisBoundsControl({
label={i18n.translate('xpack.lens.fullExtent.niceValues', {
defaultMessage: 'Round to nice values',
})}
display="columnCompressedSwitch"
display="columnCompressed"
fullWidth
>
<EuiSwitch

View file

@ -40,7 +40,7 @@ export const AxisTicksSettings: React.FunctionComponent<AxisTicksSettingsProps>
return (
<>
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
label={i18n.translate('xpack.lens.shared.tickLabels', {
defaultMessage: 'Tick labels',
})}

View file

@ -18,7 +18,7 @@ export function IgnoreGlobalFilterRowControl({
}) {
return (
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
label={i18n.translate('xpack.lens.layerSettings.ignoreGlobalFilters', {
defaultMessage: 'Use global filters',
})}

View file

@ -360,7 +360,7 @@ export function LegendSettingsPopover<LegendStats extends LegendValue = XYLegend
)}
{showsShowValueSetting && (
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
label={i18n.translate('xpack.lens.shared.valueInLegendLabel', {
defaultMessage: 'Show value',
})}
@ -415,7 +415,7 @@ export function LegendSettingsPopover<LegendStats extends LegendValue = XYLegend
{isLegendNotHidden && renderNestedLegendSwitch && (
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
label={i18n.translate('xpack.lens.shared.nestedLegendLabel', {
defaultMessage: 'Nested',
})}

View file

@ -256,7 +256,7 @@ export function TableDimensionEditor(props: TableDimensionEditorProps) {
label={i18n.translate('xpack.lens.table.columnVisibilityLabel', {
defaultMessage: 'Hide column',
})}
display="columnCompressedSwitch"
display="columnCompressed"
>
<EuiSwitch
compressed
@ -292,7 +292,7 @@ export function TableDimensionEditor(props: TableDimensionEditorProps) {
label={i18n.translate('xpack.lens.table.columnFilterClickLabel', {
defaultMessage: 'Directly filter on click',
})}
display="columnCompressedSwitch"
display="columnCompressed"
>
<EuiSwitch
compressed

View file

@ -112,7 +112,7 @@ export function DataTableToolbar(props: VisualizationToolbarProps<DatatableVisua
label={i18n.translate('xpack.lens.table.visualOptionsPaginateTable', {
defaultMessage: 'Paginate table',
})}
display="columnCompressedSwitch"
display="columnCompressed"
>
<EuiToolTip
content={i18n.translate('xpack.lens.table.visualOptionsPaginateTableTooltip', {

View file

@ -143,7 +143,7 @@ export function GaugeDimensionEditor(
</PalettePanelContainer>
</EuiFormRow>
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
fullWidth
label={
<TooltipWrapper

View file

@ -30,7 +30,7 @@ export function LayerSettings(
return (
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
label={i18n.translate('xpack.lens.pieChart.multipleMetrics', {
defaultMessage: 'Multiple metrics',
})}

View file

@ -100,7 +100,7 @@ export function TagcloudToolbar(props: VisualizationToolbarProps<TagcloudState>)
/>
</EuiFormRow>
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
label={i18n.translate('xpack.lens.label.tagcloud.showLabel', {
defaultMessage: 'Show label',
})}

View file

@ -279,7 +279,7 @@ export const AxisSettingsPopover: React.FunctionComponent<AxisSettingsPopoverPro
isTitleVisible={isTitleVisible}
/>
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
label={i18n.translate('xpack.lens.xyChart.Gridlines', {
defaultMessage: 'Gridlines',
})}
@ -332,7 +332,7 @@ export const AxisSettingsPopover: React.FunctionComponent<AxisSettingsPopoverPro
)}
{setEndzoneVisibility && (
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
label={i18n.translate('xpack.lens.xyChart.showEnzones', {
defaultMessage: 'Show partial data markers',
})}
@ -352,7 +352,7 @@ export const AxisSettingsPopover: React.FunctionComponent<AxisSettingsPopoverPro
)}
{setCurrentTimeMarkerVisibility && (
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
label={i18n.translate('xpack.lens.xyChart.showCurrenTimeMarker', {
defaultMessage: 'Show current time marker',
})}

View file

@ -120,7 +120,7 @@ export const MissingValuesOptions: React.FC<MissingValuesOptionProps> = ({
label={i18n.translate('xpack.lens.xyChart.missingValuesStyle', {
defaultMessage: 'Show as dotted line',
})}
display="columnCompressedSwitch"
display="columnCompressed"
>
<EuiSwitch
showLabel={false}

View file

@ -392,7 +392,7 @@ exports[`should render 1`] = `
size="m"
/>
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
>
<EuiSwitch
checked={true}
@ -741,7 +741,7 @@ exports[`should render with no style fields 1`] = `
size="m"
/>
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
>
<EuiSwitch
checked={true}

View file

@ -159,7 +159,7 @@ export function DynamicColorForm({
invert={invert}
/>
{!!styleOptions.useCustomColorRamp ? null : (
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<EuiSwitch
label={i18n.translate('xpack.maps.style.revereseColorsLabel', {
defaultMessage: `Reverse colors`,

View file

@ -31,7 +31,7 @@ export function CategoricalDataMappingPopover<DynamicOptions>(props: Props<Dynam
return (
<DataMappingPopover>
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<>
<EuiSwitch
label={i18n.translate('xpack.maps.styles.fieldMetaOptions.isEnabled.categoricalLabel', {

View file

@ -161,7 +161,7 @@ export function OrdinalDataMappingPopover<DynamicOptions>(props: Props<DynamicOp
return (
<Fragment>
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<>
<EuiSwitch
label={i18n.translate('xpack.maps.styles.ordinalDataMapping.isEnabledSwitchLabel', {

View file

@ -72,7 +72,7 @@ export function DynamicSizeForm({
showLabels
compressed
/>
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<EuiSwitch
label={i18n.translate('xpack.maps.style.revereseSizeLabel', {
defaultMessage: `Reverse size`,

View file

@ -616,7 +616,7 @@ export class VectorStyleEditor extends Component<Props, State> {
}
return (
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<EuiSwitch
label={i18n.translate('xpack.maps.vectorStyleEditor.isTimeAwareLabel', {
defaultMessage: 'Apply global time to style metadata requests',

View file

@ -20,7 +20,7 @@ export function ForceRefreshCheckbox({ applyForceRefresh, setApplyForceRefresh }
};
return (
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<EuiToolTip
position="top"
content={i18n.translate('xpack.maps.filterEditor.applyForceRefreshTooltip', {

View file

@ -35,7 +35,7 @@ export function GlobalFilterCheckbox({
});
return (
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<EuiToolTip position="top" content={tooltipMessage}>
<EuiSwitch
label={label}

View file

@ -34,7 +34,7 @@ export function GlobalTimeCheckbox({
});
return (
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<EuiToolTip position="top" content={tooltipMessage}>
<EuiSwitch
label={label}

View file

@ -94,7 +94,7 @@ export function LayerSettings(props: Props) {
return null;
}
return (
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<EuiToolTip
position="top"
content={i18n.translate('xpack.maps.layerPanel.settingsPanel.fittableFlagTooltip', {
@ -157,7 +157,7 @@ export function LayerSettings(props: Props) {
}
return (
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<EuiSwitch
label={i18n.translate('xpack.maps.layerPanel.settingsPanel.labelsOnTop', {
defaultMessage: `Show labels on top`,
@ -173,7 +173,7 @@ export function LayerSettings(props: Props) {
const renderDisableTooltips = () => {
return !isVectorLayer(props.layer) ? null : (
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<EuiSwitch
label={i18n.translate('xpack.maps.layerPanel.settingsPanel.DisableTooltips', {
defaultMessage: `Show tooltips`,

View file

@ -34,7 +34,7 @@ class FilterByMapExtentModal extends Component<Props> {
_renderSwitches() {
return mapEmbeddablesSingleton.getMapPanels().map((mapPanel) => {
return (
<EuiFormRow display="columnCompressedSwitch" key={mapPanel.id}>
<EuiFormRow display="columnCompressed" key={mapPanel.id}>
<EuiSwitch
label={mapPanel.getTitle()}
checked={mapPanel.getIsFilterByMapExtent()}

View file

@ -42,7 +42,7 @@ class SynchronizeMovementModal extends Component<Props> {
const hasErrors = synchronizedPanels.length === 1 && mapPanel.getIsMovementSynchronized();
return (
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
key={mapPanel.id}
isInvalid={hasErrors}
error={