Add todo quick action to work items
What does this MR do and why?
Related to #412277 (closed)
- Adds quick actions for toggling todos in a work item:
-
/todo
-> Adds a todo for the current user, available only if no pending todos are present -
/done
-> Marks todo as done, available only if a pending todo is present
- Fixes todos creation for work items to use the correct class in the
target_type
column.
Screenshots or screen recordings
Screen_Recording_2023-06-22_at_15.52.02
How to set up and validate locally
- In rails console enable flags and create a task
# Enable FFs
Feature.enable(:work_items_mvc)
# Create task
user, project = User.first, Project.first
task_type_id = WorkItems::Type.find_by(name: 'Task').id
task = WorkItem.create!(title: 'task 1', author: user, project: project, work_item_type_id: task_type_id, issue_type: :task)
task.id # take note of its ID
- Visit the task at
https://gdk.test:3000/gitlab-org/gitlab-test/-/work_items/<task_id>
- Verify that
/done
action is not available as there are no pending todos - Verify that
/todo
quick action is available and adds a todo (reloading the page should turn the todo icon blue) - Once the work item has a pending todo the
/done
action should be available and mark the todo as done.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Eugenia Grieff