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

[DARGA] ops_rbac - group detail - don't render trees that are not visible #13471

Merged
merged 14 commits into from
Jan 16, 2017
Merged

[DARGA] ops_rbac - group detail - don't render trees that are not visible #13471

merged 14 commits into from
Jan 16, 2017

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Jan 12, 2017

This is a darga version of ManageIQ/manageiq-ui-classic#68 - lazy-load right-side trees in rbac group detail.

(Euwe version is in #13399)

https://bugzilla.redhat.com/show_bug.cgi?id=1399345
https://bugzilla.redhat.com/show_bug.cgi?id=1412441 (darga)

since #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

(cherry picked from commit 2b1da75)
…edit

@filters were unused in TreeBuilderBelongsTo*

(cherry picked from commit db39aee)
…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

(cherry picked from commit 62aaf8f)
..and enable the tabs to be lazy

(cherry picked from commit eb96dc7)
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)

(cherry picked from commit 90b0e86)
a long line, and a trailing _ in array assignment

(cherry picked from commit a7b219c)
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 :)

(cherry picked from commit 6a33db2)
…r lazy loading the tab

otherwise, ManageIQ.record.recordId gets overwritten with null, causing the toolbar to generate an url without an id

(cherry picked from commit fb3a0e7)
(cherry picked from commit a110791)
(cherry picked from commit c99485e)
technically cherry-picked from 01193c0
same change, different code
@himdel
Copy link
Contributor Author

himdel commented Jan 13, 2017

Error caught: [NoMethodError] undefined method `for_render' for #<ExplorerPresenter:0x007f0497578af8>
/home/himdel/manageiq/app/controllers/ops_controller.rb:230:in `rbac_group_load_tab'

himdel and others added 2 commits January 13, 2017 12:39
…resenter

because render :json => presenter.for_render is too new for darga
upstream version in #9741

backporting to darga because this breaks the split ops rbac group trees

(cherry picked from commit b8dbd6f)
@himdel himdel changed the title [WIP] [DARGA] ops_rbac - group detail - don't render trees that are not visible [DARGA] ops_rbac - group detail - don't render trees that are not visible Jan 13, 2017
@miq-bot miq-bot removed the wip label Jan 13, 2017
@miq-bot
Copy link
Member

miq-bot commented Jan 13, 2017

Checked commits https://github.com/himdel/manageiq/compare/e66e26ae5f228353f227dbc15c1363cf4c8fcdf0~...6b5827fb4b2a2e29766770cbbe27cd9dca27cffe with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
10 files checked, 43 offenses detected

app/controllers/ops_controller/ops_rbac.rb

app/views/layouts/_multi_auth_credentials.html.haml

  • ⚠️ - Line 13 - Redundant curly braces around a hash parameter.
  • ⚠️ - Line 16 - Redundant curly braces around a hash parameter.
  • ⚠️ - Line 19 - Redundant curly braces around a hash parameter.
  • ⚠️ - Line 22 - Redundant curly braces around a hash parameter.
  • ⚠️ - Line 24 - Redundant curly braces around a hash parameter.
  • ⚠️ - Line 26 - Redundant curly braces around a hash parameter.
  • ⚠️ - Line 9 - Redundant curly braces around a hash parameter.

app/views/ops/_rbac_group_details.html.haml

  • ⚠️ - Line 171 - Redundant curly braces around a hash parameter.
  • ⚠️ - Line 173 - Redundant curly braces around a hash parameter.
  • ⚠️ - Line 175 - Redundant curly braces around a hash parameter.
  • ⚠️ - Line 179 - Redundant curly braces around a hash parameter.
  • ⚠️ - Line 181 - Redundant curly braces around a hash parameter.
  • ⚠️ - Line 183 - Redundant curly braces around a hash parameter.

app/views/ops/rbac_group/_customer_tags.html.haml

  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.

app/views/ops/rbac_group/_hosts_clusters.html.haml

  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.

app/views/ops/rbac_group/_vms_templates.html.haml

  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.
  • ⚠️ - Line 6 - Operator => should be surrounded by a single space.

@simaishi simaishi merged commit 1530dfc into ManageIQ:darga Jan 16, 2017
@himdel himdel deleted the darga-rbac-group-split-trees branch January 19, 2017 13:11
@simaishi simaishi added this to the Sprint 52 Ending Jan 16, 2017 milestone Jan 19, 2017
cben added a commit to cben/manageiq that referenced this pull request Mar 20, 2017
Call changeAuthTab from more miq_tab_header()s
miq_tab_header() once did this automatically, that was disabled by
ManageIQ/manageiq-ui-classic@2b1da75
[backported to darga as commit e66e26a in ManageIQ#13471]
and explicit ng-click was added to some tab headers but not all,
this adds some more.

https://bugzilla.redhat.com/show_bug.cgi?id=1434064 (master)
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.

5 participants