Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9e2c3fc6
Commit
9e2c3fc6
authored
Oct 05, 2020
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved method into a resolver instead
* Updates schema and docs * Updates specs
parent
44af7813
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
30 deletions
+34
-30
app/graphql/types/ci/detailed_status_type.rb
app/graphql/types/ci/detailed_status_type.rb
+14
-15
app/graphql/types/ci/status_action_type.rb
app/graphql/types/ci/status_action_type.rb
+7
-2
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+5
-5
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+6
-6
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+1
-1
spec/graphql/types/ci/status_action_type_spec.rb
spec/graphql/types/ci/status_action_type_spec.rb
+1
-1
No files found.
app/graphql/types/ci/detailed_status_type.rb
View file @
9e2c3fc6
...
@@ -25,21 +25,20 @@ module Types
...
@@ -25,21 +25,20 @@ module Types
description:
'Tooltip associated with the pipeline status'
,
description:
'Tooltip associated with the pipeline status'
,
method: :status_tooltip
method: :status_tooltip
field
:action
,
Types
::
Ci
::
StatusActionType
,
null:
true
,
field
:action
,
Types
::
Ci
::
StatusActionType
,
null:
true
,
description:
'Action information for the status. This includes method, button title, icon, path, and title'
description:
'Action information for the status. This includes method, button title, icon, path, and title'
,
resolve:
->
(
obj
,
_args
,
_ctx
)
{
def
action
if
obj
.
has_action?
if
object
.
has_action?
{
{
button_title:
obj
.
action_button_title
,
action_method:
object
.
action_method
,
icon:
obj
.
icon
,
button_title:
object
.
action_button_title
,
method:
obj
.
action_method
,
icon:
object
.
action_icon
,
path:
obj
.
action_path
,
path:
object
.
action_path
,
title:
obj
.
action_title
title:
object
.
action_title
}
}
else
else
nil
nil
end
end
}
end
end
end
# rubocop: enable Graphql/AuthorizeTypes
# rubocop: enable Graphql/AuthorizeTypes
end
end
...
...
app/graphql/types/ci/status_action_type.rb
View file @
9e2c3fc6
...
@@ -9,12 +9,17 @@ module Types
...
@@ -9,12 +9,17 @@ module Types
description:
'Title for the button, for example: Retry this job'
description:
'Title for the button, for example: Retry this job'
field
:icon
,
GraphQL
::
STRING_TYPE
,
null:
true
,
field
:icon
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Icon used in the action button'
description:
'Icon used in the action button'
field
:action_method
,
GraphQL
::
STRING_TYPE
,
null:
true
,
field
:method
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Method for the action, for example: :post'
description:
'Method for the action, for example: :post'
,
resolver_method: :action_method
field
:path
,
GraphQL
::
STRING_TYPE
,
null:
true
,
field
:path
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Path for the action'
description:
'Path for the action'
field
:title
,
GraphQL
::
STRING_TYPE
,
null:
true
,
field
:title
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Title for the action, for example: Retry'
description:
'Title for the action, for example: Retry'
def
action_method
object
[
:method
]
end
end
end
end
end
end
end
doc/api/graphql/reference/gitlab_schema.graphql
View file @
9e2c3fc6
...
@@ -17718,11 +17718,6 @@ enum Sort {
...
@@ -17718,11 +17718,6 @@ enum Sort {
}
}
type
StatusAction
{
type
StatusAction
{
"""
Method
for
the
action
,
for
example
:
:
post
"""
actionMethod
:
String
"""
"""
Title
for
the
button
,
for
example
:
Retry
this
job
Title
for
the
button
,
for
example
:
Retry
this
job
"""
"""
...
@@ -17733,6 +17728,11 @@ type StatusAction {
...
@@ -17733,6 +17728,11 @@ type StatusAction {
"""
"""
icon
:
String
icon
:
String
"""
Method
for
the
action
,
for
example
:
:
post
"""
method
:
String
"""
"""
Path
for
the
action
Path
for
the
action
"""
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
9e2c3fc6
...
@@ -51497,8 +51497,8 @@
...
@@ -51497,8 +51497,8 @@
"description": null,
"description": null,
"fields": [
"fields": [
{
{
"name": "
actionMethod
",
"name": "
buttonTitle
",
"description": "
Method for the action, for example: :post
",
"description": "
Title for the button, for example: Retry this job
",
"args": [
"args": [
],
],
...
@@ -51511,8 +51511,8 @@
...
@@ -51511,8 +51511,8 @@
"deprecationReason": null
"deprecationReason": null
},
},
{
{
"name": "
buttonTitle
",
"name": "
icon
",
"description": "
Title for the button, for example: Retry this job
",
"description": "
Icon used in the action button
",
"args": [
"args": [
],
],
...
@@ -51525,8 +51525,8 @@
...
@@ -51525,8 +51525,8 @@
"deprecationReason": null
"deprecationReason": null
},
},
{
{
"name": "
icon
",
"name": "
method
",
"description": "
Icon used in the action button
",
"description": "
Method for the action, for example: :post
",
"args": [
"args": [
],
],
doc/api/graphql/reference/index.md
View file @
9e2c3fc6
...
@@ -2460,9 +2460,9 @@ Represents how the blob content should be displayed.
...
@@ -2460,9 +2460,9 @@ Represents how the blob content should be displayed.
| Field | Type | Description |
| Field | Type | Description |
| ----- | ---- | ----------- |
| ----- | ---- | ----------- |
|
`actionMethod`
| String | Method for the action, for example: :post |
|
`buttonTitle`
| String | Title for the button, for example: Retry this job |
|
`buttonTitle`
| String | Title for the button, for example: Retry this job |
|
`icon`
| String | Icon used in the action button |
|
`icon`
| String | Icon used in the action button |
|
`method`
| String | Method for the action, for example: :post |
|
`path`
| String | Path for the action |
|
`path`
| String | Path for the action |
|
`title`
| String | Title for the action, for example: Retry |
|
`title`
| String | Title for the action, for example: Retry |
...
...
spec/graphql/types/ci/status_action_type_spec.rb
View file @
9e2c3fc6
...
@@ -7,10 +7,10 @@ RSpec.describe Types::Ci::StatusActionType do
...
@@ -7,10 +7,10 @@ RSpec.describe Types::Ci::StatusActionType do
it
'exposes the expected fields'
do
it
'exposes the expected fields'
do
expected_fields
=
%i[
expected_fields
=
%i[
actionMethod
buttonTitle
buttonTitle
icon
icon
path
path
method
title
title
]
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment