@@ -63,12 +63,20 @@ def label_tag_mapping_edit
6363 end
6464 get_node_info ( x_node )
6565 @lt_map = @edit = session [ :edit ] = nil # clean out the saved info
66- replace_right_cell ( :nodetype => @nodetype )
66+ render :update do |page |
67+ page << javascript_prologue
68+ page . replace ( "flash_msg_div" , :partial => "layouts/flash_msg" )
69+ page << "miqScrollTop();" if @flash_array . present?
70+ page . replace_html ( 'map_tags' , :partial => 'settings_map_tags_tab' )
71+ end
6772 when "save" , "add"
6873 id = params [ :id ] || "new"
6974 return unless load_edit ( "label_tag_mapping_edit__#{ id } " , "replace_cell__explorer" )
7075
7176 @lt_map = @edit [ :lt_map ] if @edit && @edit [ :lt_map ]
77+ if @edit [ :new ] [ :entity ] . blank?
78+ add_flash ( _ ( "Entity is required" ) , :error )
79+ end
7280 if @edit [ :new ] [ :label_name ] . blank?
7381 add_flash ( _ ( "Label is required" ) , :error )
7482 end
@@ -109,7 +117,7 @@ def entity_ui_name_or_all(entity)
109117 ui_lookup ( :model => model )
110118 end
111119 else
112- _ ( "<All >" )
120+ _ ( "<Choose >" )
113121 end
114122 end
115123
@@ -277,7 +285,12 @@ def label_tag_mapping_add(entity, label_name, cat_description)
277285 add_flash ( _ ( "Provider Tag Mapping \" %{name}\" was added" ) % { :name => label_name } )
278286 get_node_info ( x_node )
279287 @lt_map = @edit = session [ :edit ] = nil # clean out the saved info
280- replace_right_cell ( :nodetype => "root" )
288+ render :update do |page |
289+ page << javascript_prologue
290+ page . replace ( "flash_msg_div" , :partial => "layouts/flash_msg" )
291+ page << "miqScrollTop();" if @flash_array . present?
292+ page . replace_html ( 'map_tags' , :partial => 'settings_map_tags_tab' )
293+ end
281294 end
282295 end
283296
@@ -307,7 +320,12 @@ def label_tag_mapping_update(id, cat_description)
307320 add_flash ( _ ( "Provider Tag Mapping \" %{name}\" was saved" ) % { :name => mapping . label_name } )
308321 get_node_info ( x_node )
309322 @lt_map = @edit = session [ :edit ] = nil # clean out the saved info
310- replace_right_cell ( :nodetype => "root" )
323+ render :update do |page |
324+ page << javascript_prologue
325+ page . replace ( "flash_msg_div" , :partial => "layouts/flash_msg" )
326+ page << "miqScrollTop();" if @flash_array . present?
327+ page . replace_html ( 'map_tags' , :partial => 'settings_map_tags_tab' )
328+ end
311329 end
312330 end
313331
@@ -336,7 +354,7 @@ def label_tag_mapping_delete
336354 page << javascript_prologue
337355 page . replace ( "flash_msg_div" , :partial => "layouts/flash_msg" )
338356 page << "miqScrollTop();" if @flash_array . present?
339- page . replace_html ( 'settings_label_tag_mapping ' , :partial => 'settings_label_tag_mapping_tab ' )
357+ page . replace_html ( 'map_tags ' , :partial => 'settings_map_tags_tab ' )
340358 end
341359 else
342360 mapping . errors . each { |error | add_flash ( "#{ error . attribute . to_s . capitalize } #{ error . message } " , :error ) }
@@ -360,7 +378,7 @@ def cat_description_without_prefix(cat_description)
360378 def tag_category_parameters_for_haml
361379 { :lt_map => @lt_map ,
362380 :categories => categories_for_select ,
363- :category => @edit [ :new ] [ :category ] || categories_for_select . first ,
381+ :category => @edit [ :new ] [ :category ] ,
364382 :all_entities => @edit [ :new ] [ :entity ] == ALL_ENTITIES }
365383 end
366384 end
0 commit comments