-
Notifications
You must be signed in to change notification settings - Fork 358
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
Ansible repository refresh button on subpage #4160
Comments
@Glutexo In #3721 I removed only the lines of the code which I have added before by mistake, while adding tagging feature for Ansible Playbooks, ... (for example here: #3522) It turned out that that PR caused many problems (I mean the way I've added toolbar to the pages), especially for nested lists, tagging, etc. I fixed that by #3721. While displaying nested lists, Refresh button was never designed to be there. If you need Refresh button for some reason in Ansible Playbooks, ..., you need to make changes in app/helpers/application_helper/toolbar/ansible_playbooks_center.rb. |
@hstastna I don’t need that button. It might make sense to have one there, since it is on the main show page, but if it was not intended, it’s still fine not to have it. My only concern was that there is already some code that handles this button on the Playbooks subpage. I can prepare a PR that removes this remnants. 🧹 That will clean up the code (and specs) a bit and also gets rid of the |
@Glutexo Where exactly is the code that "handles this button on the Playbooks subpage" ? I can't see it, at least not in ansible playbook controller where I would expect that. |
It‘s this line:
@display value (from memory I guess) by pretending it came in a request. It is then picked up by GenericShowMixin#init_show and stored back into @display instead of its default value 'main' .
If it wasn’t there, pushing the refresh button on the playbooks subpage would cause the main div content to be replaced by the main show content. It still doesn’t work well however, because |
@Glutexo It's because Ansible Repositories have Refresh button. Others not. But.. I still don't understand the problem well. Could you write down the exact steps to reproduce the problem? And let's assume that we don't want Refresh button on any subpage. |
@hstastna If we assume that we don’t need the refresh button on the subpages, then it’s not necessary to fix this line and reproduce the bug it causes. In such case, the line is only redundant and can be removed with a few spec examples. I created a PR that removes this unused code: #4163 If you were still interested in why this line was troublesome in the first place, here are steps to reproduce:
If you do this, the contents of the main div is replaced by the repository’s main show page. Normally it should be replaced by an updated version of the playbooks subpage contents. This doesn’t matter anymore though if the code is going to be removed and there is no intention in returning the reload button to the subpage. |
Changes in #3721 by @hstastna made refresh button on playbooks subpage disappear. It is now only present on the main repository show page. Was this an intention?
There is a [piece of code] in ansible_repository_controller.rb handling the refresh button. It contains some rather obscure manipulation with the
@display
andparams[:display]
values:manageiq-ui-classic/app/controllers/ansible_repository_controller.rb
Line 44 in 37a9337
manageiq-ui-classic/app/controllers/mixins/generic_show_mixin.rb
Line 121 in 37a9337
If we want to have the refresh button there, I’d suggest:
@display
andparams[:display]
handling. Currently it is not easily understandable what is going on there.In case the refresh button should not be present on the subpages, it would be good to remove the code that is there only to support this feature:
manageiq-ui-classic/spec/controllers/ansible_repository_controller_spec.rb
Line 54 in 09a453a
manageiq-ui-classic/app/controllers/ansible_repository_controller.rb
Line 43 in 09a453a
The text was updated successfully, but these errors were encountered: