Skip to content

List related work items in the work item relationship widget

Rajan Mistry requested to merge 416558-create-work-item-relationship-widget into master

What does this MR do and why?

Note: This MR is part of the Work Items - Linked (Related) Items epic &7459 (closed). This particular MR lists the linked work items similar to issues.

Task Merge request Status
Extract Work item contents and create a wrapper !128088 (merged) Merged
Extract work_items_token_input.vue from app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue !128973 (merged) Merged
Create work items relationship shell !130456 (merged) Merged
Create a work_item_relationships component in the work_item_relationship folder which lists the linked items based on FF checks !130194 (merged) This MR
Create a work_item_relationship_form component in the work_item_relationship folder which allows to select relationship type, paste link, show autocompletions based on license and FF checks
Allow removing the linked item
Work with UX to reposition metadata for both Hierarchy and Relationship widgets

Screenshots or screen recordings

Empty list

List with linked work items

Screenshot 2023-09-06 at 11.46.36 AM.png

Screenshot 2023-09-06 at 11.45.01 AM.png

How to set up and validate locally

Prerequisites:

  1. Enable the OKRs feature as mentioned in the OKRs docs.
  2. Enable the feature flag Feature.enable(:linked_work_items)

Steps to verify:

  1. Login with any user
  2. Go to any Project > Issues > List
  3. Create an new Objective under New issue split button
  4. Go to Objective detail page
  5. Fire following query to link work items using graph-explorer
    • Mutation

      mutation workItemAddLinkedItems($input: WorkItemAddLinkedItemsInput!) {
        workItemAddLinkedItems(input: $input) {
          workItem {
            id
            widgets {
              ... on WorkItemWidgetLinkedItems {
                type
                linkedItems {
                  edges {
                    node {
                      linkId
                      linkType
                      workItem {
                        id
                        iid
                        confidential
                        workItemType {
                          id
                          name
                          iconName
                        }
                        title
                      }
                    }
                  }
                }
              }
            }
          }
          errors
        }
      }
    • Input

      {
        "input": {
          "id": "gid://gitlab/WorkItem/690",
          "linkType": "RELATED",
          "workItemsIds": [
            "gid://gitlab/WorkItem/642"
          ]
        }
      }
  6. Use different linkType like (RELATED, BLOCKS, BLOCKED_BY) to link work items
  7. Check different details in the Linked Items widget

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 #416558 (closed)

Edited by Rajan Mistry

Merge request reports

Loading