Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] De explorization of infra networking pages #8579

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
De explorization of infra networkng show page
akhilkr128 committed Jun 13, 2023

Verified

This commit was signed with the committer’s verified signature.
commit 0f8d49e81febe4b587fab887ccb726df030971cc
4 changes: 2 additions & 2 deletions app/controllers/application_controller/tags.rb
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@ def tagging_edit_tags_cancel
add_flash(_("Tag Edit was cancelled by the user"))
session[:tag_items] = nil # reset tag_items in session
@edit = nil # clean out the saved info
if tagging_explorer_controller?
if tagging_explorer_controller? && @lastaction != 'show_list'
@sb[:action] = nil
replace_right_cell
else
@@ -109,7 +109,7 @@ def tagging_edit_tags_save
tagging_save_tags

@edit = nil # clean out the saved info
if tagging_explorer_controller?
if tagging_explorer_controller? && @lastaction != 'show_list'
@sb[:action] = nil
replace_right_cell
else
24 changes: 23 additions & 1 deletion app/controllers/infra_networking_controller.rb
Original file line number Diff line number Diff line change
@@ -11,6 +11,10 @@ class InfraNetworkingController < ApplicationController
include Mixins::CustomButtonDialogFormMixin
include Mixins::BreadcrumbsMixin

INFRA_X_BUTTON_ALLOWED_ACTIONS = {
"infra_networking_tag" => :infra_networking_tag
}.freeze

def self.model
Switch
end
@@ -20,8 +24,10 @@ def self.table_name
end

def show_list
@center_toolbar = 'infra_networking'
@lastaction = "showlist"
@center_toolbar = 'infra_networkings'
process_show_list(:dbname => :switch, :gtl_dbname => :switch, :named_scope => :shareable)
render :layout => "application"
end

alias_method :index, :show_list
@@ -30,6 +36,10 @@ def tagging_explorer_controller?
@explorer
end

def show_searchbar?
true
end

def tree_select
@lastaction = "explorer"
@sb[:action] = nil
@@ -75,6 +85,11 @@ def load_or_clear_adv_search
end
end

def show
assert_privileges("infra_networking_view")
@switch = @record = identify_record(params[:id], Switch)
end

def x_show
assert_privileges("infra_networking_view")
@switch = @record = identify_record(params[:id], Switch)
@@ -119,6 +134,8 @@ def tagging
def button
if params[:pressed] == "custom_button"
custom_buttons
else
tag(self.class.model)
end
end

@@ -299,6 +316,11 @@ def replace_right_cell(options = {})
return
end

if params[:action] == 'button' && params[:pressed] == 'infra_networking_tag'
tagging
return
end

if action_type == "dialog_form_button_pressed"
presenter = set_custom_button_dialog_presenter(options)
render :json => presenter.for_render
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -234,7 +234,7 @@ def view_to_url(view, parent = nil)
if association.nil?
controller, action = db_to_controller(view.db)
if controller == "switch" && action == "show"
return url_for_only_path(:action => "x_show") + "/"
return url_for_only_path(:action => action)
end
if controller == "ems_cloud" && action == "show"
return ems_clouds_path
2 changes: 2 additions & 0 deletions app/views/infra_networking/show.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#main_div
= render :partial => "layouts/textual_groups_generic"
12 changes: 10 additions & 2 deletions app/views/infra_networking/show_list.html.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
#main-div
= render :partial => 'layouts/x_gtl'
- content_for :search do
= render(:partial => "layouts/x_adv_searchbox")
= render(:partial => 'layouts/quick_search')

-# Showing a list of switches
#main_div
= render(:partial => 'layouts/gtl')
-# Show Search box
:javascript
#{javascript_show_if_exists("adv_searchbox_div")}
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1779,6 +1779,7 @@
tagging
tagging_edit
x_show
show
),
:post => %w(
button