[PATCH conductor] BZ 786225 - New Image workflow tweak
Tomas Sedovic
tsedovic at redhat.com
Mon Feb 6 10:42:31 UTC 2012
On 02/02/2012 08:44 PM, Matt Wagner wrote:
> Building a new image no longer leads to a dead-end, but instead
> takes you to the image details view for the image you've just defined.
> ---
> src/app/controllers/deployables_controller.rb | 2 ++
> src/app/controllers/images_controller.rb | 6 +-----
> src/app/views/images/overview.html.haml | 3 ---
> .../controllers/deployables_controller_spec.rb | 2 +-
> 4 files changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/src/app/controllers/deployables_controller.rb b/src/app/controllers/deployables_controller.rb
> index 102722a..6fe75d3 100644
> --- a/src/app/controllers/deployables_controller.rb
> +++ b/src/app/controllers/deployables_controller.rb
> @@ -141,6 +141,8 @@ class DeployablesController< ApplicationController
> flash[:notice] = t("catalog_entries.flash.notice.added", :catalog => @selected_catalogs.map{|c| c.name}.join(", "))
> if params[:edit_xml]
> redirect_to edit_polymorphic_path([@selected_catalogs.first, @deployable], :edit_xml =>true)
> + elsif params[:create_from_image]
> + redirect_to @deployable
> else
> redirect_to catalog_path(@selected_catalogs.first)
> end
> diff --git a/src/app/controllers/images_controller.rb b/src/app/controllers/images_controller.rb
> index 997ab6a..cfdc969 100644
> --- a/src/app/controllers/images_controller.rb
> +++ b/src/app/controllers/images_controller.rb
> @@ -280,11 +280,7 @@ class ImagesController< ApplicationController
> :template => @template.uuid
> })
> flash.now[:error] = t('images.flash.notice.created')
> - if params[:make_deployable]
> - redirect_to new_deployable_path(:create_from_image => @image.id)
> - else
> - redirect_to image_path(@image.id)
> - end
> + redirect_to image_path(@image.id)
> end
>
> def edit
> diff --git a/src/app/views/images/overview.html.haml b/src/app/views/images/overview.html.haml
> index 0167513..0b716a1 100644
> --- a/src/app/views/images/overview.html.haml
> +++ b/src/app/views/images/overview.html.haml
> @@ -16,9 +16,6 @@
> %h2= t('.valid_image')
> %p.description= t('.description', :name => @name)
>
> - %fieldset.align-center
> - = check_box_tag :make_deployable, 1, true
> - = label_tag :make_deployable, t('.make_deployable', :name => @name)
> .centered
> %fieldset.align-center
> = submit_tag t('.back'), :name => 'back', :id => 'back_button', :class => 'button'
> diff --git a/src/spec/controllers/deployables_controller_spec.rb b/src/spec/controllers/deployables_controller_spec.rb
> index ec96d7c..6d51a33 100644
> --- a/src/spec/controllers/deployables_controller_spec.rb
> +++ b/src/spec/controllers/deployables_controller_spec.rb
> @@ -41,7 +41,7 @@ describe DeployablesController do
> hw_profile = FactoryGirl.create(:front_hwp1)
> catalog = FactoryGirl.create(:catalog)
> post(:create, :create_from_image => @image.id, :deployable => {:name => @image.name}, :hardware_profile => hw_profile.id, :catalog_id => catalog.id)
> - response.should redirect_to(catalog_url(catalog.id))
> + response.should be_redirect
> end
> end
>
ACK
More information about the aeolus-devel
mailing list