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

Support for hidden columns in reports and views #17133

Merged
merged 2 commits into from
Mar 20, 2018

Conversation

gtanzillo
Copy link
Member

Columns, including headers, with MiqReport#col_options[<column_name>][:hidden] == true should not
are included in html, pdf, text output formats and only be included in csv

UI changes in ManageIQ/manageiq-ui-classic#3564

/cc @dclarizio

Columns, including headers, with MiqReport#col_options[<column_name>][:hidden] == true should not
are included in html, pdf, text output formats and only be included in csv

@hidden_cols ||= col_options.keys.each_with_object([]) do |c, a|
a << c if col_options[c][:hidden]
a
Copy link
Member

Choose a reason for hiding this comment

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

You do not need the array as the last line in the block when using each_with_object. This line can be removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

@gmcculloug I was going to remove that but then I realized that if the column is not hidden, the last line in the block would be nil. Not sure if that's correct. I'll need to try it. Thanks.

@bzwei
Copy link
Contributor

bzwei commented Mar 13, 2018

@miq-bot add_label transformation

@miq-bot miq-bot added the v2v label Mar 13, 2018
@gmcculloug
Copy link
Member

I was able to validate this PR by added the following changes in the ui-classic repo.

--- a/product/views/VmOrTemplate.yaml
+++ b/product/views/VmOrTemplate.yaml
@@ -27,6 +27,12 @@ cols:
 - allocated_disk_storage
 - last_scan_on
 - region_description
+- uid_ems
+
+col_options:
+  uid_ems:
+    :hidden: true
+
 
 # Included tables (joined, has_one, has_many) and columns
 include:
@@ -75,6 +81,7 @@ headers:
 - Allocated Size
 - Last Analysis Time
 - Region
+- uid_ems

@gtanzillo gtanzillo force-pushed the report-hidden-cols branch from 3e535fc to cc9fd3a Compare March 19, 2018 19:30
@gtanzillo gtanzillo removed the wip label Mar 19, 2018
@gtanzillo gtanzillo changed the title [WIP] Support for hidden columns in reports and views Support for hidden columns in reports and views Mar 19, 2018
@gtanzillo gtanzillo force-pushed the report-hidden-cols branch from cc9fd3a to eb3e0b0 Compare March 19, 2018 20:54
@miq-bot
Copy link
Member

miq-bot commented Mar 19, 2018

Checked commits gtanzillo/manageiq@7b22d8f~...eb3e0b0 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
4 files checked, 0 offenses detected
Everything looks fine. 🍪

@gtanzillo
Copy link
Member Author

@gmcculloug This should be good to go

@gmcculloug gmcculloug merged commit 2206775 into ManageIQ:master Mar 20, 2018
@gmcculloug gmcculloug added this to the Sprint 82 Ending Mar 26, 2018 milestone Mar 20, 2018
@simaishi
Copy link
Contributor

simaishi commented Mar 22, 2018

@gtanzillo Please add BZ link.

Edit: never mind... it's for v2v.

simaishi pushed a commit that referenced this pull request May 29, 2018
Support for hidden columns in reports and views
(cherry picked from commit 2206775)
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit 0a950abc0a2fefadf4b52aa7e09b9e1a2ab7ea56
Author: Greg McCullough <[email protected]>
Date:   Tue Mar 20 10:35:36 2018 -0400

    Merge pull request #17133 from gtanzillo/report-hidden-cols
    
    Support for hidden columns in reports and views
    (cherry picked from commit 220677511a07ad56f4587133269c62a3ecde3c98)

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.

6 participants