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

Physical server page #970

Closed
wants to merge 48 commits into from
Closed

Physical server page #970

wants to merge 48 commits into from

Conversation

gabrielsvinha
Copy link
Contributor

@gabrielsvinha gabrielsvinha commented Apr 7, 2017

This Pull Request implements the toolbar buttons for Physical Server summary page.

  • Add pages for physical server and physical infrastructure
  • Add buttons to physical server toolbar
  • Fix uuid error to ems_ref
  • Add buttons to physical infrastructure toolbar
  • Fix bug that makes physical server toolbar does not appear

Depends on core #14709

Odravison Amaral and others added 29 commits March 20, 2017 20:52
1. Adding routes to physical_server in routes.rb file
1. Adding physical_server flag into ems_common/_show.html.haml file.
1. Adding PhysicalServer structure to ui_constants.rb file.
1. Adding PhysicalServer structure to quadicon_helper.rb file to render properly physical_server's quadicon.
1. Adding physical_server flag into host textual summary.
1. Adding PhysicalServer structure into textual_summary of ems_physical_infra.
Adding physical server flags into three files:
1. app/helpers/application_helper/toolbar_chooser.rb
2. app/helpers/application_helper.rb
3, app/controllers/ems_common.rb
This last one has view_setup_param structure with only physical_server.
Add all helpers and list_nav to physical server.
Adapt physical infra helpers to show physical servers.
Add assets to physical server health state.
1. using `@record.machine_type` instead of `@record.machineType`
2. using `@record.serial_number` instead of `@record.serialNumber`
3. using `@record.product_name` instead of `@record.productName`
@miq-bot miq-bot added the wip label Apr 7, 2017
@miq-bot
Copy link
Member

miq-bot commented Apr 25, 2017

Checked commits https://github.com/lenovo/manageiq-ui-classic/compare/ca99b62bed310f1cd9ed6c704190b348915d54b6~...fd8c51eb0016cc63384334340e431aaeb05e1fa0 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
17 files checked, 0 offenses detected
Everything looks good. 🍰

@gabrielsvinha
Copy link
Contributor Author

@miq-bot remove_label wip

@miq-bot miq-bot changed the title [WIP] Physical server page Physical server page Apr 25, 2017
@miq-bot miq-bot removed the wip label Apr 25, 2017
@@ -208,7 +187,7 @@ def ownership_update
# Retire 1 or more VMs
def retirevms
assert_privileges(params[:pressed])
vms = find_checked_items_with_rbac(VmOrTemplate)
vms = find_checked_items
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was the rbac call replaced with the non-rbac one?


items = []

# Either a list or coming from a different controller
if @lastaction == "show_list" || %w(cloud_object_store_containers cloud_object_store_objects).include?(@display)
if @lastaction == "show_list" || !%w(cloud_object_store_container).include?(request.parameters["controller"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of making these changes here in ci_processing, could you make all the Physical Server related changes in it's own controller, which would be physical_server_controller?

@@ -2511,6 +2478,18 @@ def refreshhosts
host_button_operation('refresh_ems', _('Refresh'))
end

def refreshphysicalservers
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above.
It's best to handle all Physical Server actions in physical_server_controller

@@ -722,7 +782,6 @@ def form_instance_vars
@vmware_cloud_api_versions = retrieve_vmware_cloud_api_versions
@emstype_display = model.supported_types_and_descriptions_hash[@ems.emstype]
@nuage_api_versions = retrieve_nuage_api_versions
@hawkular_security_protocols = retrieve_hawkular_security_protocols
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this change related to Physical Servers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as below.

@@ -775,13 +834,6 @@ def retrieve_container_security_protocols
[_('SSL without validation'), 'ssl-without-validation']]
end

def retrieve_hawkular_security_protocols
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this unrelated method being removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe this was changes in the master branch and came up with a merge made. But this is fixed in the next commits:

https://github.com/lenovo/manageiq-ui-classic/blob/physical_server_page/app/controllers/ems_common.rb#L776

# Physical server
when "physical_server_refresh" then refreshphysicalservers
when "physical_server_delete" then deletephysicalservers
when "physical_server_edit" then editphysicalservers
Copy link
Contributor

Choose a reason for hiding this comment

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

I would expect this button handling in physical_server_controller, not here in ems_common

drop_breadcrumb(:name => @ems.name + _(" (Topology)"), :url => show_link(@ems))
end

def view_setup_params
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this method being called? What does it do?

@@ -53,6 +53,68 @@ def show_ad_hoc_metrics
drop_breadcrumb(:name => @ems.name + _(" (Ad hoc Metrics)"), :url => show_link(@ems))
end

def show_topology
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove this method and instead use the MoreShowActions mixin which has the show_topology method.

@@ -1,44 +1,52 @@
module PhysicalServerHelper::TextualSummary


Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the newlines

@@ -61,7 +61,7 @@ class ApplicationHelper::Toolbar::PhysicalServerCenter < ApplicationHelper::Tool
nil,
N_('Power off the server'),
N_('Power Off'),
:image => "power_off",
:image => "power_off",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why that space?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a typo. Sorry for that.

@@ -203,7 +203,6 @@ def ownership_update
# Retire 1 or more items (vms, stacks, services)
def retirevms
assert_privileges(params[:pressed])
vms = find_checked_items
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this change related to Physical Server?

If it's not related, please avoid making changes like these since it disturbs the flow of the review process.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We made a merge from ManageIQ/master and this variable remained, this was blocking Travis because it's an unused variable.

[[_('SSL'), 'ssl-with-validation'],
[_('SSL trusting custom CA'), 'ssl-with-validation-custom-ca'],
[_('SSL without validation'), 'ssl-without-validation'],
[_('Non-SSL'), 'non-ssl']]
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the removed code was added back.
Why was it removed though? Was it removed inadvertently?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe this was merged from master.

end

def textual_host
{:label => _("Host"), :value => @record.host.try(:name), :icon => "pficon pficon-virtual-machine", :link => url_for(:controller =>'host', :action => 'show', :id => @record.host.try(:id))}
{:label=> _("Host"), :value=> @record.host.try(:name), :icon=> "pficon pficon-virtual-machine", :link=> url_for(:controller=> 'host', :action=> 'show', :id=> @record.host.try(:id))}
Copy link
Contributor

Choose a reason for hiding this comment

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

need a space after label

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does the other attributes need spaces also?

{:label => _("Serial Number"), :value => @record.serial_number }
end
def textual_machine_type
{:label=> _("Machine Type"), :value => @record.machine_type }
Copy link
Contributor

Choose a reason for hiding this comment

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

same, space after label

@AparnaKarve
Copy link
Contributor

@gabrielsvinha @walteraa There is a lot going on here in this PR.
Ideally this feature should have been added in smaller baby steps as shown below for easier review and quick merging.

  • Grid/Tile/List (GTL) views
  • Summary page: Textual Summary/Relationships
  • Toolbars and actions in GTL views
  • Toolbars and actions in Summary page
  • Angular forms

@@ -0,0 +1,108 @@
- @angular_form = true
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be a copy-paste of the host angular form.

To simplify things a little bit, I recommend removing all angular related code from this PR.
It would be a good idea to work on the angular bits after this gets merged.

@AparnaKarve
Copy link
Contributor

@gabrielsvinha Please add some screenshots of the new screens added in your first PR comment.

Looks like a separate method, render_physical_server_quadicon, was added to render the quadicon for Physical Servers.
Could you also add some quadicon screenshots? Thanks.

def editphysicalservers
# TODO: edit physical servers
end

Copy link
Contributor

Choose a reason for hiding this comment

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

Please move these methods in physical_server_controller.
Also rename the methods to use snake_case (i.e. refresh_physical_server as opposed to refreshphysicalserver)

@gabrielsvinha
Copy link
Contributor Author

@AparnaKarve I am dividing this PR in new PRs with all these alterations. Sounds good?

@AparnaKarve
Copy link
Contributor

@gabrielsvinha That will help us immensely.
Thanks, appreciate it.

@gabrielsvinha
Copy link
Contributor Author

@AparnaKarve @rodneyhbrown7 I am closing this Pull Request. It was broke down into smaller ones.

@dclarizio
Copy link

@gabrielsvinha closing this for you, if incorrect, we can reopen :)

@dclarizio dclarizio closed this May 3, 2017
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.

7 participants