[frontend/backend] Add available filter keys to stored filters for CSV feeds
Closes #5844
Proposed changes
- Add available filter keys from the backend for Data sharing >CSV feeds (chunk# 2)
- Clean filters on entity type update
- Test filter key schema
Related issues
- https://github.com/OpenCTI-Platform/opencti/issues/5844
Checklist
- [x] I consider the submitted work as finished
- [x] I tested the code for its functionality
- [x] I wrote test cases for the relevant uses case (coverage and e2e)
- [ ] I added/update the relevant documentation (either on github or on notion)
- [ ] Where necessary I refactored code to improve the overall quality
Further comments
To check the filters cleaning on entity type update:
- Add at least one filter. It must be based on a specific entity type attributes.
For example, for Reports -> report types, for Indicator -> pattern
- Update your entity type selection by removing one
- The related filter has been automatically removed
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 67.55%. Comparing base (
fb59229) to head (a846014).
Additional details and impacted files
@@ Coverage Diff @@
## master #7098 +/- ##
==========================================
+ Coverage 67.54% 67.55% +0.01%
==========================================
Files 561 561
Lines 68747 68747
Branches 5838 5841 +3
==========================================
+ Hits 46437 46444 +7
+ Misses 22310 22303 -7
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
In a CSV feed, I selected only one entity type (ex: City), but in the filters lists the filters are separated between 'most used filters' and 'other filters' (this separation should only occurs when more than 1 entity type is selected) :
Select the entity types 'City' and 'Region' Add the filter 'entity type'. In the filter list values, all the entity types existing are available. This list should be limited to the previously selected entity types
Behavior OK but some code improvements to do (cf comments)
Behavior OK but some code improvements to do (cf comments)
Those explicit typings were required by the frontend tests of the CI. I will try to remove them.
Behavior ok :) waiting for the answer about types