[DO NOT MERGE] Add fields to New epic work item form
What does this MR do and why?
Work items at the group level - create epic fro... (#429127 - closed)
Behind namespace_level_work_items
feature flag (also recommend work_items_beta
and work_items_mvc_2
)
- Adds widgets to the New Epic form on
/groups/gitlab-org/-/epics/
page - Moves form to drawer (was previously modal)
- ??
What works?
- Drawer shows all fields, and the
/groups/gitlab-org/-/work_items/new
shows fields for each work item type - Can create epic with title, description, confidentiality toggles (top-level fields)
What doesn't work?
- 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 @skip
ed. 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.