Skip to content

Commit

Permalink
Remove unnecessary hasEmptyLabelSpace prop within `EuiDescribedForm…
Browse files Browse the repository at this point in the history
…Group`s

- EuiDescribedFormGroups already automatically accounts for form rows without labels, so the `hasEmptyLabelSpace` prop is now unnecessary and adds extra unwanted spacing
  • Loading branch information
cee-chen committed Aug 23, 2024
1 parent 6766709 commit 50bed3e
Show file tree
Hide file tree
Showing 18 changed files with 14 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ export function FormatSelector(props: FormatSelectorProps) {
<EuiFormRow
display="columnCompressed"
hasEmptyLabelSpace
label=" "
helpText={
<EuiLink
href={docLinks.links.indexPatterns.fieldFormattersNumber}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const ConnectionMode: FunctionComponent<Props> = (props) => {
id="xpack.remoteClusters.remoteClusterForm.sectionModeDescription"
defaultMessage="Use seed nodes by default, or switch to proxy mode."
/>
<EuiFormRow hasEmptyLabelSpace fullWidth>
<EuiFormRow fullWidth>
<EuiSwitch
label={
<FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const ConnectionModeCloud: FunctionComponent<Props> = (props) => {
id="xpack.remoteClusters.remoteClusterForm.sectionModeCloudDescription"
defaultMessage="Configure how to connect to the remote cluster."
/>
<EuiFormRow hasEmptyLabelSpace fullWidth>
<EuiFormRow fullWidth>
<EuiSwitch
label={
<FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ export class RemoteClusterForm extends Component<Props, State> {
<EuiFormRow
data-test-subj="remoteClusterFormSkipUnavailableFormRow"
className="remoteClusterSkipIfUnavailableSwitch"
hasEmptyLabelSpace
fullWidth
helpText={
skipUnavailable !== defaultClusterValues.skipUnavailable ? (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/*
* Prevent switch controls from moving around when toggling content
*/
.snapshotRestore__policyForm__stepSettings {
.euiFormRow--hasEmptyLabelSpace {
min-height: auto;
margin-top: $euiFontSizeXS + $euiSizeS + calc($euiSizeXXL / 4);
}
}

/*
* Allow toggle mode link in indices field label to be flushed right
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const IncludeFeatureStatesField: FunctionComponent<Props> = ({ policy, on
}
fullWidth
>
<EuiFormRow hasEmptyLabelSpace fullWidth>
<EuiFormRow fullWidth>
<EuiSwitch
data-test-subj="featureStatesToggle"
label={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const IncludeGlobalStateField: FunctionComponent<Props> = ({ policy, onUp
}
fullWidth
>
<EuiFormRow hasEmptyLabelSpace fullWidth>
<EuiFormRow fullWidth>
<EuiSwitch
data-test-subj="globalStateToggle"
label={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export const IndicesAndDataStreamsField: FunctionComponent<Props> = ({
}
fullWidth
>
<EuiFormRow hasEmptyLabelSpace fullWidth>
<EuiFormRow fullWidth>
<Fragment>
{isManagedPolicy ? (
<EuiToolTip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const PolicyStepSettings: React.FunctionComponent<StepProps> = ({
}
fullWidth
>
<EuiFormRow hasEmptyLabelSpace fullWidth>
<EuiFormRow fullWidth>
<EuiSwitch
data-test-subj="ignoreUnavailableIndicesToggle"
label={
Expand Down Expand Up @@ -111,7 +111,7 @@ export const PolicyStepSettings: React.FunctionComponent<StepProps> = ({
}
fullWidth
>
<EuiFormRow hasEmptyLabelSpace fullWidth>
<EuiFormRow fullWidth>
<EuiSwitch
data-test-subj="partialIndicesToggle"
label={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ export const RepositoryFormStepOne: React.FunctionComponent<Props> = ({
/>
</EuiText>
<EuiFormRow
hasEmptyLabelSpace
describedByIds={['repositoryTypeDescription']}
fullWidth
isInvalid={Boolean(hasValidationErrors && validation.errors.type)}
Expand Down Expand Up @@ -290,7 +289,7 @@ export const RepositoryFormStepOne: React.FunctionComponent<Props> = ({
}
fullWidth
>
<EuiFormRow hasEmptyLabelSpace={true} fullWidth>
<EuiFormRow fullWidth>
<EuiSwitch
label={
<FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ export const AzureSettings: React.FunctionComponent<Props> = ({
fullWidth
>
<EuiFormRow
hasEmptyLabelSpace={true}
fullWidth
isInvalid={Boolean(hasErrors && settingErrors.compress)}
error={settingErrors.compress}
Expand Down Expand Up @@ -333,7 +332,6 @@ export const AzureSettings: React.FunctionComponent<Props> = ({
fullWidth
>
<EuiFormRow
hasEmptyLabelSpace={true}
fullWidth
isInvalid={Boolean(hasErrors && settingErrors.readonly)}
error={settingErrors.readonly}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ export const FSSettings: React.FunctionComponent<Props> = ({
fullWidth
>
<EuiFormRow
hasEmptyLabelSpace={true}
fullWidth
isInvalid={Boolean(hasErrors && settingErrors.compress)}
error={settingErrors.compress}
Expand Down Expand Up @@ -190,7 +189,6 @@ export const FSSettings: React.FunctionComponent<Props> = ({
fullWidth
>
<EuiFormRow
hasEmptyLabelSpace={true}
fullWidth
isInvalid={Boolean(hasErrors && settingErrors.readonly)}
error={settingErrors.readonly}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ export const GCSSettings: React.FunctionComponent<Props> = ({
fullWidth
>
<EuiFormRow
hasEmptyLabelSpace={true}
fullWidth
isInvalid={Boolean(hasErrors && settingErrors.compress)}
error={settingErrors.compress}
Expand Down Expand Up @@ -275,7 +274,6 @@ export const GCSSettings: React.FunctionComponent<Props> = ({
fullWidth
>
<EuiFormRow
hasEmptyLabelSpace={true}
fullWidth
isInvalid={Boolean(hasErrors && settingErrors.readonly)}
error={settingErrors.readonly}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ export const HDFSSettings: React.FunctionComponent<Props> = ({
fullWidth
>
<EuiFormRow
hasEmptyLabelSpace={true}
fullWidth
isInvalid={Boolean(hasErrors && settingErrors.loadDefaults)}
error={settingErrors.loadDefaults}
Expand Down Expand Up @@ -225,7 +224,6 @@ export const HDFSSettings: React.FunctionComponent<Props> = ({
fullWidth
>
<EuiFormRow
hasEmptyLabelSpace={true}
fullWidth
isInvalid={Boolean(hasErrors && settingErrors.compress)}
error={settingErrors.compress}
Expand Down Expand Up @@ -427,7 +425,6 @@ export const HDFSSettings: React.FunctionComponent<Props> = ({
fullWidth
>
<EuiFormRow
hasEmptyLabelSpace={true}
fullWidth
isInvalid={Boolean(hasErrors && settingErrors.readonly)}
error={settingErrors.readonly}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ export const S3Settings: React.FunctionComponent<Props> = ({
fullWidth
>
<EuiFormRow
hasEmptyLabelSpace={true}
fullWidth
isInvalid={Boolean(hasErrors && settingErrors.compress)}
error={settingErrors.compress}
Expand Down Expand Up @@ -294,7 +293,6 @@ export const S3Settings: React.FunctionComponent<Props> = ({
fullWidth
>
<EuiFormRow
hasEmptyLabelSpace={true}
fullWidth
isInvalid={Boolean(hasErrors && settingErrors.serverSideEncryption)}
error={settingErrors.serverSideEncryption}
Expand Down Expand Up @@ -503,7 +501,6 @@ export const S3Settings: React.FunctionComponent<Props> = ({
fullWidth
>
<EuiFormRow
hasEmptyLabelSpace={true}
fullWidth
isInvalid={Boolean(hasErrors && settingErrors.readonly)}
error={settingErrors.readonly}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
/*
* Prevent switch controls from moving around when toggling content
*/
.snapshotRestore__restoreForm__stepLogistics,
.snapshotRestore__restoreForm__stepSettings {
.euiFormRow--hasEmptyLabelSpace {
min-height: auto;
margin-top: $euiFontSizeXS + $euiSizeS + calc($euiSizeXXL / 4);
}
}

/*
* Allow toggle mode link in indices field label to be flushed right
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export const RestoreSnapshotStepLogistics: React.FunctionComponent<StepProps> =
}
fullWidth
>
<EuiFormRow hasEmptyLabelSpace fullWidth>
<EuiFormRow fullWidth>
<Fragment>
<EuiSwitch
label={
Expand Down Expand Up @@ -451,7 +451,7 @@ export const RestoreSnapshotStepLogistics: React.FunctionComponent<StepProps> =
}
fullWidth
>
<EuiFormRow hasEmptyLabelSpace fullWidth>
<EuiFormRow fullWidth>
<Fragment>
<EuiSwitch
label={
Expand Down Expand Up @@ -566,7 +566,7 @@ export const RestoreSnapshotStepLogistics: React.FunctionComponent<StepProps> =
}
fullWidth
>
<EuiFormRow hasEmptyLabelSpace={true} fullWidth>
<EuiFormRow fullWidth>
<EuiSwitch
label={
<FormattedMessage
Expand Down Expand Up @@ -601,7 +601,6 @@ export const RestoreSnapshotStepLogistics: React.FunctionComponent<StepProps> =
fullWidth
>
<EuiFormRow
hasEmptyLabelSpace={true}
fullWidth
helpText={
snapshotIncludeGlobalState ? null : (
Expand Down Expand Up @@ -660,7 +659,6 @@ export const RestoreSnapshotStepLogistics: React.FunctionComponent<StepProps> =
fullWidth
>
<EuiFormRow
hasEmptyLabelSpace={true}
fullWidth
helpText={
snapshotIncludeFeatureStates ? null : (
Expand Down Expand Up @@ -732,7 +730,7 @@ export const RestoreSnapshotStepLogistics: React.FunctionComponent<StepProps> =
}
fullWidth
>
<EuiFormRow hasEmptyLabelSpace={true} fullWidth>
<EuiFormRow fullWidth>
<EuiSwitch
label={
<FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export const RestoreSnapshotStepSettings: React.FunctionComponent<StepProps> = (
}
fullWidth
>
<EuiFormRow hasEmptyLabelSpace fullWidth>
<EuiFormRow fullWidth>
<Fragment>
<EuiSwitch
data-test-subj="modifyIndexSettingsSwitch"
Expand Down Expand Up @@ -244,7 +244,7 @@ export const RestoreSnapshotStepSettings: React.FunctionComponent<StepProps> = (
}
fullWidth
>
<EuiFormRow hasEmptyLabelSpace fullWidth>
<EuiFormRow fullWidth>
<Fragment>
<EuiSwitch
label={
Expand Down

0 comments on commit 50bed3e

Please sign in to comment.