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

Rename new guest device pages #16996

Merged
merged 3 commits into from
Feb 26, 2018
Merged

Conversation

skovic
Copy link

@skovic skovic commented Feb 13, 2018

This PR renames the new guest device pages introduced in ManageIQ/manageiq-ui-classic#3398 to network device pages. Also, a filter method was added to the guest device model for displaying only ethernet devices. In addition, the physical server model was updated with an association to guest devices.

@skovic
Copy link
Author

skovic commented Feb 13, 2018

@miq-bot add_label wip

@miq-bot miq-bot changed the title Rename new guest device pages [WIP] Rename new guest device pages Feb 13, 2018
@miq-bot miq-bot added the wip label Feb 13, 2018
@miq-bot
Copy link
Member

miq-bot commented Feb 20, 2018

Checked commits skovic/manageiq@4a11b65~...fbf750f with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 1 offense detected

app/models/physical_server.rb

@skovic
Copy link
Author

skovic commented Feb 21, 2018

@miq-bot add_label providers/physical

@skovic
Copy link
Author

skovic commented Feb 21, 2018

@miq-bot remove_label wip

@miq-bot miq-bot changed the title [WIP] Rename new guest device pages Rename new guest device pages Feb 21, 2018
@miq-bot miq-bot removed the wip label Feb 21, 2018
@skovic
Copy link
Author

skovic commented Feb 21, 2018

@agrare When you get a chance, could you take a look at this? Thanks

@@ -14,4 +14,10 @@ class GuestDevice < ApplicationRecord

has_many :firmwares, :dependent => :destroy
has_many :child_devices, -> { where(:parent_device_id => ids) }, :foreign_key => "parent_device_id", :class_name => "GuestDevice", :dependent => :destroy

alias_attribute :name, :device_name
Copy link
Member

Choose a reason for hiding this comment

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

Why was this needed? I don't disagree that guest_device.device_name is a bit repetitive but could this work with just using device_name?

Copy link
Author

Choose a reason for hiding this comment

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

@agrare Without this alias, I get an error when I try to access the guest device summary page in the UI. Here is the backtrace of the error from development.log:

[----] F, [2018-02-26T11:10:45.064300 #4797:2afb9bcf2a44] FATAL -- : Error caught: [NoMethodError] undefined method `name' for #<GuestDevice:0x007f03c8a1ae28>
/home/skovic/.gem/ruby/gems/activemodel-5.0.6/lib/active_model/attribute_methods.rb:433:in `method_missing'
/home/skovic/dev/network-device/manageiq-ui-classic/app/controllers/mixins/generic_show_mixin.rb:81:in `show_main'
/home/skovic/dev/network-device/manageiq-ui-classic/app/controllers/mixins/generic_show_mixin.rb:13:in `show'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/abstract_controller/base.rb:188:in `process_action'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_controller/metal/rendering.rb:30:in `process_action'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/home/skovic/.gem/ruby/gems/activesupport-5.0.6/lib/active_support/callbacks.rb:126:in `call'
/home/skovic/.gem/ruby/gems/activesupport-5.0.6/lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
/home/skovic/.gem/ruby/gems/activesupport-5.0.6/lib/active_support/callbacks.rb:455:in `call'
/home/skovic/.gem/ruby/gems/activesupport-5.0.6/lib/active_support/callbacks.rb:101:in `__run_callbacks__'
/home/skovic/.gem/ruby/gems/activesupport-5.0.6/lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
/home/skovic/.gem/ruby/gems/activesupport-5.0.6/lib/active_support/callbacks.rb:90:in `run_callbacks'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/abstract_controller/callbacks.rb:19:in `process_action'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_controller/metal/rescue.rb:20:in `process_action'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/home/skovic/.gem/ruby/gems/activesupport-5.0.6/lib/active_support/notifications.rb:164:in `block in instrument'
/home/skovic/.gem/ruby/gems/activesupport-5.0.6/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/skovic/.gem/ruby/gems/activesupport-5.0.6/lib/active_support/notifications.rb:164:in `instrument'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
/home/skovic/.gem/ruby/gems/activerecord-5.0.6/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/abstract_controller/base.rb:126:in `process'
/home/skovic/.gem/ruby/gems/actionview-5.0.6/lib/action_view/rendering.rb:30:in `process'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_controller/metal.rb:190:in `dispatch'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_controller/metal.rb:262:in `dispatch'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/routing/route_set.rb:32:in `serve'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/journey/router.rb:39:in `block in serve'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/journey/router.rb:26:in `each'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/journey/router.rb:26:in `serve'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/routing/route_set.rb:727:in `call'
/home/skovic/.gem/ruby/bundler/gems/manageiq-graphql-334da8c9270b/lib/manageiq/graphql/rest_api_proxy.rb:18:in `call'
/home/skovic/.gem/ruby/gems/secure_headers-3.0.3/lib/secure_headers/middleware.rb:10:in `call'
/home/skovic/.gem/ruby/gems/rack-2.0.4/lib/rack/etag.rb:25:in `call'
/home/skovic/.gem/ruby/gems/rack-2.0.4/lib/rack/conditional_get.rb:25:in `call'
/home/skovic/.gem/ruby/gems/rack-2.0.4/lib/rack/head.rb:12:in `call'
/home/skovic/.gem/ruby/gems/rack-2.0.4/lib/rack/session/abstract/id.rb:232:in `context'
/home/skovic/.gem/ruby/gems/rack-2.0.4/lib/rack/session/abstract/id.rb:226:in `call'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/middleware/cookies.rb:613:in `call'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
/home/skovic/.gem/ruby/gems/activesupport-5.0.6/lib/active_support/callbacks.rb:97:in `__run_callbacks__'
/home/skovic/.gem/ruby/gems/activesupport-5.0.6/lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
/home/skovic/.gem/ruby/gems/activesupport-5.0.6/lib/active_support/callbacks.rb:90:in `run_callbacks'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/middleware/callbacks.rb:36:in `call'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/middleware/executor.rb:12:in `call'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
/home/skovic/.gem/ruby/gems/railties-5.0.6/lib/rails/rack/logger.rb:36:in `call_app'
/home/skovic/.gem/ruby/gems/railties-5.0.6/lib/rails/rack/logger.rb:26:in `call'
/home/skovic/.gem/ruby/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in `call'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/middleware/request_id.rb:24:in `call'
/home/skovic/.gem/ruby/gems/rack-2.0.4/lib/rack/method_override.rb:22:in `call'
/home/skovic/.gem/ruby/gems/rack-2.0.4/lib/rack/runtime.rb:22:in `call'
/home/skovic/.gem/ruby/gems/activesupport-5.0.6/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/middleware/executor.rb:12:in `call'
/home/skovic/.gem/ruby/gems/actionpack-5.0.6/lib/action_dispatch/middleware/static.rb:136:in `call'
/home/skovic/.gem/ruby/gems/rack-2.0.4/lib/rack/sendfile.rb:111:in `call'
/home/skovic/.gem/ruby/gems/railties-5.0.6/lib/rails/engine.rb:522:in `call'
/home/skovic/.gem/ruby/gems/puma-3.7.1/lib/puma/configuration.rb:232:in `call'
/home/skovic/.gem/ruby/gems/puma-3.7.1/lib/puma/server.rb:578:in `handle_request'
/home/skovic/.gem/ruby/gems/puma-3.7.1/lib/puma/server.rb:415:in `process_client'
/home/skovic/.gem/ruby/gems/puma-3.7.1/lib/puma/server.rb:275:in `block in run'
/home/skovic/.gem/ruby/gems/puma-3.7.1/lib/puma/thread_pool.rb:120:in `block in spawn_thread'

Copy link
Member

Choose a reason for hiding this comment

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

Okay so it is needed by some UI mixin, 👍

@agrare
Copy link
Member

agrare commented Feb 26, 2018

@skovic just one comment on the alias_attribute, rest looks good to me

@agrare agrare self-assigned this Feb 26, 2018
@agrare agrare merged commit 2e96a1b into ManageIQ:master Feb 26, 2018
@agrare agrare added this to the Sprint 80 Ending Feb 26, 2018 milestone Feb 26, 2018
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.

3 participants