Commit a911a5c3 by Jeffrey Phillips

Disable application selection in bind form when no applications.

parent 651aa230
...@@ -136,15 +136,15 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -136,15 +136,15 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
" <form name=\"ctrl.formName\" class=\"mar-bottom-lg\">\n" + " <form name=\"ctrl.formName\" class=\"mar-bottom-lg\">\n" +
" <fieldset>\n" + " <fieldset>\n" +
" <div class=\"radio\">\n" + " <div class=\"radio\">\n" +
" <label class=\"bind-choice\">\n" + " <label class=\"bind-choice\" ng-disabled=\"!$ctrl.applications.length\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"true\">\n" + " <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"true\" 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.shouldBindToApp !== 'true'\"\n" +
" ng-required=\"ctrl.shouldBindToApp === 'true'\">\n" + " ng-required=\"ctrl.shouldBindToApp === 'true'\">\n" +
" <ui-select-match placeholder=\"Select an application\">\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" +
" <small class=\"text-muted\">&ndash; {{$select.selected.kind | humanizeKind : true}}</small>\n" + " <small class=\"text-muted\">&ndash; {{$select.selected.kind | humanizeKind : true}}</small>\n" +
......
...@@ -307,15 +307,15 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -307,15 +307,15 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
" <form name=\"ctrl.formName\" class=\"mar-bottom-lg\">\n" + " <form name=\"ctrl.formName\" class=\"mar-bottom-lg\">\n" +
" <fieldset>\n" + " <fieldset>\n" +
" <div class=\"radio\">\n" + " <div class=\"radio\">\n" +
" <label class=\"bind-choice\">\n" + " <label class=\"bind-choice\" ng-disabled=\"!$ctrl.applications.length\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"true\">\n" + " <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"true\" 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.shouldBindToApp !== 'true'\"\n" +
" ng-required=\"ctrl.shouldBindToApp === 'true'\">\n" + " ng-required=\"ctrl.shouldBindToApp === 'true'\">\n" +
" <ui-select-match placeholder=\"Select an application\">\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" +
" <small class=\"text-muted\">&ndash; {{$select.selected.kind | humanizeKind : true}}</small>\n" + " <small class=\"text-muted\">&ndash; {{$select.selected.kind | humanizeKind : true}}</small>\n" +
......
...@@ -118,15 +118,15 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac ...@@ -118,15 +118,15 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac
" <form name=\"ctrl.formName\" class=\"mar-bottom-lg\">\n" + " <form name=\"ctrl.formName\" class=\"mar-bottom-lg\">\n" +
" <fieldset>\n" + " <fieldset>\n" +
" <div class=\"radio\">\n" + " <div class=\"radio\">\n" +
" <label class=\"bind-choice\">\n" + " <label class=\"bind-choice\" ng-disabled=\"!$ctrl.applications.length\">\n" +
" <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"true\">\n" + " <input type=\"radio\" ng-model=\"ctrl.shouldBindToApp\" value=\"true\" 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.shouldBindToApp !== 'true'\"\n" +
" ng-required=\"ctrl.shouldBindToApp === 'true'\">\n" + " ng-required=\"ctrl.shouldBindToApp === 'true'\">\n" +
" <ui-select-match placeholder=\"Select an application\">\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" +
" <small class=\"text-muted\">&ndash; {{$select.selected.kind | humanizeKind : true}}</small>\n" + " <small class=\"text-muted\">&ndash; {{$select.selected.kind | humanizeKind : true}}</small>\n" +
......
...@@ -11,15 +11,15 @@ ...@@ -11,15 +11,15 @@
<form name="ctrl.formName" class="mar-bottom-lg"> <form name="ctrl.formName" class="mar-bottom-lg">
<fieldset> <fieldset>
<div class="radio"> <div class="radio">
<label class="bind-choice"> <label class="bind-choice" ng-disabled="!$ctrl.applications.length">
<input type="radio" ng-model="ctrl.shouldBindToApp" value="true"> <input type="radio" ng-model="ctrl.shouldBindToApp" value="true" 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.shouldBindToApp !== 'true'"
ng-required="ctrl.shouldBindToApp === 'true'"> ng-required="ctrl.shouldBindToApp === 'true'">
<ui-select-match placeholder="Select an application"> <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}}
<small class="text-muted">&ndash; {{$select.selected.kind | humanizeKind : true}}</small> <small class="text-muted">&ndash; {{$select.selected.kind | humanizeKind : true}}</small>
......
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