Skip to content

Commit

Permalink
Merge pull request #4911 from AparnaKarve/fix_gce_validation
Browse files Browse the repository at this point in the history
Fix GCE validation
  • Loading branch information
h-kataria authored Nov 15, 2018
2 parents d0ac1a2 + 81916df commit 158b6aa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ ManageIQ.angular.app.controller('emsCommonFormController', ['$http', '$scope', '
}
return;
}
if ($scope.emsCommonModel.emstype === 'gce') {
$scope.currentTab = 'service_account';
return;
}
$scope.emsCommonModel.default_api_port = '';
$scope.emsCommonModel.provider_region = '';
$scope.emsCommonModel.default_security_protocol = '';
Expand Down
1 change: 1 addition & 0 deletions app/controllers/mixins/ems_common_angular.rb
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ def ems_form_fields
:amqp_auth_status => amqp_auth_status,
:ssh_keypair_auth_status => ssh_keypair_auth_status.nil? ? true : ssh_keypair_auth_status,
:service_account_auth_status => service_account_auth_status,
:non_default_current_tab => @ems.emstype == "gce" ? "service_account" : nil,
:amqp_fallback_hostname1 => amqp_fallback_hostname1 ? amqp_fallback_hostname1 : "",
:amqp_fallback_hostname2 => amqp_fallback_hostname2 ? amqp_fallback_hostname2 : "",
:default_url => @ems.endpoints.first.url}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,18 @@ describe('emsCommonFormController', function() {
});
});

describe('#providerTypeChanged', function() {
beforeEach(function() {
$httpBackend.flush();
$scope.emsCommonModel.emstype = 'gce';
$scope.providerTypeChanged();
});

it('sets currentTab to service_account', function() {
expect($scope.currentTab).toEqual('service_account');
});
});

describe('#resetClicked', function() {
beforeEach(function() {
$httpBackend.flush();
Expand Down

0 comments on commit 158b6aa

Please sign in to comment.