New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DARGA] Display error when the ajax request fails #13690
[DARGA] Display error when the ajax request fails #13690
Conversation
@miq-bot add_label wip, ui, bug |
bdc27cd
to
1214bba
Compare
@@ -790,15 +790,20 @@ function miqAjaxButtonSend(url, serialize_fields) { | |||
|
|||
// Function to generate an Ajax request | |||
function miqAjax(url, serialize_fields) { | |||
var data = undefined; | |||
var data = 'undefined'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is broken, you really need to initialize to undefined
, not 'undefined'
otherwise if you don't overwrite it, it will send malformed data to the server - sends a string instead of nothing.
..and after that, the reson the specs are failing now is that whenever we mock Specifically, I think you're looking for spyOn(window, 'miqJqueryRequest').and.callFake(function () {
return {
then: function (ok, err) {
err()
},
catch: function (err) {
err()
},
};
}); should help :) (and an identical change in the next EDIT: fixed |
79eb624
to
e49d864
Compare
e49d864
to
2ff8a4a
Compare
LGTM 👍 |
Checked commit lgalis@2ff8a4a with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@miq-bot remove_label wip |
Darga backport for #12785
Links
#12785
darga BZ
https://bugzilla.redhat.com/show_bug.cgi?id=1399769