Fix #4124: Boards: Hide tasks from hidden projects #4186
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.
#4124
The visibility of each task aligns with the visibility of the corresponding project in the boards section.
Description
The issue was that the toggleHideFromMenu function in the project service was never being called, and there was no interaction between the visibility of a project and its associated tasks.
Implementation
I introduced a flag in tasks called unavailable, which changes according to the visibility of the respective project.
Previously, when changing the project's visibility in side-nav.component.html, the toggleProjectVisibility function in side-nav.component.ts was called, directly modifying the isHiddenFromMenu flag of the project.
Now, nav.component.html calls toggleProjectVisibility in side-nav.component.ts, which invokes the projectHideFromMenu service, triggering the toggleHideFromMenu action.
In the project reducer, the isHiddenFromMenu flag is updated, and in the tasks reducer, the unavailable flags of all tasks associated with the project are updated accordingly.
When the board selects tasks to display, it uses a new selector called selectAllAvailableTasksWithSubTasks, which filters only the tasks that are available.