diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-03-22 17:11:09 -0600 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-03-23 15:41:25 -0600 |
commit | dbaebc53b0267f526dc0d59275292f8d129b27c4 (patch) | |
tree | a155a598866d41029dd175c34096aad51e7318f6 /core | |
parent | 31fa2f73d4089630b158d23f765db3a675b77683 (diff) | |
download | nextcloud-server-dbaebc53b0267f526dc0d59275292f8d129b27c4.tar.gz nextcloud-server-dbaebc53b0267f526dc0d59275292f8d129b27c4.zip |
fix sorting in the backend
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'core')
-rw-r--r-- | core/js/sharedialogview.js | 3 | ||||
-rw-r--r-- | core/js/tests/specs/sharedialogviewSpec.js | 74 |
2 files changed, 0 insertions, 77 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index 78168336bb7..a63960da2b8 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -260,9 +260,6 @@ var suggestions = users.concat(groups).concat(remotes).concat(emails).concat(lookup); if (suggestions.length > 0) { - suggestions.sort(function (a, b) { - return OC.Util.naturalSortCompare(a.label, b.label); - }); $shareWithField .autocomplete("option", "autoFocus", true); diff --git a/core/js/tests/specs/sharedialogviewSpec.js b/core/js/tests/specs/sharedialogviewSpec.js index 7e3232f86e1..307adea85ff 100644 --- a/core/js/tests/specs/sharedialogviewSpec.js +++ b/core/js/tests/specs/sharedialogviewSpec.js @@ -490,80 +490,6 @@ describe('OC.Share.ShareDialogView', function() { }); }); describe('autocompletion of users', function() { - it('is sorted naturally', function () { - dialog.render(); - var response = sinon.stub(); - dialog.autocompleteHandler({term: 'p'}, response); - var jsonData = JSON.stringify({ - 'ocs' : { - 'meta' : { - 'status' : 'success', - 'statuscode' : 100, - 'message' : null - }, - 'data' : { - 'exact' : { - 'users' : [], - 'groups' : [], - 'remotes': [] - }, - 'users' : [{ - "label": "Peter A.", - "value": { - "shareType": 0, - "shareWith": "Peter A." - } - }, - { - "label": "Petra", - "value": { - "shareType": 0, - "shareWith": "Petra" - } - }, - { - "label": "peter B.", - "value": { - "shareType": 0, - "shareWith": "peter B." - } - }], - 'groups' : [], - 'remotes': [] - } - } - }); - - fakeServer.requests[0].respond( - 200, - {'Content-Type': 'application/json'}, - jsonData - ); - - expect(response.calledWithExactly([ - { - "label": "Peter A.", - "value": { - "shareType": 0, - "shareWith": "Peter A." - } - }, - { - "label": "peter B.", - "value": { - "shareType": 0, - "shareWith": "peter B." - } - }, - { - "label": "Petra", - "value": { - "shareType": 0, - "shareWith": "Petra" - } - } - ])).toEqual(true); - }); it('triggers autocomplete display and focus with data when ajax search succeeds', function () { dialog.render(); var response = sinon.stub(); |