Commit a3353c25 authored by Mario de la Ossa's avatar Mario de la Ossa Committed by Kushal Pandya

Add iid, epic_issue_id & group_id to sidebar

Expose `iid`, `epic_issue_id` & `group_id` for Issuable
sidebar
parent e367aafd
......@@ -65,6 +65,8 @@ Example response:
"title": "Accusamus iste et ullam ratione voluptatem omnis debitis dolor est.",
"description": "Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum.",
"state": "opened",
"web_edit_url": "http://localhost:3001/groups/test/-/epics/4",
"reference": "&4",
"author": {
"id": 10,
"name": "Lu Mayer",
......@@ -118,6 +120,8 @@ Example response:
"title": "Ea cupiditate dolores ut vero consequatur quasi veniam voluptatem et non.",
"description": "Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum.",
"state": "opened",
"web_edit_url": "http://localhost:3001/groups/test/-/epics/5",
"reference": "&5",
"author":{
"id": 7,
"name": "Pamella Huel",
......@@ -182,6 +186,8 @@ Example response:
"title": "Epic",
"description": "Epic description",
"state": "opened",
"web_edit_url": "http://localhost:3001/groups/test/-/epics/6",
"reference": "&6",
"author": {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
......@@ -247,6 +253,8 @@ Example response:
"title": "New Title",
"description": "Epic description",
"state": "opened",
"web_edit_url": "http://localhost:3001/groups/test/-/epics/6",
"reference": "&6",
"author": {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
......
......@@ -5,7 +5,12 @@ module EE
extend ActiveSupport::Concern
prepended do
expose :epic, using: EpicBaseEntity
expose :epic do
expose :epic, merge: true, using: EpicBaseEntity
expose :epic_issue_id do |issuable|
issuable.epic_issue&.id
end
end
expose :weight
end
end
......
......@@ -5,10 +5,12 @@ class EpicBaseEntity < Grape::Entity
include EntityDateHelper
expose :id
expose :iid
expose :title
expose :url do |epic|
group_epic_path(epic.group, epic)
end
expose :group_id
expose :human_readable_end_date, if: -> (epic, _) { epic.end_date.present? } do |epic|
epic.end_date&.to_s(:medium)
end
......
- if issuable_sidebar[:supports_epic]
- if issuable_sidebar[:features_available][:epics]
.block.epic
#js-vue-sidebar-item-epic
.title.hide-collapsed
Epic
= icon('spinner spin')
- if cookies[:epics_select_dropdown] == 'true'
#js-vue-sidebar-item-epics-select{ data: { can_edit: can_admin_issue?.to_s, group_id: @project.group.id, issue_id: @issuable.id, epic_issue_id: @issuable.epic_issue&.id } }
- else
.block.epic
#js-vue-sidebar-item-epic
.title.hide-collapsed
Epic
= icon('spinner spin')
- else
= render 'shared/promotions/promote_epics'
......@@ -260,11 +260,11 @@ module EE
expose :due_date_is_fixed?, as: :due_date_is_fixed, if: can_admin_epic
expose :due_date_fixed, :due_date_from_milestones, if: can_admin_epic
expose :state
expose :web_edit_url do |epic|
expose :web_edit_url, if: can_admin_epic do |epic|
::Gitlab::Routing.url_helpers.group_epic_path(epic.group, epic)
end
expose :reference do |epic|
epic.to_reference(epic.parent&.group)
expose :reference, if: { with_reference: true } do |epic|
epic.to_reference(full: true)
end
expose :created_at
expose :updated_at
......@@ -298,7 +298,9 @@ module EE
class EpicIssueLink < Grape::Entity
expose :id
expose :relative_position
expose :epic, using: EE::API::Entities::Epic
expose :epic do |epic_issue_link, _options|
::EE::API::Entities::Epic.represent(epic_issue_link.epic, with_reference: true)
end
expose :issue, using: ::API::Entities::IssueBasic
end
......
......@@ -8,7 +8,8 @@
"properties": {
"id": { "type": "integer" },
"title": { "type": "string" },
"url": { "type": "string" }
"url": { "type": "string" },
"epic_issue_id": { "type": ["integer", "null"] }
}
},
"weight": { "type": ["integer", "null"] }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment