[SIEM] Add license check to ML Rule form#60691
Conversation
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
|
Pinging @elastic/siem (Team:SIEM) |
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
|
Optional, I would update the checklist for the PR. |
| description={license ? i18n.ML_TYPE_DESCRIPTION : i18n.ML_TYPE_DISABLED_DESCRIPTION} | ||
| isDisabled={!license} | ||
| description={<MlCardDescription hasValidLicense={hasValidLicense} />} | ||
| icon={<EuiIcon size="l" type="machineLearningApp" />} |
There was a problem hiding this comment.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
...egacy/plugins/siem/public/pages/detection_engine/rules/components/select_rule_type/index.tsx
Outdated
Show resolved
Hide resolved
FrankHassanabad
left a comment
There was a problem hiding this comment.
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.
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.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* 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)
* 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.
* 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) ...


Summary
aria-describedbyanddata-test-subjto new input fieldsChecklist
Delete any items that are not applicable to this PR.
Documentation was added for features that require explanation or tutorialsThis was checked for keyboard-only and screenreader accessibilityThis renders correctly on smaller devices using a responsive layout. (You can test this in your browserThis was checked for cross-browser compatibility, including a check against IE11For maintainers