Skip to content

Commit

Permalink
Bug 1480819: Fix labels for Scale Infrastructure Provider form
Browse files Browse the repository at this point in the history
fixes https://bugzilla.redhat.com/show_bug.cgi?id=1480819

This commit changes the labels on the Scale Infrastructure Provider form
from the user-unfriendly parameter names (i.e. "ControllerCount") to
more descriptive labels (i.e. "Number of Controller Hosts").
  • Loading branch information
sseago committed Jan 3, 2019
1 parent 6332d21 commit 24509ed
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions app/helpers/ems_infra_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
module EmsInfraHelper
include_concern 'TextualSummary'

def scaling_field_label(param_name)
field_name = param_name.dup
case field_name
when 'BlockStorageCount'
_('Number of Block Storage Hosts')
when 'ObjectStorageCount'
_('Number of Object Storage Hosts')
when 'CephStorageCount'
_('Number of Ceph Storage Hosts')
when 'ComputeCount'
_('Number of Compute Hosts')
when 'ControllerCount'
_('Number of Controller Hosts')
else
field_name.sub!("Count", "")
field_name.sub!("::count", "")
_("Number of %{host_type} Hosts") % {:host_type => field_name.underscore.humanize.titleize}
end
end
end
2 changes: 1 addition & 1 deletion app/views/ems_infra/scaling.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- @count_parameters.each do |parameter|
.form-group
%label.col-md-2.control-label
= parameter.name
= scaling_field_label(parameter.name)
.col-md-8
= text_field_tag(parameter.name, parameter.value, :maxlength => 5)
%table{:width => "100%"}
Expand Down

0 comments on commit 24509ed

Please sign in to comment.