Closes #267: spaces not allowed in group names

This commit is contained in:
Benjamin Gamard 2019-01-24 20:03:10 +01:00
parent 7a285d11a5
commit b8c2bd3564
2 changed files with 3 additions and 0 deletions

View File

@ -9,6 +9,7 @@
<label class="col-sm-2 control-label" for="inputName">{{ 'settings.group.edit.name' | translate }}</label>
<div class="col-sm-7">
<input name="name" type="text" id="inputName" required class="form-control"
ui-validate="{ space: '!$value || $value.indexOf(\' \') == -1' }"
ng-minlength="3" ng-maxlength="50" ng-attr-placeholder="{{ 'settings.group.edit.name' | translate }}" ng-model="group.name"/>
</div>
@ -16,6 +17,7 @@
<span class="help-block" ng-show="editGroupForm.name.$error.required && editGroupForm.$dirty">{{ 'validation.required' | translate }}</span>
<span class="help-block" ng-show="editGroupForm.name.$error.minlength && editGroupForm.$dirty">{{ 'validation.too_short' | translate }}</span>
<span class="help-block" ng-show="editGroupForm.name.$error.maxlength && editGroupForm.$dirty">{{ 'validation.too_long' | translate }}</span>
<span class="help-block" ng-show="editGroupForm.name.$error.space && editGroupForm.$dirty">{{ 'validation.no_space' | translate }}</span>
</div>
</div>

View File

@ -185,6 +185,7 @@ public class TestDocumentResource extends BaseJerseyTest {
// Search documents
Assert.assertEquals(1, searchDocuments("full:uranium full:einstein", document1Token));
Assert.assertEquals(2, searchDocuments("tit*", document1Token));
Assert.assertEquals(2, searchDocuments("docu*", document1Token));
Assert.assertEquals(2, searchDocuments("full:title", document1Token));
Assert.assertEquals(2, searchDocuments("title", document1Token));
Assert.assertEquals(1, searchDocuments("super description", document1Token));