Commit 43da3c78 by Jeffrey Phillips

Update bind pages for different bind types

Bind types available are now ‘application’, ‘secret-only’, or ‘none’.
parent 47bb9504
...@@ -98,8 +98,8 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -98,8 +98,8 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
" <span class=\"sr-only\">Success</span>\n" + " <span class=\"sr-only\">Success</span>\n" +
" <h3 class=\"bind-message\">\n" + " <h3 class=\"bind-message\">\n" +
" <strong>{{ctrl.serviceToBind}}</strong>\n" + " <strong>{{ctrl.serviceToBind}}</strong>\n" +
" <span>&nbsp;has been bound</span>\n" + " <span>has been bound</span>\n" +
" <span ng-if=\"ctrl.applicationToBind\">&nbsp;to <strong>{{ctrl.applicationToBind}}</strong> successfully</span>\n" + " <span ng-if=\"ctrl.bindType === 'application'\"> to <strong>{{ctrl.applicationToBind}}</strong> successfully</span>\n" +
" </h3>\n" + " </h3>\n" +
" </div>\n" + " </div>\n" +
" <div class=\"sub-title\">\n" + " <div class=\"sub-title\">\n" +
...@@ -152,13 +152,13 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -152,13 +152,13 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
" <fieldset>\n" + " <fieldset>\n" +
" <div class=\"radio\">\n" + " <div class=\"radio\">\n" +
" <label class=\"bind-choice\" ng-disabled=\"!ctrl.applications.length\">\n" + " <label class=\"bind-choice\" ng-disabled=\"!ctrl.applications.length\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"true\" ng-disabled=\"!ctrl.applications.length\">\n" + " <input type=\"radio\" ng-model=\"ctrl.bindType\" value=\"application\" ng-disabled=\"!ctrl.applications.length\">\n" +
" Bind to an application\n" + " Bind to an application\n" +
" </label>\n" + " </label>\n" +
" <div class=\"application-select\">\n" + " <div class=\"application-select\">\n" +
" <ui-select ng-model=\"ctrl.appToBind\"\n" + " <ui-select ng-model=\"ctrl.appToBind\"\n" +
" ng-disabled=\"ctrl.shouldBindToApp !== 'true'\"\n" + " ng-disabled=\"ctrl.bindType !== 'application'\"\n" +
" ng-required=\"ctrl.shouldBindToApp === 'true'\">\n" + " ng-required=\"ctrl.bindType === 'application'\">\n" +
" <ui-select-match placeholder=\"{{ctrl.applications.length ? 'Select an application' : 'There are no applications in this project'}}\">\n" + " <ui-select-match placeholder=\"{{ctrl.applications.length ? 'Select an application' : 'There are no applications in this project'}}\">\n" +
" <span>\n" + " <span>\n" +
" {{$select.selected.metadata.name}}\n" + " {{$select.selected.metadata.name}}\n" +
...@@ -173,14 +173,14 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -173,14 +173,14 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
" </ui-select>\n" + " </ui-select>\n" +
" </div>\n" + " </div>\n" +
" <label class=\"bind-choice\">\n" + " <label class=\"bind-choice\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"false\">\n" + " <input type=\"radio\" ng-model=\"ctrl.bindType\" value=\"secret-only\">\n" +
" Create a secret in my project\n" + " Create a secret in my project\n" +
" </label>\n" + " </label>\n" +
" <div class=\"help-block bind-description\">\n" + " <div class=\"help-block bind-description\">\n" +
" You can reference this secret later from any application either as environment variables or configuration files mounted as volumes.\n" + " You can reference this secret later from any application either as environment variables or configuration files mounted as volumes.\n" +
" </div>\n" + " </div>\n" +
" <label ng-if=\"ctrl.allowNoBinding\" class=\"bind-choice\">\n" + " <label ng-if=\"ctrl.allowNoBinding\" class=\"bind-choice\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"none\">\n" + " <input type=\"radio\" ng-model=\"ctrl.bindType\" value=\"none\">\n" +
" Do not bind at this time\n" + " Do not bind at this time\n" +
" </label>\n" + " </label>\n" +
" <div ng-if=\"ctrl.allowNoBinding\" class=\"help-block bind-description\">\n" + " <div ng-if=\"ctrl.allowNoBinding\" class=\"help-block bind-description\">\n" +
...@@ -482,6 +482,7 @@ angular.module('openshiftCommonUI').component('bindResults', { ...@@ -482,6 +482,7 @@ angular.module('openshiftCommonUI').component('bindResults', {
binding: '<', binding: '<',
progressInline: '@', progressInline: '@',
serviceToBind: '<', serviceToBind: '<',
bindType: '@',
applicationToBind: '<', applicationToBind: '<',
showPodPresets: '<', showPodPresets: '<',
secretHref: '<' secretHref: '<'
...@@ -509,17 +510,20 @@ angular.module('openshiftCommonUI').component('bindServiceForm', { ...@@ -509,17 +510,20 @@ angular.module('openshiftCommonUI').component('bindServiceForm', {
bindings: { bindings: {
serviceClass: '<', serviceClass: '<',
serviceClassName: '<', serviceClassName: '<',
formName: '=',
applications: '<', applications: '<',
appToBind: '=', formName: '=',
createBinding: '=?',
allowNoBinding: '<?', allowNoBinding: '<?',
shouldBindToApp: '=', bindType: '=', // One of: 'none', 'application', 'secret-only'
groupByKind: '<' appToBind: '=' // only applicable to 'application' bindType
}, },
templateUrl: 'src/components/binding/bindServiceForm.html', templateUrl: 'src/components/binding/bindServiceForm.html',
controller: function () { controller: function ($filter) {
var ctrl = this; var ctrl = this;
var humanizeKind = $filter('humanizeKind');
ctrl.groupByKind = function(object) {
return humanizeKind(object.kind);
};
} }
}); });
;"use strict"; ;"use strict";
......
...@@ -269,8 +269,8 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -269,8 +269,8 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
" <span class=\"sr-only\">Success</span>\n" + " <span class=\"sr-only\">Success</span>\n" +
" <h3 class=\"bind-message\">\n" + " <h3 class=\"bind-message\">\n" +
" <strong>{{ctrl.serviceToBind}}</strong>\n" + " <strong>{{ctrl.serviceToBind}}</strong>\n" +
" <span>&nbsp;has been bound</span>\n" + " <span>has been bound</span>\n" +
" <span ng-if=\"ctrl.applicationToBind\">&nbsp;to <strong>{{ctrl.applicationToBind}}</strong> successfully</span>\n" + " <span ng-if=\"ctrl.bindType === 'application'\"> to <strong>{{ctrl.applicationToBind}}</strong> successfully</span>\n" +
" </h3>\n" + " </h3>\n" +
" </div>\n" + " </div>\n" +
" <div class=\"sub-title\">\n" + " <div class=\"sub-title\">\n" +
...@@ -323,13 +323,13 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -323,13 +323,13 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
" <fieldset>\n" + " <fieldset>\n" +
" <div class=\"radio\">\n" + " <div class=\"radio\">\n" +
" <label class=\"bind-choice\" ng-disabled=\"!ctrl.applications.length\">\n" + " <label class=\"bind-choice\" ng-disabled=\"!ctrl.applications.length\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"true\" ng-disabled=\"!ctrl.applications.length\">\n" + " <input type=\"radio\" ng-model=\"ctrl.bindType\" value=\"application\" ng-disabled=\"!ctrl.applications.length\">\n" +
" Bind to an application\n" + " Bind to an application\n" +
" </label>\n" + " </label>\n" +
" <div class=\"application-select\">\n" + " <div class=\"application-select\">\n" +
" <ui-select ng-model=\"ctrl.appToBind\"\n" + " <ui-select ng-model=\"ctrl.appToBind\"\n" +
" ng-disabled=\"ctrl.shouldBindToApp !== 'true'\"\n" + " ng-disabled=\"ctrl.bindType !== 'application'\"\n" +
" ng-required=\"ctrl.shouldBindToApp === 'true'\">\n" + " ng-required=\"ctrl.bindType === 'application'\">\n" +
" <ui-select-match placeholder=\"{{ctrl.applications.length ? 'Select an application' : 'There are no applications in this project'}}\">\n" + " <ui-select-match placeholder=\"{{ctrl.applications.length ? 'Select an application' : 'There are no applications in this project'}}\">\n" +
" <span>\n" + " <span>\n" +
" {{$select.selected.metadata.name}}\n" + " {{$select.selected.metadata.name}}\n" +
...@@ -344,14 +344,14 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -344,14 +344,14 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
" </ui-select>\n" + " </ui-select>\n" +
" </div>\n" + " </div>\n" +
" <label class=\"bind-choice\">\n" + " <label class=\"bind-choice\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"false\">\n" + " <input type=\"radio\" ng-model=\"ctrl.bindType\" value=\"secret-only\">\n" +
" Create a secret in my project\n" + " Create a secret in my project\n" +
" </label>\n" + " </label>\n" +
" <div class=\"help-block bind-description\">\n" + " <div class=\"help-block bind-description\">\n" +
" You can reference this secret later from any application either as environment variables or configuration files mounted as volumes.\n" + " You can reference this secret later from any application either as environment variables or configuration files mounted as volumes.\n" +
" </div>\n" + " </div>\n" +
" <label ng-if=\"ctrl.allowNoBinding\" class=\"bind-choice\">\n" + " <label ng-if=\"ctrl.allowNoBinding\" class=\"bind-choice\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"none\">\n" + " <input type=\"radio\" ng-model=\"ctrl.bindType\" value=\"none\">\n" +
" Do not bind at this time\n" + " Do not bind at this time\n" +
" </label>\n" + " </label>\n" +
" <div ng-if=\"ctrl.allowNoBinding\" class=\"help-block bind-description\">\n" + " <div ng-if=\"ctrl.allowNoBinding\" class=\"help-block bind-description\">\n" +
...@@ -653,6 +653,7 @@ angular.module('openshiftCommonUI').component('bindResults', { ...@@ -653,6 +653,7 @@ angular.module('openshiftCommonUI').component('bindResults', {
binding: '<', binding: '<',
progressInline: '@', progressInline: '@',
serviceToBind: '<', serviceToBind: '<',
bindType: '@',
applicationToBind: '<', applicationToBind: '<',
showPodPresets: '<', showPodPresets: '<',
secretHref: '<' secretHref: '<'
...@@ -680,18 +681,21 @@ angular.module('openshiftCommonUI').component('bindServiceForm', { ...@@ -680,18 +681,21 @@ angular.module('openshiftCommonUI').component('bindServiceForm', {
bindings: { bindings: {
serviceClass: '<', serviceClass: '<',
serviceClassName: '<', serviceClassName: '<',
formName: '=',
applications: '<', applications: '<',
appToBind: '=', formName: '=',
createBinding: '=?',
allowNoBinding: '<?', allowNoBinding: '<?',
shouldBindToApp: '=', bindType: '=', // One of: 'none', 'application', 'secret-only'
groupByKind: '<' appToBind: '=' // only applicable to 'application' bindType
}, },
templateUrl: 'src/components/binding/bindServiceForm.html', templateUrl: 'src/components/binding/bindServiceForm.html',
controller: function () { controller: ["$filter", function ($filter) {
var ctrl = this; var ctrl = this;
}
var humanizeKind = $filter('humanizeKind');
ctrl.groupByKind = function(object) {
return humanizeKind(object.kind);
};
}]
}); });
;"use strict"; ;"use strict";
......
...@@ -71,8 +71,8 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac ...@@ -71,8 +71,8 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac
" <span class=\"sr-only\">Success</span>\n" + " <span class=\"sr-only\">Success</span>\n" +
" <h3 class=\"bind-message\">\n" + " <h3 class=\"bind-message\">\n" +
" <strong>{{ctrl.serviceToBind}}</strong>\n" + " <strong>{{ctrl.serviceToBind}}</strong>\n" +
" <span>&nbsp;has been bound</span>\n" + " <span>has been bound</span>\n" +
" <span ng-if=\"ctrl.applicationToBind\">&nbsp;to <strong>{{ctrl.applicationToBind}}</strong> successfully</span>\n" + " <span ng-if=\"ctrl.bindType === 'application'\"> to <strong>{{ctrl.applicationToBind}}</strong> successfully</span>\n" +
" </h3>\n" + " </h3>\n" +
" </div>\n" + " </div>\n" +
" <div class=\"sub-title\">\n" + " <div class=\"sub-title\">\n" +
...@@ -125,13 +125,13 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac ...@@ -125,13 +125,13 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac
" <fieldset>\n" + " <fieldset>\n" +
" <div class=\"radio\">\n" + " <div class=\"radio\">\n" +
" <label class=\"bind-choice\" ng-disabled=\"!ctrl.applications.length\">\n" + " <label class=\"bind-choice\" ng-disabled=\"!ctrl.applications.length\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"true\" ng-disabled=\"!ctrl.applications.length\">\n" + " <input type=\"radio\" ng-model=\"ctrl.bindType\" value=\"application\" ng-disabled=\"!ctrl.applications.length\">\n" +
" Bind to an application\n" + " Bind to an application\n" +
" </label>\n" + " </label>\n" +
" <div class=\"application-select\">\n" + " <div class=\"application-select\">\n" +
" <ui-select ng-model=\"ctrl.appToBind\"\n" + " <ui-select ng-model=\"ctrl.appToBind\"\n" +
" ng-disabled=\"ctrl.shouldBindToApp !== 'true'\"\n" + " ng-disabled=\"ctrl.bindType !== 'application'\"\n" +
" ng-required=\"ctrl.shouldBindToApp === 'true'\">\n" + " ng-required=\"ctrl.bindType === 'application'\">\n" +
" <ui-select-match placeholder=\"{{ctrl.applications.length ? 'Select an application' : 'There are no applications in this project'}}\">\n" + " <ui-select-match placeholder=\"{{ctrl.applications.length ? 'Select an application' : 'There are no applications in this project'}}\">\n" +
" <span>\n" + " <span>\n" +
" {{$select.selected.metadata.name}}\n" + " {{$select.selected.metadata.name}}\n" +
...@@ -146,14 +146,14 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac ...@@ -146,14 +146,14 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac
" </ui-select>\n" + " </ui-select>\n" +
" </div>\n" + " </div>\n" +
" <label class=\"bind-choice\">\n" + " <label class=\"bind-choice\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"false\">\n" + " <input type=\"radio\" ng-model=\"ctrl.bindType\" value=\"secret-only\">\n" +
" Create a secret in my project\n" + " Create a secret in my project\n" +
" </label>\n" + " </label>\n" +
" <div class=\"help-block bind-description\">\n" + " <div class=\"help-block bind-description\">\n" +
" You can reference this secret later from any application either as environment variables or configuration files mounted as volumes.\n" + " You can reference this secret later from any application either as environment variables or configuration files mounted as volumes.\n" +
" </div>\n" + " </div>\n" +
" <label ng-if=\"ctrl.allowNoBinding\" class=\"bind-choice\">\n" + " <label ng-if=\"ctrl.allowNoBinding\" class=\"bind-choice\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"none\">\n" + " <input type=\"radio\" ng-model=\"ctrl.bindType\" value=\"none\">\n" +
" Do not bind at this time\n" + " Do not bind at this time\n" +
" </label>\n" + " </label>\n" +
" <div ng-if=\"ctrl.allowNoBinding\" class=\"help-block bind-description\">\n" + " <div ng-if=\"ctrl.allowNoBinding\" class=\"help-block bind-description\">\n" +
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<span class="sr-only">Success</span> <span class="sr-only">Success</span>
<h3 class="bind-message"> <h3 class="bind-message">
<strong>{{ctrl.serviceToBind}}</strong> <strong>{{ctrl.serviceToBind}}</strong>
<span>&nbsp;has been bound</span> <span>has been bound</span>
<span ng-if="ctrl.applicationToBind">&nbsp;to <strong>{{ctrl.applicationToBind}}</strong> successfully</span> <span ng-if="ctrl.bindType === 'application'"> to <strong>{{ctrl.applicationToBind}}</strong> successfully</span>
</h3> </h3>
</div> </div>
<div class="sub-title"> <div class="sub-title">
......
...@@ -7,6 +7,7 @@ angular.module('openshiftCommonUI').component('bindResults', { ...@@ -7,6 +7,7 @@ angular.module('openshiftCommonUI').component('bindResults', {
binding: '<', binding: '<',
progressInline: '@', progressInline: '@',
serviceToBind: '<', serviceToBind: '<',
bindType: '@',
applicationToBind: '<', applicationToBind: '<',
showPodPresets: '<', showPodPresets: '<',
secretHref: '<' secretHref: '<'
......
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
<fieldset> <fieldset>
<div class="radio"> <div class="radio">
<label class="bind-choice" ng-disabled="!ctrl.applications.length"> <label class="bind-choice" ng-disabled="!ctrl.applications.length">
<input type="radio" ng-model="ctrl.shouldBindToApp" value="true" ng-disabled="!ctrl.applications.length"> <input type="radio" ng-model="ctrl.bindType" value="application" ng-disabled="!ctrl.applications.length">
Bind to an application Bind to an application
</label> </label>
<div class="application-select"> <div class="application-select">
<ui-select ng-model="ctrl.appToBind" <ui-select ng-model="ctrl.appToBind"
ng-disabled="ctrl.shouldBindToApp !== 'true'" ng-disabled="ctrl.bindType !== 'application'"
ng-required="ctrl.shouldBindToApp === 'true'"> ng-required="ctrl.bindType === 'application'">
<ui-select-match placeholder="{{ctrl.applications.length ? 'Select an application' : 'There are no applications in this project'}}"> <ui-select-match placeholder="{{ctrl.applications.length ? 'Select an application' : 'There are no applications in this project'}}">
<span> <span>
{{$select.selected.metadata.name}} {{$select.selected.metadata.name}}
...@@ -33,14 +33,14 @@ ...@@ -33,14 +33,14 @@
</ui-select> </ui-select>
</div> </div>
<label class="bind-choice"> <label class="bind-choice">
<input type="radio" ng-model="ctrl.shouldBindToApp" value="false"> <input type="radio" ng-model="ctrl.bindType" value="secret-only">
Create a secret in my project Create a secret in my project
</label> </label>
<div class="help-block bind-description"> <div class="help-block bind-description">
You can reference this secret later from any application either as environment variables or configuration files mounted as volumes. You can reference this secret later from any application either as environment variables or configuration files mounted as volumes.
</div> </div>
<label ng-if="ctrl.allowNoBinding" class="bind-choice"> <label ng-if="ctrl.allowNoBinding" class="bind-choice">
<input type="radio" ng-model="ctrl.shouldBindToApp" value="none"> <input type="radio" ng-model="ctrl.bindType" value="none">
Do not bind at this time Do not bind at this time
</label> </label>
<div ng-if="ctrl.allowNoBinding" class="help-block bind-description"> <div ng-if="ctrl.allowNoBinding" class="help-block bind-description">
......
...@@ -5,16 +5,19 @@ angular.module('openshiftCommonUI').component('bindServiceForm', { ...@@ -5,16 +5,19 @@ angular.module('openshiftCommonUI').component('bindServiceForm', {
bindings: { bindings: {
serviceClass: '<', serviceClass: '<',
serviceClassName: '<', serviceClassName: '<',
formName: '=',
applications: '<', applications: '<',
appToBind: '=', formName: '=',
createBinding: '=?',
allowNoBinding: '<?', allowNoBinding: '<?',
shouldBindToApp: '=', bindType: '=', // One of: 'none', 'application', 'secret-only'
groupByKind: '<' appToBind: '=' // only applicable to 'application' bindType
}, },
templateUrl: 'src/components/binding/bindServiceForm.html', templateUrl: 'src/components/binding/bindServiceForm.html',
controller: function () { controller: function ($filter) {
var ctrl = this; var ctrl = this;
var humanizeKind = $filter('humanizeKind');
ctrl.groupByKind = function(object) {
return humanizeKind(object.kind);
};
} }
}); });
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