Add error feedback when mailbox name is already taken

This commit is contained in:
Johannes Zellner
2018-04-09 16:21:32 +02:00
parent 63e43e8d20
commit 9acde7fe86
2 changed files with 8 additions and 5 deletions

View File

@@ -33,8 +33,11 @@
<div class="modal-body">
<form name="mailboxadd_form" role="form" ng-submit="mailboxes.add.submit()" autocomplete="off">
<input type="password" style="display: none;">
<div class="form-group">
<div class="form-group" ng-class="{ 'has-error': mailboxes.add.error.statusCode === 409 }">
<label class="control-label">Name</label>
<div class="control-label" ng-show="mailboxes.add.error.statusCode === 409">
<small>A mailbox, alias or mailinglist with this name already exists</small>
</div>
<div class="input-group form-inline" style="margin-top: 10px;">
<input type="text" class="form-control" ng-model="mailboxes.add.name" placeholder="Name" required autofocus autocomplete="off"/>
<div class="input-group-addon">@{{ selectedDomain.domain }}</div>
@@ -42,7 +45,7 @@
</div>
<div class="form-group">
<label class="control-label">Owner</label>
<select class="form-control" ng-model="mailboxes.add.owner" ng-options="u.display for u in users track by u.id"></select>
<select class="form-control" ng-model="mailboxes.add.owner" ng-options="u.display for u in users track by u.id" required></select>
</div>
<input class="hide" type="submit" ng-disabled="mailboxadd_form.$invalid || mailboxes.add.busy"/>
</form>
@@ -323,7 +326,7 @@
<div class="card card-large" style="margin-bottom: 15px;" ng-show="selectedDomain.mailConfig.enabled">
<div class="row">
<div class="col-md-12">
Mailinglists will forward all emails to the assigned mailboxes.
Mailinglists will forward all emails to the associated mailboxes.
<br/>
<br/>
@@ -332,7 +335,7 @@
<thead>
<tr>
<th>Name</th>
<th>Mailboxes</th>
<th>Associated Mailboxes</th>
<th class="text-right">Action</th>
</tr>
</thead>