Skip to content

Commit

Permalink
Merge pull request #1703 from europ/remove-ui-constants-3
Browse files Browse the repository at this point in the history
Remove MAX_HOSTNAME_LEN from UiConstants
  • Loading branch information
martinpovolny authored Jul 25, 2017
2 parents 894b867 + e23878b commit 3cf39c8
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions app/helpers/ui_constants.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
module UiConstants
# MAX_NAME_LEN = 20 # Default maximum name length
# MAX_HOSTNAME_LEN = 50 # Default maximum host name length
# dac - Changed to allow up to 255 characters for all text fields on 1/11/07
MAX_NAME_LEN = 255 # Default maximum name length
MAX_HOSTNAME_LEN = 255 # Default maximum host name length

CHARTS_REPORTS_FOLDER = File.join(Rails.root, "product/charts/miq_reports")
CHARTS_LAYOUTS_FOLDER = File.join(Rails.root, "product/charts/layouts")
Expand Down
1 change: 1 addition & 0 deletions app/helpers/view_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module ViewHelper
extend ActionView::Helpers::OutputSafetyHelper

MAX_DESC_LEN = 255
MAX_HOSTNAME_LEN = 255

class << self
def concat_tag(*args, &block)
Expand Down
2 changes: 1 addition & 1 deletion app/views/ems_container/_form_fields.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.col-md-4
= text_field_tag("hostname",
@edit[:new][:hostname],
:maxlength => MAX_HOSTNAME_LEN,
:maxlength => ViewHelper::MAX_HOSTNAME_LEN,
"class" => "form-control",
"data-miq_observe" => {:interval => '.5', :url => url}.to_json,
:title => _('Hostname or IPv4/IPv6 address'))
Expand Down
2 changes: 1 addition & 1 deletion app/views/ems_datawarehouse/_form_fields.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.col-md-8
= text_field_tag("hostname",
@edit[:new][:hostname],
:maxlength => MAX_HOSTNAME_LEN,
:maxlength => ViewHelper::MAX_HOSTNAME_LEN,
"class" => "form-control",
"data-miq_observe" => {:interval => '.5', :url => url}.to_json,
:title => _('Hostname or IPv4/IPv6 address'))
Expand Down
2 changes: 1 addition & 1 deletion app/views/ems_infra/_form_fields.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.col-md-4
= text_field_tag("hostname",
@edit[:new][:hostname],
:maxlength => MAX_HOSTNAME_LEN,
:maxlength => ViewHelper::MAX_HOSTNAME_LEN,
"data-miq_observe" => {:interval => '.5', :url => url}.to_json,
:class => "form-control",
:title => _("Hostname or IPv4/IPv6 address"))
Expand Down
2 changes: 1 addition & 1 deletion app/views/ems_middleware/_form_fields.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.col-md-4
= text_field_tag("hostname",
@edit[:new][:hostname],
:maxlength => MAX_HOSTNAME_LEN,
:maxlength => ViewHelper::MAX_HOSTNAME_LEN,
"class" => "form-control",
"data-miq_observe" => {:interval => '.5', :url => url}.to_json,
:title => _('Hostname or IPv4/IPv6 address'))
Expand Down
2 changes: 1 addition & 1 deletion app/views/host/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"id" => "hostname",
"name" => "hostname",
"ng-model" => "hostModel.hostname",
"maxlength" => "#{MAX_HOSTNAME_LEN}",
"maxlength" => "#{ViewHelper::MAX_HOSTNAME_LEN}",
"miqrequired" => "",
"checkchange" => ""}
%span.help-block{"ng-show" => "angularForm.hostname.$error.miqrequired"}
Expand Down

0 comments on commit 3cf39c8

Please sign in to comment.