Skip to content

Commit

Permalink
fix form width for transform wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Nov 24, 2023
1 parent 7b17044 commit 49d6b79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Expand Up @@ -20,6 +20,7 @@ interface DestinationIndexFormProps {
destinationIndexNameExists: boolean;
destinationIndexNameValid: boolean;
destIndexSameAsId: boolean;
fullWidth?: boolean;
indexNameExistsMessage: string;
isJobCreated: boolean;
onDestinationIndexChange: (d: string) => void;
Expand All @@ -34,6 +35,7 @@ export const DestinationIndexForm: FC<DestinationIndexFormProps> = ({
destinationIndexNameExists,
destinationIndexNameValid,
destIndexSameAsId,
fullWidth = true,
indexNameExistsMessage,
isJobCreated,
onDestinationIndexChange,
Expand All @@ -42,7 +44,7 @@ export const DestinationIndexForm: FC<DestinationIndexFormProps> = ({
}) => (
<>
<EuiFormRow
fullWidth
fullWidth={fullWidth}
helpText={destIndexSameAsId === true && destinationIndexNameExists && indexNameExistsMessage}
>
<UseIdAsIndexNameSwitch
Expand All @@ -54,7 +56,7 @@ export const DestinationIndexForm: FC<DestinationIndexFormProps> = ({
</EuiFormRow>
{destIndexSameAsId === false && (
<EuiFormRow
fullWidth
fullWidth={fullWidth}
label={i18n.translate('xpack.ml.creationWizardUtils.destinationIndexLabel', {
defaultMessage: 'Destination index',
})}
Expand All @@ -80,20 +82,20 @@ export const DestinationIndexForm: FC<DestinationIndexFormProps> = ({
}
>
<EuiFieldText
fullWidth
fullWidth={fullWidth}
disabled={isJobCreated}
placeholder="destination index"
value={destinationIndex}
// onChange={(e) => setFormState({ destinationIndex: e.target.value })}
onChange={(e) => onDestinationIndexChange(e.target.value)}
aria-label={i18n.translate(
'xpack.ml.dataframe.analytics.create.destinationIndexInputAriaLabel',
'xpack.ml.creationWizardUtils.destinationIndexInputAriaLabel',
{
defaultMessage: 'Choose a unique destination index name.',
}
)}
isInvalid={!destinationIndexNameEmpty && !destinationIndexNameValid}
data-test-subj="mlAnalyticsCreateJobFlyoutDestinationIndexInput"
data-test-subj="mlCreationWizardUtilsDestinationIndexInput"
/>
</EuiFormRow>
)}
Expand Down
Expand Up @@ -456,6 +456,7 @@ export const StepDetailsForm: FC<StepDetailsFormProps> = React.memo(
destinationIndexNameExists={indexNameExists}
destinationIndexNameValid={indexNameValid}
destIndexSameAsId={destIndexSameAsId}
fullWidth={false}
indexNameExistsMessage={i18n.translate(
'xpack.transform.stepDetailsForm.destinationIndexHelpText',
{
Expand Down

0 comments on commit 49d6b79

Please sign in to comment.