kibana/packages/kbn-securitysolution-exception-list-components
Khristinin Nikita 35dc121c95
Value lists modal window (#179339)
##  Value List Items Modal Window

Experimental flag: **valueListItemsModal**

it's temporarily true and will be set to false, before merge


2aafe007-734f-4c0e-b542-5eca229e310d

Added a new modal window that lets users interact with value lists
directly. This modal supports viewing, searching, adding, deleting,
updating, and uploading items.

Where to find the modal window:
- Value list popup
- Exception editing and viewing on both the rule page and shared
exceptions management page
Permissions:

Add, edit, delete, and upload buttons are hidden for read-only users.
The modal link is not shown to users without read permissions.


### Changes to API
I added optional **refresh** flag for list items API, because we want to
see the changes in UI, when editing list items

### How to review

All new components is here -
`x-pack/plugins/security_solution/public/value_list/`
New hooks - `packages/kbn-securitysolution-list-hooks/`
API calls - `packages/kbn-securitysolution-list-api`
Actual API - `x-pack/plugins/lists/server/routes`

There also some props drilling into exceptions package, which is not
ideal, please let me know if you have better ideas

[test plan](https://github.com/elastic/security-team/pull/9128)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 19:45:52 +02:00
..
src Value lists modal window (#179339) 2024-04-15 19:45:52 +02:00
index.ts [Security Solution][Artifacts][Trusted Apps] Wildcard warning with IS operator for trusted apps creation/editing (#175356) 2024-02-13 21:43:25 -07:00
jest.config.js [Security Solution][Exceptions] - Create/ refactor Exception-List common's components in @kbn/securitysolution-exception-list-components (#143363) 2022-10-19 19:33:17 +02:00
kibana.jsonc [Security Solution] Clean up CODEOWNERS and other files for the Detection Engine team (#159729) 2023-06-14 10:39:50 -07:00
package.json flag packages without side effects (#173351) 2023-12-19 02:46:39 -07:00
README.md [Security Solution][Exceptions] - Create/ refactor Exception-List common's components in @kbn/securitysolution-exception-list-components (#143363) 2022-10-19 19:33:17 +02:00
setup_test.ts Exceptions List component (#140985) 2022-09-28 20:36:05 +02:00
tsconfig.json [Security Solution][Artifacts][Trusted Apps] Wildcard warning with IS operator for trusted apps creation/editing (#175356) 2024-02-13 21:43:25 -07:00

@kbn/securitysolution-exception-list-components

Common exceptions' components

Aim

  • To have most of the Exceptions' components in one place, to be shared accross multiple pages and used for different logic.
  • This package holds the presetational part of the components only as the API or the logic part should reside under the consumer page

Pattern used

component
    index.tsx
    index.styles.ts <-- to hold styles if the component has many custom styles
    use_component.ts <-- for logic if the Presentational Component has logic
    component.test.tsx
    use_component.test.tsx
  

Testing

In order to unify our testing tools, we configured only two libraries, the React-Testing-Library to test the component UI part and the Reat-Testing-Hooks to test the component's UI interactions

Styling

In order to follow the KBN-Packages's recommendations, to define a custom CSS we can only use the @emotion/react or @emotion/css libraries

Next

  • Now the ExceptionItems, ExceptionItemCard and ExceptionItemCardMetaInfo receive securityLinkAnchorComponent, exceptionsUtilityComponent , and exceptionsUtilityComponent as props to avoid moving all the common components under the x-pack at once, later we should move all building blocks to this kbn-package