-
Notifications
You must be signed in to change notification settings - Fork 356
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
Fix Features Tree for "everything under" features #1229
Conversation
@hayesr what's the structure of the items in the case where the JS thing doesn't work? Trying to understand why that happens.. Sounds like "features not available in the menu" is something we need to show in the tree too.. |
@himdel This tree is really a merger of MiqProductFeatures hierarchy and the main menu hierarchy. At the higher levels of the tree, we show I suppose we could show an extra node under that, but it would look weird. Alternatively we could add a feature attribute to |
87fb64a
to
9b3e899
Compare
Original description and commit had the wrong BZ reference. Correct one is https://bugzilla.redhat.com/show_bug.cgi?id=1442796 |
Well, it still baffles me that we can hide features from a tree that's supposed to let you assign those features to |
Not as far as I can tell. The edit-mode-tree sends all the features then they are compacted. |
Can we merge this @himdel @h-kataria ? |
Well, the problem with not being able to assign certain features looks real, but could probably be addressed in a separate PR, this just fixes a bug, so I'd say yes... .. except it doesn't work :). Create a new role, check just Automation > Ansible and Automation > Ansible Tower, Save. I'd expect those 2 things to be checked, and the rest not. What happens is that the user has Everything. Can you please fix that? :) |
( This does however fix the situation where you pick an existing role which does not have Everything, and has nothing under Automation, check Automation > Ansible, save... In master, Ansible is not checked, with this PR, it is. 👍 ) |
So.. will you be addressing the new role problem in a separate PR? Since I can verify that this fixes at least this one bug, I'm inclined to merge, unless both make sense here? |
@himdel I'm finally getting back to this, I do plan on fixing the problem you found. |
@himdel The problem seems to be with the form and only in the process of creating a new role. If you toggle Everything (top of the tree) on and off, then select items as you describe it works. |
…. This causes the new role form to be unchecked despite the role having the “everything” feature.
9b3e899
to
b8c1008
Compare
Checked commits hayesr/manageiq-ui-classic@67980fc~...b8c1008 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
It seems from the controller code that the intended behavior for the role form is that everything is checked initially. In the tree builder the features ivar would end up empty for new records. This should be fixed now. Ready for another look @himdel @h-kataria |
Perfect, thanks @hayesr! (The travis failure is the same as on master, will re-kick travis when it is fixed.) |
Go to Configuration > Access Control > Roles, pick a role - the tree is on the right, in the role detail.
In #137 we set the select state of a node based on whether the role has the feature identifier for the corresponding part of the tree. Then we depend on the client side to check parents and children of that node. However, some features have no equivalent in the menu, so when the role has a feature like "Everything under Ansible" nothing would be selected.
See:
https://bugzilla.redhat.com/show_bug.cgi?id=1442796
This should not be backported.
@dclarizio @skateman @martinpovolny @himdel
Checking nodes with only Javascript was too good to be true. We have to do a little work on the server to cover cases like this.
@miq-bot add_label bug, fine/no, euwe/no