summaryrefslogtreecommitdiff
path: root/lib/gitlab/performance_bar/with_top_level_warnings.rb
blob: fb5c5c5959da16c7ba2082e5037acb6f3a302598 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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