Skip to content

[DO NOT MERGE] Add fields to New epic work item form

Simon Knox requested to merge psi-epic-form into master

What does this MR do and why?

Work items at the group level - create epic fro... (#429127)

Behind namespace_level_work_items feature flag (also recommend work_items_beta and work_items_mvc_2)

  1. Adds widgets to the New Epic form on /groups/gitlab-org/-/epics/ page
  2. Moves form to drawer (was previously modal)
  3. ??

What works?

  1. Drawer shows all fields, and the /groups/gitlab-org/-/work_items/new shows fields for each work item type
  2. Can create epic with title, description, confidentiality toggles (top-level fields)

widg

What doesn't work?

  1. Widgets!

Assignees kind of works visually: it has an assignees prop, so we can update it from outside. But it still doesn't save – workItemCreate mutation does not support assignees widget. Can work around this for now by doing create, then update for missing fields.

Labels does not work; the widget only gets fullPath & iid. Since this is the New page there is no iid, so the query is currently @skiped. I can still emit a value but debating the best way to update the UI.

Could go the assignees way (add a labels prop to labels widget), but I am leaning toward passing the entire workItem as a prop to all widgets instead, then they can use workItem.iid from that.

Then they can be passed either an actual work item query response, or this draft object (same shape as a work item). There is probably a way to do this all in Apollo but am not currently sure how.

So we'd have something more like:

<work-item-assignees-with-edit
  work-item="workItem" 
  @error="$emit('error', $event)"
  @update="$emit('updateWorkItemAttribute', 'assignees', $event)"
/>
<work-item-labels-with-edit
  work-item="workItem" 
  @error="$emit('error', $event)"
  @update="$emit('updateWorkItemAttribute', 'labels', $event)"
/>
<work-item-weight
  work-item="workItem" 
  @error="$emit('error', $event)"
  @update="$emit('updateWorkItemAttribute', 'weight', $event)"
/>

@update is only used if there is no workItem.iid/id fields, otherwise the widgets will do mutations like they currently do.

Edited by Simon Knox

Merge request reports