Skip to content

Commit

Permalink
Removed chargeback rates tree view as per GH discussion/comment
Browse files Browse the repository at this point in the history
ManageIQ#7039 (comment). Reverted any gtl_view buttons related code that was introduced in this PR.
  • Loading branch information
h-kataria authored and kbrock committed Jul 13, 2020
1 parent 0b45588 commit 00a47b5
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 52 deletions.
10 changes: 0 additions & 10 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -555,16 +555,6 @@ def search_clear
end
end

helper_method :show_tree_button?
def show_tree_button?
false
end

helper_method :gtl_buttons
def gtl_buttons
%w[view_grid view_list view_tile]
end

protected

def render_flash(add_flash_text = nil, severity = nil)
Expand Down
6 changes: 0 additions & 6 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -743,12 +743,6 @@ def ot_show
explorer
end

def gtl_buttons
# used @gtl_buttons, service catalog list does not need to show view_grid button
# other accordions in this explorer show all three buttons
@gtl_buttons ||= %w[view_grid view_list view_tile]
end

private

def build_tenants_tree
Expand Down
15 changes: 0 additions & 15 deletions app/controllers/chargeback_rate_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ def show
@center_toolbar = 'chargeback_rate'
end


# TODO clean this up after the new trees are in and do the redirect in the TreeBuilder directly instead
def tree_select
id = parse_nodetype_and_id(params[:id]).last
javascript_redirect(:action => 'show', :id => id)
end

def cb_rate_edit
@_params[:id] ||= find_checked_items[0]
rate = new_rate_edit? ? ChargebackRate.new : ChargebackRate.find(params[:id])
Expand Down Expand Up @@ -222,14 +215,6 @@ def title
@title = _("Chargeback Rates")
end

def show_tree_button?
true
end

def gtl_buttons
%w[view_list view_tree]
end

private ############################

def build_view_tree
Expand Down
1 change: 0 additions & 1 deletion app/controllers/mixins/generic_list_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ def show_list
@showtype = nil
@center_toolbar = self.class.toolbar_plural if self.class.toolbar_plural
process_show_list
@tree = build_view_tree if @gtl_type == 'tree'
end
end
end
4 changes: 1 addition & 3 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def _toolbar_builder
:edit => @edit,
:explorer => @explorer,
:ght_type => @ght_type,
:gtl_buttons => gtl_buttons,
:gtl_buttons => @gtl_buttons,
:gtl_type => @gtl_type,
:html => @html,
:lastaction => @lastaction,
Expand All @@ -467,7 +467,6 @@ def _toolbar_builder
:settings => @settings,
:showtype => @showtype,
:tabform => @tabform,
:show_tree_button => show_tree_button?,
:widget_running => @widget_running,
:widgetsets => @widgetsets,
:render_chart => @render_chart,
Expand Down Expand Up @@ -1045,7 +1044,6 @@ def pdf_page_size_style
alerts_overview
alerts_list
alerts_most_recent
chargeback_rate
cloud_network
cloud_object_store_container
cloud_object_store_object
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/application_helper/button/view.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class ApplicationHelper::Button::View < ApplicationHelper::Button::ButtonWithoutRbacCheck
def visible?
return false if self[:id] == "view_tree" && !@show_tree_button
@gtl_buttons.include?(self[:id].to_s)
# only hide gtl button if they are not in @gtl_buttons
!@gtl_buttons || @gtl_buttons.include?(self[:id].to_s)
end

def disabled?
Expand Down
8 changes: 0 additions & 8 deletions app/helpers/application_helper/toolbar/gtl_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ class ApplicationHelper::Toolbar::GtlView < ApplicationHelper::Toolbar::Basic
:klass => ApplicationHelper::Button::View,
:url => "\#{@gtl_url}",
:url_parms => "?type=list"),
twostate(
:view_tree,
'fa fa-sitemap',
N_('Tree View'),
nil,
:klass => ApplicationHelper::Button::View,
:url => "\#{@gtl_url}",
:url_parms => "?type=tree"),
])
button_group('download_main', [
select(
Expand Down
5 changes: 1 addition & 4 deletions app/views/chargeback_rate/show_list.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
#main_div
- if @tree.present?
= render(:partial => "shared/tree", :locals => {:tree => @tree, :name => @tree.name})
- else
= render :partial => 'layouts/gtl'
= render :partial => 'layouts/gtl'
3 changes: 0 additions & 3 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,6 @@
},
:chargeback_rate => {
:get => %w(
download_data
download_summary_pdf
edit
show_list
show
Expand All @@ -385,7 +383,6 @@
edit
show_list
show
tree_select
)
},

Expand Down

0 comments on commit 00a47b5

Please sign in to comment.