Skip to content
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

Merged
merged 2 commits into from
Jul 26, 2018

Conversation

peteharverson
Copy link
Contributor

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:

image

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:

image

Fixes #21208

@peteharverson peteharverson added bug Fixes for quality problems that affect the customer experience review v7.0.0 v6.4.0 :ml Feature:Anomaly Detection ML anomaly detection labels Jul 26, 2018
@elasticmachine
Copy link
Contributor

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));
Copy link
Contributor

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.

Copy link
Contributor

@walterra walterra left a 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.

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@peteharverson peteharverson merged commit c16a821 into elastic:master Jul 26, 2018
@peteharverson peteharverson deleted the ml-rule-scope-enabled branch July 26, 2018 14:50
peteharverson added a commit to peteharverson/kibana that referenced this pull request Jul 26, 2018
* [ML] Fixes enabled state of detector rule scope options

* [ML] Edit to rule scope enabled check following review
peteharverson added a commit that referenced this pull request Jul 26, 2018
)

* [ML] Fixes enabled state of detector rule scope options

* [ML] Edit to rule scope enabled check following review
peteharverson added a commit to peteharverson/kibana that referenced this pull request Jul 26, 2018
* [ML] Fixes enabled state of detector rule scope options

* [ML] Edit to rule scope enabled check following review
peteharverson added a commit that referenced this pull request Jul 26, 2018
)

* [ML] Fixes enabled state of detector rule scope options

* [ML] Edit to rule scope enabled check following review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Anomaly Detection ML anomaly detection :ml review v6.4.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] Rules - scope options text disabled
4 participants