feat: blocked tasks blocking#2891
Conversation
|
working on the concern ux |
Preview DeploymentPreview deployments for this PR are available at:
The preview environment will start automatically on first visit. Subsequent pushes to this PR will update the Run locally with Dockerdocker pull ghcr.io/go-vikunja/vikunja:pr-2891
docker run -p 3456:3456 ghcr.io/go-vikunja/vikunja:pr-2891Last updated for commit a8bce2e |
|
@kolaente :) ping pong |
|
@kolaente is this something you require me to resolve conflicts and work? or you never want this feature and are gonna close? this way i save any more efforts in this PR if so |
|
Hey sorry for the silence! I have a bunch of things on my plate right now with my day job and other Vikunja things. I would like to have this feature and think it makes sense to have it, just need to set aside some time to review it properly. Don't worry about the conflicts, we'll resolve these shortly before merging. |
Make sense! Thank you for the reply and it's understandable! Will resolve the conflicts 🫂 |
|
Please check the failing frontend lint though |
| "14001": "The provided api token is invalid.", | ||
| "14002": "The permission {permission} of group {group} is invalid." | ||
| "14002": "The permission {permission} of group {group} is invalid.", | ||
| "20001": "This task is blocked by incomplete tasks and cannot be marked as done." |
There was a problem hiding this comment.
Why two times the same message?
There was a problem hiding this comment.
It's the pretty much the same as in line 944
|
will clear the comments, lints and merge and update shortly. |
5c69958 to
696cc2c
Compare
|
the comments have been addressed. |
|
@kolaente i did some cleanup, I know you asked me to return the list and frontend just builts msg for it. Until i realise frontend already has the knowledge of the tasks and can check locally for just relationships. So i did that. This saves an api call i presume and thats good right? 🤔 tho i am still worried of some edge case scenarios maybe you help me on confirm this. |
|
it might be possible in the kanban or gantt view that the subtasks are not loaded for certain filters. But as you said, that's an edge case. You could do a fallback thing: If the tasks are not present locally, do a fetch. |
|
Ahhhh make sense. Will do it and reply back. |
Resolves #2194
This pull request introduces logic to enforce task blocking: tasks that are blocked by other incomplete tasks cannot be marked as complete. It adds a new error type for this scenario, updates the task update process to check for blockers, and provides comprehensive tests to ensure the correct enforcement of blocking relationships.
Task blocking enforcement:
Task.updateSingleTaskto prevent marking a task as complete if any blocking tasks are not yet completed, returning a newErrTaskIsBlockederror with details about the blockers.getActiveBlockingRelationsto retrieve all incomplete tasks that are blocking a given task.Error handling improvements:
ErrTaskIsBlockederror type, including HTTP error mapping, error code, and human-readable details about blocking tasks; also added a function to check for this error type.Testing enhancements:
TestTaskBlockingEnforcementto verify that blocked tasks cannot be completed until all blockers are done, and to check error details and edge cases.