Title: [227749] trunk/Websites/perf.webkit.org
Revision
227749
Author
rn...@webkit.org
Date
2018-01-29 12:35:11 -0800 (Mon, 29 Jan 2018)

Log Message

REGRESSION(r225898): The perf dashboard fails to open when there are no summary pages
https://bugs.webkit.org/show_bug.cgi?id=182210

Rubber-stamped by Chris Dumez.

The bug was caused by TestFreshnessPage unconditionally assuming that summaryPageConfiguration is set.
Fixed it by not creating TestFreshnessPage when there are no summary pages specified.

Also modernized the code to use const & let instead of var.

* public/v3/main.js:
(main):

Modified Paths

Diff

Modified: trunk/Websites/perf.webkit.org/ChangeLog (227748 => 227749)


--- trunk/Websites/perf.webkit.org/ChangeLog	2018-01-29 20:34:38 UTC (rev 227748)
+++ trunk/Websites/perf.webkit.org/ChangeLog	2018-01-29 20:35:11 UTC (rev 227749)
@@ -1,5 +1,20 @@
 2018-01-29  Ryosuke Niwa  <rn...@webkit.org>
 
+        REGRESSION(r225898): The perf dashboard fails to open when there are no summary pages
+        https://bugs.webkit.org/show_bug.cgi?id=182210
+
+        Rubber-stamped by Chris Dumez.
+
+        The bug was caused by TestFreshnessPage unconditionally assuming that summaryPageConfiguration is set.
+        Fixed it by not creating TestFreshnessPage when there are no summary pages specified.
+
+        Also modernized the code to use const & let instead of var.
+
+        * public/v3/main.js:
+        (main):
+
+2018-01-29  Ryosuke Niwa  <rn...@webkit.org>
+
         Perf dashboard's page title can be set to a previously visited page
         https://bugs.webkit.org/show_bug.cgi?id=182209
 

Modified: trunk/Websites/perf.webkit.org/public/v3/main.js (227748 => 227749)


--- trunk/Websites/perf.webkit.org/public/v3/main.js	2018-01-29 20:34:38 UTC (rev 227748)
+++ trunk/Websites/perf.webkit.org/public/v3/main.js	2018-01-29 20:35:11 UTC (rev 227749)
@@ -11,7 +11,7 @@
         'Shadow DOM API': () => { return !!Element.prototype.attachShadow; },
     };
 
-    for (let name in requiredFeatures) {
+    for (const name in requiredFeatures) {
         if (!requiredFeatures[name]())
             return alert(`Your browser does not support ${name}. Try using the latest Safari or Chrome.`);
     }
@@ -19,52 +19,52 @@
     (new SpinningPage).open();
 
     Manifest.fetch().then(function (manifest) {
-        var dashboardToolbar = new DashboardToolbar;
-        var dashboardPages = [];
+        const dashboardToolbar = new DashboardToolbar;
+        const dashboardPages = [];
         if (manifest.dashboards) {
-            for (var name in manifest.dashboards)
+            for (const name in manifest.dashboards)
                 dashboardPages.push(new DashboardPage(name, manifest.dashboards[name], dashboardToolbar));
         }
 
-        var router = new PageRouter();
-        var chartsToolbar = new ChartsToolbar;
-
-        var summaryPages = [];
+        const summaryPages = [];
+        let testFreshnessPage = null;
         if (manifest.summaryPages) {
-            for (var summaryPage of manifest.summaryPages)
+            for (const summaryPage of manifest.summaryPages)
                 summaryPages.push(new SummaryPage(summaryPage));
+            testFreshnessPage = new TestFreshnessPage(manifest.summaryPages, manifest.testAgeToleranceInHours);
         }
 
-        var chartsPage = new ChartsPage(chartsToolbar);
-        var analysisCategoryPage = new AnalysisCategoryPage();
+        const chartsToolbar = new ChartsToolbar;
+        const chartsPage = new ChartsPage(chartsToolbar);
+        const analysisCategoryPage = new AnalysisCategoryPage();
 
-        var createAnalysisTaskPage = new CreateAnalysisTaskPage();
+        summaryPages.push(chartsPage);
+        summaryPages.push(analysisCategoryPage);
+        if (testFreshnessPage)
+            summaryPages.push(testFreshnessPage);
+
+        const createAnalysisTaskPage = new CreateAnalysisTaskPage();
         createAnalysisTaskPage.setParentPage(analysisCategoryPage);
 
-        var analysisTaskPage = new AnalysisTaskPage();
+        const analysisTaskPage = new AnalysisTaskPage();
         analysisTaskPage.setParentPage(analysisCategoryPage);
 
-        var buildRequestQueuePage = new BuildRequestQueuePage();
+        const buildRequestQueuePage = new BuildRequestQueuePage();
         buildRequestQueuePage.setParentPage(analysisCategoryPage);
 
-        const testHealthPage = new TestFreshnessPage(manifest.summaryPages, manifest.testAgeToleranceInHours);
+        const heading = new Heading(manifest.siteTitle);
+        heading.addPageGroup(summaryPages);
 
-        var heading = new Heading(manifest.siteTitle);
-        heading.addPageGroup(summaryPages.concat([chartsPage, analysisCategoryPage, testHealthPage]));
-
         heading.setTitle(manifest.siteTitle);
         heading.addPageGroup(dashboardPages);
 
-        var router = new PageRouter();
-        for (var summaryPage of summaryPages)
+        const router = new PageRouter();
+        for (const summaryPage of summaryPages)
             router.addPage(summaryPage);
-        router.addPage(chartsPage);
         router.addPage(createAnalysisTaskPage);
         router.addPage(analysisTaskPage);
         router.addPage(buildRequestQueuePage);
-        router.addPage(analysisCategoryPage);
-        router.addPage(testHealthPage);
-        for (var page of dashboardPages)
+        for (const page of dashboardPages)
             router.addPage(page);
 
         if (summaryPages.length)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to