Skip to content

Commit

Permalink
Merge pull request #3154 from ZitaNemeckova/hide_policy_events_az
Browse files Browse the repository at this point in the history
Availability Zone has only Management Events in Timelines
(cherry picked from commit 46e1d85)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1533167
  • Loading branch information
h-kataria authored and simaishi committed Jan 10, 2018
1 parent c1b2eef commit 0d33481
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
Expand Up @@ -1722,4 +1722,8 @@ def translate_header_text(text)
def parse_nodetype_and_id(x_node)
x_node.split('_').last.split('-')
end

def accessible_select_event_types
ApplicationController::Timelines::SELECT_EVENT_TYPE.map {|key, value| [_(key), value]}
end
end
4 changes: 4 additions & 0 deletions app/helpers/availability_zone_helper.rb
@@ -1,3 +1,7 @@
module AvailabilityZoneHelper
include_concern 'TextualSummary'

def accessible_select_event_types
[[_('Management Events'), 'timeline']]
end
end
2 changes: 1 addition & 1 deletion app/views/layouts/_tl_options.html.haml
Expand Up @@ -17,7 +17,7 @@
.form-group
%div{'class' => 'timeline-filterbar'}
= select_tag("tl_show",
options_for_select(ApplicationController::Timelines::SELECT_EVENT_TYPE.map {|key, value| [_(key), value]}, nil),
options_for_select(accessible_select_event_types, nil),
'ng-model' => 'reportModel.tl_show',
"selectpicker-for-select-tag" => '',
:class => 'selectpicker',
Expand Down
8 changes: 8 additions & 0 deletions spec/helpers/availability_zone_helper_spec.rb
@@ -0,0 +1,8 @@
describe AvailabilityZoneHelper do

context "#accessible_select_event_types" do
it 'returns only Management Events' do
expect(accessible_select_event_types).to eq([['Management Events', 'timeline']])
end
end
end

0 comments on commit 0d33481

Please sign in to comment.