More detailed namespace validation

Fixes namespace validation to use the proper regex for checking length, as well as showing the proper messaging if the entered namespace is invalid

[Delivers #137830461]
This commit is contained in:
Joseph Schorr 2017-01-17 17:31:24 -05:00
parent aafcb592a6
commit 462f47924e
7 changed files with 11 additions and 14 deletions

View file

@ -16,7 +16,7 @@
Usernames with dots or dashes are incompatible with Docker version 1.8 or older
</div>
<div class="co-alert co-alert-danger thin" ng-show="!signupForm.namespaceField.$error.required && signupForm.namespaceField.$invalid">
Usernames must be alphanumeric and be at least four characters in length
Usernames must be alphanumeric and between four and thirty characters in length
</div>
</div>

View file

@ -1,6 +1,6 @@
var TEAM_PATTERN = '^[a-z][a-z0-9]+$';
var ROBOT_PATTERN = '^[a-z][a-z0-9_]{3,29}$';
var USERNAME_PATTERN = '^([a-z0-9]+(?:[._-][a-z0-9]+)*){4,30}$';
var USERNAME_PATTERN = '^(?=.{4,30}$)([a-z0-9]+(?:[._-][a-z0-9]+)*)$';
// Define the pages module.
quayPages = angular.module('quayPages', [], function(){});

View file

@ -48,10 +48,10 @@
Organization names with dots or dashes are incompatible with Docker version 1.8 or older
</span>
<span class="co-alert co-alert-danger thin" ng-show="!newOrgForm.namespaceField.$error.required && newOrgForm.namespaceField.$invalid">
Organization names must be alphanumeric and be at least four characters in length
Organization names must be alphanumeric, be at least four characters in length and max thirty characters in length
</span>
</div>
<span class="description">This will also be the namespace for your repositories. Must be alphanumeric, all lowercase and at least four characters long.</span>
<span class="description">This will also be the namespace for your repositories. Must be alphanumeric, all lowercase, at least four characters long and at most thirty characters long.</span>
</div>
<div class="form-group nested" quay-require="['MAILING']">