Skip to content

PR 1/2 - feat(challenge-filters): add logic to manage language tags selected filters#768

Merged
ivilarop merged 34 commits intodevelopfrom
feature232/Add-logic-to-manage-language-tags-slected-filters
Mar 5, 2026
Merged

PR 1/2 - feat(challenge-filters): add logic to manage language tags selected filters#768
ivilarop merged 34 commits intodevelopfrom
feature232/Add-logic-to-manage-language-tags-slected-filters

Conversation

@otrocadev
Copy link
Collaborator

@otrocadev otrocadev commented Feb 19, 2026

Description of the task

As part of the new filtering system refactor, the challenge filters modal needs support for tag-based filtering. Currently, the challenge-filters-trigger component does not manage tags dynamically and lacks the logic required to retrieve and display them depending on the selected languages.

Important

This task introduces the data flow and logic necessary to enable tag filtering. It prepares the filter system for the next UI-focused step of the parent task #230. This PR focuses on functionality and data handling. Styling improvements will be handled in #231

What does this task aim to accomplish?

The goal is to dynamically retrieve tags based on the languages selected by the user and allow them to be selected as part of the filtering criteria.

To achieve this:

  • A language ID → name map is propagated from the language filter component
  • Tags are fetched per selected language
  • Tags are grouped by language and displayed as selectable checkboxes
  • Selected tag IDs are emitted to the parent component when filters are applied

📁 Files changed or created

Changes:

language-filter.component.ts

  • Emits language ID → name mapping on initialization

challenge-list-filters.component.ts

  • Passes the language map to challenge-filters-trigger

challenge-filters-trigger.component.ts

  • Fetches tags per selected language using ChallengeFormService.getTagsByLanguage()
  • Groups tags by language name
  • Tracks selected tag IDs in draftFilters.tags
  • Emits selected tag IDs on Apply
  • Restores previously selected tags when reopening the modal

Definition of done

  • Tags are fetched dynamically when the filter modal opens based on selected languages
  • Tags are grouped and displayed by language name
  • Users can select/deselect individual tags
  • Selected tag IDs are emitted to the parent via filtersApplied
  • Previously selected tags remain checked when reopening the modal

Out of scope in this task

  • Persisting filter state across sessions
  • UI styling or visual polishing handled in #231

Tests / Verification

Manual verification:
• Selecting languages updates available tags
• Tags appear grouped by language
• Applying filters emits correct tag IDs
• Reopening modal restores selected tags

@otrocadev otrocadev marked this pull request as ready for review February 19, 2026 20:51
@otrocadev otrocadev changed the title Feature232/add logic to manage language tags slected filters PR 1/2 - feat(challenge-filters): add logic to manage language tags selected filters Feb 19, 2026
JungleGiu

This comment was marked as resolved.

Copy link
Collaborator

@JungleGiu JungleGiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice implementation. I was confused at first since I expected to see the tags appear as I selected languages (I think the modifications to the challenge-filters-trigger template threw me off), but I understand that my PR and yours are strictly related, as you need my implementation to make yours work. Maybe change some details in the PR explanation can help everybody understand this better

Hopefully we won’t encounter too many conflicts during the merging process. I saw that you anticipated this with a parallel event, so it shouldn’t create any major issues. Maybe we can open a future PR to integrate our changes even better.

All tests pass! Approved!

Copy link
Collaborator

@vaniaferreresteban vaniaferreresteban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the logic of the tagItems should be out of the filter logic, but it's also truth that the filter is who decides what will be challanges... the other components must use this source to manage a single truth, let's discuss tomorrow.

Copy link
Collaborator

@vaniaferreresteban vaniaferreresteban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's true that you need adittional filtering of the tags to display on your branch, the overlap query is needed for now, let's create a tech debt and link that to this pr

@sonarqubecloud
Copy link

@ivilarop ivilarop merged commit f828dfb into develop Mar 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FE] Add the logic to manage the language of the tags selected

5 participants