Refactor FiltersService by extracting Filter model and centralising filter logic#506
Open
e1121208 wants to merge 2 commits intoCATcher-org:mainfrom
Open
Refactor FiltersService by extracting Filter model and centralising filter logic#506e1121208 wants to merge 2 commits intoCATcher-org:mainfrom
e1121208 wants to merge 2 commits intoCATcher-org:mainfrom
Conversation
added 2 commits
August 14, 2025 15:45
Previously, filter-related state and logic were tightly coupled inside FiltersService, leading to a monolithic service that handled both URL serialisation, preset views, and direct filter state management. This made the service harder to maintain, test, and extend, and mixed concerns of state management with data transformation. Let’s extract the Filter class and related types (FilterProps, FilterUpdate) into a dedicated model (filters.model.ts). The Filter class now encapsulates: • Immutable state with .clone() for updates • Serialisation and deserialisation from plain objects or query parameters • Default instance creation via createDefault FiltersService now consumes the Filter model instead of managing raw filter state, simplifying preset view logic, URL synchronisation, and sanitisation of labels, milestones, and assignees. All filter transformations are centralised in the Filter model, improving separation of concerns, maintainability, and testability.
…stants in filters.constants.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Fixes #405
Type of change:
Changes Made:
Screenshots:
Functionality of WATcher still remains the same as observed below.

Proposed Commit Message:
Checklist: