-
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
[Cases] Case action enhancements and fixes #180758
Conversation
/ci |
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
.map(([key, value]) => { | ||
const keyAsCodeBlock = `\`${key}\``; | ||
const valueAsCodeBlock = `\`${convertValueToString(value)}\``; | ||
const description = `This case was created by the Case action in ${ruleName}.`; |
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.
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.
Good point. If you see my screenshot in the description if you have set the server.publicBaseUrl: 'https://localhost:5601'
in your kibana.dev.yml
the name of the rule would be a URL. Quotation marks seem more suitable with links. Wdyt?
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.
Ah I like how it looks in the screenshot, imo that is ideal and we dont need the quotation marks.
Is there any scenario where no URL is rendered and we just have the name?
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.
Yes if the user is not set server.publicBaseUrl
it will be shown as in your screenshot.
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 tested the changes and the fixes work.
I left one small comment about the Case description.
Regarding the bug I found previously you mention the following in this PR's Summary:
the only way to do it properly is to validate while the user is typing which is going to lead to bad UX
Why only during typing? We already have an error being shown, can't we prevent the user from clicking Save
if the form has errors?
I tried other fields and saving is not allowed if they have errors. This behavior is not consistent with the rest of the sidepanel.
Screen.Recording.2024-04-15.at.10.57.49.mov
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.
Verified again and it works as expected. 👍
We already have an error being shown, can't we prevent the user from clicking Save if the form has errors?
Agree with @adcoelho We prevent to save when there is an error. We should keep similar behaviour for group by alert field.
x-pack/plugins/cases/server/connectors/cases/cases_connector_executor.ts
Outdated
Show resolved
Hide resolved
const ruleNameTrimmed = ruleName.slice(0, MAX_TITLE_LENGTH - suffix.length - 1); | ||
const suffix = `${ | ||
groupingDescription.length > 0 ? ` - Grouping by ${groupingDescription}` : '' | ||
}${oracleCounter > INITIAL_ORACLE_RECORD_COUNTER ? ` (${oracleCounter})` : ''} (Auto-created)`; |
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.
Should (Auto-created)
be translated? What about the description or the grouping description?
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.
Hey! I do not think we should translate them because this content is generated dynamically on the server side. It is not a static text on the UI.
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.
ok but if I might nitpick a bit, I think we should answer another question. Should the user be seeing it in their default set language or in english? I disagree that depending where it comes from it should be translated or not. IMO it's better UX.
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.
To be honest, I am not sure what is the best practice here and what we do in Kibana. @lcawl what we should do here?
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'm not sure if either of these links are helpful: https://eui.elastic.co/#/utilities/i18n or https://github.com/elastic/kibana/tree/main/packages/kbn-i18n. However I agree that we should try to translate these phrases if it's possible.
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.
Done in 81667dd
(#180758)
return `${description} The assigned alerts are grouped by ${groupingDescription}.`; | ||
} | ||
|
||
return `${description}`; |
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.
shouldn't this be just return description
?
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.
Done af0baec
(#180758)
@adcoelho @js-jankisalvi We can only disable the |
x-pack/plugins/cases/server/connectors/cases/cases_connector_executor.ts
Outdated
Show resolved
Hide resolved
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
History
To update your PR or re-run it, just comment with: cc @cnasikas |
Summary
In this PR:
The issue about the "Unknown" user will be fixed in another PR.
About @adcoelho bug:
rule_grouping_UI_issue.mov
I think it is fine to leave it as it is because a) the value will not be saved even if they are added b) an error is being shown c) the only way to do it properly is to validate while the user is typing which is going to lead to bad UX. If you feel otherwise let me know.
Checklist
Delete any items that are not applicable to this PR.
For maintainers