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
description:
'Tooltip associated with the pipeline status'
,
method: :status_tooltip
field
:action
,
Types
::
Ci
::
StatusActionType
,
null:
true
,
description:
'Action information for the status. This includes method, button title, icon, path, and title'
def
action
if
object
.
has_action?
{
action_method:
object
.
action_method
,
button_title:
object
.
action_button_title
,
icon:
object
.
action_icon
,
path:
object
.
action_path
,
title:
object
.
action_title
}
else
nil
end
end
description:
'Action information for the status. This includes method, button title, icon, path, and title'
,
resolve:
->
(
obj
,
_args
,
_ctx
)
{
if
obj
.
has_action?
{
button_title:
obj
.
action_button_title
,
icon:
obj
.
icon
,
method:
obj
.
action_method
,
path:
obj
.
action_path
,
title:
obj
.
action_title
}
else
nil
end
}
end
# rubocop: enable Graphql/AuthorizeTypes
end
...
...
app/graphql/types/ci/status_action_type.rb
View file @
9e2c3fc6
...
...
@@ -9,12 +9,17 @@ module Types
description:
'Title for the button, for example: Retry this job'
field
:icon
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Icon used in the action button'
field
:action_method
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Method for the action, for example: :post'
field
:method
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Method for the action, for example: :post'
,
resolver_method: :action_method
field
:path
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Path for the action'
field
:title
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Title for the action, for example: Retry'
def
action_method
object
[
:method
]
end
end
end
end
doc/api/graphql/reference/gitlab_schema.graphql
View file @
9e2c3fc6
...
...
@@ -17718,11 +17718,6 @@ enum Sort {
}
type
StatusAction
{
"""
Method
for
the
action
,
for
example
:
:
post
"""
actionMethod
:
String
"""
Title
for
the
button
,
for
example
:
Retry
this
job
"""
...
...
@@ -17733,6 +17728,11 @@ type StatusAction {
"""
icon
:
String
"""
Method
for
the
action
,
for
example
:
:
post
"""
method
:
String
"""
Path
for
the
action
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
9e2c3fc6
...
...
@@ -51497,8 +51497,8 @@
"description": null,
"fields": [
{
"name": "
actionMethod
",
"description": "
Method for the action, for example: :post
",
"name": "
buttonTitle
",
"description": "
Title for the button, for example: Retry this job
",
"args": [
],
...
...
@@ -51511,8 +51511,8 @@
"deprecationReason": null
},
{
"name": "
buttonTitle
",
"description": "
Title for the button, for example: Retry this job
",
"name": "
icon
",
"description": "
Icon used in the action button
",
"args": [
],
...
...
@@ -51525,8 +51525,8 @@
"deprecationReason": null
},
{
"name": "
icon
",
"description": "
Icon used in the action button
",
"name": "
method
",
"description": "
Method for the action, for example: :post
",
"args": [
],
doc/api/graphql/reference/index.md
View file @
9e2c3fc6
...
...
@@ -2460,9 +2460,9 @@ Represents how the blob content should be displayed.
| Field | Type | Description |
| ----- | ---- | ----------- |
|
`actionMethod`
| String | Method for the action, for example: :post |
|
`buttonTitle`
| String | Title for the button, for example: Retry this job |
|
`icon`
| String | Icon used in the action button |
|
`method`
| String | Method for the action, for example: :post |
|
`path`
| String | Path for the action |
|
`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
it
'exposes the expected fields'
do
expected_fields
=
%i[
actionMethod
buttonTitle
icon
path
method
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