Skip to content

Commit

Permalink
Merge branch 'main' into enable-modal
Browse files Browse the repository at this point in the history
  • Loading branch information
CAWilson94 authored Nov 12, 2024
2 parents 212fd23 + c58989c commit d7216d9
Showing 1 changed file with 36 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,42 +97,45 @@ export const SplitCards: FC<PropsWithChildren<Props>> = memo(
}

return (
<EuiFlexGroup>
<EuiFlexItem data-test-subj="mlDataSplit">
{(fieldValues.length === 0 || numberOfDetectors === 0) && <>{children}</>}
{fieldValues.length > 0 && numberOfDetectors > 0 && splitField !== null && (
<Fragment>
{(jobType === JOB_TYPE.MULTI_METRIC || jobType === JOB_TYPE.GEO) && (
<Fragment>
<>
<EuiFlexGroup>
<EuiFlexItem data-test-subj="mlDataSplit">
{(fieldValues.length === 0 || numberOfDetectors === 0) && <>{children}</>}
{fieldValues.length > 0 && numberOfDetectors > 0 && splitField !== null && (
<Fragment>
{(jobType === JOB_TYPE.MULTI_METRIC || jobType === JOB_TYPE.GEO) && (
<Fragment>
<div
css={{ fontSize: 'small' }}
data-test-subj={`mlDataSplitTitle ${splitField.name}`}
>
<FormattedMessage
id="xpack.ml.newJob.wizard.pickFieldsStep.splitCards.dataSplitBy"
defaultMessage="Data split by {field}"
values={{ field: splitField.name }}
/>
</div>
<EuiSpacer size="m" />
</Fragment>
)}

{getBackPanels()}
<EuiPanel paddingSize="m" css={splitCardStyle} data-test-subj="mlSplitCard front">
<div
css={{ fontSize: 'small' }}
data-test-subj={`mlDataSplitTitle ${splitField.name}`}
css={{ fontWeight: 'bold', fontSize: 'small' }}
data-test-subj="mlSplitCardTitle"
>
<FormattedMessage
id="xpack.ml.newJob.wizard.pickFieldsStep.splitCards.dataSplitBy"
defaultMessage="Data split by {field}"
values={{ field: splitField.name }}
/>
{fieldValues[0]}
</div>
<EuiSpacer size="m" />
</Fragment>
)}

{getBackPanels()}
<EuiPanel paddingSize="m" css={splitCardStyle} data-test-subj="mlSplitCard front">
<div
css={{ fontWeight: 'bold', fontSize: 'small' }}
data-test-subj="mlSplitCardTitle"
>
{fieldValues[0]}
</div>
<EuiHorizontalRule margin="s" />
<>{children}</>
</EuiPanel>
</Fragment>
)}
</EuiFlexItem>
</EuiFlexGroup>
<EuiHorizontalRule margin="s" />
<>{children}</>
</EuiPanel>
</Fragment>
)}
</EuiFlexItem>
</EuiFlexGroup>
{splitField !== null ? <EuiSpacer size="m" /> : null}
</>
);
}
);

0 comments on commit d7216d9

Please sign in to comment.