Skip to content

Commit

Permalink
Merge pull request #9214 from liu-samuel/annotations-on-summary-page
Browse files Browse the repository at this point in the history
Add annotations on container summary pages that contain labels
  • Loading branch information
agrare authored Jul 22, 2024
2 parents 47bdf7a + 131f1b1 commit 94f4726
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/controllers/container_group_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def show_list
def textual_group_list
[
%i[properties container_labels container_node_selectors volumes],
%i[relationships conditions smart_management]
%i[relationships conditions smart_management annotations]
]
end
helper_method :textual_group_list
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/container_node_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def show_list
def textual_group_list
[
%i[properties container_labels compliance miq_custom_attributes],
%i[relationships conditions smart_management]
%i[relationships conditions smart_management annotations]
]
end
helper_method :textual_group_list
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/container_replicator_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def download_summary_pdf
private

def textual_group_list
[%i[properties container_labels container_selectors compliance], %i[relationships smart_management]]
[%i[properties container_labels container_selectors compliance], %i[relationships smart_management annotations]]
end
helper_method :textual_group_list

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/container_route_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def download_summary_pdf
private

def textual_group_list
[%i[properties container_labels], %i[relationships smart_management]]
[%i[properties container_labels annotations], %i[relationships smart_management]]
end
helper_method :textual_group_list

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/container_service_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def download_summary_pdf
private

def textual_group_list
[%i[properties port_configs container_labels container_selectors], %i[relationships smart_management]]
[%i[properties port_configs container_labels container_selectors], %i[relationships smart_management annotations]]
end
helper_method :textual_group_list

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/container_template_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def download_summary_pdf
private

def textual_group_list
[%i[properties parameters objects], %i[relationships container_labels smart_management]]
[%i[properties parameters objects], %i[relationships container_labels smart_management annotations]]
end
helper_method :textual_group_list

Expand Down
6 changes: 5 additions & 1 deletion app/helpers/container_summary_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,16 @@ def textual_group_container_labels
TextualGroup.new(_("Labels"), textual_key_value_group(@record.labels.to_a))
end

def textual_group_annotations
TextualGroup.new(_("Annotations"), textual_key_value_group(@record.annotations))
end

def textual_group_miq_custom_attributes
TextualGroup.new(_("Custom Attributes"), textual_miq_custom_attributes)
end

def textual_miq_custom_attributes
attrs = @record.custom_attributes
attrs = @record.miq_custom_attributes
return nil if attrs.blank?
attrs.sort_by(&:name).collect { |a| {:label => a.name.tr("_", " "), :value => a.value} }
end
Expand Down

0 comments on commit 94f4726

Please sign in to comment.