Skip to content

Commit

Permalink
Merge pull request #1413 from skateman/log-collection-fix
Browse files Browse the repository at this point in the history
Fixed prompt for log collection by reorganizing button inheritance
(cherry picked from commit 5288862)

https://bugzilla.redhat.com/show_bug.cgi?id=1460033
  • Loading branch information
mzazrivec authored and simaishi committed Jun 8, 2017
1 parent 924c9f7 commit 0359517
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 25 deletions.
3 changes: 2 additions & 1 deletion app/helpers/application_helper/button/collect_logs.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,5 @@
class ApplicationHelper::Button::CollectLogs < ApplicationHelper::Button::DiagnosticsLogs class ApplicationHelper::Button::CollectLogs < ApplicationHelper::Button::LogDepotEdit
include ApplicationHelper::Button::Mixins::ButtonPromptMixin
needs :@record needs :@record


def disabled? def disabled?
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationHelper::Button::DiagnosticsLogs < ApplicationHelper::Button::Logs class ApplicationHelper::Button::LogDepotEdit < ApplicationHelper::Button::Basic
include ApplicationHelper::Button::Mixins::ActiveContextMixin include ApplicationHelper::Button::Mixins::ActiveContextMixin


def visible? def visible?
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationHelper::Button::Logs < ApplicationHelper::Button::Basic module ApplicationHelper::Button::Mixins::ButtonPromptMixin
def calculate_properties def calculate_properties
super super
self[:prompt] = @record.try(:log_file_depot).try(:requires_support_case?) self[:prompt] = @record.try(:log_file_depot).try(:requires_support_case?)
Expand Down
3 changes: 2 additions & 1 deletion app/helpers/application_helper/button/zone_collect_logs.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,5 @@
class ApplicationHelper::Button::ZoneCollectLogs < ApplicationHelper::Button::ZoneLogDepotEdit class ApplicationHelper::Button::ZoneCollectLogs < ApplicationHelper::Button::LogDepotEdit
include ApplicationHelper::Button::Mixins::ButtonPromptMixin
needs :@record needs :@record


def disabled? def disabled?
Expand Down
7 changes: 0 additions & 7 deletions app/helpers/application_helper/button/zone_log_depot_edit.rb

This file was deleted.

Original file line number Original file line Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class ApplicationHelper::Toolbar::DiagnosticsServerCenter < ApplicationHelper::T
'pficon pficon-edit fa-lg', 'pficon pficon-edit fa-lg',
N_('Edit the Log Depot settings for the selected Server'), N_('Edit the Log Depot settings for the selected Server'),
N_('Edit'), N_('Edit'),
:klass => ApplicationHelper::Button::DiagnosticsLogs), :klass => ApplicationHelper::Button::LogDepotEdit),
select( select(
:restart_vmdb_choice, :restart_vmdb_choice,
'fa fa-cog fa-lg', 'fa fa-cog fa-lg',
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ class ApplicationHelper::Toolbar::DiagnosticsZoneCenter < ApplicationHelper::Too
'pficon pficon-edit fa-lg', 'pficon pficon-edit fa-lg',
N_('Edit the Log Depot settings for the selected Zone'), N_('Edit the Log Depot settings for the selected Zone'),
N_('Edit'), N_('Edit'),
:klass => ApplicationHelper::Button::ZoneLogDepotEdit), :klass => ApplicationHelper::Button::LogDepotEdit),
]) ])
end end
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
describe ApplicationHelper::Button::DiagnosticsLogs do describe ApplicationHelper::Button::LogDepotEdit do
let(:view_context) { setup_view_context_with_sandbox(:active_tree => tree, :active_tab => tab) } let(:view_context) { setup_view_context_with_sandbox(:active_tree => tree, :active_tab => tab) }
let(:button) { described_class.new(view_context, {}, {}, {}) } let(:button) { described_class.new(view_context, {}, {}, {}) }


Expand Down

This file was deleted.

0 comments on commit 0359517

Please sign in to comment.