opencti icon indicating copy to clipboard operation
opencti copied to clipboard

[frontend/backend] Add available filter keys to stored filters for CSV feeds

Open Goumies opened this issue 1 year ago • 5 comments

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 image
  • Update your entity type selection by removing one
  • The related filter has been automatically removed

Goumies avatar May 23 '24 13:05 Goumies

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.

codecov[bot] avatar May 23 '24 14:05 codecov[bot]

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) : image

Archidoit avatar May 28 '24 07:05 Archidoit

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

image

Archidoit avatar May 28 '24 07:05 Archidoit

Behavior OK but some code improvements to do (cf comments)

Archidoit avatar May 30 '24 09:05 Archidoit

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.

Goumies avatar May 30 '24 16:05 Goumies

Behavior ok :) waiting for the answer about types

Archidoit avatar Jun 04 '24 14:06 Archidoit