Skip to content

Commit

Permalink
Merge pull request #228 from mzazrivec/sort_custom_attributes_by_name
Browse files Browse the repository at this point in the history
Sort custom attributes by attribute name
  • Loading branch information
h-kataria authored Jan 26, 2017
2 parents a22d5a8 + 5366019 commit 80241bf
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/helpers/container_summary_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def textual_group_container_labels
def textual_miq_custom_attributes
attrs = @record.custom_attributes
return nil if attrs.blank?
attrs.collect { |a| {:label => a.name.tr("_", " "), :value => a.value} }
attrs.sort_by(&:name).collect { |a| {:label => a.name.tr("_", " "), :value => a.value} }
end

def textual_group_container_selectors
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/ems_container_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,6 @@ def textual_endpoints
def textual_miq_custom_attributes
attrs = @record.custom_attributes
return nil if attrs.blank?
attrs.collect { |a| {:label => a.name.tr("_", " "), :value => a.value} }
attrs.sort_by(&:name).collect { |a| {:label => a.name.tr("_", " "), :value => a.value} }
end
end
4 changes: 2 additions & 2 deletions app/helpers/host_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -489,13 +489,13 @@ def textual_esx_logs
def textual_miq_custom_attributes
attrs = @record.miq_custom_attributes
return nil if attrs.blank?
attrs.collect { |a| {:label => a.name, :value => a.value} }
attrs.sort_by(&:name).collect { |a| {:label => a.name, :value => a.value} }
end

def textual_ems_custom_attributes
attrs = @record.ems_custom_attributes
return nil if attrs.blank?
attrs.collect { |a| {:label => a.name, :value => a.value} }
attrs.sort_by(&:name).collect { |a| {:label => a.name, :value => a.value} }
end

def textual_openstack_nova_scheduler
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/service_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,6 @@ def textual_created
def textual_miq_custom_attributes
attrs = @record.miq_custom_attributes
return nil if attrs.blank?
attrs.collect { |a| {:label => a.name, :value => a.value} }
attrs.sort_by(&:name).collect { |a| {:label => a.name, :value => a.value} }
end
end
4 changes: 2 additions & 2 deletions app/helpers/vm_cloud_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,13 @@ def textual_vmsafe_timeout
def textual_miq_custom_attributes
attrs = @record.miq_custom_attributes
return nil if attrs.blank?
attrs.collect { |a| {:label => a.name, :value => a.value} }
attrs.sort_by(&:name).collect { |a| {:label => a.name, :value => a.value} }
end

def textual_ems_custom_attributes
attrs = @record.ems_custom_attributes
return nil if attrs.blank?
attrs.collect { |a| {:label => a.name, :value => a.value} }
attrs.sort_by(&:name).collect { |a| {:label => a.name, :value => a.value} }
end

def textual_compliance_history
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/vm_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -759,13 +759,13 @@ def textual_vmsafe_timeout
def textual_miq_custom_attributes
attrs = @record.miq_custom_attributes
return nil if attrs.blank?
attrs.collect { |a| {:label => a.name, :value => a.value} }
attrs.sort_by(&:name).collect { |a| {:label => a.name, :value => a.value} }
end

def textual_ems_custom_attributes
attrs = @record.ems_custom_attributes
return nil if attrs.blank?
attrs.collect { |a| {:label => a.name, :value => a.value} }
attrs.sort_by(&:name).collect { |a| {:label => a.name, :value => a.value} }
end

def textual_compliance_history
Expand Down

0 comments on commit 80241bf

Please sign in to comment.