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

Allow create Service Dialog from Template on Ansible/Templates screen, depending on navigation steps #6412

Merged

Conversation

hstastna
Copy link
Contributor

Issue: #6375

Relatively recently the Configuration toolbar button was added to Ansible Tower Templates screen, with possibility to create Service Dialog from a selected Template in the list. However, this button appeared also on the screen with the list of Templates related to selected node in accordion, for example related to Ansible Tower Automation Manager. While being in such a screen, creating Service Dialog did not work, nothing happened in the UI, and error occurred.

The problem is exactly here. It's easy to achieve the situation when both params[:id] and params[:miq_grid_checks] are set, so we are trying to find the selected item using the id which is in params[:id] because params[:id] is present, but we are not successful, obviously. We don't have proper id in this situation. The proper id we want to find the selected item is always in params[:miq_grid_checks] if params[:miq_grid_checks] is present. If this was not true, then the fix wouldn't work.

I've made change the way that it checks params[:miq_grid_checks] first. And if it is not present, we can find the selected item as originally - by id set in params[:id]. This works well in all the kinds of lists or in details pages of Templates under Automation > Ansible Tower > Explorer. Looks like params[:miq_grid_checks] is never present if we are in a details page or in a list view with the All Ansible Tower Templates node selected in accordion.

Related PR: #5968


Before: (nothing happens in the UI)
template_before

After:
template_after

@hstastna
Copy link
Contributor Author

@miq-bot add_label bug, automation/ansible tower, ivanchuk/no

@hstastna
Copy link
Contributor Author

@miq-bot add_reviewer @skateman

@miq-bot
Copy link
Member

miq-bot commented Nov 13, 2019

Checked commit hstastna@694438e with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🏆

Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Seal of Approval

@mzazrivec mzazrivec added this to the Sprint 125 Ending Nov 25, 2019 milestone Nov 14, 2019
@mzazrivec mzazrivec self-assigned this Nov 14, 2019
@mzazrivec mzazrivec merged commit ac919f5 into ManageIQ:master Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants