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

[SIEM] Add license check to ML Rule form #60691

Merged
merged 10 commits into from
Mar 23, 2020

Conversation

rylnd
Copy link
Contributor

@rylnd rylnd commented Mar 19, 2020

Summary

  • If the user doesn't have a platinum or trial license, we disable the ML card and change its text, with a link to the subscriptions marketing page
  • Adds aria-describedby and data-test-subj to new input fields

Fullscreen_3_19_20__4_12_PM

Checklist

Delete any items that are not applicable to this PR.

For maintainers

rylnd added 4 commits March 19, 2020 15:25
If they don't have a Platinum or Trial license, then we disable the ML
Card and provide them a link to the subscriptions marketing page.
This is already passed as isLoading
@rylnd rylnd added Team:SIEM v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.7.0 labels Mar 19, 2020
@rylnd rylnd self-assigned this Mar 19, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/siem (Team:SIEM)

@rylnd rylnd mentioned this pull request Mar 19, 2020
11 tasks
 Conflicts:
	x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/select_rule_type/index.tsx
	x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/step_define_rule/index.tsx
@rylnd rylnd requested a review from a team as a code owner March 20, 2020 16:32
@FrankHassanabad
Copy link
Contributor

Optional, I would update the checklist for the PR.

@@ -47,11 +90,10 @@ export const SelectRuleType: React.FC<SelectRuleTypeProps> = ({ field, isReadOnl
<EuiFlexItem>
<EuiCard
title={i18n.ML_TYPE_TITLE}
description={license ? i18n.ML_TYPE_DESCRIPTION : i18n.ML_TYPE_DISABLED_DESCRIPTION}
isDisabled={!license}
description={<MlCardDescription hasValidLicense={hasValidLicense} />}
icon={<EuiIcon size="l" type="machineLearningApp" />}
Copy link
Contributor

Choose a reason for hiding this comment

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

I played with adding:

isDisabled={isReadOnly || !hasValidLicense}

To see what it looked like if the whole thing was diasbled.

What you have now:
Screen Shot 2020-03-20 at 4 59 43 PM

vs if the whole thing was disabled:
Screen Shot 2020-03-20 at 5 03 55 PM

Up to you and design on which is better but I prefer the whole thing being disabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ended up going with the full-disabling, as it is more visually striking and a better CTA

export const SelectRuleType: React.FC<SelectRuleTypeProps> = ({
describedByIds = [],
field,
hasValidLicense = false,
Copy link
Contributor

Choose a reason for hiding this comment

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

You have these two taking values when they are defaulted by the SelectRuleTypeProps shows they cannot have defaults and are required?

If they are required I would just drop the defaulting or change the types to be ? variants where they are defaults.

Copy link
Contributor

@FrankHassanabad FrankHassanabad left a comment

Choose a reason for hiding this comment

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

Few questions about the optional parameters and one UI question but I checked this out and tested locally by flipping flags and this looks good as is.

LGTM, don't want to hold this up over small stuff.

rylnd added 4 commits March 20, 2020 21:36
If we're editing an existing rule, or if the user has an insufficient
license, we disable both the card and its selectability. This is more
visually striking, and a more obvious CTA.
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@rylnd rylnd merged commit 21e8cea into elastic:master Mar 23, 2020
@rylnd rylnd deleted the ml_rule_license_check branch March 23, 2020 16:10
gmmorris added a commit to gmmorris/kibana that referenced this pull request Mar 23, 2020
* master:
  [Uptime] Skip failing location test temporarily (elastic#60938)
  [ML] Disabling datafeed editing when job is running (elastic#60751)
  Adding `authc.invalidateAPIKeyAsInternalUser` (elastic#60717)
  [SIEM] Add license check to ML Rule form (elastic#60691)
  Adding `authc.grantAPIKeyAsInternalUser`  (elastic#60423)
  Support Histogram Data Type (elastic#59387)
  [Upgrade Assistant] Fix edge case where reindex op can falsely be seen as stale (elastic#60770)
  [SIEM] [Cases] Update case icons (elastic#60812)
  [TSVB] Fix percentiles band mode (elastic#60741)
rylnd added a commit that referenced this pull request Mar 23, 2020
* Gate ML Rules behind a license check

If they don't have a Platinum or Trial license, then we disable the ML
Card and provide them a link to the subscriptions marketing page.

* Add aria-describedby for new ML input fields

* Add data-test-subj to new ML input fields

* Remove unused prop

This is already passed as isLoading

* Fix capitalization on translation id

* Declare defaulted props as optional

* Gray out entire ML card when ML Rules are disabled

If we're editing an existing rule, or if the user has an insufficient
license, we disable both the card and its selectability. This is more
visually striking, and a more obvious CTA.
gmmorris added a commit to gmmorris/kibana that referenced this pull request Mar 23, 2020
* master: (26 commits)
  [Alerting] Fixes flaky test in Alert Instances Details page (elastic#60893)
  cleanup visualizations api (elastic#59958)
  Inline timezoneProvider function, remove ui/vis/lib/timezone  (elastic#60475)
  [SIEM] Adds 'Open one signal' Cypress test (elastic#60484)
  [UA] Upgrade assistant migration meta data can become stale (elastic#60789)
  [Metrics Alerts] Remove metric field from doc count on backend (elastic#60679)
  [Uptime] Skip failing location test temporarily (elastic#60938)
  [ML] Disabling datafeed editing when job is running (elastic#60751)
  Adding `authc.invalidateAPIKeyAsInternalUser` (elastic#60717)
  [SIEM] Add license check to ML Rule form (elastic#60691)
  Adding `authc.grantAPIKeyAsInternalUser`  (elastic#60423)
  Support Histogram Data Type (elastic#59387)
  [Upgrade Assistant] Fix edge case where reindex op can falsely be seen as stale (elastic#60770)
  [SIEM] [Cases] Update case icons (elastic#60812)
  [TSVB] Fix percentiles band mode (elastic#60741)
  Fix formatter on range aggregation (elastic#58651)
  Goodbye, legacy data plugin 👋 (elastic#60449)
  [Metrics UI] Alerting for metrics explorer and inventory (elastic#58779)
  [Remote clustersadopt changes to remote info API (elastic#60795)
  Only run xpack siem cypress in PRs when there are siem changes (elastic#60661)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:SIEM v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants