Commit 7c21775a authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch '321385-cablett-epic-board-weburl-webpath' into 'master'

Expose GraphQL web URL and path for epic boards

See merge request gitlab-org/gitlab!54277
parents 31a5664d a8b28dfe
......@@ -3,7 +3,7 @@
module Types
class BoardType < BaseObject
graphql_name 'Board'
description 'Represents a project or group board'
description 'Represents a project or group issue board'
accepts ::Board
authorize :read_board
......
......@@ -1603,7 +1603,7 @@ enum BlobViewersType {
}
"""
Represents a project or group board
Represents a project or group issue board
"""
type Board {
"""
......@@ -9490,7 +9490,7 @@ type EpicBoard {
hideClosedList: Boolean
"""
Global ID of the board.
Global ID of the epic board.
"""
id: BoardsEpicBoardID!
......@@ -9525,9 +9525,19 @@ type EpicBoard {
): EpicListConnection
"""
Name of the board.
Name of the epic board.
"""
name: String
"""
Web path of the epic board.
"""
webPath: String!
"""
Web URL of the epic board.
"""
webUrl: String!
}
"""
......
......@@ -4260,7 +4260,7 @@
{
"kind": "OBJECT",
"name": "Board",
"description": "Represents a project or group board",
"description": "Represents a project or group issue board",
"fields": [
{
"name": "assignee",
......@@ -26126,7 +26126,7 @@
},
{
"name": "id",
"description": "Global ID of the board.",
"description": "Global ID of the epic board.",
"args": [
],
......@@ -26207,7 +26207,7 @@
},
{
"name": "name",
"description": "Name of the board.",
"description": "Name of the epic board.",
"args": [
],
......@@ -26218,6 +26218,42 @@
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "webPath",
"description": "Web path of the epic board.",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "webUrl",
"description": "Web URL of the epic board.",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
......@@ -438,7 +438,7 @@ Autogenerated return type of AwardEmojiToggle.
### Board
Represents a project or group board.
Represents a project or group issue board.
| Field | Type | Description |
| ----- | ---- | ----------- |
......@@ -1699,9 +1699,11 @@ Represents an epic board.
| ----- | ---- | ----------- |
| `hideBacklogList` | Boolean | Whether or not backlog list is hidden. |
| `hideClosedList` | Boolean | Whether or not closed list is hidden. |
| `id` | BoardsEpicBoardID! | Global ID of the board. |
| `id` | BoardsEpicBoardID! | Global ID of the epic board. |
| `lists` | EpicListConnection | Epic board lists. |
| `name` | String | Name of the board. |
| `name` | String | Name of the epic board. |
| `webPath` | String! | Web path of the epic board. |
| `webUrl` | String! | Web URL of the epic board. |
### EpicBoardCreatePayload
......
......@@ -9,11 +9,13 @@ module Types
accepts ::Boards::EpicBoard
authorize :read_epic_board
present_using ::Boards::EpicBoardPresenter
field :id, type: ::Types::GlobalIDType[::Boards::EpicBoard], null: false,
description: 'Global ID of the board.'
description: 'Global ID of the epic board.'
field :name, type: GraphQL::STRING_TYPE, null: true,
description: 'Name of the board.'
description: 'Name of the epic board.'
field :hide_backlog_list, type: GraphQL::BOOLEAN_TYPE, null: true,
description: 'Whether or not backlog list is hidden.'
......@@ -27,6 +29,12 @@ module Types
description: 'Epic board lists.',
extras: [:lookahead],
resolver: Resolvers::Boards::EpicListsResolver
field :web_path, GraphQL::STRING_TYPE, null: false,
description: 'Web path of the epic board.'
field :web_url, GraphQL::STRING_TYPE, null: false,
description: 'Web URL of the epic board.'
end
end
end
# frozen_string_literal: true
module Boards
class EpicBoardPresenter < Gitlab::View::Presenter::Delegated
presents :epic_board
end
end
......@@ -13,6 +13,8 @@ module EE
case object.itself
when Epic
instance.group_epic_url(object.group, object, **options)
when ::Boards::EpicBoard
instance.group_epic_board_url(object.group, object, **options)
when Iteration
instance.iteration_url(object, **options)
when ::Vulnerability
......
......@@ -8,7 +8,7 @@ RSpec.describe GitlabSchema.types['EpicBoard'] do
specify { expect(described_class).to require_graphql_authorizations(:read_epic_board) }
it 'has specific fields' do
expected_fields = %w[id name lists hideBacklogList hideClosedList]
expected_fields = %w[id name lists hideBacklogList hideClosedList web_url web_path]
expect(described_class).to include_graphql_fields(*expected_fields)
end
......
......@@ -10,6 +10,7 @@ RSpec.describe Gitlab::UrlBuilder do
where(:factory, :path_generator) do
:epic | ->(epic) { "/groups/#{epic.group.full_path}/-/epics/#{epic.iid}" }
:epic_board | ->(epic_board) { "/groups/#{epic_board.group.full_path}/-/epic_boards/#{epic_board.id}" }
:vulnerability | ->(vulnerability) { "/#{vulnerability.project.full_path}/-/security/vulnerabilities/#{vulnerability.id}" }
:note_on_epic | ->(note) { "/groups/#{note.noteable.group.full_path}/-/epics/#{note.noteable.iid}#note_#{note.id}" }
......
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