-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Fixes enabled state of detector rule scope options #21263
[ML] Fixes enabled state of detector rule scope options #21263
Conversation
Pinging @elastic/ml-ui |
if (scope !== undefined && Object.keys(scope).length > 0) { | ||
isValid = true; | ||
if (scope !== undefined) { | ||
const enabledScope = Object.keys(scope).find(field => (scope[field].enabled === true)); |
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.
This could use .some(...)
instead to be able to just evaluate against a boolean.
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.
LGTM, just added a small comment about .find/.some
.
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.
LGTM
💚 Build Succeeded |
💚 Build Succeeded |
* [ML] Fixes enabled state of detector rule scope options * [ML] Edit to rule scope enabled check following review
* [ML] Fixes enabled state of detector rule scope options * [ML] Edit to rule scope enabled check following review
Fixes the appearance of deselected scope options in the detector rule editor.
Previously options for partitioning fields which had not been selected for addition to the rule appeared with a greyed out disabled appearance, which could give the impression that they were not available for use:
This has been fixed so that the disabled style has been removed, and the checkbox next to each scope field just controls whether the field is added to the rule's scope and does not effect the enabled/disabled state of the controls:
Fixes #21208