From a3ee0a6018712fbe5c4c73a9bf14e1660da38aca Mon Sep 17 00:00:00 2001 From: Harpreet Kataria Date: Fri, 21 Jun 2019 11:15:11 -0400 Subject: [PATCH] Display Lifecycle State on Service details screen Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1677571 --- app/helpers/service_helper/textual_summary.rb | 6 +++++- spec/helpers/service_helper/textual_summary_spec.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/helpers/service_helper/textual_summary.rb b/app/helpers/service_helper/textual_summary.rb index cb32b868d21..2a73f49d179 100644 --- a/app/helpers/service_helper/textual_summary.rb +++ b/app/helpers/service_helper/textual_summary.rb @@ -84,7 +84,7 @@ def textual_group_vm_totals end def textual_group_lifecycle - TextualGroup.new(_("Lifecycle"), %i[retirement_date retirement_state owner group created]) + TextualGroup.new(_("Lifecycle"), %i[lifecycle_state retirement_date retirement_state owner group created]) end def textual_group_relationships @@ -142,6 +142,10 @@ def textual_retirement_state {:label => _("Retirement State"), :value => @record.retirement_state.to_s.capitalize} end + def textual_lifecycle_state + {:label => _("State"), :value => @record.lifecycle_state ? @record.lifecycle_state.humanize.capitalize : _("None")} + end + def textual_catalog_item st = @record.service_template s = {:label => _("Parent Catalog Item"), :icon => "pficon pficon-template", :value => (st.nil? ? _("None") : st.name)} diff --git a/spec/helpers/service_helper/textual_summary_spec.rb b/spec/helpers/service_helper/textual_summary_spec.rb index d44044cd889..93edee763fc 100644 --- a/spec/helpers/service_helper/textual_summary_spec.rb +++ b/spec/helpers/service_helper/textual_summary_spec.rb @@ -143,7 +143,7 @@ aggregate_all_vm_memory_on_disk ), "vm_totals" - include_examples "textual_group", "Lifecycle", %i(retirement_date retirement_state owner group created) + include_examples "textual_group", "Lifecycle", %i(lifecycle_state retirement_date retirement_state owner group created) include_examples "textual_group", "Relationships", %i(catalog_item parent_service orchestration_stack job custom_button_events)