summaryrefslogtreecommitdiffstats
path: root/utils/test
diff options
context:
space:
mode:
Diffstat (limited to 'utils/test')
-rw-r--r--utils/test/testapi/3rd_party/static/testapi-ui/components/pods/pods.html2
-rw-r--r--utils/test/testapi/3rd_party/static/testapi-ui/components/pods/podsController.js35
2 files changed, 21 insertions, 16 deletions
diff --git a/utils/test/testapi/3rd_party/static/testapi-ui/components/pods/pods.html b/utils/test/testapi/3rd_party/static/testapi-ui/components/pods/pods.html
index cdfcfaf36..7ce36ca7c 100644
--- a/utils/test/testapi/3rd_party/static/testapi-ui/components/pods/pods.html
+++ b/utils/test/testapi/3rd_party/static/testapi-ui/components/pods/pods.html
@@ -63,7 +63,7 @@
</tbody>
</table>
</div>
-
+<br>
<div ng-show="ctrl.showError" class="alert alert-danger" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only">Error:</span>
diff --git a/utils/test/testapi/3rd_party/static/testapi-ui/components/pods/podsController.js b/utils/test/testapi/3rd_party/static/testapi-ui/components/pods/podsController.js
index 53e8b1eff..201258619 100644
--- a/utils/test/testapi/3rd_party/static/testapi-ui/components/pods/podsController.js
+++ b/utils/test/testapi/3rd_party/static/testapi-ui/components/pods/podsController.js
@@ -31,7 +31,6 @@
function PodsController($scope, $http, $filter, $state, testapiApiUrl,
raiseAlert) {
var ctrl = this;
-
ctrl.url = testapiApiUrl + '/pods';
ctrl.create = create;
@@ -82,21 +81,27 @@
*/
function create() {
ctrl.showError = false;
- var pods_url = ctrl.url;
- var body = {
- name: ctrl.name,
- mode: ctrl.mode,
- role: ctrl.role,
- details: ctrl.details
- };
- ctrl.podsRequest =
- $http.post(pods_url, body).error(function (error) {
- ctrl.showError = true;
- ctrl.error =
- 'Error creating the new pod from server: ' +
- angular.toJson(error);
- });
+ if(ctrl.name != ""){
+ var pods_url = ctrl.url;
+ var body = {
+ name: ctrl.name,
+ mode: ctrl.mode,
+ role: ctrl.role,
+ details: ctrl.details
+ };
+ ctrl.podsRequest =
+ $http.post(pods_url, body).error(function (error) {
+ ctrl.showError = true;
+ ctrl.error =
+ 'Error creating the new pod from server: ' +
+ angular.toJson(error);
+ });
+ }
+ else{
+ ctrl.showError = true;
+ ctrl.error = 'Name is missing.'
+ }
}
/**