Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: gm/rebaseline_server/static/loader.js

Issue 369473005: rebaseline_server: handle category filtering more generically (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase after https://codereview.chromium.org/364253003/ ('rebaseline_server: if urlSchemaVersion is… Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | gm/rebaseline_server/static/view.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.extraColumnHeaders and $scope.imagePairs . 4 * them into $scope.extraColumnHeaders and $scope.imagePairs .
5 */ 5 */
6 var Loader = angular.module( 6 var Loader = angular.module(
7 'Loader', 7 'Loader',
8 ['ConstantsModule'] 8 ['ConstantsModule']
9 ); 9 );
10 10
(...skipping 12 matching lines...) Expand all
23 ] 23 ]
24 ); 24 );
25 25
26 // TODO(epoger): Combine ALL of our filtering operations (including 26 // TODO(epoger): Combine ALL of our filtering operations (including
27 // truncation) into this one filter, so that runs most efficiently? 27 // truncation) into this one filter, so that runs most efficiently?
28 // (We would have to make sure truncation still took place after 28 // (We would have to make sure truncation still took place after
29 // sorting, though.) 29 // sorting, though.)
30 Loader.filter( 30 Loader.filter(
31 'removeHiddenImagePairs', 31 'removeHiddenImagePairs',
32 function(constants) { 32 function(constants) {
33 return function(unfilteredImagePairs, hiddenResultTypes, hiddenConfigs, 33 return function(unfilteredImagePairs, showingColumnValues,
34 builderSubstring, testSubstring, viewingTab) { 34 builderSubstring, testSubstring, viewingTab) {
35 var filteredImagePairs = []; 35 var filteredImagePairs = [];
36 for (var i = 0; i < unfilteredImagePairs.length; i++) { 36 for (var i = 0; i < unfilteredImagePairs.length; i++) {
37 var imagePair = unfilteredImagePairs[i]; 37 var imagePair = unfilteredImagePairs[i];
38 var extraColumnValues = imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMN S]; 38 var extraColumnValues = imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMN S];
39 // For performance, we examine the "set" objects directly rather 39 // For performance, we examine the "set" objects directly rather
40 // than calling $scope.isValueInSet(). 40 // than calling $scope.isValueInSet().
41 // Besides, I don't think we have access to $scope in here... 41 // Besides, I don't think we have access to $scope in here...
42 if (!(true == hiddenResultTypes[extraColumnValues[ 42 if (showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE][extraC olumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE]] &&
43 constants.KEY__EXTRACOLUMNS__RESULT_TYPE]]) && 43 showingColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG][extraColumn Values[constants.KEY__EXTRACOLUMNS__CONFIG]] &&
44 !(true == hiddenConfigs[extraColumnValues[
45 constants.KEY__EXTRACOLUMNS__CONFIG]]) &&
46 !(-1 == extraColumnValues[constants.KEY__EXTRACOLUMNS__BUILDER] 44 !(-1 == extraColumnValues[constants.KEY__EXTRACOLUMNS__BUILDER]
47 .indexOf(builderSubstring)) && 45 .indexOf(builderSubstring)) &&
48 !(-1 == extraColumnValues[constants.KEY__EXTRACOLUMNS__TEST] 46 !(-1 == extraColumnValues[constants.KEY__EXTRACOLUMNS__TEST]
49 .indexOf(testSubstring)) && 47 .indexOf(testSubstring)) &&
50 (viewingTab == imagePair.tab)) { 48 (viewingTab == imagePair.tab)) {
51 filteredImagePairs.push(imagePair); 49 filteredImagePairs.push(imagePair);
52 } 50 }
53 } 51 }
54 return filteredImagePairs; 52 return filteredImagePairs;
55 }; 53 };
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 110 }
113 return filteredImagePairs; 111 return filteredImagePairs;
114 }; 112 };
115 } 113 }
116 ); 114 );
117 115
118 116
119 Loader.controller( 117 Loader.controller(
120 'Loader.Controller', 118 'Loader.Controller',
121 function($scope, $http, $filter, $location, $log, $timeout, constants) { 119 function($scope, $http, $filter, $location, $log, $timeout, constants) {
120 $scope.readyToDisplay = false;
122 $scope.constants = constants; 121 $scope.constants = constants;
123 $scope.windowTitle = "Loading GM Results..."; 122 $scope.windowTitle = "Loading GM Results...";
124 $scope.resultsToLoad = $location.search().resultsToLoad; 123 $scope.resultsToLoad = $location.search().resultsToLoad;
125 $scope.loadingMessage = "please wait..."; 124 $scope.loadingMessage = "please wait...";
126 125
127 /** 126 /**
128 * On initial page load, load a full dictionary of results. 127 * On initial page load, load a full dictionary of results.
129 * Once the dictionary is loaded, unhide the page elements so they can 128 * Once the dictionary is loaded, unhide the page elements so they can
130 * render the data. 129 * render the data.
131 */ 130 */
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 191
193 // Add index and tab fields to all records. 192 // Add index and tab fields to all records.
194 for (var i = 0; i < $scope.imagePairs.length; i++) { 193 for (var i = 0; i < $scope.imagePairs.length; i++) {
195 $scope.imagePairs[i].index = i; 194 $scope.imagePairs[i].index = i;
196 $scope.imagePairs[i].tab = $scope.defaultTab; 195 $scope.imagePairs[i].tab = $scope.defaultTab;
197 } 196 }
198 197
199 // Arrays within which the user can toggle individual elements. 198 // Arrays within which the user can toggle individual elements.
200 $scope.selectedImagePairs = []; 199 $scope.selectedImagePairs = [];
201 200
202 // Sets within which the user can toggle individual elements. 201 // allColumnValues[columnName] is a list of all known values
203 $scope.hiddenResultTypes = {}; 202 // for this column.
204 $scope.hiddenResultTypes[ 203 // showingColumnValues[columnName] is a set indicating which values
205 constants.KEY__RESULT_TYPE__FAILUREIGNORED] = true; 204 // in this column would cause us to show a row, instead of hiding it.
206 $scope.hiddenResultTypes[ 205 $scope.allColumnValues = {};
207 constants.KEY__RESULT_TYPE__NOCOMPARISON] = true; 206 $scope.showingColumnValues = {};
208 $scope.hiddenResultTypes[ 207 // set allColumnValues/showingColumnValues for RESULT_TYPE;
209 constants.KEY__RESULT_TYPE__SUCCEEDED] = true; 208 // by default, show only KEY__RESULT_TYPE__FAILED results
210 $scope.allResultTypes = $scope.columnSliceOf2DArray( 209 $scope.allColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE] =
211 $scope.extraColumnHeaders[constants.KEY__EXTRACOLUMNS__RESULT_TYPE ] 210 $scope.columnSliceOf2DArray(
212 [constants.KEY__EXTRACOLUMNHEADERS__VALUE S_AND_COUNTS], 211 $scope.extraColumnHeaders[constants.KEY__EXTRACOLUMNS__RESULT_ TYPE]
213 0); 212 [constants.KEY__EXTRACOLUMNHEADERS__V ALUES_AND_COUNTS],
214 $scope.hiddenConfigs = {}; 213 0);
215 $scope.allConfigs = $scope.columnSliceOf2DArray( 214 $scope.showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE] = {};
216 $scope.extraColumnHeaders[constants.KEY__EXTRACOLUMNS__CONFIG] 215 $scope.showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE][
217 [constants.KEY__EXTRACOLUMNHEADERS__VALUE S_AND_COUNTS], 216 constants.KEY__RESULT_TYPE__FAILED] = true;
218 0); 217 // set allColumnValues/showingColumnValues for CONFIG;
218 // by default, show results for all configs
219 $scope.allColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG] =
220 $scope.columnSliceOf2DArray(
221 $scope.extraColumnHeaders[constants.KEY__EXTRACOLUMNS__CONFIG]
222 [constants.KEY__EXTRACOLUMNHEADERS__V ALUES_AND_COUNTS],
223 0);
224 $scope.showingColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG] = {};
225 $scope.toggleValuesInSet($scope.allColumnValues[constants.KEY__EXTRACO LUMNS__CONFIG],
226 $scope.showingColumnValues[constants.KEY__EXT RACOLUMNS__CONFIG]);
219 227
220 // Associative array of partial string matches per category. 228 // Associative array of partial string matches per category.
229 // TODO(epoger): Rename as columnValueMatch to be more consistent
230 // with allColumnValues/showingColumnValues ?
221 $scope.categoryValueMatch = {}; 231 $scope.categoryValueMatch = {};
222 $scope.categoryValueMatch.builder = ""; 232 $scope.categoryValueMatch[constants.KEY__EXTRACOLUMNS__BUILDER] = "";
223 $scope.categoryValueMatch.test = ""; 233 $scope.categoryValueMatch[constants.KEY__EXTRACOLUMNS__TEST] = "";
224 234
225 // If any defaults were overridden in the URL, get them now. 235 // If any defaults were overridden in the URL, get them now.
226 $scope.queryParameters.load(); 236 $scope.queryParameters.load();
227 237
228 // Any image URLs which are relative should be relative to the JSON 238 // Any image URLs which are relative should be relative to the JSON
229 // file's source directory; absolute URLs should be left alone. 239 // file's source directory; absolute URLs should be left alone.
230 var baseUrlKey = constants.KEY__IMAGESETS__FIELD__BASE_URL; 240 var baseUrlKey = constants.KEY__IMAGESETS__FIELD__BASE_URL;
231 angular.forEach( 241 angular.forEach(
232 $scope.imageSets, 242 $scope.imageSets,
233 function(imageSet) { 243 function(imageSet) {
234 var baseUrl = imageSet[baseUrlKey]; 244 var baseUrl = imageSet[baseUrlKey];
235 if ((baseUrl.substring(0, 1) != '/') && 245 if ((baseUrl.substring(0, 1) != '/') &&
236 (baseUrl.indexOf('://') == -1)) { 246 (baseUrl.indexOf('://') == -1)) {
237 imageSet[baseUrlKey] = $scope.resultsToLoad + '/../' + baseUrl; 247 imageSet[baseUrlKey] = $scope.resultsToLoad + '/../' + baseUrl;
238 } 248 }
239 } 249 }
240 ); 250 );
241 251
252 $scope.readyToDisplay = true;
242 $scope.updateResults(); 253 $scope.updateResults();
243 $scope.loadingMessage = ""; 254 $scope.loadingMessage = "";
244 $scope.windowTitle = "Current GM Results"; 255 $scope.windowTitle = "Current GM Results";
245 } 256 }
246 } 257 }
247 ).error( 258 ).error(
248 function(data, status, header, config) { 259 function(data, status, header, config) {
249 $scope.loadingMessage = "FAILED to load."; 260 $scope.loadingMessage = "FAILED to load.";
250 $scope.windowTitle = "Failed to Load GM Results"; 261 $scope.windowTitle = "Failed to Load GM Results";
251 } 262 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 var value = nameValuePairs[name]; 392 var value = nameValuePairs[name];
382 if (value) { 393 if (value) {
383 $scope.categoryValueMatch[name] = value; 394 $scope.categoryValueMatch[name] = value;
384 } 395 }
385 }, 396 },
386 'save': function(nameValuePairs, name) { 397 'save': function(nameValuePairs, name) {
387 nameValuePairs[name] = $scope.categoryValueMatch[name]; 398 nameValuePairs[name] = $scope.categoryValueMatch[name];
388 } 399 }
389 }, 400 },
390 401
391 'set': { 402 'showingColumnValuesSet': {
392 'load': function(nameValuePairs, name) { 403 'load': function(nameValuePairs, name) {
393 var value = nameValuePairs[name]; 404 var value = nameValuePairs[name];
394 if (value) { 405 if (value) {
395 var valueArray = value.split(','); 406 var valueArray = value.split(',');
396 $scope[name] = {}; 407 $scope.showingColumnValues[name] = {};
397 $scope.toggleValuesInSet(valueArray, $scope[name]); 408 $scope.toggleValuesInSet(valueArray, $scope.showingColumnValues[name ]);
398 } 409 }
399 }, 410 },
400 'save': function(nameValuePairs, name) { 411 'save': function(nameValuePairs, name) {
401 nameValuePairs[name] = Object.keys($scope[name]).join(','); 412 nameValuePairs[name] = Object.keys($scope.showingColumnValues[name]).j oin(',');
402 } 413 }
403 }, 414 },
404 415
405 }; 416 };
406 417
407 // parameter name -> copier objects to load/save parameter value 418 // parameter name -> copier objects to load/save parameter value
408 $scope.queryParameters.map = { 419 $scope.queryParameters.map = {
409 'resultsToLoad': $scope.queryParameters.copiers.simple, 420 'resultsToLoad': $scope.queryParameters.copiers.simple,
410 'displayLimitPending': $scope.queryParameters.copiers.simple, 421 'displayLimitPending': $scope.queryParameters.copiers.simple,
411 'showThumbnailsPending': $scope.queryParameters.copiers.simple, 422 'showThumbnailsPending': $scope.queryParameters.copiers.simple,
412 'mergeIdenticalRowsPending': $scope.queryParameters.copiers.simple, 423 'mergeIdenticalRowsPending': $scope.queryParameters.copiers.simple,
413 'imageSizePending': $scope.queryParameters.copiers.simple, 424 'imageSizePending': $scope.queryParameters.copiers.simple,
414 'sortColumnSubdict': $scope.queryParameters.copiers.simple, 425 'sortColumnSubdict': $scope.queryParameters.copiers.simple,
415 'sortColumnKey': $scope.queryParameters.copiers.simple, 426 'sortColumnKey': $scope.queryParameters.copiers.simple,
416
417 'hiddenResultTypes': $scope.queryParameters.copiers.set,
418 'hiddenConfigs': $scope.queryParameters.copiers.set,
419 }; 427 };
428 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__RESULT_TYPE] =
429 $scope.queryParameters.copiers.showingColumnValuesSet;
420 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__BUILDER] = 430 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__BUILDER] =
421 $scope.queryParameters.copiers.categoryValueMatch; 431 $scope.queryParameters.copiers.categoryValueMatch;
422 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__TEST] = 432 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__TEST] =
423 $scope.queryParameters.copiers.categoryValueMatch; 433 $scope.queryParameters.copiers.categoryValueMatch;
434 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__CONFIG] =
435 $scope.queryParameters.copiers.showingColumnValuesSet;
424 436
425 // Loads all parameters into $scope from the URL query string; 437 // Loads all parameters into $scope from the URL query string;
426 // any which are not found within the URL will keep their current value. 438 // any which are not found within the URL will keep their current value.
427 $scope.queryParameters.load = function() { 439 $scope.queryParameters.load = function() {
428 var nameValuePairs = $location.search(); 440 var nameValuePairs = $location.search();
429 441
430 // If urlSchemaVersion is not specified, we assume the current version. 442 // If urlSchemaVersion is not specified, we assume the current version.
431 var urlSchemaVersion = constants.URL_VALUE__SCHEMA_VERSION__CURRENT; 443 var urlSchemaVersion = constants.URL_VALUE__SCHEMA_VERSION__CURRENT;
432 if (constants.URL_KEY__SCHEMA_VERSION in nameValuePairs) { 444 if (constants.URL_KEY__SCHEMA_VERSION in nameValuePairs) {
433 urlSchemaVersion = nameValuePairs[constants.URL_KEY__SCHEMA_VERSION]; 445 urlSchemaVersion = nameValuePairs[constants.URL_KEY__SCHEMA_VERSION];
434 } 446 }
435 $scope.urlSchemaVersionLoaded = urlSchemaVersion; 447 $scope.urlSchemaVersionLoaded = urlSchemaVersion;
436 448
449 if (urlSchemaVersion != constants.URL_VALUE__SCHEMA_VERSION__CURRENT) {
450 nameValuePairs = $scope.upconvertUrlNameValuePairs(nameValuePairs, urlSc hemaVersion);
451 }
452
437 angular.forEach($scope.queryParameters.map, 453 angular.forEach($scope.queryParameters.map,
438 function(copier, paramName) { 454 function(copier, paramName) {
439 copier.load(nameValuePairs, paramName); 455 copier.load(nameValuePairs, paramName);
440 } 456 }
441 ); 457 );
442 }; 458 };
443 459
444 // Saves all parameters from $scope into the URL query string. 460 // Saves all parameters from $scope into the URL query string.
445 $scope.queryParameters.save = function() { 461 $scope.queryParameters.save = function() {
446 var nameValuePairs = {}; 462 var nameValuePairs = {};
447 nameValuePairs[constants.URL_KEY__SCHEMA_VERSION] = constants.URL_VALUE__S CHEMA_VERSION__CURRENT; 463 nameValuePairs[constants.URL_KEY__SCHEMA_VERSION] =
464 constants.URL_VALUE__SCHEMA_VERSION__CURRENT;
448 angular.forEach($scope.queryParameters.map, 465 angular.forEach($scope.queryParameters.map,
449 function(copier, paramName) { 466 function(copier, paramName) {
450 copier.save(nameValuePairs, paramName); 467 copier.save(nameValuePairs, paramName);
451 } 468 }
452 ); 469 );
453 $location.search(nameValuePairs); 470 $location.search(nameValuePairs);
454 }; 471 };
455 472
473 /**
474 * Converts URL name/value pairs that were stored by a previous urlSchemaVer sion
475 * to the currently needed format.
476 *
477 * @param oldNValuePairs name/value pairs found in the loaded URL
478 * @param oldUrlSchemaVersion which version of the schema was used to genera te that URL
479 *
480 * @returns nameValuePairs as needed by the current URL parser
481 */
482 $scope.upconvertUrlNameValuePairs = function(oldNameValuePairs, oldUrlSchema Version) {
483 var newNameValuePairs = {};
484 angular.forEach(oldNameValuePairs,
485 function(value, name) {
486 if (oldUrlSchemaVersion < 1) {
487 if ('hiddenConfigs' == name) {
488 name = 'config';
489 var valueSet = {};
490 $scope.toggleValuesInSet(value.split(','), valueSet) ;
491 $scope.toggleValuesInSet(
492 $scope.allColumnValues[constants.KEY__EXTRACOLUM NS__CONFIG],
493 valueSet);
494 value = Object.keys(valueSet).join(',');
495 } else if ('hiddenResultTypes' == name) {
496 name = 'resultType';
497 var valueSet = {};
498 $scope.toggleValuesInSet(value.split(','), valueSet) ;
499 $scope.toggleValuesInSet(
500 $scope.allColumnValues[constants.KEY__EXTRACOLUM NS__RESULT_TYPE],
501 valueSet);
502 value = Object.keys(valueSet).join(',');
503 }
504 }
505
506 newNameValuePairs[name] = value;
507 }
508 );
509 return newNameValuePairs;
510 }
511
456 512
457 // 513 //
458 // updateResults() and friends. 514 // updateResults() and friends.
459 // 515 //
460 516
461 /** 517 /**
462 * Set $scope.areUpdatesPending (to enable/disable the Update Results 518 * Set $scope.areUpdatesPending (to enable/disable the Update Results
463 * button). 519 * button).
464 * 520 *
465 * TODO(epoger): We could reduce the amount of code by just setting the 521 * TODO(epoger): We could reduce the amount of code by just setting the
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 var doReverse = ( 553 var doReverse = (
498 ($scope.sortColumnKey == 554 ($scope.sortColumnKey ==
499 constants.KEY__DIFFERENCES__PERCENT_DIFF_PIXELS) || 555 constants.KEY__DIFFERENCES__PERCENT_DIFF_PIXELS) ||
500 ($scope.sortColumnKey == 556 ($scope.sortColumnKey ==
501 constants.KEY__DIFFERENCES__PERCEPTUAL_DIFF)); 557 constants.KEY__DIFFERENCES__PERCEPTUAL_DIFF));
502 558
503 $scope.filteredImagePairs = 559 $scope.filteredImagePairs =
504 $filter("orderBy")( 560 $filter("orderBy")(
505 $filter("removeHiddenImagePairs")( 561 $filter("removeHiddenImagePairs")(
506 $scope.imagePairs, 562 $scope.imagePairs,
507 $scope.hiddenResultTypes, 563 $scope.showingColumnValues,
508 $scope.hiddenConfigs, 564 $scope.categoryValueMatch[constants.KEY__EXTRACOLUMNS__BUILD ER],
509 $scope.categoryValueMatch.builder, 565 $scope.categoryValueMatch[constants.KEY__EXTRACOLUMNS__TEST] ,
510 $scope.categoryValueMatch.test,
511 $scope.viewingTab 566 $scope.viewingTab
512 ), 567 ),
513 [$scope.getSortColumnValue, $scope.getSecondOrderSortValue], 568 [$scope.getSortColumnValue, $scope.getSecondOrderSortValue],
514 doReverse); 569 doReverse);
515 $scope.limitedImagePairs = $filter("mergeAndLimit")( 570 $scope.limitedImagePairs = $filter("mergeAndLimit")(
516 $scope.filteredImagePairs, $scope.displayLimit, $scope.mergeIdentica lRows); 571 $scope.filteredImagePairs, $scope.displayLimit, $scope.mergeIdentica lRows);
517 } else { 572 } else {
518 $scope.filteredImagePairs = 573 $scope.filteredImagePairs =
519 $filter("orderBy")( 574 $filter("orderBy")(
520 $filter("filter")( 575 $filter("filter")(
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 * 647 *
593 * @param name 648 * @param name
594 * @param value 649 * @param value
595 */ 650 */
596 $scope.setCategoryValueMatch = function(name, value) { 651 $scope.setCategoryValueMatch = function(name, value) {
597 $scope.categoryValueMatch[name] = value; 652 $scope.categoryValueMatch[name] = value;
598 $scope.updateResults(); 653 $scope.updateResults();
599 } 654 }
600 655
601 /** 656 /**
602 * Update $scope.hiddenResultTypes so that ONLY this resultType is showing, 657 * Update $scope.showingColumnValues[columnName] so that ONLY entries with
603 * and update the visible results. 658 * this columnValue are showing, and update the visible results.
604 * 659 *
605 * @param resultType 660 * @param columnName
661 * @param columnValue
606 */ 662 */
607 $scope.showOnlyResultType = function(resultType) { 663 $scope.showOnlyColumnValue = function(columnName, columnValue) {
608 $scope.hiddenResultTypes = {}; 664 $scope.showingColumnValues[columnName] = {};
609 // TODO(epoger): Maybe change $scope.allResultTypes to be a Set like 665 $scope.toggleValueInSet(columnValue, $scope.showingColumnValues[columnName ]);
610 // $scope.hiddenResultTypes (rather than an array), so this operation is
611 // simpler (just assign or add allResultTypes to hiddenResultTypes).
612 $scope.toggleValuesInSet($scope.allResultTypes, $scope.hiddenResultTypes);
613 $scope.toggleValueInSet(resultType, $scope.hiddenResultTypes);
614 $scope.updateResults(); 666 $scope.updateResults();
615 } 667 }
616 668
617 /** 669 /**
618 * Update $scope.hiddenResultTypes so that ALL resultTypes are showing, 670 * Update $scope.showingColumnValues[columnName] so that ALL entries are
619 * and update the visible results. 671 * showing, and update the visible results.
672 *
673 * @param columnName
620 */ 674 */
621 $scope.showAllResultTypes = function() { 675 $scope.showAllColumnValues = function(columnName) {
622 $scope.hiddenResultTypes = {}; 676 $scope.showingColumnValues[columnName] = {};
677 $scope.toggleValuesInSet($scope.allColumnValues[columnName],
678 $scope.showingColumnValues[columnName]);
623 $scope.updateResults(); 679 $scope.updateResults();
624 } 680 }
625 681
626 /**
627 * Update $scope.hiddenConfigs so that ONLY this config is showing,
628 * and update the visible results.
629 *
630 * @param config
631 */
632 $scope.showOnlyConfig = function(config) {
633 $scope.hiddenConfigs = {};
634 $scope.toggleValuesInSet($scope.allConfigs, $scope.hiddenConfigs);
635 $scope.toggleValueInSet(config, $scope.hiddenConfigs);
636 $scope.updateResults();
637 }
638
639 /**
640 * Update $scope.hiddenConfigs so that ALL configs are showing,
641 * and update the visible results.
642 */
643 $scope.showAllConfigs = function() {
644 $scope.hiddenConfigs = {};
645 $scope.updateResults();
646 }
647
648 682
649 // 683 //
650 // Operations for sending info back to the server. 684 // Operations for sending info back to the server.
651 // 685 //
652 686
653 /** 687 /**
654 * Tell the server that the actual results of these particular tests 688 * Tell the server that the actual results of these particular tests
655 * are acceptable. 689 * are acceptable.
656 * 690 *
657 * TODO(epoger): This assumes that the original expectations are in 691 * TODO(epoger): This assumes that the original expectations are in
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 */ 966 */
933 $scope.getImageDiffRelativeUrl = function(imagePair) { 967 $scope.getImageDiffRelativeUrl = function(imagePair) {
934 var before = 968 var before =
935 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_A_URL] + "-vs-" + 969 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_A_URL] + "-vs-" +
936 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_B_URL]; 970 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_B_URL];
937 return before.replace(/[^\w\-]/g, "_") + ".png"; 971 return before.replace(/[^\w\-]/g, "_") + ".png";
938 } 972 }
939 973
940 } 974 }
941 ); 975 );
OLDNEW
« no previous file with comments | « no previous file | gm/rebaseline_server/static/view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698