Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/usage/docs/value_formatter.rb')
-rw-r--r--lib/gitlab/usage/docs/value_formatter.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/usage/docs/value_formatter.rb b/lib/gitlab/usage/docs/value_formatter.rb
index a2dc9b081f8..379e5df4d52 100644
--- a/lib/gitlab/usage/docs/value_formatter.rb
+++ b/lib/gitlab/usage/docs/value_formatter.rb
@@ -5,17 +5,19 @@ module Gitlab
module Docs
class ValueFormatter
def self.format(key, value)
+ return '' unless value.present?
+
case key
when :key_path
"**`#{value}`**"
when :data_source
value.to_s.capitalize
- when :product_group
+ when :product_group, :product_category, :status
"`#{value}`"
when :introduced_by_url
"[Introduced by](#{value})"
when :distribution, :tier
- Array(value).join(', ')
+ Array(value).map { |tier| " `#{tier}`" }.join(',')
else
value
end