Skip to content

Update progress update mutation

Abhilash Kotte requested to merge akotte-show-start-end-in-fe into master

What does this MR do and why?

Update progress update mutation

Add start, end, and current values to progresswidgetinput and calculate progress based on these

Issue: gitlab-org/incubation-engineering/okr/meta#34 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

GraphQl Mutation

mutation {
  workItemUpdate(
    input: {id: "gid://gitlab/WorkItem/650", progressWidget: { currentValue: 20, startValue: 10, endValue: 30}}
  ) {
    workItem {
      ...WorkItem
      __typename
    }
    errors
    __typename
  }
}

fragment WorkItem on WorkItem {
  id
  iid
  title
  widgets {
    ...WorkItemWidgets
    __typename
  }
  __typename
}

fragment WorkItemWidgets on WorkItemWidget {
  ... on WorkItemWidgetProgress {
    type
    progress
    startValue
    endValue
    __typename
  }
}

GraphQl Response

{
  "data": {
    "workItemUpdate": {
      "workItem": {
        "id": "gid://gitlab/WorkItem/650",
        "iid": "46",
        "title": "ONJJJJJJ",
        "widgets": [
          {
            "__typename": "WorkItemWidgetAssignees"
          },
          {
            "__typename": "WorkItemWidgetLabels"
          },
          {
            "__typename": "WorkItemWidgetDescription"
          },
          {
            "__typename": "WorkItemWidgetHierarchy"
          },
          {
            "__typename": "WorkItemWidgetMilestone"
          },
          {
            "__typename": "WorkItemWidgetNotes"
          },
          {
            "__typename": "WorkItemWidgetHealthStatus"
          },
          {
            "type": "PROGRESS",
            "progress": 50,
            "startValue": 10,
            "endValue": 30,
            "__typename": "WorkItemWidgetProgress"
          },
          {
            "__typename": "WorkItemWidgetNotifications"
          },
          {
            "__typename": "WorkItemWidgetCurrentUserTodos"
          },
          {
            "__typename": "WorkItemWidgetAwardEmoji"
          }
        ],
        "__typename": "WorkItem"
      },
      "errors": [],
      "__typename": "WorkItemUpdatePayload"
    }
  }
}

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

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

Edited by Abhilash Kotte

Merge request reports

Loading