Skip to content

Commit

Permalink
Remove all references to the method ui_namespace
Browse files Browse the repository at this point in the history
Co-authored-by: David Kang <dkang@suse.com>
  • Loading branch information
saraycp and David Kang committed Sep 13, 2019
1 parent 4c35984 commit cddbc33
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/api/app/controllers/webui/package_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ def save_file

switch_to_webui2
status ||= 200
render layout: false, status: status, partial: "layouts/#{ui_namespace}/flash", object: flash
render layout: false, status: status, partial: 'layouts/webui/flash', object: flash
end

def remove_file
Expand Down Expand Up @@ -1039,7 +1039,7 @@ def save_meta
status = 400
end
switch_to_webui2
render layout: false, status: status, partial: "layouts/#{ui_namespace}/flash", object: flash
render layout: false, status: status, partial: 'layouts/webui/flash', object: flash
end

def edit; end
Expand Down Expand Up @@ -1070,7 +1070,7 @@ def validate_xml
@meta_xml = Xmlhash.parse(params[:meta])
rescue Suse::ValidationError => e
flash.now[:error] = "Error while saving the Meta file: #{e}."
render layout: false, status: 400, partial: "layouts/#{ui_namespace}/flash", object: flash
render layout: false, status: 400, partial: 'layouts/webui/flash', object: flash
end

def package_files(rev = nil, expand = nil)
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/controllers/webui/projects/meta_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def update
400
end
switch_to_webui2
render layout: false, status: status, partial: "layouts/#{ui_namespace}/flash", object: flash
render layout: false, status: status, partial: 'layouts/webui/flash', object: flash
end

private
Expand All @@ -32,7 +32,7 @@ def validate_meta
meta_validator.call
if meta_validator.errors?
flash.now[:error] = meta_validator.errors
render layout: false, status: 400, partial: "layouts/#{ui_namespace}/flash", object: flash
render layout: false, status: 400, partial: 'layouts/webui/flash', object: flash
else
@request_data = meta_validator.request_data
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def update
400
end
switch_to_webui2
render layout: false, status: status, partial: "layouts/#{ui_namespace}/flash", object: flash
render layout: false, status: status, partial: 'layouts/webui/flash', object: flash
end
end
end
Expand Down
5 changes: 0 additions & 5 deletions src/api/app/controllers/webui/webui_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,6 @@ def switch_to_webui2?
true
end

# TODO: remove and replace where used after migrating all the controllers
def ui_namespace
switch_to_webui2? ? 'webui2' : 'webui'
end

# TODO: remove after migrating all the controller
def switch_to_webui2
if switch_to_webui2?
Expand Down

0 comments on commit cddbc33

Please sign in to comment.