From c017bfc4b85cf866cf1a884689cc1c51942b25ad Mon Sep 17 00:00:00 2001 From: Harpreet Kataria Date: Mon, 6 Jul 2020 17:45:22 -0400 Subject: [PATCH] Show hover text correctly on Copy catalog item button Fixes #6046 --- .../application_helper/button/catalog_item_copy_button.rb | 3 ++- .../application_helper/toolbar/servicetemplate_center.rb | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper/button/catalog_item_copy_button.rb b/app/helpers/application_helper/button/catalog_item_copy_button.rb index 05646c11d2f..1bf7c6b2262 100644 --- a/app/helpers/application_helper/button/catalog_item_copy_button.rb +++ b/app/helpers/application_helper/button/catalog_item_copy_button.rb @@ -1,5 +1,6 @@ class ApplicationHelper::Button::CatalogItemCopyButton < ApplicationHelper::Button::Basic def disabled? - !@record.template_valid? || @record.type == 'ServiceTemplateAnsiblePlaybook' + @error_message = N_('This Item cannot be copied') if !@record.template_valid? || @record.type == 'ServiceTemplateAnsiblePlaybook' + @error_message.present? end end diff --git a/app/helpers/application_helper/toolbar/servicetemplate_center.rb b/app/helpers/application_helper/toolbar/servicetemplate_center.rb index 721f0996694..190a6ee4f58 100644 --- a/app/helpers/application_helper/toolbar/servicetemplate_center.rb +++ b/app/helpers/application_helper/toolbar/servicetemplate_center.rb @@ -36,8 +36,8 @@ class ApplicationHelper::Toolbar::ServicetemplateCenter < ApplicationHelper::Too button( :catalogitem_copy, 'pficon pficon-edit fa-lg', - N_('This Item cannot be copied'), - N_('Copy Selected Item'), + t = N_('Copy Selected Item'), + t, :send_checked => true, :klass => ApplicationHelper::Button::CatalogItemCopyButton ),