From d5cfb38449e94e48f572003a9f19dd47cd57aeaa Mon Sep 17 00:00:00 2001 From: Chon Kou Date: Sun, 10 Sep 2017 00:54:06 -0700 Subject: [PATCH] Sort apps by enabled/disabled but not by official/in-appstore in App Management Signed-off-by: Chon Kou --- settings/js/apps.js | 6 +----- settings/tests/js/appsSpec.js | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/settings/js/apps.js b/settings/js/apps.js index 278c307b1f..258b0f4adc 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -114,11 +114,7 @@ OC.Settings.Apps = OC.Settings.Apps || { if (a.active !== b.active) { return (a.active ? -1 : 1) } else { - var levelDiff = b.level - a.level; - if (levelDiff === 0) { - return OC.Util.naturalSortCompare(a.name, b.name); - } - return levelDiff; + return OC.Util.naturalSortCompare(a.name, b.name); } }); } diff --git a/settings/tests/js/appsSpec.js b/settings/tests/js/appsSpec.js index 4b917b425c..bc4681e2b8 100644 --- a/settings/tests/js/appsSpec.js +++ b/settings/tests/js/appsSpec.js @@ -172,7 +172,7 @@ describe('OC.Settings.Apps tests', function() { return results; } - it('sorts all applications using the level', function() { + it('does not sort applications using the level', function() { Apps.loadCategory('TestId'); suite.server.requests[0].respond( @@ -223,7 +223,7 @@ describe('OC.Settings.Apps tests', function() { var results = getResultsFromDom(); expect(results.length).toEqual(5); - expect(results).toEqual(['alpha', 'delta', 'zork', 'foo', 'nolevel']); + expect(results).toEqual(['alpha', 'foo', 'delta', 'nolevel', 'zork']); expect(OC.Settings.Apps.State.apps).toEqual({ 'foo': { id: 'foo',