Merge pull request #3671 from nextcloud/1070-user-management-no-results

FIX: Add feedback on user settings when no results
This commit is contained in:
Joas Schilling 2017-03-07 15:51:30 +01:00 committed by GitHub
commit b029ffca62
2 changed files with 25 additions and 0 deletions

View file

@ -10,6 +10,7 @@
var $userList;
var $userListBody;
var $emptyContainer;
var UserDeleteHandler;
var UserList = {
@ -396,15 +397,25 @@ var UserList = {
}
UserList.add(user);
});
if (result.length > 0) {
UserList.doSort();
$userList.siblings('.loading').css('visibility', 'hidden');
// reset state on load
UserList.noMoreEntries = false;
$userListHead.show();
$emptyContainer.hide();
$emptyContainer.find('h2').text('');
}
else {
UserList.noMoreEntries = true;
$userList.siblings('.loading').remove();
if (pattern !== ""){
$userListHead.hide();
$emptyContainer.show();
$emptyContainer.find('h2').html(t('settings', 'No user found for <strong>{pattern}</strong>', {pattern: pattern}));
}
}
UserList.offset += limit;
}).always(function() {
@ -668,6 +679,8 @@ var UserList = {
$(document).ready(function () {
$userList = $('#userlist');
$userListBody = $userList.find('tbody');
$userListHead = $userList.find('thead');
$emptyContainer = $userList.siblings('.emptycontent');
UserList.initDeleteHandling();
@ -899,6 +912,13 @@ $(document).ready(function () {
$(this).find('#default_quota').singleSelect().on('change', UserList.onQuotaSelect);
});
$('#newuser input').click(function() {
// empty the container also here to avoid visual delay
$emptyContainer.hide();
OC.Search = new OCA.Search($('#searchbox'), $('#searchresults'));
OC.Search.clear();
});
UserList._updateGroupListLabel($('#newuser .groups'), []);
var _submitNewUserForm = function (event) {
event.preventDefault();

View file

@ -67,3 +67,8 @@
</tr>
</tbody>
</table>
<div class="emptycontent" style="display:none">
<div class="icon-search"></div>
<h2></h2>
</div>