From 5accb14431dbe0ed8d654f8221f73bd3a90a27f1 Mon Sep 17 00:00:00 2001 From: PanSpagetka Date: Fri, 9 Aug 2019 10:50:24 +0200 Subject: [PATCH] Add Ownership info to Textual summary --- app/controllers/auth_key_pair_cloud_controller.rb | 2 +- .../toolbar/auth_key_pair_clouds_center.rb | 2 +- .../auth_key_pair_cloud_helper/textual_summary.rb | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/controllers/auth_key_pair_cloud_controller.rb b/app/controllers/auth_key_pair_cloud_controller.rb index b50b90f5abb..1c5aea7e422 100644 --- a/app/controllers/auth_key_pair_cloud_controller.rb +++ b/app/controllers/auth_key_pair_cloud_controller.rb @@ -212,7 +212,7 @@ def process_deletions(key_pairs) private def textual_group_list - [%i[properties relationships], %i[tags]] + [%i[properties relationships lifecycle], %i[tags]] end helper_method :textual_group_list diff --git a/app/helpers/application_helper/toolbar/auth_key_pair_clouds_center.rb b/app/helpers/application_helper/toolbar/auth_key_pair_clouds_center.rb index e2a3d746e6d..bc3124efb4c 100644 --- a/app/helpers/application_helper/toolbar/auth_key_pair_clouds_center.rb +++ b/app/helpers/application_helper/toolbar/auth_key_pair_clouds_center.rb @@ -14,7 +14,7 @@ class ApplicationHelper::Toolbar::AuthKeyPairCloudsCenter < ApplicationHelper::T :klass => ApplicationHelper::Button::AuthKeyPairCloudCreate), separator, button( - :key_pair_ownership, + :auth_key_pair_ownership, 'pficon pficon-user fa-lg', N_('Set Ownership for the selected items'), N_('Set Ownership'), diff --git a/app/helpers/auth_key_pair_cloud_helper/textual_summary.rb b/app/helpers/auth_key_pair_cloud_helper/textual_summary.rb index 58439082387..363a1dcfe2e 100644 --- a/app/helpers/auth_key_pair_cloud_helper/textual_summary.rb +++ b/app/helpers/auth_key_pair_cloud_helper/textual_summary.rb @@ -28,4 +28,19 @@ def textual_vms end h end + + def textual_group_lifecycle + TextualGroup.new( + _("Lifecycle"), + %i[owner group] + ) + end + + def textual_owner + @record.evm_owner.try(:name) + end + + def textual_group + {:label => _("Group"), :value => @record.miq_group.try(:description)} + end end