[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.
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.
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.
Yes if the user is not set server.publicBaseUrl it will be shown as in your screenshot.
There was a problem hiding this comment.
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.
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.
Should (Auto-created) be translated? What about the description or the grouping description?
There was a problem hiding this comment.
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.
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.
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.
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.
| return `${description} The assigned alerts are grouped by ${groupingDescription}.`; | ||
| } | ||
|
|
||
| return `${description}`; |
There was a problem hiding this comment.
shouldn't this be just return description?
|
@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