Commit c1c69a27 by David Taylor Committed by GitHub

Merge pull request #167 from jeff-phillips-18/bind

Check pod presets before allowing bind to application
parents bdc00a2f 692fe815
...@@ -92,7 +92,7 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -92,7 +92,7 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
$templateCache.put('src/components/binding/bindResults.html', $templateCache.put('src/components/binding/bindResults.html',
"<div ng-if=\"!ctrl.error\">\n" + "<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" + " <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" + " <h3 class=\"bind-message\">\n" +
" <span class=\"sr-only\">Pending</span>\n" + " <span class=\"sr-only\">Pending</span>\n" +
...@@ -148,21 +148,21 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -148,21 +148,21 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
"<div class=\"bind-form\">\n" + "<div class=\"bind-form\">\n" +
" <form>\n" + " <form>\n" +
" <div class=\"form-group\">\n" + " <div class=\"form-group\">\n" +
" <label>\n" + " <label>\n" +
" <h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>\n" + " <h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>\n" +
" </label>\n" + " </label>\n" +
" <span class=\"help-block\">Bindings create a secret containing the necessary information for an application to use this service.</span>\n" + " <span class=\"help-block\">Bindings create a secret containing the necessary information for an application to use this service.</span>\n" +
" </div>\n" + " </div>\n" +
" </form>\n" + " </form>\n" +
"\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" + " <fieldset>\n" +
" <div class=\"radio\">\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" + " <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" + " Create a secret and inject it into an application\n" +
" </label>\n" + " </label>\n" +
" <div class=\"application-select\">\n" + " <div ng-if=\"ctrl.showPodPresets\" class=\"application-select\">\n" +
" <ui-select ng-model=\"ctrl.appToBind\"\n" + " <ui-select ng-model=\"ctrl.appToBind\"\n" +
" ng-disabled=\"ctrl.bindType !== 'application'\"\n" + " ng-disabled=\"ctrl.bindType !== 'application'\"\n" +
" ng-required=\"ctrl.bindType === 'application'\">\n" + " ng-required=\"ctrl.bindType === 'application'\">\n" +
...@@ -530,6 +530,7 @@ angular.module('openshiftCommonUI').component('bindServiceForm', { ...@@ -530,6 +530,7 @@ angular.module('openshiftCommonUI').component('bindServiceForm', {
bindings: { bindings: {
serviceClass: '<', serviceClass: '<',
serviceClassName: '<', serviceClassName: '<',
showPodPresets: '<',
applications: '<', applications: '<',
formName: '=', formName: '=',
allowNoBinding: '<?', allowNoBinding: '<?',
......
...@@ -263,7 +263,7 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -263,7 +263,7 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
$templateCache.put('src/components/binding/bindResults.html', $templateCache.put('src/components/binding/bindResults.html',
"<div ng-if=\"!ctrl.error\">\n" + "<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" + " <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" + " <h3 class=\"bind-message\">\n" +
" <span class=\"sr-only\">Pending</span>\n" + " <span class=\"sr-only\">Pending</span>\n" +
...@@ -319,21 +319,21 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -319,21 +319,21 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
"<div class=\"bind-form\">\n" + "<div class=\"bind-form\">\n" +
" <form>\n" + " <form>\n" +
" <div class=\"form-group\">\n" + " <div class=\"form-group\">\n" +
" <label>\n" + " <label>\n" +
" <h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>\n" + " <h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>\n" +
" </label>\n" + " </label>\n" +
" <span class=\"help-block\">Bindings create a secret containing the necessary information for an application to use this service.</span>\n" + " <span class=\"help-block\">Bindings create a secret containing the necessary information for an application to use this service.</span>\n" +
" </div>\n" + " </div>\n" +
" </form>\n" + " </form>\n" +
"\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" + " <fieldset>\n" +
" <div class=\"radio\">\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" + " <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" + " Create a secret and inject it into an application\n" +
" </label>\n" + " </label>\n" +
" <div class=\"application-select\">\n" + " <div ng-if=\"ctrl.showPodPresets\" class=\"application-select\">\n" +
" <ui-select ng-model=\"ctrl.appToBind\"\n" + " <ui-select ng-model=\"ctrl.appToBind\"\n" +
" ng-disabled=\"ctrl.bindType !== 'application'\"\n" + " ng-disabled=\"ctrl.bindType !== 'application'\"\n" +
" ng-required=\"ctrl.bindType === 'application'\">\n" + " ng-required=\"ctrl.bindType === 'application'\">\n" +
...@@ -701,6 +701,7 @@ angular.module('openshiftCommonUI').component('bindServiceForm', { ...@@ -701,6 +701,7 @@ angular.module('openshiftCommonUI').component('bindServiceForm', {
bindings: { bindings: {
serviceClass: '<', serviceClass: '<',
serviceClassName: '<', serviceClassName: '<',
showPodPresets: '<',
applications: '<', applications: '<',
formName: '=', formName: '=',
allowNoBinding: '<?', allowNoBinding: '<?',
......
...@@ -63,7 +63,7 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac ...@@ -63,7 +63,7 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac
$templateCache.put('src/components/binding/bindResults.html', $templateCache.put('src/components/binding/bindResults.html',
"<div ng-if=\"!ctrl.error\">\n" + "<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" + " <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" + " <h3 class=\"bind-message\">\n" +
" <span class=\"sr-only\">Pending</span>\n" + " <span class=\"sr-only\">Pending</span>\n" +
...@@ -119,21 +119,21 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac ...@@ -119,21 +119,21 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac
"<div class=\"bind-form\">\n" + "<div class=\"bind-form\">\n" +
" <form>\n" + " <form>\n" +
" <div class=\"form-group\">\n" + " <div class=\"form-group\">\n" +
" <label>\n" + " <label>\n" +
" <h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>\n" + " <h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>\n" +
" </label>\n" + " </label>\n" +
" <span class=\"help-block\">Bindings create a secret containing the necessary information for an application to use this service.</span>\n" + " <span class=\"help-block\">Bindings create a secret containing the necessary information for an application to use this service.</span>\n" +
" </div>\n" + " </div>\n" +
" </form>\n" + " </form>\n" +
"\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" + " <fieldset>\n" +
" <div class=\"radio\">\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" + " <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" + " Create a secret and inject it into an application\n" +
" </label>\n" + " </label>\n" +
" <div class=\"application-select\">\n" + " <div ng-if=\"ctrl.showPodPresets\" class=\"application-select\">\n" +
" <ui-select ng-model=\"ctrl.appToBind\"\n" + " <ui-select ng-model=\"ctrl.appToBind\"\n" +
" ng-disabled=\"ctrl.bindType !== 'application'\"\n" + " ng-disabled=\"ctrl.bindType !== 'application'\"\n" +
" ng-required=\"ctrl.bindType === 'application'\">\n" + " ng-required=\"ctrl.bindType === 'application'\">\n" +
......
<div ng-if="!ctrl.error"> <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> <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"> <h3 class="bind-message">
<span class="sr-only">Pending</span> <span class="sr-only">Pending</span>
......
<div class="bind-form"> <div class="bind-form">
<form> <form>
<div class="form-group"> <div class="form-group">
<label> <label>
<h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3> <h3>Create a binding for <strong>{{ctrl.serviceClass.externalMetadata.displayName || ctrl.serviceClassName}}</strong></h3>
</label> </label>
<span class="help-block">Bindings create a secret containing the necessary information for an application to use this service.</span> <span class="help-block">Bindings create a secret containing the necessary information for an application to use this service.</span>
</div> </div>
</form> </form>
<form name="ctrl.formName" class="mar-bottom-lg"> <form ng-if="ctrl.allowNoBinding || ctrl.showPodPresets" name="ctrl.formName" class="mar-bottom-lg">
<fieldset> <fieldset>
<div class="radio"> <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"> <input type="radio" ng-model="ctrl.bindType" value="application" ng-disabled="!ctrl.applications.length">
Create a secret and inject it into an application Create a secret and inject it into an application
</label> </label>
<div class="application-select"> <div ng-if="ctrl.showPodPresets" class="application-select">
<ui-select ng-model="ctrl.appToBind" <ui-select ng-model="ctrl.appToBind"
ng-disabled="ctrl.bindType !== 'application'" ng-disabled="ctrl.bindType !== 'application'"
ng-required="ctrl.bindType === 'application'"> ng-required="ctrl.bindType === 'application'">
......
...@@ -5,6 +5,7 @@ angular.module('openshiftCommonUI').component('bindServiceForm', { ...@@ -5,6 +5,7 @@ angular.module('openshiftCommonUI').component('bindServiceForm', {
bindings: { bindings: {
serviceClass: '<', serviceClass: '<',
serviceClassName: '<', serviceClassName: '<',
showPodPresets: '<',
applications: '<', applications: '<',
formName: '=', formName: '=',
allowNoBinding: '<?', 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