Merge pull request #6439 from nextcloud/fix-5960-sort-apps-ignore-level

Sort apps by enabled/disabled but not by official/in-appstore in App Management
This commit is contained in:
Lukas Reschke 2017-09-11 22:17:21 +02:00 committed by GitHub
commit 038ae39f13
2 changed files with 3 additions and 7 deletions

View File

@ -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);
}
});
}

View File

@ -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',