Commit 692fe815 by Jeffrey Phillips

Check pod presets before allowing bind to application

parent bdc00a2f
......@@ -92,7 +92,7 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
$templateCache.put('src/components/binding/bindResults.html',
"<div ng-if=\"!ctrl.error\">\n" +
" <div ng-if=\"!(ctrl.binding | isBindingReady)\" class=\"bind-status\" ng-class=\"{'text-center': !ctrl.progressInline, 'show-progress': !ctrl.progressInline}\">\n" +
" <div ng-if=\"ctrl.binding && !(ctrl.binding | isBindingReady)\" class=\"bind-status\" ng-class=\"{'text-center': !ctrl.progressInline, 'show-progress': !ctrl.progressInline}\">\n" +
" <div class=\"spinner\" ng-class=\"{'spinner-sm': ctrl.progressInline, 'spinner-inline': ctrl.progressInline, 'spinner-lg': !ctrl.progressInline}\" aria-hidden=\"true\"></div>\n" +
" <h3 class=\"bind-message\">\n" +
" <span class=\"sr-only\">Pending</span>\n" +
......@@ -148,21 +148,21 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
"<div class=\"bind-form\">\n" +
" <form>\n" +
" <div class=\"form-group\">\n" +
" <label>\n" +
" <h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>\n" +
" </label>\n" +
" <span class=\"help-block\">Bindings create a secret containing the necessary information for an application to use this service.</span>\n" +
" <label>\n" +
" <h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>\n" +
" </label>\n" +
" <span class=\"help-block\">Bindings create a secret containing the necessary information for an application to use this service.</span>\n" +
" </div>\n" +
" </form>\n" +
"\n" +
" <form name=\"ctrl.formName\" class=\"mar-bottom-lg\">\n" +
" <form ng-if=\"ctrl.allowNoBinding || ctrl.showPodPresets\" name=\"ctrl.formName\" class=\"mar-bottom-lg\">\n" +
" <fieldset>\n" +
" <div class=\"radio\">\n" +
" <label class=\"bind-choice\" ng-disabled=\"!ctrl.applications.length\">\n" +
" <label ng-if=\"ctrl.showPodPresets\" class=\"bind-choice\" ng-disabled=\"!ctrl.applications.length\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.bindType\" value=\"application\" ng-disabled=\"!ctrl.applications.length\">\n" +
" Create a secret and inject it into an application\n" +
" </label>\n" +
" <div class=\"application-select\">\n" +
" <div ng-if=\"ctrl.showPodPresets\" class=\"application-select\">\n" +
" <ui-select ng-model=\"ctrl.appToBind\"\n" +
" ng-disabled=\"ctrl.bindType !== 'application'\"\n" +
" ng-required=\"ctrl.bindType === 'application'\">\n" +
......@@ -530,6 +530,7 @@ angular.module('openshiftCommonUI').component('bindServiceForm', {
bindings: {
serviceClass: '<',
serviceClassName: '<',
showPodPresets: '<',
applications: '<',
formName: '=',
allowNoBinding: '<?',
......
......@@ -263,7 +263,7 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
$templateCache.put('src/components/binding/bindResults.html',
"<div ng-if=\"!ctrl.error\">\n" +
" <div ng-if=\"!(ctrl.binding | isBindingReady)\" class=\"bind-status\" ng-class=\"{'text-center': !ctrl.progressInline, 'show-progress': !ctrl.progressInline}\">\n" +
" <div ng-if=\"ctrl.binding && !(ctrl.binding | isBindingReady)\" class=\"bind-status\" ng-class=\"{'text-center': !ctrl.progressInline, 'show-progress': !ctrl.progressInline}\">\n" +
" <div class=\"spinner\" ng-class=\"{'spinner-sm': ctrl.progressInline, 'spinner-inline': ctrl.progressInline, 'spinner-lg': !ctrl.progressInline}\" aria-hidden=\"true\"></div>\n" +
" <h3 class=\"bind-message\">\n" +
" <span class=\"sr-only\">Pending</span>\n" +
......@@ -319,21 +319,21 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
"<div class=\"bind-form\">\n" +
" <form>\n" +
" <div class=\"form-group\">\n" +
" <label>\n" +
" <h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>\n" +
" </label>\n" +
" <span class=\"help-block\">Bindings create a secret containing the necessary information for an application to use this service.</span>\n" +
" <label>\n" +
" <h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>\n" +
" </label>\n" +
" <span class=\"help-block\">Bindings create a secret containing the necessary information for an application to use this service.</span>\n" +
" </div>\n" +
" </form>\n" +
"\n" +
" <form name=\"ctrl.formName\" class=\"mar-bottom-lg\">\n" +
" <form ng-if=\"ctrl.allowNoBinding || ctrl.showPodPresets\" name=\"ctrl.formName\" class=\"mar-bottom-lg\">\n" +
" <fieldset>\n" +
" <div class=\"radio\">\n" +
" <label class=\"bind-choice\" ng-disabled=\"!ctrl.applications.length\">\n" +
" <label ng-if=\"ctrl.showPodPresets\" class=\"bind-choice\" ng-disabled=\"!ctrl.applications.length\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.bindType\" value=\"application\" ng-disabled=\"!ctrl.applications.length\">\n" +
" Create a secret and inject it into an application\n" +
" </label>\n" +
" <div class=\"application-select\">\n" +
" <div ng-if=\"ctrl.showPodPresets\" class=\"application-select\">\n" +
" <ui-select ng-model=\"ctrl.appToBind\"\n" +
" ng-disabled=\"ctrl.bindType !== 'application'\"\n" +
" ng-required=\"ctrl.bindType === 'application'\">\n" +
......@@ -701,6 +701,7 @@ angular.module('openshiftCommonUI').component('bindServiceForm', {
bindings: {
serviceClass: '<',
serviceClassName: '<',
showPodPresets: '<',
applications: '<',
formName: '=',
allowNoBinding: '<?',
......
......@@ -63,7 +63,7 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac
$templateCache.put('src/components/binding/bindResults.html',
"<div ng-if=\"!ctrl.error\">\n" +
" <div ng-if=\"!(ctrl.binding | isBindingReady)\" class=\"bind-status\" ng-class=\"{'text-center': !ctrl.progressInline, 'show-progress': !ctrl.progressInline}\">\n" +
" <div ng-if=\"ctrl.binding && !(ctrl.binding | isBindingReady)\" class=\"bind-status\" ng-class=\"{'text-center': !ctrl.progressInline, 'show-progress': !ctrl.progressInline}\">\n" +
" <div class=\"spinner\" ng-class=\"{'spinner-sm': ctrl.progressInline, 'spinner-inline': ctrl.progressInline, 'spinner-lg': !ctrl.progressInline}\" aria-hidden=\"true\"></div>\n" +
" <h3 class=\"bind-message\">\n" +
" <span class=\"sr-only\">Pending</span>\n" +
......@@ -119,21 +119,21 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac
"<div class=\"bind-form\">\n" +
" <form>\n" +
" <div class=\"form-group\">\n" +
" <label>\n" +
" <h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>\n" +
" </label>\n" +
" <span class=\"help-block\">Bindings create a secret containing the necessary information for an application to use this service.</span>\n" +
" <label>\n" +
" <h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>\n" +
" </label>\n" +
" <span class=\"help-block\">Bindings create a secret containing the necessary information for an application to use this service.</span>\n" +
" </div>\n" +
" </form>\n" +
"\n" +
" <form name=\"ctrl.formName\" class=\"mar-bottom-lg\">\n" +
" <form ng-if=\"ctrl.allowNoBinding || ctrl.showPodPresets\" name=\"ctrl.formName\" class=\"mar-bottom-lg\">\n" +
" <fieldset>\n" +
" <div class=\"radio\">\n" +
" <label class=\"bind-choice\" ng-disabled=\"!ctrl.applications.length\">\n" +
" <label ng-if=\"ctrl.showPodPresets\" class=\"bind-choice\" ng-disabled=\"!ctrl.applications.length\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.bindType\" value=\"application\" ng-disabled=\"!ctrl.applications.length\">\n" +
" Create a secret and inject it into an application\n" +
" </label>\n" +
" <div class=\"application-select\">\n" +
" <div ng-if=\"ctrl.showPodPresets\" class=\"application-select\">\n" +
" <ui-select ng-model=\"ctrl.appToBind\"\n" +
" ng-disabled=\"ctrl.bindType !== 'application'\"\n" +
" ng-required=\"ctrl.bindType === 'application'\">\n" +
......
<div ng-if="!ctrl.error">
<div ng-if="!(ctrl.binding | isBindingReady)" class="bind-status" ng-class="{'text-center': !ctrl.progressInline, 'show-progress': !ctrl.progressInline}">
<div ng-if="ctrl.binding && !(ctrl.binding | isBindingReady)" class="bind-status" ng-class="{'text-center': !ctrl.progressInline, 'show-progress': !ctrl.progressInline}">
<div class="spinner" ng-class="{'spinner-sm': ctrl.progressInline, 'spinner-inline': ctrl.progressInline, 'spinner-lg': !ctrl.progressInline}" aria-hidden="true"></div>
<h3 class="bind-message">
<span class="sr-only">Pending</span>
......
<div class="bind-form">
<form>
<div class="form-group">
<label>
<h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>
</label>
<span class="help-block">Bindings create a secret containing the necessary information for an application to use this service.</span>
<label>
<h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>
</label>
<span class="help-block">Bindings create a secret containing the necessary information for an application to use this service.</span>
</div>
</form>
<form name="ctrl.formName" class="mar-bottom-lg">
<form ng-if="ctrl.allowNoBinding || ctrl.showPodPresets" name="ctrl.formName" class="mar-bottom-lg">
<fieldset>
<div class="radio">
<label class="bind-choice" ng-disabled="!ctrl.applications.length">
<label ng-if="ctrl.showPodPresets" class="bind-choice" ng-disabled="!ctrl.applications.length">
<input type="radio" ng-model="ctrl.bindType" value="application" ng-disabled="!ctrl.applications.length">
Create a secret and inject it into an application
</label>
<div class="application-select">
<div ng-if="ctrl.showPodPresets" class="application-select">
<ui-select ng-model="ctrl.appToBind"
ng-disabled="ctrl.bindType !== 'application'"
ng-required="ctrl.bindType === 'application'">
......
......@@ -5,6 +5,7 @@ angular.module('openshiftCommonUI').component('bindServiceForm', {
bindings: {
serviceClass: '<',
serviceClassName: '<',
showPodPresets: '<',
applications: '<',
formName: '=',
allowNoBinding: '<?',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment