require endpoint when provider is azure-arm
diff --git a/ui-modules/location-manager/app/views/wizard/cloud/cloud.controller.js b/ui-modules/location-manager/app/views/wizard/cloud/cloud.controller.js
index 996a156..9309e50 100644
--- a/ui-modules/location-manager/app/views/wizard/cloud/cloud.controller.js
+++ b/ui-modules/location-manager/app/views/wizard/cloud/cloud.controller.js
@@ -71,6 +71,11 @@
return disabled.indexOf(vm.provider) > -1;
};
+ vm.isEndpointRequired = function () {
+ let required = ['jclouds:azurecompute-arm'];
+ return required.indexOf(vm.provider) > -1;
+ }
+
vm.save = function () {
let config = angular.copy(vm.config);
if (vm.region) {
diff --git a/ui-modules/location-manager/app/views/wizard/cloud/cloud.template.html b/ui-modules/location-manager/app/views/wizard/cloud/cloud.template.html
index 418e2fb..7d22072 100644
--- a/ui-modules/location-manager/app/views/wizard/cloud/cloud.template.html
+++ b/ui-modules/location-manager/app/views/wizard/cloud/cloud.template.html
@@ -67,7 +67,10 @@
<div class="form-group" ng-class="{'has-error': form.endpoint.$invalid && form.endpoint.$touched}">
<label class="control-label" for="endpoint">Cloud endpoint</label>
- <input ng-model="vm.endpoint" type="text" class="form-control" id="endpoint" name="endpoint" ng-disabled="vm.isEndpointDisabled()" placeholder="If using a private cloud, the URL to connect to it is required">
+ <input ng-model="vm.endpoint" type="text" class="form-control" id="endpoint" name="endpoint" ng-required="vm.isEndpointRequired()" ng-disabled="vm.isEndpointDisabled()" placeholder="If using a private cloud, the URL to connect to it is required">
+ <p class="help-block" ng-show="form.$submitted || form.endpoint.$touched">
+ <span ng-show="form.endpoint.$error.required">You must specify an endpoint with this provider</span>
+ </p>
</div>
<div class="form-group" ng-class="{'has-error': form.identity.$invalid && form.identity.$touched}">