Skip to content

Commit c6aef37

Browse files
authored
Merge pull request #9389 from GilbertCherrie/fix_tag_category_pages
Fix tag category pages
2 parents 94b2e7c + f126dfc commit c6aef37

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

app/controllers/ops_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def set_active_tab(nodetype)
436436
case node[0]
437437
when "root"
438438
@sb[:active_tab] = "settings_details"
439-
@sb[:active_subtab] = "settings_co_categories"
439+
@sb[:active_subtab] = "settings_my_company_categories"
440440
when "z"
441441
@sb[:active_tab] = "settings_evm_servers"
442442
when "xx", "sis", "msc", "l", "lr", "ld"
@@ -512,7 +512,7 @@ def set_form_locals
512512
action_url = "zone_edit"
513513
record_id = @edit[:zone_id] ? @edit[:zone_id] : nil
514514
end
515-
elsif @sb[:active_tab] == "settings_tags" && @sb[:active_subtab] == "settings_co_categories" && @in_a_form
515+
elsif @sb[:active_tab] == "settings_tags" && @sb[:active_subtab] == "settings_my_company_categories" && @in_a_form
516516
action_url = "category_edit"
517517
record_id = @category.try(:id)
518518
elsif @sb[:active_tab] == "settings_tags" && @sb[:active_subtab] == "settings_label_tag_mapping" && @in_a_form
@@ -651,7 +651,7 @@ def settings_replace_right_cell(nodetype, presenter)
651651
presenter[:update_partials][partial_div] = r[:partial => "zone_form"]
652652
when "ce" # category edit
653653
# when editing/adding category in settings tree
654-
presenter.update(:settings_co_categories, r[:partial => "category_form"])
654+
presenter.update(:my_company_categories, r[:partial => "category_form"])
655655
@right_cell_text = if !@category
656656
_("Adding a new Category")
657657
else

app/controllers/ops_controller/settings/tags.rb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def category_delete
2929
page << javascript_prologue
3030
page.replace("flash_msg_div", :partial => "layouts/flash_msg")
3131
page << "miqScrollTop();" if @flash_array.present?
32-
page.replace_html('settings_co_categories', :partial => 'settings_co_categories_tab')
32+
page.replace_html('my_company_categories', :partial => 'settings_my_company_categories_tab')
3333
end
3434
else
3535
category.errors.each { |error| add_flash("#{error.attribute.to_s.capitalize} #{error.message}", :error) }
@@ -45,14 +45,24 @@ def cancel_category
4545
add_flash(_("Edit of Category \"%{name}\" was cancelled by the user") % {:name => category.name})
4646
end
4747
get_node_info(x_node)
48-
replace_right_cell(:nodetype => "root")
48+
render :update do |page|
49+
page << javascript_prologue
50+
page.replace("flash_msg_div", :partial => "layouts/flash_msg")
51+
page << "miqScrollTop();" if @flash_array.present?
52+
page.replace_html('my_company_categories', :partial => 'settings_my_company_categories_tab')
53+
end
4954
end
5055

5156
def add_category
5257
category = Classification.find(params[:id])
5358
add_flash(_("Category \"%{name}\" was added") % {:name => category.name})
5459
get_node_info(x_node)
55-
replace_right_cell(:nodetype => "root")
60+
render :update do |page|
61+
page << javascript_prologue
62+
page.replace("flash_msg_div", :partial => "layouts/flash_msg")
63+
page << "miqScrollTop();" if @flash_array.present?
64+
page.replace_html('my_company_categories', :partial => 'settings_my_company_categories_tab')
65+
end
5666
end
5767

5868
def save_category

app/views/ops/_all_tabs.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
})
7777
.tab-content
7878
= settings_tags_content(:my_company_categories) do
79-
= render :partial => "settings_co_categories_tab"
79+
= render :partial => "settings_my_company_categories_tab"
8080
= settings_tags_content(:my_company_tags) do
8181
= render :partial => "settings_co_tags_tab"
8282
= settings_tags_content(:import_tags) do

0 commit comments

Comments
 (0)