-
Notifications
You must be signed in to change notification settings - Fork 356
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
Fix Default Views settings for Service Catalogs #3487
Fix Default Views settings for Service Catalogs #3487
Conversation
@miq-bot add_label bug |
@@ -1426,6 +1426,9 @@ def get_view(db, options = {}, fetch_data = false) | |||
sortcol_sym = "#{sort_prefix}_sortcol".to_sym | |||
sortdir_sym = "#{sort_prefix}_sortdir".to_sym | |||
|
|||
# Change db_sym for proper setting of @gtl_type as Service Catalogs and Catalog Items use the same db | |||
db_sym = :catalog if x_active_tree == :svccat_tree && %w(servicetemplate).include?(db_sym.to_s) |
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.
Look at line 1391:
db_sym = (options[:gtl_dbname] || dbname).to_sym # Get db name as symbol
you should be able to pass gtl_dbname
in options to override db_sym
there.
(So that this very service-specific code can live in the service(?) controller, instead of in application controller.)
Any reason you can't do that?
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.
I was expecting similar comment on this because yes, it would be nicer to have this change implemented in catalog controller (catalog for now, not service), not here in app controller. App controller is more general but I tried to push there this specific thing, because it is simple, straight, clear and it works well comparing to what I was trying to add in catalog controller. I better pushed here what really works. What I forgot was to move this PR to WIP till I find nicer and working solution (we both know now that I probably was doing something wrong that such a simple thing as passing gtl_dbname in options did not work for me). Thank you!
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.
👍 thanks, looks much better now :)
95f5879
to
42bb5ba
Compare
42bb5ba
to
e6d1947
Compare
@hstastna when i click on a Service Catalog name in the tree, that does not honor the list view type setting, see attached screenshots |
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1404207 Fix Default Views settings for Services > Catalogs > Service Catalogs accordion.
e6d1947
to
971c8f3
Compare
b3e0f32
to
08d4647
Compare
@h-kataria Thank you for your catch, Harpreet, Now it should work well in every node in Service Catalogs. I also added spec test for my change :) (rubocop issue also fixed) |
Add spec test to check options for Service Catalogs page view in service_template_list method, for proper setting of @gtl_type variable in application controller.
08d4647
to
e54d3b9
Compare
Checked commits hstastna/manageiq-ui-classic@971c8f3~...e54d3b9 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
…catalogs Fix Default Views settings for Service Catalogs (cherry picked from commit 819ebed) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1553336
Gaprindashvili backport details:
|
@miq-bot add_label test |
…catalogs Fix Default Views settings for Service Catalogs (cherry picked from commit 819ebed) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1553337
Fine backport details:
|
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1404207
More info: #3469
Fix Default Views settings for Services > Catalogs > Service Catalogs accordion.
Setting up new Default Views settings for Service Catalogs (tile view):
![service_cat_tile](https://user-images.githubusercontent.com/13417815/36739412-1bcbf5ba-1be0-11e8-92e4-6ae13c3b3936.png)
Before: (still list view)
![service_cat_bad](https://user-images.githubusercontent.com/13417815/36739559-881dde54-1be0-11e8-88dc-3773812c638c.png)
After:(tile view as expected)
![service_cat_ok](https://user-images.githubusercontent.com/13417815/36739222-b7109bf8-1bdf-11e8-9a82-fc4945352d25.png)
Note:
Changing between views in Service Catalogs now also works properly.