-
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
[Security Solution][Detection Engine] hides 'run query' label on ES|QL rule creation #167912
[Security Solution][Detection Engine] hides 'run query' label on ES|QL rule creation #167912
Conversation
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
@vitaliidm I am sorry I am not very familiar with your code. Why are you using the unified search to render the ESQL editor and not immediately the editor? As it is done in The editor is on it own plugin so it should be used instead of the unified search component. |
We are already using unified search component in our rule form: kibana/x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx Line 16 in 361f92e
for various rule types: query, new terms, threshold, etc. Since this component(unified search SearchBar) supports ES|QL and we got a lot of Security Solution logic build on top of Thats why, the decision was to use the same component, instead of importing new one and integrate it into the Security Solution. |
I don't think we are going to add filters in ES|QL as filtering is already provided in the language. Unified search offers the editor but only as part of it (if you have the dataview picker and click Try it). I would like to avoid using the unified search for rendering only the editor because then if we need more customizations (as the one you are proposing here) that have nothing to do with the unified search component then we need to pass all these props to unified search. Is it a big change for you to render the editor instead for this case? We can sync and check it together if you want. |
If the only concern are customizations, if any new arise, we can reconsider to use ES|QL text editor directly again. For us, we would like to be synchronized with the functionality available in unified search component, as this something we are getting for free and don't need to re-implement on our side. For example: selecting languages, using filters, using saving queries and so on. Instead of supporting 2 components, where one of them already built-in in another and available inside it. Similarly, ES|QL also used in timeline: #166764, within unified search component, so it's not a unique use case Happy to sync if needed |
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.
We synced offline, it is actually a usage of unified search (they want to click the editor and expand it exactly as it happens in Discover) so this property makes sense.
In the future if we decide to do more customizations we might need to organize the editor customization properties in an object property but I think it is ok for now.
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @vitaliidm |
…L rule creation (elastic#167912) ## Summary - hides **Run query ⌘ + Enter** label on ES|QL text editor when create/edit rule - On unified search side, passes property `hideTextBasedRunQueryLabel` to underlying `TextBasedLangEditor` component ### Before <img width="1012" alt="Screenshot 2023-10-03 at 17 16 09" src="https://github.com/elastic/kibana/assets/92328789/8a063167-fd78-4afd-8e2a-0f1168e5a7eb"> ### After <img width="1099" alt="Screenshot 2023-10-03 at 17 16 45" src="https://github.com/elastic/kibana/assets/92328789/59819074-aab3-4367-a398-739f718368d0"> --------- Co-authored-by: Stratoula Kalafateli <[email protected]> (cherry picked from commit 01fdd67)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…on ES|QL rule creation (#167912) (#168205) # Backport This will backport the following commits from `main` to `8.11`: - [[Security Solution][Detection Engine] hides 'run query' label on ES|QL rule creation (#167912)](#167912) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Vitalii Dmyterko","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-10-06T10:50:28Z","message":"[Security Solution][Detection Engine] hides 'run query' label on ES|QL rule creation (#167912)\n\n## Summary\r\n\r\n- hides **Run query ⌘ + Enter** label on ES|QL text editor when\r\ncreate/edit rule\r\n- On unified search side, passes property `hideTextBasedRunQueryLabel`\r\nto underlying `TextBasedLangEditor` component\r\n\r\n### Before\r\n\r\n<img width=\"1012\" alt=\"Screenshot 2023-10-03 at 17 16 09\"\r\nsrc=\"https://github.com/elastic/kibana/assets/92328789/8a063167-fd78-4afd-8e2a-0f1168e5a7eb\">\r\n\r\n### After\r\n\r\n<img width=\"1099\" alt=\"Screenshot 2023-10-03 at 17 16 45\"\r\nsrc=\"https://github.com/elastic/kibana/assets/92328789/59819074-aab3-4367-a398-739f718368d0\">\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>","sha":"01fdd674891132ea9f3cac14e92b9933d3cbe53a","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Detections and Resp","Team: SecuritySolution","backport:prev-minor","Team:Detection Engine","v8.11.0","v8.12.0"],"number":167912,"url":"https://github.com/elastic/kibana/pull/167912","mergeCommit":{"message":"[Security Solution][Detection Engine] hides 'run query' label on ES|QL rule creation (#167912)\n\n## Summary\r\n\r\n- hides **Run query ⌘ + Enter** label on ES|QL text editor when\r\ncreate/edit rule\r\n- On unified search side, passes property `hideTextBasedRunQueryLabel`\r\nto underlying `TextBasedLangEditor` component\r\n\r\n### Before\r\n\r\n<img width=\"1012\" alt=\"Screenshot 2023-10-03 at 17 16 09\"\r\nsrc=\"https://github.com/elastic/kibana/assets/92328789/8a063167-fd78-4afd-8e2a-0f1168e5a7eb\">\r\n\r\n### After\r\n\r\n<img width=\"1099\" alt=\"Screenshot 2023-10-03 at 17 16 45\"\r\nsrc=\"https://github.com/elastic/kibana/assets/92328789/59819074-aab3-4367-a398-739f718368d0\">\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>","sha":"01fdd674891132ea9f3cac14e92b9933d3cbe53a"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/167912","number":167912,"mergeCommit":{"message":"[Security Solution][Detection Engine] hides 'run query' label on ES|QL rule creation (#167912)\n\n## Summary\r\n\r\n- hides **Run query ⌘ + Enter** label on ES|QL text editor when\r\ncreate/edit rule\r\n- On unified search side, passes property `hideTextBasedRunQueryLabel`\r\nto underlying `TextBasedLangEditor` component\r\n\r\n### Before\r\n\r\n<img width=\"1012\" alt=\"Screenshot 2023-10-03 at 17 16 09\"\r\nsrc=\"https://github.com/elastic/kibana/assets/92328789/8a063167-fd78-4afd-8e2a-0f1168e5a7eb\">\r\n\r\n### After\r\n\r\n<img width=\"1099\" alt=\"Screenshot 2023-10-03 at 17 16 45\"\r\nsrc=\"https://github.com/elastic/kibana/assets/92328789/59819074-aab3-4367-a398-739f718368d0\">\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>","sha":"01fdd674891132ea9f3cac14e92b9933d3cbe53a"}}]}] BACKPORT--> Co-authored-by: Vitalii Dmyterko <[email protected]>
…L rule creation (elastic#167912) ## Summary - hides **Run query ⌘ + Enter** label on ES|QL text editor when create/edit rule - On unified search side, passes property `hideTextBasedRunQueryLabel` to underlying `TextBasedLangEditor` component ### Before <img width="1012" alt="Screenshot 2023-10-03 at 17 16 09" src="https://github.com/elastic/kibana/assets/92328789/8a063167-fd78-4afd-8e2a-0f1168e5a7eb"> ### After <img width="1099" alt="Screenshot 2023-10-03 at 17 16 45" src="https://github.com/elastic/kibana/assets/92328789/59819074-aab3-4367-a398-739f718368d0"> --------- Co-authored-by: Stratoula Kalafateli <[email protected]>
Summary
hideTextBasedRunQueryLabel
to underlyingTextBasedLangEditor
componentBefore
After