Skip to content

Fix #4124: Boards: Hide tasks from hidden projects #4186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidrr21
Copy link

#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.

The visibility of each task is in accordance with the
visibility of the corresponding project in the boards
section
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hello there davidrr21! 👋

Thank you and congrats 🎉 for opening your first PR on this project! ✨ 💖

We will try to review it soon!

Copy link
Owner

@johannesjo johannesjo left a comment

Choose a reason for hiding this comment

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

Thank you very much for this! While I generally would like to see this feature, I think I'd prefer if the this would be done on the data mapping level rather, than changing the actual (persisted) model.

@@ -113,6 +113,24 @@ export const taskReducer = createReducer<TaskState>(
});
}),

on(toggleHideFromMenu, (state, { projectId, allTaskIds, isHiddenFromMenu }) => {
Copy link
Owner

Choose a reason for hiding this comment

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

I'd rather avoid updating the task model itself for this, since it might complicate things further down the road, adds additional data size and logically the hidden state belongs more to the project model, than the task model.

@johannesjo johannesjo added the needs work PRs that need additional changes. label Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs work PRs that need additional changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants