From cc453e7d1090ebece70f9217a5f5c013e8e35efe Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 14 Jan 2015 17:04:02 -0500 Subject: [PATCH] Fix some issues around validation in the config forms --- static/css/core-ui.css | 8 +------- static/directives/config/config-setup-tool.html | 17 ++++++++++------- static/js/controllers.js | 8 ++++++-- static/partials/super-user.html | 7 ++++++- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/static/css/core-ui.css b/static/css/core-ui.css index 570492b4b..02ffbb34a 100644 --- a/static/css/core-ui.css +++ b/static/css/core-ui.css @@ -278,13 +278,6 @@ padding: 6px; } -.config-setup-tool-element label { - padding-left: 10px; - padding-right: 10px; - margin: 4px; - cursor: pointer; -} - .config-file-field-element input { display: inline-block; width: 78px; @@ -302,6 +295,7 @@ .co-checkbox label { position: relative; padding-left: 28px; + cursor: pointer; } .co-checkbox label:before { diff --git a/static/directives/config/config-setup-tool.html b/static/directives/config/config-setup-tool.html index 391ba0ce8..a2c3c0fad 100644 --- a/static/directives/config/config-setup-tool.html +++ b/static/directives/config/config-setup-tool.html @@ -61,7 +61,8 @@ Server Hostname: + placeholder="Hostname (and optional port if non-standard)" + pattern="^[a-zA-Z-0-9\.]+(:[0-9]+)?$">
The HTTP host (and optionally the port number if a non-standard HTTP/HTTPS port) of the location where the registry will be accessible on the network @@ -119,7 +120,8 @@ Redis Hostname: + placeholder="The redis server hostname" + pattern="^[a-zA-Z-0-9\.]+(:[0-9]+)?$"> @@ -213,7 +215,8 @@ SMTP Server: + placeholder="SMTP server for sending e-mail" + pattern="^[a-zA-Z-0-9\.]+(:[0-9]+)?$"> @@ -235,8 +238,8 @@ Mail Sender: - +
E-mail address from which all e-mails are sent. If not specified, support@quay.io will be used. @@ -374,7 +377,7 @@ + pattern="^https?://([a-zA-Z0-9]+\.?\/?)+$">
The Github Enterprise endpoint. Must start with http:// or https://. @@ -506,7 +509,7 @@ + pattern="^https?://([a-zA-Z0-9]+\.?\/?)+$">
The Github Enterprise endpoint. Must start with http:// or https://. diff --git a/static/js/controllers.js b/static/js/controllers.js index 171aa3cac..f4d5f2349 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -2924,7 +2924,7 @@ function SuperUserAdminCtrl($scope, $timeout, ApiService, Features, UserService, $scope.creatingUser = false; $scope.newUser = {}; $scope.createdUser = resp; - $scope.loadUsers(); + $scope.loadUsersInternal(); }, errorHandler) }; @@ -3028,12 +3028,16 @@ function SuperUserAdminCtrl($scope, $timeout, ApiService, Features, UserService, }; $scope.createSuperUser = function() { + $scope.createSuperuserIssue = null; $scope.configStep = 'creating-superuser'; ApiService.scCreateInitialSuperuser($scope.superUser, null).then(function(resp) { UserService.load(); $('#createSuperuserModal').modal('hide'); $scope.checkContainerStatus(); - }, ApiService.errorDisplay('Could not create superuser')); + }, function(resp) { + $scope.configStep = 'create-superuser'; + $scope.createSuperuserIssue = ApiService.getErrorMessage(resp, 'Could not create superuser'); + }); }; $scope.checkContainerStatus = function() { diff --git a/static/partials/super-user.html b/static/partials/super-user.html index 46cf248a4..78e8c6f51 100644 --- a/static/partials/super-user.html +++ b/static/partials/super-user.html @@ -292,7 +292,9 @@
- +
@@ -302,6 +304,9 @@
+