-
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
[SIEM] ML Rules Details #61182
[SIEM] ML Rules Details #61182
Conversation
Don't display the row as fullwidth, lest the help text wrap across the entire page. It only looks okay now because it was a short sentence; adding the ML Job select with its wrapped text caused some visual weirdness, so this at least makes it consistent.
This is displayed both on the readonly form view, and the Rule Details page.
This is a base hook that we can combine with our permissions helpers.
If we're auto-activating jobs on their behalf, they'll need to be an admin.
This adds the auditMessage as well as a link to ML; actual status is next
Also simplifies the layout of these job details.
UseSiemJobs uses uiSettings, so we need to use our kibana mocks here.
Pinging @elastic/siem (Team:SIEM) |
[] | ||
); | ||
const listItems = keys.reduce((acc: ListItems[], key: string) => { | ||
if (key === 'machineLearningJobId') { |
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.
I added this branch here because I didn't want to add yet another optional argument to buildListItems
that would only be used in one case.
|
||
import { isJobStarted, isJobLoading, isJobFailed } from './'; | ||
|
||
describe('isJobStarted', () => { |
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.
Yaaay! Tests for verifying job states -- thanks @rylnd! 🎉🥇
@@ -101,6 +102,7 @@ export interface MlSetupArgs { | |||
* Representation of an ML Job as returned from the `ml/jobs/jobs_summary` API | |||
*/ | |||
export interface JobSummary { | |||
auditMessage?: AuditMessageBase; |
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.
Nice that we can use the explicit ML types! ++ 🎉
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.
I was a little wary of this one... I'm getting no linter complaints, and that file is just types, so I think we should be fine.
The long job names were causing the panel to overflow.
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.
Checked out, tested locally, and performed code review -- LGTM! Thanks for the added cleanup around MlCapabilitiesContext
with useMlCapabilities
as well. Nice clean code as always @rylnd! 🙂 👍
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* Add basic help text to ML Job dropdown on Rule form * Use EUI's preferred layout for form fields * Add a link to ML in the Job select help text * Restrict timeline picker to EUI guidelines Don't display the row as fullwidth, lest the help text wrap across the entire page. It only looks okay now because it was a short sentence; adding the ML Job select with its wrapped text caused some visual weirdness, so this at least makes it consistent. * Add placeholder option to ML Job dropdown * Humanize rule type on Rule Description component This is displayed both on the readonly form view, and the Rule Details page. * Add useMlCapabilities hook This is a base hook that we can combine with our permissions helpers. * Restrict ML Rule creation to ML Admins If we're auto-activating jobs on their behalf, they'll need to be an admin. * Extract ML Job status helpers to separate file * WIP: Enrich Rule Description with ML Job Data This adds the auditMessage as well as a link to ML; actual status is next * Display job status as a badge on Rule Details Also simplifies the layout of these job details. * Port helper tests to new location * Fix DescriptionStep tests now that they use useSiemJobs UseSiemJobs uses uiSettings, so we need to use our kibana mocks here. * Fix responsiveness of ML Rule Details The long job names were causing the panel to overflow.
@@ -266,3 +268,27 @@ export const buildNoteDescription = (label: string, note: string): ListItems[] = | |||
} | |||
return []; | |||
}; | |||
|
|||
export const buildRuleTypeDescription = (label: string, ruleType: RuleType): ListItems[] => { |
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.
@MadameSheema here's the terminal point of those Rule Details changes if you're interested. I haven't addressed the sliders discrepancy but I'll ping you on that when it's resolved!
Pinging @elastic/security-solution (Team: SecuritySolution) |
Summary
Checklist
Delete any items that are not applicable to this PR.
For maintainers