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

ops_rbac - group detail - don't render trees that are not visible #68

Merged
merged 12 commits into from
Jan 6, 2017
Merged

ops_rbac - group detail - don't render trees that are not visible #68

merged 12 commits into from
Jan 6, 2017

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Jan 4, 2017

Go to Configuration > Access Control > Groups - select a group

On the right side, there are 3 tabs: my company tags, h&c and v&t - each of these contains a tree.

Right now, all 3 trees are instantiated and rendered at the same time, which is unfortunate because the first tab's tree takes only about 10% of the time.

This enables the tabs to be lazy-loaded, causing the right tree to get rendered the first time a tab is opened. (Then it's cached in the browser.)

(No visible UI changes, except you get a spinner when loading the tab.)

Cc @ZitaNemeckova

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

himdel added 6 commits January 4, 2017 12:55
since ManageIQ/manageiq#3859 (comment), `miq_tab_header` would put ng-click (hardcoded to call `changeAuthTab`) on every tab header, even though it makes no sense for most tabs

Fixed by moving the ng-click value explicitly to options, and passing it from where `ng-click` is actually needed

Also added :onclick to options, so that custom functionality can be added in non-angular tabs too.

miq_tab_content now also takes a :lazy option, which causes the tab content to render only if the tab is currently active
…detail

this is used to keep track of the current tab in rbac_group detail

not using `@sb[:active_tab]` because technically, the whole rbac detail is a tab (of one), aand there's code that assumes a `#{@sb[:active_tab]}_tab` partial exists
only loaded once, then it's kept in the browser

(so only the first time one switches to a tab, a round trip is needed)
himdel added 4 commits January 4, 2017 16:53
a long line, and a trailing _ in array assignment
This makes rbac_group_load_tab setup @edit, so that the trees can be autoloaded even in form edit.

And moved @edit=nil outside rbac_group_get_details (to the original caller), so as not to undo that :)
…r lazy loading the tab

otherwise, ManageIQ.record.recordId gets overwritten with null, causing the toolbar to generate an url without an id
@himdel himdel changed the title [WIP] ops_rbac - group detail - don't render trees that are not visible ops_rbac - group detail - don't render trees that are not visible Jan 5, 2017
@himdel
Copy link
Contributor Author

himdel commented Jan 5, 2017

Also cc @kbrock :) (because you're on the BZ too..)

@himdel himdel removed the wip label Jan 6, 2017
@mzazrivec mzazrivec self-assigned this Jan 6, 2017
@miq-bot
Copy link
Member

miq-bot commented Jan 6, 2017

Checked commits https://github.com/himdel/manageiq-ui-classic/compare/2b1da75e4d389b1212f3db1b2885016a047846ee~...c99485e1eda37bfd8c34908833f4874ace1eab5b with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
10 files checked, 3 offenses detected

**

  • 💣 💥 🔥 🚒 - Linter/Haml - missing config files

app/controllers/ops_controller/ops_rbac.rb

spec/views/ops/_rbac_group_details.html.haml_spec.rb

  • ❗ - Line 18, Col 9 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.

@mzazrivec mzazrivec added this to the Sprint 52 Ending Jan 16, 2017 milestone Jan 6, 2017
@mzazrivec mzazrivec merged commit 04f272a into ManageIQ:master Jan 6, 2017
@himdel himdel deleted the rbac_group-split-trees-bz1399345 branch January 6, 2017 16:04
@himdel
Copy link
Contributor Author

himdel commented Jan 6, 2017

euwe PR in ManageIQ/manageiq#13399

@simaishi
Copy link
Contributor

Backported to Euwe via ManageIQ/manageiq#13399

@simaishi
Copy link
Contributor

Backported to Darga via ManageIQ/manageiq#13471

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.

4 participants