Skip to content

Hide Assignees for epic work items

Abhilash Kotte requested to merge akotte/hide-assignees-for-epics into master

What does this MR do and why?

Hide Assignees for epic work items

Introduce a new FF work_items_epics_show_assignees to hide assignees widget for epic type when ff is disabled.

Issue: #473248 (closed)

How to set up and validate locally

To test this locally, you need to enable WI at group level, so you will have to enable these feature flags namespace_level_work_items (If you are still unable to access work-item page for an epic then enable/disable FF from this list - &11777 )

  1. Visit Epics page and try to create a new EPIC(If all relevant FF's are enabled then you should see a modal when you click on New Epic)
  2. Open the newly created epic and replace epics in the URL with work_items, SO the target URL would be something like http://127.0.0.1:3000/groups/flightjs/-/work_items/6
  3. You should not see Assignees widget
  4. From Graphql explorer use the below mutation to update assingees and it should fail with a error message saying "Widget not supported"
  5. Enabled FF work_items_epics_show_assignees and you should now see assignee widget and update it via UI/GraphQl mutation
Mutation to update assignee
mutation workItemUpdate($input: WorkItemUpdateInput!) {
  workItemUpdate(input: $input) {
    workItem {
      ...WorkItem
      __typename
    }
    errors
    __typename
  }
}

fragment WorkItem on WorkItem {
  id
  iid
  archived
  title
  state
  description
  confidential
  createdAt
  closedAt
  webUrl
  reference(full: true)
  createNoteEmail
  namespace {
    id
    fullPath
    name
    __typename
  }
  author {
    ...Author
    __typename
  }
  workItemType {
    id
    name
    iconName
    __typename
  }
  userPermissions {
    deleteWorkItem
    updateWorkItem
    adminParentLink
    setWorkItemMetadata
    createNote
    adminWorkItemLink
    __typename
  }
  widgets {
    ...WorkItemWidgets
    __typename
  }
  __typename
}

fragment WorkItemWidgets on WorkItemWidget {
  type
  ... on WorkItemWidgetDescription {
    description
    descriptionHtml
    lastEditedAt
    lastEditedBy {
      name
      webPath
      __typename
    }
    taskCompletionStatus {
      completedCount
      count
      __typename
    }
    __typename
  }
  ... on WorkItemWidgetAssignees {
    allowsMultipleAssignees
    canInviteMembers
    assignees {
      nodes {
        ...User
        __typename
      }
      __typename
    }
    __typename
  }
  ... on WorkItemWidgetLabels {
    allowsScopedLabels
    labels {
      nodes {
        ...Label
        __typename
      }
      __typename
    }
    __typename
  }
  ... on WorkItemWidgetParticipants {
    participants {
      nodes {
        ...User
        __typename
      }
      __typename
    }
    __typename
  }
  ... on WorkItemWidgetStartAndDueDate {
    dueDate
    startDate
    __typename
  }
  ... on WorkItemWidgetTimeTracking {
    timeEstimate
    timelogs {
      nodes {
        ...TimelogFragment
        __typename
      }
      __typename
    }
    totalTimeSpent
    __typename
  }
  ...RolledupDatesFragment
  ... on WorkItemWidgetWeight {
    weight
    rolledUpWeight
    widgetDefinition {
      editable
      rollUp
      __typename
    }
    __typename
  }
  ... on WorkItemWidgetProgress {
    progress
    updatedAt
    __typename
  }
  ... on WorkItemWidgetHierarchy {
    hasChildren
    hasParent
    parent {
      id
      iid
      title
      confidential
      webUrl
      workItemType {
        id
        name
        iconName
        __typename
      }
      __typename
    }
    __typename
  }
  ... on WorkItemWidgetIteration {
    iteration {
      description
      id
      iid
      title
      startDate
      dueDate
      webUrl
      updatedAt
      iterationCadence {
        id
        title
        __typename
      }
      __typename
    }
    __typename
  }
  ... on WorkItemWidgetMilestone {
    milestone {
      ...MilestoneFragment
      __typename
    }
    __typename
  }
  ... on WorkItemWidgetNotes {
    discussionLocked
    __typename
  }
  ... on WorkItemWidgetHealthStatus {
    healthStatus
    __typename
  }
  ... on WorkItemWidgetNotifications {
    subscribed
    __typename
  }
  ... on WorkItemWidgetCurrentUserTodos {
    currentUserTodos(state: pending) {
      nodes {
        id
        __typename
      }
      __typename
    }
    __typename
  }
  ... on WorkItemWidgetLinkedItems {
    linkedItems {
      nodes {
        linkId
        linkType
        workItem {
          id
          iid
          confidential
          workItemType {
            id
            name
            iconName
            __typename
          }
          title
          state
          createdAt
          closedAt
          webUrl
          reference(full: true)
          widgets {
            ...WorkItemMetadataWidgets
            ...WorkItemMetadataWidgetsExtras
            __typename
          }
          __typename
        }
        __typename
      }
      __typename
    }
    __typename
  }
  ... on WorkItemWidgetColor {
    color
    textColor
    __typename
  }
  ... on WorkItemWidgetDevelopment {
    type
    willAutoCloseByMergeRequest
    closingMergeRequests {
      nodes {
        fromMrDescription
        mergeRequest {
          iid
          id
          title
          webUrl
          state
          project {
            id
            name
            namespace {
              path
              __typename
            }
            __typename
          }
          assignees {
            nodes {
              webUrl
              id
              name
              webPath
              avatarUrl
              __typename
            }
            __typename
          }
          __typename
        }
        __typename
      }
      __typename
    }
    __typename
  }
  __typename
}

fragment Label on Label {
  id
  title
  description
  color
  textColor
  __typename
}

fragment User on User {
  id
  avatarUrl
  name
  username
  webUrl
  webPath
  __typename
}

fragment MilestoneFragment on Milestone {
  expired
  id
  title
  state
  startDate
  dueDate
  webPath
  __typename
}

fragment TimelogFragment on WorkItemTimelog {
  __typename
  id
  timeSpent
  user {
    id
    name
    __typename
  }
  spentAt
  note {
    id
    body
    __typename
  }
  summary
  userPermissions {
    adminTimelog
    __typename
  }
}

fragment WorkItemMetadataWidgets on WorkItemWidget {
  type
  ... on WorkItemWidgetStartAndDueDate {
    dueDate
    startDate
    __typename
  }
  ... on WorkItemWidgetWeight {
    weight
    rolledUpWeight
    widgetDefinition {
      editable
      rollUp
      __typename
    }
    __typename
  }
  ... on WorkItemWidgetProgress {
    progress
    updatedAt
    __typename
  }
  ... on WorkItemWidgetHealthStatus {
    healthStatus
    __typename
  }
  ... on WorkItemWidgetMilestone {
    milestone {
      ...MilestoneFragment
      __typename
    }
    __typename
  }
  ... on WorkItemWidgetAssignees {
    allowsMultipleAssignees
    canInviteMembers
    assignees {
      nodes {
        ...User
        __typename
      }
      __typename
    }
    __typename
  }
  ... on WorkItemWidgetLabels {
    allowsScopedLabels
    labels {
      nodes {
        ...Label
        __typename
      }
      __typename
    }
    __typename
  }
  __typename
}

fragment WorkItemMetadataWidgetsExtras on WorkItemWidget {
  ...RolledupDatesFragment
  ... on WorkItemWidgetIteration {
    iteration {
      description
      id
      iid
      title
      startDate
      dueDate
      updatedAt
      iterationCadence {
        title
        __typename
      }
      __typename
    }
    __typename
  }
  ... on WorkItemWidgetNotifications {
    subscribed
    __typename
  }
  ... on WorkItemWidgetCurrentUserTodos {
    currentUserTodos(state: pending) {
      nodes {
        id
        __typename
      }
      __typename
    }
    __typename
  }
  __typename
}

fragment RolledupDatesFragment on WorkItemWidgetRolledupDates {
  type
  dueDate
  dueDateFixed
  dueDateIsFixed
  startDate
  startDateFixed
  startDateIsFixed
  __typename
}

fragment Author on User {
  id
  avatarUrl
  name
  username
  webUrl
  webPath
  __typename
}
Variabled
{
  "input": {
    "id": "gid://gitlab/WorkItem/675",
    "assigneesWidget": {
      "assigneeIds": [
 
      ]
    }
  }
}

Merge request reports

Loading