mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-03 16:04:30 +00:00

This key is useful to reduce the amount of logic needed on the frontend: if `has_warnings` is true, then the frontend knows that the request in question has warnings for some metric.
20 lines
366 B
Ruby
20 lines
366 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Gitlab
|
|
module PerformanceBar
|
|
module WithTopLevelWarnings
|
|
def results
|
|
results = super
|
|
|
|
results.merge(has_warnings: has_warnings?(results))
|
|
end
|
|
|
|
def has_warnings?(results)
|
|
results[:data].any? do |_, value|
|
|
value[:warnings].present?
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|