-
Notifications
You must be signed in to change notification settings - Fork 919
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
[frontend/backend] add filters based on schema definition in the Add entities panels #6086
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6086 +/- ##
==========================================
- Coverage 66.73% 66.58% -0.16%
==========================================
Files 540 540
Lines 64184 64270 +86
Branches 5241 5224 -17
==========================================
- Hits 42833 42793 -40
- Misses 21351 21477 +126 ☔ View full report in Codecov by Sentry. |
727cdf2
to
eb6c942
Compare
cdc32a6
to
6368e31
Compare
handleAddFilter={helpers.handleAddFilter} | ||
handleRemoveFilter={helpers.handleRemoveFilter} | ||
handleSwitchLocalMode={helpers.handleSwitchLocalMode} | ||
handleSwitchGlobalMode={helpers.handleSwitchGlobalMode} |
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.
I am not sure about the impact as we had many children components that passed these props but we should try to remove it later.
With helpers
we can use all the functions that is related to this..
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.
yes it would be nice to refacto this later
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 pass those children + 'helpers' everywhere when listLines is called for the moment)
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.
this refacto was not done for the moment because there are about 100 files to modify and the release is soon
...tform/opencti-front/src/private/components/common/containers/ContainerAddStixCoreObjects.jsx
Show resolved
Hide resolved
...tform/opencti-front/src/private/components/common/containers/ContainerAddStixCoreObjects.jsx
Show resolved
Hide resolved
}; | ||
|
||
const LOCAL_STORAGE_KEY = `container-${containerId}-add-objects`; | ||
const { viewStorage, helpers, paginationOptions: addObjectsPaginationOptions } = usePaginationLocalStorage( |
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.
What is the goal of the hook? The filters should be saved in local storage?
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.
Yes. But not only the filters but there are some other utilities.
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.
But we are not saving it in local storage here? Or at least we are not fetching what is in local storage when loading the page as if I refresh I don't see the previous filters I made
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.
Yes, you are correct. I'm unsure about the intention here. The saving in localStorage is functional, but upon closing the drawer, we reset the state and clear all filters.
https://github.com/OpenCTI-Platform/opencti/pull/6086/files/eb6c9427dcab8747dfda8053e566206e15ad277a#diff-c501c533b095ec5c7f5b484df27e33d102e40b4369f12d850a58a82b465ea31bR419-R421
I believe we're utilizing the useLocalStoragePagination for the infinite loader rather than for storing the filter in localStorage.
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.
In this history, we are using here a simple filter state. If we can confirm the behavior, I can change the code and use "useFilterState" instead.
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.
See with the product. We will keep the state. I remove the resetState function
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.
Ok for me, need to resolve conflicts
Add filters in some 'Add entities' panels :