Skip to content

Refactor tasks URL to contain IID instead of ID

What does this MR do and why?

This MR implements a few changes:

  • it moves the logic for opening the Task modal on page load when the ?work_item_id URL parameter is present from description.vue to work_item_links.vue. Previously, we had this inconsistency - we opened the modal from the description on the page load and we opened modal on the task link click from the work items link component. This MR unifies modal behavior;
  • it adds the possibility to fetch tasks by iid instead of id when featuring flag :use_iid_in_work_items_path is enabled and when ?iid_path URL parameter is present

Screenshots or screen recordings

Fetched by ID Fetched by iid
Screenshot_2022-11-21_at_10.14.03 Screenshot_2022-11-21_at_10.14.47

How to set up and validate locally

  1. Enable the feature flag for using iid:
    Feature.enable(:use_iid_in_work_items_path)
  2. Open any issue and add a few tasks.
  3. Add ?iid_path=true to the URL.
  4. Click on the task to open it.
  5. You should see workItemByIid GraphQL query being called in the Network tab and `?work_item_iid=<X?" parameter in the URL.
  6. Refresh the page.
  7. After page load, you should see the modal with the same Task being open

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #381695 (closed)

Edited by Natalia Tepluhina

Merge request reports