Add type quick action for converting work items type
What does this MR do and why?
Related to #385227 (closed)
Adds the /type
quick action to convert a work item to the specified type. This command is behind the feature flag work_items_mvc_2
Note that flash notifications are not yet implemented for the work item view so the command message will not be displayed (issue: Surface quick action errors (#391281)).
This MR also adds a new usage counter event (needed for QuickActions::InterpretService#usage_ping_tracking
).
Screenshots or screen recordings
How to set up and validate locally
- In rails console enable the feature flag and create a task
Feature.enable(:work_items_mvc_2) project, user = Project.first, User.first type = ::WorkItems::Type.default_by_type(:task) task = WorkItem.create!(project: project, author: user, title: 'Test task to convert', issue_type: :task, work_item_type: work_item_type) task_url = "http://gdk.test:3000/#{project.full_path}/-/work_items/#{task.iid}"
- Visit the task URL and try the quick action in a comment:
/type Issue
- Verify that a new note is created and the type changed to issue:
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