-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ML] Advanced wizard functional UI tests #49480
Changes from 12 commits
09a65c9
e46b3ff
292f2f7
25174f1
543e7cc
5ef0edb
c58dca7
594cc45
178a449
38cb287
dca9a83
cf6fc45
242be04
f32ca31
dfe2e17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ import { JobCreatorContext } from '../../../job_creator_context'; | |
import { AdvancedJobCreator } from '../../../../../common/job_creator'; | ||
import { Validation } from '../../../../../common/job_validator'; | ||
import { detectorToString } from '../../../../../../../util/string_utils'; | ||
import { Detector } from '../../../../../common/job_creator/configs'; | ||
|
||
interface Props { | ||
isActive: boolean; | ||
|
@@ -62,6 +63,7 @@ export const DetectorList: FC<Props> = ({ isActive, onEditJob, onDeleteJob }) => | |
defaultMessage: 'Edit', | ||
} | ||
)} | ||
data-test-subj="mlAdvancedDetectorEditButton" | ||
/> | ||
</EuiFlexItem> | ||
<EuiFlexItem> | ||
|
@@ -75,6 +77,7 @@ export const DetectorList: FC<Props> = ({ isActive, onEditJob, onDeleteJob }) => | |
defaultMessage: 'Delete', | ||
} | ||
)} | ||
data-test-subj="mlAdvancedDetectorDeleteButton" | ||
/> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
|
@@ -98,14 +101,16 @@ export const DetectorList: FC<Props> = ({ isActive, onEditJob, onDeleteJob }) => | |
|
||
<EuiFlexGrid columns={3}> | ||
{detectors.map((d, i) => ( | ||
<EuiFlexItem key={i}> | ||
<EuiFlexItem key={i} data-test-subj={`mlAdvancedDetector ${i}`}> | ||
<EuiPanel paddingSize="m"> | ||
<EuiFlexGroup> | ||
<EuiFlexItem> | ||
{d.detector_description !== undefined ? ( | ||
<div style={{ fontWeight: 'bold' }}>{d.detector_description}</div> | ||
<div style={{ fontWeight: 'bold' }} data-test-subj="detectorDescription"> | ||
{d.detector_description} | ||
</div> | ||
) : ( | ||
detectorToString(d) | ||
<DetectorIdentifier detector={d} /> | ||
)} | ||
</EuiFlexItem> | ||
{isActive && ( | ||
|
@@ -117,7 +122,7 @@ export const DetectorList: FC<Props> = ({ isActive, onEditJob, onDeleteJob }) => | |
{d.detector_description !== undefined && ( | ||
<Fragment> | ||
<EuiHorizontalRule margin="s" /> | ||
{detectorToString(d)} | ||
<DetectorIdentifier detector={d} /> | ||
</Fragment> | ||
)} | ||
</EuiPanel> | ||
|
@@ -142,6 +147,7 @@ const NoDetectorsWarning: FC<{ show: boolean }> = ({ show }) => { | |
defaultMessage: 'No detectors', | ||
})} | ||
iconType="alert" | ||
data-test-subj="mlAdvancedNoDetectorsMessage" | ||
> | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.pickFieldsStep.noDetectorsCallout.message" | ||
|
@@ -166,3 +172,7 @@ const DuplicateDetectorsWarning: FC<{ validation: Validation }> = ({ validation | |
</Fragment> | ||
); | ||
}; | ||
|
||
const DetectorIdentifier: FC<{ detector: Detector }> = ({ detector }) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'm not sure about the name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed in f32ca31 |
||
return <div data-test-subj="detectorIdentifier">{detectorToString(detector)}</div>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this subject be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above, renamed in dfe2e17 |
||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this subject be
mlDetectorDescription
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was originally planned to be nested subject only as it's not necessarily unique on its own, i.e. it's currently used as
but it makes sense to keep our
ml
namespace here as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed in dfe2e17