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
Fixes #8011 - When displaying Reports for a host, eventful=true should b... #1895
Conversation
…true should be the default
[test] |
thanks, but now I have three entries in the menu:
|
…true should be the default
[test] |
@@ -11,7 +11,17 @@ | |||
<ul class="dropdown-menu pull-right"> | |||
<% bookmarks = Bookmark.my_bookmarks.controller(controller_name) %> | |||
<% bookmarks.each do |bookmark| %> | |||
<li><%= link_to_if_authorized bookmark.name, send("hash_for_#{bookmark.controller}_path").merge(:search => bookmark.query) %></li> | |||
<% if bookmark.name == "eventful" or bookmark.name == "eventless" %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://devblog.avdi.org/2010/08/02/using-and-and-or-in-ruby/
In any case if you're checking if a variable is one of several values, this is a little more idiomatic:
['eventful', 'eventless'].include? bookmark.name
@yebeloved Thanks for the contribution! If you check the issue, I think we would favor more offering the user an easy way to display eventful/eventless/both reports. Defaulting to eventful would likely result in confusion by many of our existing users. Could you change this PR to do that? If the data (eventful/eventless reports) could load via AJAX after clicking a button or ticking something, it'd be really great, but if you're not comfortable with that do it through reusing the index action in the controller with search parameters. |
@elobato Thank you for your advise. I'll make the change. |
@yebeloved, |
Dear @yebeloved , |
Description of problem:
When accessing a hosts report (via Dashboard-> Select hostname), the user is presented with a great deal of reports, many of which have no eventful information. This RFE requests setting 'eventful=true' so that the end user doesn't have to wade through a large number of reports to get to the information they desire.
Version-Release number of selected component (if applicable):
foreman-1.6.0.46-1.el6sat.noarch
Dominic wrote,"Bit of a matter of opinion really, given there's a filter already there. I think when I'm using it, I'm perfectly happy to see non-eventful reports. Maybe a one-click way to add/remove eventful = true to the search would be very useful."
So I add two bookmarks, "eventful = true" and "eventful = false". If the input is "host = test" and "eventful = true" is clicked, the search condition will be set as "host = test and eventful = true". And if the input is "host = test" and "eventful = false" is clicked, the search condition will be set as "host = test and eventful = false".