Files
plane/apps/api
Jayash Tripathy 9fbb1a42d0 [WEB-4125] [WEB-4824] feat: dashboard widget rich filters (#3881)
* feat: rich filters store architecture and UI components

* improvements: minor enhancements for rich filters
* added button configuration to add filters button
* added option to disable transition for filter item
* fixed filter item label truncation
* added support for changing work item filter config keys

* improvements: add filter button config initialization

* feat: done basic  setup of rich filters in dashboard widgets

* refactor: clean up whitespace in widget type definitions

* feat: implement complex filtering backend for Django REST Framework

* Added ComplexFilterBackend to support advanced JSON-based filtering with logical operators.
* Introduced DashboardWidgetIssueFilterSet for filtering issues based on various criteria.
* Updated widget views to utilize the new filtering capabilities.
* Refactored widget_graph_plot.py to streamline query construction.
* Added README documentation for the filters module detailing usage and examples.

* chore: update filter configurations and clean up

* Enhance ComplexFilterBackend for improved performance and documentation

* Updated WidgetListEndpoint to pass the view instance to the filter method.
* Optimized NOT operations to use subqueries instead of large IN clauses for better performance.
* Removed deprecated range filter validation logic.
* Expanded README documentation to include performance considerations and advanced usage examples for NOT operations.

* Refactor DashboardWidgetIssueFilterSet to use custom filter methods for soft delete exclusion

* Replaced direct field lookups with custom filter methods for assignee, cycle, module, mention, and label IDs to exclude soft deleted records.
* Added new filter methods for label ID and label ID in to enhance filtering capabilities.
* Improved code readability and maintainability by centralizing filtering logic.

* refactor: remove unused export for TAutomationConditionFilterExpression in widget.ts

* fix: types

* chore: added more filters

* refactor: made the TFilterValue typed and add config for boolean

* refactor: made TFilterValue typed and add config for boolean

* Refactor WidgetListEndpoint to streamline issue filtering logic

* Updated the issue filtering process to first retrieve workspace by slug, improving clarity and maintainability.
* Consolidated filtering conditions into a single query for better performance and readability.
* Enhanced the DashboardWidgetIssueFilterSet to utilize the new filtering capabilities for label IDs.

* Enhance ComplexFilterBackend with depth validation and structure checks

* Introduced maximum depth validation for complex filters to prevent excessive nesting.
* Added structure validation to ensure proper JSON format for filter nodes.
* Implemented detailed error handling for various filter scenarios, improving robustness and user feedback.

* Refactor WidgetListEndpoint to improve workspace and dashboard retrieval

* Updated the WidgetListEndpoint to retrieve the workspace by slug before querying the dashboard, enhancing clarity and maintainability.
* Replaced multiple filter conditions with workspace ID for dashboard and widget queries, improving performance and consistency.
* Removed redundant workspace retrieval from the end of the method to streamline the code.

* chore: remove boolean filter value input

* improvements: define value type for filter configs

* chore: add default value type for filter configs

* chore: minor type updates for filter configs

* imrovement: type safety of the operators in rich filters

* refactor: reverted to old types of rich filters

* refactor: reverted to old label of rich filters

* refactor: enhance dashboard widget filters with new adapter and HOC

- Replaced the existing WidgetConfigSidebarFilters with EnhancedWidgetConfigSidebarFilters to support new filter logic.
- Introduced DashboardWidgetFilterAdapter for converting between internal and external filter expressions.
- Updated filter configurations to use the new external filter structure.
- Removed the old filters adapter and adjusted related types for better clarity and maintainability.
- Cleaned up imports and improved code organization in the filters components.

* chore: cleanup

* chore: cleanup

* refactor: update dashboard filters and add observable for filters

* refactor: comment out draft filter configuration in dashboard filters

* ♻️  refactor:  adaptor to have comma separated array values and removed draft filter config

* ♻️ refactor: updated the default value for the empty expression

* ♻️ refactor: value sanitization for empty values

*  feat: enhance sidebar filters with loading state and optimized data fetching

* 🧹 chore: remove duplicate export of work-item-filters from utils index

* 🎨 style: update button variant in sidebar filters from neutral-primary to accent-primary

* 🔧 fix: update dependency in withFilters to include handleSubmit in effect dependencies

* 🔧 fix: update _parseFilterValue to handle SingleOrArray type for filter values

* Removed unnecessary code

* ♻️ refactor: integrate workspace project fetching and improve dashboard filter handling

* 🔧 fix: rename EXTERNAL_OPERATOR_SEPARATOR to EXTERNAL_WIDGET_OPERATOR_SEPARATOR for consistency in filter handling

---------

Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
Co-authored-by: Dheeraj Kumar Ketireddy <dheeru0198@gmail.com>
2025-09-02 12:37:15 +05:30
..
2025-07-04 15:37:59 +05:30
2025-07-04 17:56:59 +05:30
2025-07-04 15:32:21 +05:30
2025-09-01 19:38:21 +05:30
2025-07-04 15:37:59 +05:30