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
cad95fa4
Commit
cad95fa4
authored
Mar 29, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move more logic into render_deprecation
parent
30b6b964
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
lib/gitlab/graphql/docs/helper.rb
lib/gitlab/graphql/docs/helper.rb
+12
-15
No files found.
lib/gitlab/graphql/docs/helper.rb
View file @
cad95fa4
...
...
@@ -255,21 +255,11 @@ module Gitlab
# Returns the object description. If the object has been deprecated,
# the deprecation reason will be returned in place of the description.
def
render_description
(
object
,
owner
=
nil
,
context
=
:block
)
owner
=
Array
.
wrap
(
owner
)
content
=
[]
if
object
[
:is_deprecated
]
if
context
==
:block
deprecation
=
schema_deprecation
(
owner
,
object
[
:name
])
content
<<
(
deprecation
&
.
original_description
||
render_description_of
(
object
))
end
content
<<
render_deprecation
(
object
,
owner
,
context
)
render_deprecation
(
object
,
owner
,
context
)
else
content
<<
render_description_of
(
object
)
render_description_of
(
object
)
end
join
(
context
,
content
)
end
def
render_description_of
(
object
)
...
...
@@ -290,11 +280,18 @@ module Gitlab
end
def
render_deprecation
(
object
,
owner
,
context
)
owner
=
Array
.
wrap
(
owner
)
buff
=
[]
deprecation
=
schema_deprecation
(
owner
,
object
[
:name
])
return
deprecation
.
markdown
(
context:
context
)
if
deprecation
reason
=
object
[
:deprecation_reason
]
||
'Use of this is deprecated.'
"**Deprecated:**
#{
reason
}
"
buff
<<
(
deprecation
&
.
original_description
||
render_description_of
(
object
))
if
context
==
:block
buff
<<
if
deprecation
deprecation
.
markdown
(
context:
context
)
else
"**Deprecated:**
#{
object
[
:deprecation_reason
]
}
"
end
join
(
context
,
buff
)
end
def
render_field_type
(
type
)
...
...
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