-
Notifications
You must be signed in to change notification settings - Fork 358
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
Physical server page #970
Conversation
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`
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 |
@miq-bot remove_label wip |
@@ -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 |
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.
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"]) |
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.
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 |
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.
Same comment as above.
It's best to handle all Physical Server
actions in physical_server_controller
app/controllers/ems_common.rb
Outdated
@@ -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 |
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.
How is this change related to Physical Servers
?
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.
Same as below.
@@ -775,13 +834,6 @@ def retrieve_container_security_protocols | |||
[_('SSL without validation'), 'ssl-without-validation']] | |||
end | |||
|
|||
def retrieve_hawkular_security_protocols |
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.
Why is this unrelated method being removed?
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 believe this was changes in the master branch and came up with a merge made. But this is fixed in the next commits:
# Physical server | ||
when "physical_server_refresh" then refreshphysicalservers | ||
when "physical_server_delete" then deletephysicalservers | ||
when "physical_server_edit" then editphysicalservers |
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 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 |
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.
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 |
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.
You can remove this method and instead use the MoreShowActions
mixin which has the show_topology
method.
@@ -1,44 +1,52 @@ | |||
module PhysicalServerHelper::TextualSummary | |||
|
|||
|
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.
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", |
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.
Why that space?
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.
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 |
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.
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.
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.
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']] |
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.
Looks like the removed code was added back.
Why was it removed though? Was it removed inadvertently?
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 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))} |
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.
need a space after label
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.
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 } |
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.
same, space after label
@gabrielsvinha @walteraa There is a lot going on here in this PR.
|
@@ -0,0 +1,108 @@ | |||
- @angular_form = true |
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.
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.
@gabrielsvinha Please add some screenshots of the new screens added in your first PR comment. Looks like a separate method, |
def editphysicalservers | ||
# TODO: edit physical servers | ||
end | ||
|
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.
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
)
@AparnaKarve I am dividing this PR in new PRs with all these alterations. Sounds good? |
@gabrielsvinha That will help us immensely. |
@AparnaKarve @rodneyhbrown7 I am closing this Pull Request. It was broke down into smaller ones. |
@gabrielsvinha closing this for you, if incorrect, we can reopen :) |
This Pull Request implements the toolbar buttons for Physical Server summary page.
Depends on core #14709