Skip to content

Commit

Permalink
Fixed prompt for log collection by reorganizing button inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed May 23, 2017
1 parent e7c95dd commit 45ba57a
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 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

def disabled?
Expand Down
Original file line number 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

def visible?
Expand Down
Original file line number 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
super
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 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

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

Expand Down

This file was deleted.

0 comments on commit 45ba57a

Please sign in to comment.