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
Catch 400 error and display it in flash message in GOD #4951
Catch 400 error and display it in flash message in GOD #4951
Conversation
@ZitaNemeckova The codecliemate warnings are worth fixing here. |
783cd44
to
50ec898
Compare
65fb15d
to
4e4ab87
Compare
@miq-bot remove_label wip |
app/assets/javascripts/components/generic_object/main-custom-button-form-component.js
Show resolved
Hide resolved
…no longer is used
d19a8f9
to
74e4143
Compare
.then(miqService.redirectBack.bind(vm, saveMsgBtnInGrp, 'success', vm.redirectUrl)) | ||
.catch(miqService.handleFailure); | ||
// private functions | ||
function handleErrorMessages(error) { |
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.
missing miqSparkleOff()
it never stops sparkling on error
@@ -125,13 +125,32 @@ function mainCustomButtonFormController(API, miqService, $q, $http) { | |||
}; | |||
|
|||
vm.saveClicked = function() { | |||
miqService.sparkleOn(); |
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.
..and we probably need miqService.miqFlashClear();
in both saveClicked and addClicked.
Because otherwise:
-
fail the validation with duplicate name
=> Name has already been taken appears -
fix the name (and also edit the description)
-
fail the validation with duplicate desciption
=> Desciption has already been taken appears -
you're seeing both flash messages, but one is obsolete now
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.
(or you could just replace add_flash
with miqService.miqFlash
, but that would not work when both are supposed to be shown, so you'd have to merge the messages into one)
Verified adding a new button works, So just the error path now :). |
@@ -221,6 +223,7 @@ function mainCustomButtonFormController(API, miqService, $q, $http) { | |||
} else { | |||
return miqService.handleFailure(); | |||
} | |||
miqSparkleOff(); |
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.
wrong place :) Before the returns please :)
ae1bb63
to
2035006
Compare
Checked commits ZitaNemeckova/manageiq-ui-classic@55d7178~...2035006 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Catch 400 error and display it in flash message in GOD (cherry picked from commit 6565204) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1686018
Hammer backport details:
|
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1650085
Go to Automation -> Automate -> Generic Object Definition -> create/edit a button -> give it same name/description that some other button already has
Before:
After:
@miq-bot add_label wip, automation/automate, bug, hammer/yes