Skip to content

Commit

Permalink
Merge pull request #1515 from gildub/cloud_subnets-network_protocol-t…
Browse files Browse the repository at this point in the history
…o-ip_version

CloudSubnet: IP version not displayed
  • Loading branch information
mzazrivec committed Jun 9, 2017
2 parents deef2b6 + 7254e32 commit 217a335
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Expand Up @@ -10,7 +10,7 @@ ManageIQ.angular.app.controller('cloudSubnetFormController', ['$http', '$scope',
if (cloudSubnetFormId == 'new') {
$scope.cloudSubnetModel.name = "";
$scope.cloudSubnetModel.dhcp_enabled = true;
$scope.cloudSubnetModel.ip_version = '4';
$scope.cloudSubnetModel.network_protocol = '4';
$scope.newRecord = true;
} else {
miqService.sparkleOn();
Expand All @@ -28,7 +28,7 @@ ManageIQ.angular.app.controller('cloudSubnetFormController', ['$http', '$scope',
$scope.cloudSubnetModel.dhcp_enabled = data.dhcp_enabled;
$scope.cloudSubnetModel.cidr = data.cidr;
$scope.cloudSubnetModel.gateway = data.gateway;
$scope.cloudSubnetModel.ip_version = data.ip_version;
$scope.cloudSubnetModel.network_protocol = data.network_protocol;

$scope.modelCopy = angular.copy( $scope.cloudSubnetModel );
miqService.sparkleOff();
Expand Down
14 changes: 7 additions & 7 deletions app/controllers/cloud_subnet_controller.rb
Expand Up @@ -43,11 +43,11 @@ def cloud_subnet_form_fields
assert_privileges("cloud_subnet_edit")
subnet = find_record_with_rbac(CloudSubnet, params[:id])
render :json => {
:name => subnet.name,
:cidr => subnet.cidr,
:dhcp_enabled => subnet.dhcp_enabled,
:gateway => subnet.gateway,
:ip_version => subnet.ip_version,
:name => subnet.name,
:cidr => subnet.cidr,
:dhcp_enabled => subnet.dhcp_enabled,
:gateway => subnet.gateway,
:network_protocol => subnet.network_protocol
}
end

Expand Down Expand Up @@ -251,7 +251,7 @@ def changed_form_params
end

def new_form_params
params[:ip_version] ||= "4"
params[:network_protocol] ||= "4"
params[:dhcp_enabled] ||= false
options = {}
options[:name] = params[:name] if params[:name]
Expand All @@ -261,7 +261,7 @@ def new_form_params
if params[:gateway]
options[:gateway] = params[:gateway].blank? ? nil : params[:gateway]
end
options[:ip_version] = params[:ip_version]
options[:ip_version] = params[:network_protocol]
options[:cloud_tenant] = find_record_with_rbac(CloudTenant, params[:cloud_tenant_id]) if params[:cloud_tenant_id]
options[:network_id] = params[:network_id] if params[:network_id]
options[:enable_dhcp] = params[:dhcp_enabled]
Expand Down
4 changes: 2 additions & 2 deletions app/views/cloud_subnet/edit.html.haml
Expand Up @@ -9,8 +9,8 @@
= _('IP Version')
.col-md-8
%input.form-control{:type => "text",
:name => "ip_version",
'ng-model' => "cloudSubnetModel.ip_version",
:name => "network_protocol",
'ng-model' => "cloudSubnetModel.network_protocol",
'ng-maxlength' => 2,
:miqrequired => true,
:disabled => true,
Expand Down
4 changes: 2 additions & 2 deletions app/views/cloud_subnet/new.html.haml
Expand Up @@ -40,9 +40,9 @@
%label.col-md-2.control-label
= _('IP Version')
.col-md-8
= select_tag("ip_version",
= select_tag("network_protocol",
options_for_select([4, 6]),
"ng-model" => "cloudSubnetModel.ip_version",
"ng-model" => "cloudSubnetModel.network_protocol",
"required" => "",
:miqrequired => true,
:checkchange => true,
Expand Down

0 comments on commit 217a335

Please sign in to comment.