Skip to content

Commit

Permalink
Merge pull request ManageIQ#11830 from lgalis/tower_job_custom_dialog…
Browse files Browse the repository at this point in the history
…_reset_fail

No reset button for Job Template Service Dialog
  • Loading branch information
mzazrivec committed Oct 12, 2016
2 parents ed274e9 + 749c7ec commit cfa001a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/provider_foreman_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,7 @@ def construct_edit

def locals_for_service_dialog
{:action_url => 'service_dialog',
:no_reset => true,
:record_id => @sb[:rec_id] || @edit[:object_ids] && @edit[:object_ids][0]
}
end
Expand All @@ -1035,6 +1036,7 @@ def update_service_dialog_partials(presenter, r)
:locals => locals_for_service_dialog])
locals = {:record_id => @edit[:rec_id],
:action_url => "configscript_service_dialog_submit",
:no_reset => true,
:serialize => true}
presenter.update(:form_buttons_div, r[:partial => 'layouts/x_edit_buttons',
:locals => locals])
Expand Down
7 changes: 7 additions & 0 deletions spec/controllers/provider_foreman_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,13 @@
expect(response.status).to eq(200)
end

it "displays the new dialog form with no reset button" do
post :x_button, :params => {:pressed => 'configscript_service_dialog', :id => @cs.id}
expect(response.status).to eq(200)
expect(response.body).to include('Save Changes')
expect(response.body).not_to include('Reset')
end

it "Service Dialog is created from an Ansible Tower Job Template" do
controller.instance_variable_set(:@_params, :button => "save", :id => @cs.id)
allow(controller).to receive(:replace_right_cell)
Expand Down

0 comments on commit cfa001a

Please sign in to comment.