It looks like the private subnet disconnect button is the only button we have that does this. There doesn't appear to be a need to use an ajax submission in this case. However, javascript is still needed for the confirmation. Change the javascript to use a normal HTTP form submission if the method is POST, instead of using an ajax submission. This requires wrapping the button in an HTML form, so do that in the delete button template. Change the private subnet disconnect route to redirect after successful disconnect, instead of returning 204. Also, simplify the error handling in the disconnect route, and use handle_validation_failure. This allows the specs to use normal Capybara methods for clicking the button, instead of dropping down to rack-test methods. Use Disconnect as the label for the disconnect button. Previously, this just showed a trash icon, which was less accessible to non-visual users, and even for visual users, odd, because the trash icon is for deleting objects, and this does a disconnect and not a delete.
698 B
698 B