OLD | NEW |
1 /* | 1 /* |
2 * Loader: | 2 * Loader: |
3 * Reads GM result reports written out by results.py, and imports | 3 * Reads GM result reports written out by results.py, and imports |
4 * them into $scope.categories and $scope.testData . | 4 * them into $scope.categories and $scope.testData . |
5 */ | 5 */ |
6 var Loader = angular.module( | 6 var Loader = angular.module( |
7 'Loader', | 7 'Loader', |
8 [] | 8 [] |
9 ); | 9 ); |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 * Once the dictionary is loaded, unhide the page elements so they can | 51 * Once the dictionary is loaded, unhide the page elements so they can |
52 * render the data. | 52 * render the data. |
53 */ | 53 */ |
54 $http.get("/results/" + resultsToLoad).success( | 54 $http.get("/results/" + resultsToLoad).success( |
55 function(data, status, header, config) { | 55 function(data, status, header, config) { |
56 $scope.loadingMessage = "Processing data, please wait..."; | 56 $scope.loadingMessage = "Processing data, please wait..."; |
57 | 57 |
58 $scope.header = data.header; | 58 $scope.header = data.header; |
59 $scope.categories = data.categories; | 59 $scope.categories = data.categories; |
60 $scope.testData = data.testData; | 60 $scope.testData = data.testData; |
61 $scope.sortColumn = 'test'; | 61 $scope.sortColumn = 'weightedDiffMeasure'; |
62 $scope.showTodos = false; | 62 $scope.showTodos = false; |
63 | 63 |
64 $scope.showSubmitAdvancedSettings = false; | 64 $scope.showSubmitAdvancedSettings = false; |
65 $scope.submitAdvancedSettings = {}; | 65 $scope.submitAdvancedSettings = {}; |
66 $scope.submitAdvancedSettings['reviewed-by-human'] = true; | 66 $scope.submitAdvancedSettings['reviewed-by-human'] = true; |
67 $scope.submitAdvancedSettings['ignore-failure'] = false; | 67 $scope.submitAdvancedSettings['ignore-failure'] = false; |
68 $scope.submitAdvancedSettings['bug'] = ''; | 68 $scope.submitAdvancedSettings['bug'] = ''; |
69 | 69 |
70 // Create the list of tabs (lists into which the user can file each | 70 // Create the list of tabs (lists into which the user can file each |
71 // test). This may vary, depending on isEditable. | 71 // test). This may vary, depending on isEditable. |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 * Update the displayed results, based on filters/settings. | 235 * Update the displayed results, based on filters/settings. |
236 */ | 236 */ |
237 $scope.updateResults = function() { | 237 $scope.updateResults = function() { |
238 $scope.displayLimit = $scope.displayLimitPending; | 238 $scope.displayLimit = $scope.displayLimitPending; |
239 // TODO(epoger): Every time we apply a filter, AngularJS creates | 239 // TODO(epoger): Every time we apply a filter, AngularJS creates |
240 // another copy of the array. Is there a way we can filter out | 240 // another copy of the array. Is there a way we can filter out |
241 // the items as they are displayed, rather than storing multiple | 241 // the items as they are displayed, rather than storing multiple |
242 // array copies? (For better performance.) | 242 // array copies? (For better performance.) |
243 | 243 |
244 if ($scope.viewingTab == $scope.defaultTab) { | 244 if ($scope.viewingTab == $scope.defaultTab) { |
| 245 |
| 246 // TODO(epoger): Until we allow the user to reverse sort order, |
| 247 // there are certain columns we want to sort in a different order. |
| 248 var doReverse = ( |
| 249 ($scope.sortColumn == 'percentDifferingPixels') || |
| 250 ($scope.sortColumn == 'weightedDiffMeasure')); |
| 251 |
245 $scope.filteredTestData = | 252 $scope.filteredTestData = |
246 $filter("orderBy")( | 253 $filter("orderBy")( |
247 $filter("removeHiddenItems")( | 254 $filter("removeHiddenItems")( |
248 $scope.testData, | 255 $scope.testData, |
249 $scope.hiddenResultTypes, | 256 $scope.hiddenResultTypes, |
250 $scope.hiddenConfigs, | 257 $scope.hiddenConfigs, |
251 $scope.categoryValueMatch.builder, | 258 $scope.categoryValueMatch.builder, |
252 $scope.categoryValueMatch.test, | 259 $scope.categoryValueMatch.test, |
253 $scope.viewingTab | 260 $scope.viewingTab |
254 ), | 261 ), |
255 $scope.sortColumn); | 262 $scope.sortColumn, doReverse); |
256 $scope.limitedTestData = $filter("limitTo")( | 263 $scope.limitedTestData = $filter("limitTo")( |
257 $scope.filteredTestData, $scope.displayLimit); | 264 $scope.filteredTestData, $scope.displayLimit); |
258 } else { | 265 } else { |
259 $scope.filteredTestData = | 266 $scope.filteredTestData = |
260 $filter("orderBy")( | 267 $filter("orderBy")( |
261 $filter("filter")( | 268 $filter("filter")( |
262 $scope.testData, | 269 $scope.testData, |
263 {tab: $scope.viewingTab}, | 270 {tab: $scope.viewingTab}, |
264 true | 271 true |
265 ), | 272 ), |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 * | 508 * |
502 * @param secondsPastEpoch (numeric): seconds past epoch in UTC | 509 * @param secondsPastEpoch (numeric): seconds past epoch in UTC |
503 */ | 510 */ |
504 $scope.localTimeString = function(secondsPastEpoch) { | 511 $scope.localTimeString = function(secondsPastEpoch) { |
505 var d = new Date(secondsPastEpoch * 1000); | 512 var d = new Date(secondsPastEpoch * 1000); |
506 return d.toString(); | 513 return d.toString(); |
507 } | 514 } |
508 | 515 |
509 } | 516 } |
510 ); | 517 ); |
OLD | NEW |