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

CloudSubnet: IP version not displayed #1515

Merged
merged 1 commit into from Jun 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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