Skip to content

Commit

Permalink
Remove deprecated usages of EuiFormRow's `display="columnCompressed…
Browse files Browse the repository at this point in the history
…Switch"` prop (elastic#198709)

## Summary

This prop option has been deprecated as of
elastic/eui#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 <[email protected]>
  • Loading branch information
cee-chen and mbondyra authored Nov 6, 2024
1 parent 08b83c5 commit 83a9acd
Show file tree
Hide file tree
Showing 31 changed files with 43 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
14 changes: 7 additions & 7 deletions x-pack/examples/testing_embedded_lens/public/controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export function OverrideSwitch({
</EuiToolTip>
}
helpText={helpText}
display="columnCompressedSwitch"
display="columnCompressed"
hasChildLabel={false}
>
<EuiSwitch
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const AlertsSettingsComponent = ({ knowledgeBase, setUpdatedKnowledgeBaseSetting
return (
<>
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
label={i18n.ALERTS_LABEL}
css={css`
.euiFormRow__labelWrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{...{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function IgnoreGlobalFilterRowControl({
}) {
return (
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
label={i18n.translate('xpack.lens.layerSettings.ignoreGlobalFilters', {
defaultMessage: 'Use global filters',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})}
Expand Down Expand Up @@ -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',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export function GaugeDimensionEditor(
</PalettePanelContainer>
</EuiFormRow>
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
fullWidth
label={
<TooltipWrapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function LayerSettings(

return (
<EuiFormRow
display="columnCompressedSwitch"
display="columnCompressed"
label={i18n.translate('xpack.lens.pieChart.multipleMetrics', {
defaultMessage: 'Multiple metrics',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})}
Expand Down Expand Up @@ -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',
})}
Expand All @@ -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',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function GlobalFilterCheckbox({
});

return (
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<EuiToolTip position="top" content={tooltipMessage}>
<EuiSwitch
label={label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function GlobalTimeCheckbox({
});

return (
<EuiFormRow display="columnCompressedSwitch">
<EuiFormRow display="columnCompressed">
<EuiToolTip position="top" content={tooltipMessage}>
<EuiSwitch
label={label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down Expand Up @@ -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`,
Expand All @@ -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`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand Down

0 comments on commit 83a9acd

Please sign in to comment.