-
Notifications
You must be signed in to change notification settings - Fork 55
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
Fixes #37986, #37982 - Fix UI Error when importing templates #192
Conversation
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.
Thanks @adamlazik1 for taking this further. I'd propose a bit different fix:
Instead of
:validation_errors => errors,
try
:validation_errors => errors || {},
5081835
to
afa684e
Compare
@adamlazik1, yeah, sorry about that. It seems #190 was quite wrong, it should have been like this: https://github.com/ofedoren/foreman_templates/pull/1/files It also reverts changes in test file to the original state. |
Importing templates through UI causes an error and the page with import results does not load. Steps to Reproduce: 1. Have foreman instance with the templates plugin on nightly (error originates in one of the newest commits so it is not on stream yet). 2. Navigate to Hosts > Templates > Sync Templates 3. Import templates from https://github.com/theforeman/community-templates.git Actual behavior: The page with results does not load and two popups are displayed. One saying that templates have been imported succesfully and another saying that there has been an error. Expected behavior: Page with results loads normally and displays templates correctly.
afa684e
to
d813b0f
Compare
Thanks @ofedoren, I applied your patch and it fixes both the UI and the hammer issue. |
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.
Thanks, @adamlazik1 !
Importing templates through UI causes an error and the page with import results does not load.
Steps to Reproduce:
Have foreman instance with the templates plugin on nightly (error originates in one of the newest commits so it is not on stream yet).
Navigate to Hosts > Templates > Sync Templates
Import templates from https://github.com/theforeman/community-templates.git
Actual behavior:
The page with results does not load and two popups are displayed. One saying that templates have been imported succesfully and another saying that there has been an error.
Expected behavior:
Page with results loads normally and displays templates correctly.
It appears that UI expects the error messages to be wrapped in array as opposed to being just string, and hammer (theforeman/hammer-cli-foreman-templates#15) expects an empty hash instead of nil when there are no errors.