Method: Kennel::Models::Dashboard.normalize

Defined in:
lib/kennel/models/dashboard.rb

.normalize(expected, actual) ⇒ Object



98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/kennel/models/dashboard.rb', line 98

def normalize(expected, actual)
  super

  ignore_default expected, actual, DEFAULTS
  ignore_default expected, actual, reflow_type: "auto" if expected[:layout_type] == "ordered"

  widgets_pairs(expected, actual).each do |pair|
    pair.each { |w| sort_conditional_formats w }
    ignore_widget_defaults(*pair)
    ignore_request_defaults(*pair)
    pair.each { |widget| widget&.delete(:id) } # ids are kinda random so we always discard them
  end
end