Skip to content
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

Dialog editor - don't show error modal when validation failed #2075

Merged
merged 4 commits into from
Sep 5, 2017
Merged

Dialog editor - don't show error modal when validation failed #2075

merged 4 commits into from
Sep 5, 2017

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Sep 1, 2017

In #1976, we enabled the error modal for API use.

This is one of the places where an error from the API was already being handled by the code, and should not have an error modal.

https://bugzilla.redhat.com/show_bug.cgi?id=1486688


This also changes the API error modal opt-out mechanism:

before:

API.get('/foo') - shows error modal on any 4** and 5** response
API.get.noErrorModal('/foo') - never shows error modal

now:

API.get('/foo') - shows error modal on any 4** and 5** response
API.get('/foo', { skipErrors: true }) - never shows error modal
API.get('/foo', { skipErrors: [400, 404] }) - show error modal an all 4** and 5**, except for 400 and 404

(for methods taking data (put, post), options is the third argument)

before:

API.get('/foo') - shows error modal on any 4** and 5** response
API.get.noErrorModal('/foo') - never shows error modal

now:

API.get('/foo') - shows error modal on any 4** and 5** response
API.get('/foo', { skipErrors: true }) - never shows error modal
API.get('/foo', { skipErrors: [400, 404] }) - show error modal an all 4** and 5**, except for 400 and 404

(for methods taking data (put, post), options is the third argument)
validation errors from servers are handled by flashing the message, no need to show the error modal - skipping any 400 responses

https://bugzilla.redhat.com/show_bug.cgi?id=1486688
@himdel himdel removed the wip label Sep 4, 2017
@himdel himdel changed the title [WIP] Dialog editor - don't show error modal when validation failed Dialog editor - don't show error modal when validation failed Sep 4, 2017
@miq-bot
Copy link
Member

miq-bot commented Sep 4, 2017

Checked commits https://github.com/himdel/manageiq-ui-classic/compare/fcc6248a4432482398120412dbdb4565e4042457~...d99ae16896de0105d3ee5572fda393b710abcd83 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
0 files checked, 0 offenses detected
Everything looks fine. ⭐

@martinpovolny martinpovolny added this to the Sprint 69 Ending Sep 18, 2017 milestone Sep 5, 2017
@martinpovolny martinpovolny merged commit 6ed6f2b into ManageIQ:master Sep 5, 2017
@martinpovolny martinpovolny self-assigned this Sep 5, 2017
@himdel himdel deleted the dialog-400-bz1486688 branch February 14, 2019 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants