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

Make view selector of All Generic Objects page work #3423

Conversation

hstastna
Copy link

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

Make view selector of All Generic Objects page work, when attaching GO to a service
and navigating to Services > My Services > service with GO and clicking on Instances
from Generic Objects table (where we can change the view from tile also to grid/list).

Right before changing the view in All Generic Objects page (now default Tile view):
service_go

Before: (after clicking on Grid/List view from All Generic Objects page)
service_go_before

After:
service_go_grid
service_go_list

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

Make view selector of All Generic Objects page work, when attaching GO to a service
and navigating to Services > My Services > service with GO and clicking on Instances
from Generic Objects table (where we can change the view from tile also to grid/list).
@hstastna
Copy link
Author

hstastna commented Feb 19, 2018

@miq-bot add_label bug, gaprindashvili/yes

@miq-bot miq-bot added the bug label Feb 19, 2018
@miq-bot
Copy link
Member

miq-bot commented Feb 19, 2018

Checked commit hstastna@3b5b419 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🍪

@@ -69,6 +69,7 @@ def show
def set_display
@display = params[:display]
@display ||= default_display unless pagination_or_gtl_request?
@display ||= 'generic_objects' if role_allows?(:feature => "generic_object_view") && @record.number_of(:generic_objects).positive?
Copy link
Member

Choose a reason for hiding this comment

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

This looks strange. We want to set display to 'generic_objects' if the request is a pagination_or_gtl_request?

Copy link
Author

@hstastna hstastna Apr 9, 2018

Choose a reason for hiding this comment

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

@display was not set for All Generic Objects page and we needed it - this is why it did not work.

"We want to set display to 'generic_objects' if the request is a pagination_or_gtl_request?"
... Hmm, I see there something slightly different: if the request is a pagination_or_gtl_request, @display still does not have to be set to 'generic_objects', because there is condition: if role_allows?(:feature => "generic_object_view") && @record.number_of(:generic_objects).positive? which has to be true for @display to be set to generic_objects ... Or did you mean to change this condition to something else? This worked for me the best. I also think that @display does not have to be always set.

@martinpovolny martinpovolny merged commit ca2306d into ManageIQ:master May 23, 2018
@martinpovolny martinpovolny added this to the Sprint 87 Ending Jun 4, 2018 milestone May 23, 2018
@martinpovolny martinpovolny self-assigned this May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants