-
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
[Fleet] Feature to support columns when exporting agents to CSV #203103
Conversation
I agree that it is not easy directly from the string, but if I'm not wrong we build the filter with the function getKuery. Maybe as a follow up we could search for a way to use the values provided to |
Thanks for the review! |
{ | ||
field: 'field', | ||
name: 'Description', | ||
render: (field: string) => { |
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.
nit: what do you think of having a translated description colocated with the field definition?
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.
thanks for the suggestion, updated
Pinging @elastic/fleet (Team:Fleet) |
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.
One small suggestion otherwise LGTM 🚀
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
History
|
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.
LGTM 🚀
I'll create another pr to fix the search issue. |
Starting backport for target branches: 8.x |
…tic#203103) ## Summary Closes elastic/ingest-dev#4325 Added modal window with column selector table when agents are exported. There are some differences compared to the design due to technical limitations: - `Filters applied` badge not included, it's not really possible to accurately calculate the count of filters, since they are stored in a single string. We could potentially count by splitting AND/OR conditions, but it may not be accurate. Do we still want to include it? - We don't have display names for these mappings coming from the agent index, and currently I don't have a way to show display names on the exported file. For this reason showing the original field names on the modal too. - Added a Description column that transforms the field name to a more readable name, we can also hardcode the descriptions if this is not good enough. - After some consideration, I decided to hardcode the allowed field list to export other than querying dynamically from the agent index mappings, otherwise new sensitive field mappings would show up on the UI. - Caveat: searching on columns in the modal removes the already selected columns that do not match. This seems to be a default behaviour of the EuiTable, I find it a little strange, didn't see a straightforward way to change it. I can spend more time on it if needed. To verify: - Select a few agents, click on Export CSV action - Verify that the modal window opens with the agent mappings visible, by default the columns on the UI selected - Select a few columns to export - Submit the modal - Wait for the report to be ready and download it - Verify that the exported csv includes the columns selected <img width="1301" alt="image" src="https://github.com/user-attachments/assets/71b549a7-a316-45d4-b017-f5eedec6ea7e"> Figma design:  <img width="2138" alt="image" src="https://github.com/user-attachments/assets/77ffc5d7-343f-4d5c-8b65-251e1cac94d4"> ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios (cherry picked from commit 6e145f9)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…#203103) (#203548) # Backport This will backport the following commits from `main` to `8.x`: - [[Fleet] Feature to support columns when exporting agents to CSV (#203103)](#203103) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Bardi","email":"90178898+juliaElastic@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-12-10T11:54:51Z","message":"[Fleet] Feature to support columns when exporting agents to CSV (#203103)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/ingest-dev/issues/4325\r\n\r\nAdded modal window with column selector table when agents are exported.\r\n\r\nThere are some differences compared to the design due to technical\r\nlimitations:\r\n- `Filters applied` badge not included, it's not really possible to\r\naccurately calculate the count of filters, since they are stored in a\r\nsingle string. We could potentially count by splitting AND/OR\r\nconditions, but it may not be accurate. Do we still want to include it?\r\n- We don't have display names for these mappings coming from the agent\r\nindex, and currently I don't have a way to show display names on the\r\nexported file. For this reason showing the original field names on the\r\nmodal too.\r\n- Added a Description column that transforms the field name to a more\r\nreadable name, we can also hardcode the descriptions if this is not good\r\nenough.\r\n- After some consideration, I decided to hardcode the allowed field list\r\nto export other than querying dynamically from the agent index mappings,\r\notherwise new sensitive field mappings would show up on the UI.\r\n- Caveat: searching on columns in the modal removes the already selected\r\ncolumns that do not match. This seems to be a default behaviour of the\r\nEuiTable, I find it a little strange, didn't see a straightforward way\r\nto change it. I can spend more time on it if needed.\r\n\r\nTo verify:\r\n- Select a few agents, click on Export CSV action\r\n- Verify that the modal window opens with the agent mappings visible, by\r\ndefault the columns on the UI selected\r\n- Select a few columns to export\r\n- Submit the modal\r\n- Wait for the report to be ready and download it\r\n- Verify that the exported csv includes the columns selected\r\n\r\n<img width=\"1301\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/71b549a7-a316-45d4-b017-f5eedec6ea7e\">\r\n\r\n\r\nFigma design:\r\n\r\n\r\n\r\n<img width=\"2138\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/77ffc5d7-343f-4d5c-8b65-251e1cac94d4\">\r\n\r\n\r\n### Checklist\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"6e145f9d4ebb17b8eefd01ce688f7c2b9b461172","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Fleet","v9.0.0","release_note:feature","backport:prev-minor"],"title":"[Fleet] Feature to support columns when exporting agents to CSV","number":203103,"url":"https://github.com/elastic/kibana/pull/203103","mergeCommit":{"message":"[Fleet] Feature to support columns when exporting agents to CSV (#203103)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/ingest-dev/issues/4325\r\n\r\nAdded modal window with column selector table when agents are exported.\r\n\r\nThere are some differences compared to the design due to technical\r\nlimitations:\r\n- `Filters applied` badge not included, it's not really possible to\r\naccurately calculate the count of filters, since they are stored in a\r\nsingle string. We could potentially count by splitting AND/OR\r\nconditions, but it may not be accurate. Do we still want to include it?\r\n- We don't have display names for these mappings coming from the agent\r\nindex, and currently I don't have a way to show display names on the\r\nexported file. For this reason showing the original field names on the\r\nmodal too.\r\n- Added a Description column that transforms the field name to a more\r\nreadable name, we can also hardcode the descriptions if this is not good\r\nenough.\r\n- After some consideration, I decided to hardcode the allowed field list\r\nto export other than querying dynamically from the agent index mappings,\r\notherwise new sensitive field mappings would show up on the UI.\r\n- Caveat: searching on columns in the modal removes the already selected\r\ncolumns that do not match. This seems to be a default behaviour of the\r\nEuiTable, I find it a little strange, didn't see a straightforward way\r\nto change it. I can spend more time on it if needed.\r\n\r\nTo verify:\r\n- Select a few agents, click on Export CSV action\r\n- Verify that the modal window opens with the agent mappings visible, by\r\ndefault the columns on the UI selected\r\n- Select a few columns to export\r\n- Submit the modal\r\n- Wait for the report to be ready and download it\r\n- Verify that the exported csv includes the columns selected\r\n\r\n<img width=\"1301\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/71b549a7-a316-45d4-b017-f5eedec6ea7e\">\r\n\r\n\r\nFigma design:\r\n\r\n\r\n\r\n<img width=\"2138\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/77ffc5d7-343f-4d5c-8b65-251e1cac94d4\">\r\n\r\n\r\n### Checklist\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"6e145f9d4ebb17b8eefd01ce688f7c2b9b461172"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203103","number":203103,"mergeCommit":{"message":"[Fleet] Feature to support columns when exporting agents to CSV (#203103)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/ingest-dev/issues/4325\r\n\r\nAdded modal window with column selector table when agents are exported.\r\n\r\nThere are some differences compared to the design due to technical\r\nlimitations:\r\n- `Filters applied` badge not included, it's not really possible to\r\naccurately calculate the count of filters, since they are stored in a\r\nsingle string. We could potentially count by splitting AND/OR\r\nconditions, but it may not be accurate. Do we still want to include it?\r\n- We don't have display names for these mappings coming from the agent\r\nindex, and currently I don't have a way to show display names on the\r\nexported file. For this reason showing the original field names on the\r\nmodal too.\r\n- Added a Description column that transforms the field name to a more\r\nreadable name, we can also hardcode the descriptions if this is not good\r\nenough.\r\n- After some consideration, I decided to hardcode the allowed field list\r\nto export other than querying dynamically from the agent index mappings,\r\notherwise new sensitive field mappings would show up on the UI.\r\n- Caveat: searching on columns in the modal removes the already selected\r\ncolumns that do not match. This seems to be a default behaviour of the\r\nEuiTable, I find it a little strange, didn't see a straightforward way\r\nto change it. I can spend more time on it if needed.\r\n\r\nTo verify:\r\n- Select a few agents, click on Export CSV action\r\n- Verify that the modal window opens with the agent mappings visible, by\r\ndefault the columns on the UI selected\r\n- Select a few columns to export\r\n- Submit the modal\r\n- Wait for the report to be ready and download it\r\n- Verify that the exported csv includes the columns selected\r\n\r\n<img width=\"1301\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/71b549a7-a316-45d4-b017-f5eedec6ea7e\">\r\n\r\n\r\nFigma design:\r\n\r\n\r\n\r\n<img width=\"2138\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/77ffc5d7-343f-4d5c-8b65-251e1cac94d4\">\r\n\r\n\r\n### Checklist\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"6e145f9d4ebb17b8eefd01ce688f7c2b9b461172"}}]}] BACKPORT--> Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
## Summary Closes elastic/ingest-dev#4324 - Added tour component for Export CSV feature, it goes away on`Close tour` - Removed search in column selection - Tried a few ways to fix the search not to remove the existing selection (see in #203103), but doesn't seem possible with EuiTable. Removed for now as there aren't that many columns, and don't want to leave it in as is. <img width="1772" alt="image" src="https://github.com/user-attachments/assets/464f8247-bc2d-45d5-8fd4-96d790a40833"> <img width="860" alt="image" src="https://github.com/user-attachments/assets/5d3058f0-2e52-4248-af34-0dfa1c149417">
## Summary Closes elastic/ingest-dev#4324 - Added tour component for Export CSV feature, it goes away on`Close tour` - Removed search in column selection - Tried a few ways to fix the search not to remove the existing selection (see in elastic#203103), but doesn't seem possible with EuiTable. Removed for now as there aren't that many columns, and don't want to leave it in as is. <img width="1772" alt="image" src="https://github.com/user-attachments/assets/464f8247-bc2d-45d5-8fd4-96d790a40833"> <img width="860" alt="image" src="https://github.com/user-attachments/assets/5d3058f0-2e52-4248-af34-0dfa1c149417"> (cherry picked from commit 96573a4)
…tic#203103) ## Summary Closes elastic/ingest-dev#4325 Added modal window with column selector table when agents are exported. There are some differences compared to the design due to technical limitations: - `Filters applied` badge not included, it's not really possible to accurately calculate the count of filters, since they are stored in a single string. We could potentially count by splitting AND/OR conditions, but it may not be accurate. Do we still want to include it? - We don't have display names for these mappings coming from the agent index, and currently I don't have a way to show display names on the exported file. For this reason showing the original field names on the modal too. - Added a Description column that transforms the field name to a more readable name, we can also hardcode the descriptions if this is not good enough. - After some consideration, I decided to hardcode the allowed field list to export other than querying dynamically from the agent index mappings, otherwise new sensitive field mappings would show up on the UI. - Caveat: searching on columns in the modal removes the already selected columns that do not match. This seems to be a default behaviour of the EuiTable, I find it a little strange, didn't see a straightforward way to change it. I can spend more time on it if needed. To verify: - Select a few agents, click on Export CSV action - Verify that the modal window opens with the agent mappings visible, by default the columns on the UI selected - Select a few columns to export - Submit the modal - Wait for the report to be ready and download it - Verify that the exported csv includes the columns selected <img width="1301" alt="image" src="https://github.com/user-attachments/assets/71b549a7-a316-45d4-b017-f5eedec6ea7e"> Figma design:  <img width="2138" alt="image" src="https://github.com/user-attachments/assets/77ffc5d7-343f-4d5c-8b65-251e1cac94d4"> ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
## Summary Closes elastic/ingest-dev#4324 - Added tour component for Export CSV feature, it goes away on`Close tour` - Removed search in column selection - Tried a few ways to fix the search not to remove the existing selection (see in elastic#203103), but doesn't seem possible with EuiTable. Removed for now as there aren't that many columns, and don't want to leave it in as is. <img width="1772" alt="image" src="https://github.com/user-attachments/assets/464f8247-bc2d-45d5-8fd4-96d790a40833"> <img width="860" alt="image" src="https://github.com/user-attachments/assets/5d3058f0-2e52-4248-af34-0dfa1c149417">
# Backport This will backport the following commits from `main` to `8.x`: - [[Fleet] added tour component, removed search (#203741)](#203741) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Bardi","email":"90178898+juliaElastic@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-12-12T10:39:32Z","message":"[Fleet] added tour component, removed search (#203741)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/ingest-dev/issues/4324\r\n\r\n- Added tour component for Export CSV feature, it goes away on`Close\r\ntour`\r\n- Removed search in column selection\r\n- Tried a few ways to fix the search not to remove the existing\r\nselection (see in #203103), but\r\ndoesn't seem possible with EuiTable. Removed for now as there aren't\r\nthat many columns, and don't want to leave it in as is.\r\n\r\n<img width=\"1772\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/464f8247-bc2d-45d5-8fd4-96d790a40833\">\r\n \r\n<img width=\"860\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/5d3058f0-2e52-4248-af34-0dfa1c149417\">","sha":"96573a40c1d9b2429dafd1f88abda3a9a9c0171a","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-minor"],"title":"[Fleet] added tour component, removed search","number":203741,"url":"https://github.com/elastic/kibana/pull/203741","mergeCommit":{"message":"[Fleet] added tour component, removed search (#203741)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/ingest-dev/issues/4324\r\n\r\n- Added tour component for Export CSV feature, it goes away on`Close\r\ntour`\r\n- Removed search in column selection\r\n- Tried a few ways to fix the search not to remove the existing\r\nselection (see in #203103), but\r\ndoesn't seem possible with EuiTable. Removed for now as there aren't\r\nthat many columns, and don't want to leave it in as is.\r\n\r\n<img width=\"1772\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/464f8247-bc2d-45d5-8fd4-96d790a40833\">\r\n \r\n<img width=\"860\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/5d3058f0-2e52-4248-af34-0dfa1c149417\">","sha":"96573a40c1d9b2429dafd1f88abda3a9a9c0171a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203741","number":203741,"mergeCommit":{"message":"[Fleet] added tour component, removed search (#203741)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/ingest-dev/issues/4324\r\n\r\n- Added tour component for Export CSV feature, it goes away on`Close\r\ntour`\r\n- Removed search in column selection\r\n- Tried a few ways to fix the search not to remove the existing\r\nselection (see in #203103), but\r\ndoesn't seem possible with EuiTable. Removed for now as there aren't\r\nthat many columns, and don't want to leave it in as is.\r\n\r\n<img width=\"1772\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/464f8247-bc2d-45d5-8fd4-96d790a40833\">\r\n \r\n<img width=\"860\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/5d3058f0-2e52-4248-af34-0dfa1c149417\">","sha":"96573a40c1d9b2429dafd1f88abda3a9a9c0171a"}}]}] BACKPORT--> Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
## Summary Closes elastic/ingest-dev#4324 - Added tour component for Export CSV feature, it goes away on`Close tour` - Removed search in column selection - Tried a few ways to fix the search not to remove the existing selection (see in elastic#203103), but doesn't seem possible with EuiTable. Removed for now as there aren't that many columns, and don't want to leave it in as is. <img width="1772" alt="image" src="https://github.com/user-attachments/assets/464f8247-bc2d-45d5-8fd4-96d790a40833"> <img width="860" alt="image" src="https://github.com/user-attachments/assets/5d3058f0-2e52-4248-af34-0dfa1c149417">
Summary
Closes https://github.com/elastic/ingest-dev/issues/4325
Note: Added
release_note:feature
because this is the first time we are enabling the feature flag for the whole Export CSV feature.Added modal window with column selector table when agents are exported.
There are some differences compared to the design due to technical limitations:
Filters applied
badge not included, it's not really possible to accurately calculate the count of filters, since they are stored in a single string. We could potentially count by splitting AND/OR conditions, but it may not be accurate. Do we still want to include it?To verify:
Figma design:

Checklist