Skip to content

Commit 10811f8

Browse files
refactor: make dataset filters use the shared filters and cleanup all the individual components (#1957)
## Description Refactor dataset and proposal filtering to a shared, configurable filter architecture and modernize the proposal dashboard into composable components ## Motivation Background on use case, changes needed ## Fixes: Please provide a list of the fixes implemented in this PR * Items added ## Changes: Please provide a list of the changes implemented by this PR * changes made ## Tests included - [x] Included for each change/fix? - [x] Passing? (Merge will not be approved unless this is checked) ## Documentation - [ ] swagger documentation updated \[required\] - [ ] official documentation updated \[nice-to-have\] ### official documentation info If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included ## Backend version - [ ] Does it require a specific version of the backend - which version of the backend is required: ## Summary by Sourcery Refactor dataset and proposal filtering to a shared, configurable filter architecture and modernize the proposal dashboard into composable components New Features: - Introduce SharedFilterComponent and SharedFilterModule to replace individual filter components - Add FullTextSearchBarComponent and FullTextSearchBarModule for unified text searching - Create ProposalTableComponent, ProposalSideFilterComponent, and ProposalSearchBarComponent for the proposal dashboard Enhancements: - Unify dataset filter actions and selectors into generic multiselect, dateRange, and text filters - Replace fetchCountAction with fetchFacetCountsAction and update effects/reducers to handle facet counts - Refactor proposal-dashboard.component and datasets-filter.component to use shared filter modules and stream queryParams Tests: - Update unit tests and selectors to match new filter types and facet counts - Adjust Cypress tests to trigger searches via search-button instead of direct input ## Summary by Sourcery Refactor dataset and proposal filtering to a shared, configurable filter architecture, replacing individual filter components and actions with a unified SharedFilter component and generic filter actions/reducers, and modernize the proposal dashboard and UI by introducing faceted multi-select and numeric range filters while updating tests accordingly New Features: - Introduce a generic SharedFilterComponent and SharedFilterModule that supports text, dateRange, multiSelect, and numeric range filters - Add MultiSelectFilterComponent for faceted multi-selection filtering and NgxNumericRangeFormField modules for numeric range inputs - Update DatasetsFilterComponent and ProposalDashboardComponent to use shared filter configurations and sync filter state via query parameters Enhancements: - Replace individual dataset filter actions and reducers with generic addDatasetFilterAction, removeDatasetFilterAction, and setFiltersAction - Centralize FilterConfig and ConditionConfig definitions in the user store and remove legacy filter components and label mappings - Unify dataset selectors to dynamically derive facets from enabled filters and streamline router navigation on filter updates Tests: - Update unit tests and reducer specs to validate new generic filter actions and selectors - Add comprehensive tests for numeric range form field container and control components - Adapt existing component and end-to-end tests to use the shared filter interface and search-button triggers --------- Co-authored-by: junjiequan <[email protected]>
1 parent 875e382 commit 10811f8

File tree

95 files changed

+2188
-4534
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+2188
-4534
lines changed

CI/e2e/frontend.config.e2e.json

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,6 @@
106106
"authorization": ["#datasetAccess", "#datasetPublic"]
107107
}
108108
],
109-
"labelMaps": {
110-
"filters": {
111-
"LocationFilter": "Location",
112-
"PidFilter": "Pid",
113-
"GroupFilter": "Group",
114-
"TypeFilter": "Type",
115-
"KeywordFilter": "Keyword",
116-
"DateRangeFilter": "Start Date - End Date",
117-
"TextFilter": "Text"
118-
}
119-
},
120109
"defaultDatasetsListSettings": {
121110
"columns": [
122111
{
@@ -199,13 +188,48 @@
199188
}
200189
],
201190
"filters": [
202-
{ "LocationFilter": true },
203-
{ "PidFilter": true },
204-
{ "GroupFilter": true },
205-
{ "TypeFilter": true },
206-
{ "KeywordFilter": true },
207-
{ "DateRangeFilter": true },
208-
{ "TextFilter": true }
191+
{
192+
"key": "creationLocation",
193+
"label": "Location",
194+
"type": "multiSelect",
195+
"description": "Filter by creation location on the dataset",
196+
"enabled": true
197+
},
198+
{
199+
"key": "pid",
200+
"label": "Pid",
201+
"type": "text",
202+
"description": "Filter by dataset pid",
203+
"enabled": true
204+
},
205+
{
206+
"key": "ownerGroup",
207+
"label": "Group",
208+
"type": "multiSelect",
209+
"description": "Filter by owner group of the dataset",
210+
"enabled": true
211+
},
212+
{
213+
"key": "type",
214+
"label": "Type",
215+
"type": "multiSelect",
216+
"description": "Filter by dataset type",
217+
"enabled": true
218+
},
219+
{
220+
"key": "keywords",
221+
"label": "Keyword",
222+
"type": "multiSelect",
223+
"description": "Filter by keywords in the dataset",
224+
"enabled": true
225+
},
226+
{
227+
"key": "creationTime",
228+
"label": "Creation Time",
229+
"type": "dateRange",
230+
"description": "Filter by creation time of the dataset",
231+
"enabled": true
232+
}
209233
],
210234
"conditions": []
211235
},

0 commit comments

Comments
 (0)