Admin page should lexicologically sort tests
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Apr 2012 02:12:17 +0000 (02:12 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Apr 2012 02:12:17 +0000 (02:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82849

Rubber-stamped by Hajime Morita.

* Websites/webkit-perf.appspot.com/js/admin.js:
* Websites/webkit-perf.appspot.com/js/config.js:
(sortProperties):
(fetchDashboardManifest):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112824 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Websites/webkit-perf.appspot.com/js/admin.js
Websites/webkit-perf.appspot.com/js/config.js

index 22b1c06..549049f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2012-04-01  Ryosuke Niwa  <rniwa@webkit.org>
 
+        Admin page should lexicologically sort tests
+        https://bugs.webkit.org/show_bug.cgi?id=82849
+
+        Rubber-stamped by Hajime Morita.
+
+        * Websites/webkit-perf.appspot.com/js/admin.js:
+        * Websites/webkit-perf.appspot.com/js/config.js:
+        (sortProperties):
+        (fetchDashboardManifest):
+
+2012-04-01  Ryosuke Niwa  <rniwa@webkit.org>
+
         Revert an inadvertently committed change.
 
         * Websites/webkit-perf.appspot.com/app.yaml:
index 0d37b38..00ef63e 100644 (file)
@@ -23,10 +23,11 @@ function removeNonFormListItems(list) {
 
 function createKeyNameReloader(name, visibilityAction, callback) {
     return function () {
-        $.getJSON(name, function (platforms) {
+        $.getJSON(name, function (entries) {
             var list = $('#' + name + ' ul');
-            removeNonFormListItems(list);
-            $.each(platforms, function (key, values) {
+            entries = sortProperties(entries);
+
+            $.each(entries, function (key, values) {
                 var label = key == values['name'] ? key : key + ' : ' + values['name'];
                 list.append('<li><h3 id="' + key + '">' + label + '</h3></li>');
                 var item = list[0].lastChild;
index 6acf9e8..4b147b4 100644 (file)
@@ -79,6 +79,14 @@ function urlForChangesetList(branch, changesetList, repository)
                '&verbose=on';
 }
 
+function sortProperties(object) {
+    var tests = Object.keys(object).sort();
+    var sortedObject = {};
+    for (var i = 0; i < tests.length; i++)
+        sortedObject[tests[i]] = object[tests[i]];
+    return sortedObject;
+}
+
 // FIXME move this back to dashboard.js once the bug 718925 is fixed
 function fetchDashboardManifest(callback)
 {
@@ -90,12 +98,7 @@ function fetchDashboardManifest(callback)
     });
 
     $.getJSON(SERVER + '/api/test/dashboard', function (dashboardManifest) {
-        var testToId = dashboardManifest['testToId'];
-        var tests = Object.keys(testToId).sort();
-        var sortedTestToId = {};
-        for (var i = 0; i < tests.length; i++)
-            sortedTestToId[tests[i]] = testToId[tests[i]];
-        dashboardManifest['testToId'] = sortedTestToId;
+        dashboardManifest['testToId'] = sortProperties(dashboardManifest['testToId']);
         callback(dashboardManifest);
     });
 }