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

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

Issue 369133004: rebaseline_server: handle column filtering more generically (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: line wraps / little readability improvements 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
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,
epoger 2014/07/03 21:49:46 Throughout: - (hiddenResultTypes, hiddenConfigs) d
rmistry 2014/07/07 15:28:52 Acknowledged.
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]
43 constants.KEY__EXTRACOLUMNS__RESULT_TYPE]]) && 43 [extraColumnValues[constants.KEY__EXTRACOLUMNS__R ESULT_TYPE]] &&
44 !(true == hiddenConfigs[extraColumnValues[ 44 showingColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG]
45 constants.KEY__EXTRACOLUMNS__CONFIG]]) && 45 [extraColumnValues[constants.KEY__EXTRACOLUMNS__C ONFIG]] &&
46 !(-1 == extraColumnValues[constants.KEY__EXTRACOLUMNS__BUILDER] 46 !(-1 == extraColumnValues[constants.KEY__EXTRACOLUMNS__BUILDER]
47 .indexOf(builderSubstring)) && 47 .indexOf(builderSubstring)) &&
48 !(-1 == extraColumnValues[constants.KEY__EXTRACOLUMNS__TEST] 48 !(-1 == extraColumnValues[constants.KEY__EXTRACOLUMNS__TEST]
49 .indexOf(testSubstring)) && 49 .indexOf(testSubstring)) &&
50 (viewingTab == imagePair.tab)) { 50 (viewingTab == imagePair.tab)) {
51 filteredImagePairs.push(imagePair); 51 filteredImagePairs.push(imagePair);
52 } 52 }
53 } 53 }
54 return filteredImagePairs; 54 return filteredImagePairs;
55 }; 55 };
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 return filteredImagePairs; 113 return filteredImagePairs;
114 }; 114 };
115 } 115 }
116 ); 116 );
117 117
118 118
119 Loader.controller( 119 Loader.controller(
120 'Loader.Controller', 120 'Loader.Controller',
121 function($scope, $http, $filter, $location, $log, $timeout, constants) { 121 function($scope, $http, $filter, $location, $log, $timeout, constants) {
122 $scope.readyToDisplay = false;
122 $scope.constants = constants; 123 $scope.constants = constants;
123 $scope.windowTitle = "Loading GM Results..."; 124 $scope.windowTitle = "Loading GM Results...";
124 $scope.resultsToLoad = $location.search().resultsToLoad; 125 $scope.resultsToLoad = $location.search().resultsToLoad;
125 $scope.loadingMessage = "please wait..."; 126 $scope.loadingMessage = "please wait...";
126 127
127 /** 128 /**
128 * On initial page load, load a full dictionary of results. 129 * On initial page load, load a full dictionary of results.
129 * Once the dictionary is loaded, unhide the page elements so they can 130 * Once the dictionary is loaded, unhide the page elements so they can
130 * render the data. 131 * render the data.
131 */ 132 */
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 193
193 // Add index and tab fields to all records. 194 // Add index and tab fields to all records.
194 for (var i = 0; i < $scope.imagePairs.length; i++) { 195 for (var i = 0; i < $scope.imagePairs.length; i++) {
195 $scope.imagePairs[i].index = i; 196 $scope.imagePairs[i].index = i;
196 $scope.imagePairs[i].tab = $scope.defaultTab; 197 $scope.imagePairs[i].tab = $scope.defaultTab;
197 } 198 }
198 199
199 // Arrays within which the user can toggle individual elements. 200 // Arrays within which the user can toggle individual elements.
200 $scope.selectedImagePairs = []; 201 $scope.selectedImagePairs = [];
201 202
202 // Sets within which the user can toggle individual elements. 203 // allColumnValues[columnName] is a list of all known values
203 $scope.hiddenResultTypes = {}; 204 // for this column.
204 $scope.hiddenResultTypes[ 205 // showingColumnValues[columnName] is a set indicating which values
205 constants.KEY__RESULT_TYPE__FAILUREIGNORED] = true; 206 // in this column would cause us to show a row, rather than hiding it.
206 $scope.hiddenResultTypes[ 207 $scope.allColumnValues = {};
207 constants.KEY__RESULT_TYPE__NOCOMPARISON] = true; 208 $scope.showingColumnValues = {};
208 $scope.hiddenResultTypes[ 209
209 constants.KEY__RESULT_TYPE__SUCCEEDED] = true; 210 // set allColumnValues/showingColumnValues for RESULT_TYPE;
210 $scope.allResultTypes = $scope.columnSliceOf2DArray( 211 // by default, show only KEY__RESULT_TYPE__FAILED results
211 $scope.extraColumnHeaders[constants.KEY__EXTRACOLUMNS__RESULT_TYPE ] 212 $scope.allColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE] =
212 [constants.KEY__EXTRACOLUMNHEADERS__VALUE S_AND_COUNTS], 213 $scope.columnSliceOf2DArray(
213 0); 214 $scope.extraColumnHeaders[constants.KEY__EXTRACOLUMNS__RESULT_ TYPE]
214 $scope.hiddenConfigs = {}; 215 [constants.KEY__EXTRACOLUMNHEADERS__V ALUES_AND_COUNTS],
215 $scope.allConfigs = $scope.columnSliceOf2DArray( 216 0);
216 $scope.extraColumnHeaders[constants.KEY__EXTRACOLUMNS__CONFIG] 217 $scope.showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE] = {};
217 [constants.KEY__EXTRACOLUMNHEADERS__VALUE S_AND_COUNTS], 218 $scope.showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE][
218 0); 219 constants.KEY__RESULT_TYPE__FAILED] = true;
220
221 // set allColumnValues/showingColumnValues for CONFIG;
222 // by default, show results for all configs
223 $scope.allColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG] =
224 $scope.columnSliceOf2DArray(
225 $scope.extraColumnHeaders[constants.KEY__EXTRACOLUMNS__CONFIG]
226 [constants.KEY__EXTRACOLUMNHEADERS__V ALUES_AND_COUNTS],
227 0);
228 $scope.showingColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG] = {};
229 $scope.toggleValuesInSet($scope.allColumnValues[constants.KEY__EXTRACO LUMNS__CONFIG],
230 $scope.showingColumnValues[constants.KEY__EXT RACOLUMNS__CONFIG]);
219 231
220 // Associative array of partial string matches per category. 232 // Associative array of partial string matches per category.
233 // TODO(epoger): Rename as columnValueMatch to be more consistent
234 // with allColumnValues/showingColumnValues ?
221 $scope.categoryValueMatch = {}; 235 $scope.categoryValueMatch = {};
222 $scope.categoryValueMatch.builder = ""; 236 $scope.categoryValueMatch[constants.KEY__EXTRACOLUMNS__BUILDER] = "";
223 $scope.categoryValueMatch.test = ""; 237 $scope.categoryValueMatch[constants.KEY__EXTRACOLUMNS__TEST] = "";
224 238
225 // If any defaults were overridden in the URL, get them now. 239 // If any defaults were overridden in the URL, get them now.
226 $scope.queryParameters.load(); 240 $scope.queryParameters.load();
227 241
228 // Any image URLs which are relative should be relative to the JSON 242 // Any image URLs which are relative should be relative to the JSON
229 // file's source directory; absolute URLs should be left alone. 243 // file's source directory; absolute URLs should be left alone.
230 var baseUrlKey = constants.KEY__IMAGESETS__FIELD__BASE_URL; 244 var baseUrlKey = constants.KEY__IMAGESETS__FIELD__BASE_URL;
231 angular.forEach( 245 angular.forEach(
232 $scope.imageSets, 246 $scope.imageSets,
233 function(imageSet) { 247 function(imageSet) {
234 var baseUrl = imageSet[baseUrlKey]; 248 var baseUrl = imageSet[baseUrlKey];
235 if ((baseUrl.substring(0, 1) != '/') && 249 if ((baseUrl.substring(0, 1) != '/') &&
236 (baseUrl.indexOf('://') == -1)) { 250 (baseUrl.indexOf('://') == -1)) {
237 imageSet[baseUrlKey] = $scope.resultsToLoad + '/../' + baseUrl; 251 imageSet[baseUrlKey] = $scope.resultsToLoad + '/../' + baseUrl;
238 } 252 }
239 } 253 }
240 ); 254 );
241 255
256 $scope.readyToDisplay = true;
242 $scope.updateResults(); 257 $scope.updateResults();
243 $scope.loadingMessage = ""; 258 $scope.loadingMessage = "";
244 $scope.windowTitle = "Current GM Results"; 259 $scope.windowTitle = "Current GM Results";
245 } 260 }
246 } 261 }
247 ).error( 262 ).error(
248 function(data, status, header, config) { 263 function(data, status, header, config) {
249 $scope.loadingMessage = "FAILED to load."; 264 $scope.loadingMessage = "FAILED to load.";
250 $scope.windowTitle = "Failed to Load GM Results"; 265 $scope.windowTitle = "Failed to Load GM Results";
251 } 266 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 var value = nameValuePairs[name]; 396 var value = nameValuePairs[name];
382 if (value) { 397 if (value) {
383 $scope.categoryValueMatch[name] = value; 398 $scope.categoryValueMatch[name] = value;
384 } 399 }
385 }, 400 },
386 'save': function(nameValuePairs, name) { 401 'save': function(nameValuePairs, name) {
387 nameValuePairs[name] = $scope.categoryValueMatch[name]; 402 nameValuePairs[name] = $scope.categoryValueMatch[name];
388 } 403 }
389 }, 404 },
390 405
391 'set': { 406 'showingColumnValuesSet': {
392 'load': function(nameValuePairs, name) { 407 'load': function(nameValuePairs, name) {
393 var value = nameValuePairs[name]; 408 var value = nameValuePairs[name];
394 if (value) { 409 if (value) {
395 var valueArray = value.split(','); 410 var valueArray = value.split(',');
396 $scope[name] = {}; 411 $scope.showingColumnValues[name] = {};
397 $scope.toggleValuesInSet(valueArray, $scope[name]); 412 $scope.toggleValuesInSet(valueArray, $scope.showingColumnValues[name ]);
398 } 413 }
399 }, 414 },
400 'save': function(nameValuePairs, name) { 415 'save': function(nameValuePairs, name) {
401 nameValuePairs[name] = Object.keys($scope[name]).join(','); 416 nameValuePairs[name] = Object.keys($scope.showingColumnValues[name]).j oin(',');
402 } 417 }
403 }, 418 },
404 419
405 }; 420 };
406 421
407 // parameter name -> copier objects to load/save parameter value 422 // parameter name -> copier objects to load/save parameter value
408 $scope.queryParameters.map = { 423 $scope.queryParameters.map = {
409 'resultsToLoad': $scope.queryParameters.copiers.simple, 424 'resultsToLoad': $scope.queryParameters.copiers.simple,
410 'displayLimitPending': $scope.queryParameters.copiers.simple, 425 'displayLimitPending': $scope.queryParameters.copiers.simple,
411 'showThumbnailsPending': $scope.queryParameters.copiers.simple, 426 'showThumbnailsPending': $scope.queryParameters.copiers.simple,
412 'mergeIdenticalRowsPending': $scope.queryParameters.copiers.simple, 427 'mergeIdenticalRowsPending': $scope.queryParameters.copiers.simple,
413 'imageSizePending': $scope.queryParameters.copiers.simple, 428 'imageSizePending': $scope.queryParameters.copiers.simple,
414 'sortColumnSubdict': $scope.queryParameters.copiers.simple, 429 'sortColumnSubdict': $scope.queryParameters.copiers.simple,
415 'sortColumnKey': $scope.queryParameters.copiers.simple, 430 'sortColumnKey': $scope.queryParameters.copiers.simple,
416
417 'hiddenResultTypes': $scope.queryParameters.copiers.set,
418 'hiddenConfigs': $scope.queryParameters.copiers.set,
419 }; 431 };
432 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__RESULT_TYPE] =
433 $scope.queryParameters.copiers.showingColumnValuesSet;
420 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__BUILDER] = 434 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__BUILDER] =
421 $scope.queryParameters.copiers.categoryValueMatch; 435 $scope.queryParameters.copiers.categoryValueMatch;
422 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__TEST] = 436 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__TEST] =
423 $scope.queryParameters.copiers.categoryValueMatch; 437 $scope.queryParameters.copiers.categoryValueMatch;
438 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__CONFIG] =
439 $scope.queryParameters.copiers.showingColumnValuesSet;
424 440
425 // Loads all parameters into $scope from the URL query string; 441 // Loads all parameters into $scope from the URL query string;
426 // any which are not found within the URL will keep their current value. 442 // any which are not found within the URL will keep their current value.
427 $scope.queryParameters.load = function() { 443 $scope.queryParameters.load = function() {
428 var nameValuePairs = $location.search(); 444 var nameValuePairs = $location.search();
429 445
430 // If urlSchemaVersion is not specified, we assume the current version. 446 // If urlSchemaVersion is not specified, we assume the current version.
431 var urlSchemaVersion = constants.URL_VALUE__SCHEMA_VERSION__CURRENT; 447 var urlSchemaVersion = constants.URL_VALUE__SCHEMA_VERSION__CURRENT;
432 if (constants.URL_KEY__SCHEMA_VERSION in nameValuePairs) { 448 if (constants.URL_KEY__SCHEMA_VERSION in nameValuePairs) {
433 urlSchemaVersion = nameValuePairs[constants.URL_KEY__SCHEMA_VERSION]; 449 urlSchemaVersion = nameValuePairs[constants.URL_KEY__SCHEMA_VERSION];
450 } else if ('hiddenResultTypes' in nameValuePairs) {
451 // The combination of:
epoger 2014/07/03 21:49:46 Eric- I figured out a way to properly handle any o
452 // - absence of an explicit urlSchemaVersion, and
453 // - presence of the old 'hiddenResultTypes' field
454 // tells us that the URL is from the original urlSchemaVersion.
455 // See https://codereview.chromium.org/367173002/
456 urlSchemaVersion = 0;
434 } 457 }
435 $scope.urlSchemaVersionLoaded = urlSchemaVersion; 458 $scope.urlSchemaVersionLoaded = urlSchemaVersion;
436 459
460 if (urlSchemaVersion != constants.URL_VALUE__SCHEMA_VERSION__CURRENT) {
461 nameValuePairs = $scope.upconvertUrlNameValuePairs(nameValuePairs, urlSc hemaVersion);
462 }
437 angular.forEach($scope.queryParameters.map, 463 angular.forEach($scope.queryParameters.map,
438 function(copier, paramName) { 464 function(copier, paramName) {
439 copier.load(nameValuePairs, paramName); 465 copier.load(nameValuePairs, paramName);
440 } 466 }
441 ); 467 );
442 }; 468 };
443 469
444 // Saves all parameters from $scope into the URL query string. 470 // Saves all parameters from $scope into the URL query string.
445 $scope.queryParameters.save = function() { 471 $scope.queryParameters.save = function() {
446 var nameValuePairs = {}; 472 var nameValuePairs = {};
447 nameValuePairs[constants.URL_KEY__SCHEMA_VERSION] = constants.URL_VALUE__S CHEMA_VERSION__CURRENT; 473 nameValuePairs[constants.URL_KEY__SCHEMA_VERSION] = constants.URL_VALUE__S CHEMA_VERSION__CURRENT;
448 angular.forEach($scope.queryParameters.map, 474 angular.forEach($scope.queryParameters.map,
449 function(copier, paramName) { 475 function(copier, paramName) {
450 copier.save(nameValuePairs, paramName); 476 copier.save(nameValuePairs, paramName);
451 } 477 }
452 ); 478 );
453 $location.search(nameValuePairs); 479 $location.search(nameValuePairs);
454 }; 480 };
455 481
482 /**
483 * Converts URL name/value pairs that were stored by a previous urlSchemaVer sion
484 * to the currently needed format.
485 *
486 * @param oldNValuePairs name/value pairs found in the loaded URL
487 * @param oldUrlSchemaVersion which version of the schema was used to genera te that URL
488 *
489 * @returns nameValuePairs as needed by the current URL parser
490 */
491 $scope.upconvertUrlNameValuePairs = function(oldNameValuePairs, oldUrlSchema Version) {
492 var newNameValuePairs = {};
493 angular.forEach(oldNameValuePairs,
494 function(value, name) {
495 if (oldUrlSchemaVersion < 1) {
496 if ('hiddenConfigs' == name) {
497 name = 'config';
498 var valueSet = {};
499 $scope.toggleValuesInSet(value.split(','), valueSet) ;
500 $scope.toggleValuesInSet(
501 $scope.allColumnValues[constants.KEY__EXTRACOLUM NS__CONFIG],
502 valueSet);
503 value = Object.keys(valueSet).join(',');
504 } else if ('hiddenResultTypes' == name) {
505 name = 'resultType';
506 var valueSet = {};
507 $scope.toggleValuesInSet(value.split(','), valueSet) ;
508 $scope.toggleValuesInSet(
509 $scope.allColumnValues[constants.KEY__EXTRACOLUM NS__RESULT_TYPE],
510 valueSet);
511 value = Object.keys(valueSet).join(',');
512 }
513 }
514
515 newNameValuePairs[name] = value;
516 }
517 );
518 return newNameValuePairs;
519 }
520
456 521
457 // 522 //
458 // updateResults() and friends. 523 // updateResults() and friends.
459 // 524 //
460 525
461 /** 526 /**
462 * Set $scope.areUpdatesPending (to enable/disable the Update Results 527 * Set $scope.areUpdatesPending (to enable/disable the Update Results
463 * button). 528 * button).
464 * 529 *
465 * TODO(epoger): We could reduce the amount of code by just setting the 530 * 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 = ( 562 var doReverse = (
498 ($scope.sortColumnKey == 563 ($scope.sortColumnKey ==
499 constants.KEY__DIFFERENCES__PERCENT_DIFF_PIXELS) || 564 constants.KEY__DIFFERENCES__PERCENT_DIFF_PIXELS) ||
500 ($scope.sortColumnKey == 565 ($scope.sortColumnKey ==
501 constants.KEY__DIFFERENCES__PERCEPTUAL_DIFF)); 566 constants.KEY__DIFFERENCES__PERCEPTUAL_DIFF));
502 567
503 $scope.filteredImagePairs = 568 $scope.filteredImagePairs =
504 $filter("orderBy")( 569 $filter("orderBy")(
505 $filter("removeHiddenImagePairs")( 570 $filter("removeHiddenImagePairs")(
506 $scope.imagePairs, 571 $scope.imagePairs,
507 $scope.hiddenResultTypes, 572 $scope.showingColumnValues,
508 $scope.hiddenConfigs, 573 $scope.categoryValueMatch[constants.KEY__EXTRACOLUMNS__BUILD ER],
509 $scope.categoryValueMatch.builder, 574 $scope.categoryValueMatch[constants.KEY__EXTRACOLUMNS__TEST] ,
510 $scope.categoryValueMatch.test,
511 $scope.viewingTab 575 $scope.viewingTab
512 ), 576 ),
513 [$scope.getSortColumnValue, $scope.getSecondOrderSortValue], 577 [$scope.getSortColumnValue, $scope.getSecondOrderSortValue],
514 doReverse); 578 doReverse);
515 $scope.limitedImagePairs = $filter("mergeAndLimit")( 579 $scope.limitedImagePairs = $filter("mergeAndLimit")(
516 $scope.filteredImagePairs, $scope.displayLimit, $scope.mergeIdentica lRows); 580 $scope.filteredImagePairs, $scope.displayLimit, $scope.mergeIdentica lRows);
517 } else { 581 } else {
518 $scope.filteredImagePairs = 582 $scope.filteredImagePairs =
519 $filter("orderBy")( 583 $filter("orderBy")(
520 $filter("filter")( 584 $filter("filter")(
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 * 656 *
593 * @param name 657 * @param name
594 * @param value 658 * @param value
595 */ 659 */
596 $scope.setCategoryValueMatch = function(name, value) { 660 $scope.setCategoryValueMatch = function(name, value) {
597 $scope.categoryValueMatch[name] = value; 661 $scope.categoryValueMatch[name] = value;
598 $scope.updateResults(); 662 $scope.updateResults();
599 } 663 }
600 664
601 /** 665 /**
602 * Update $scope.hiddenResultTypes so that ONLY this resultType is showing, 666 * Update $scope.showingColumnValues[columnName] so that ONLY entries with
603 * and update the visible results. 667 * this columnValue are showing, and update the visible results.
604 * 668 *
605 * @param resultType 669 * @param columnName
670 * @param columnValue
606 */ 671 */
607 $scope.showOnlyResultType = function(resultType) { 672 $scope.showOnlyColumnValue = function(columnName, columnValue) {
608 $scope.hiddenResultTypes = {}; 673 $scope.showingColumnValues[columnName] = {};
609 // TODO(epoger): Maybe change $scope.allResultTypes to be a Set like 674 $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(); 675 $scope.updateResults();
615 } 676 }
616 677
617 /** 678 /**
618 * Update $scope.hiddenResultTypes so that ALL resultTypes are showing, 679 * Update $scope.showingColumnValues[columnName] so that ALL entries are
619 * and update the visible results. 680 * showing, and update the visible results.
681 *
682 * @param columnName
620 */ 683 */
621 $scope.showAllResultTypes = function() { 684 $scope.showAllColumnValues = function(columnName) {
622 $scope.hiddenResultTypes = {}; 685 $scope.showingColumnValues[columnName] = {};
686 $scope.toggleValuesInSet($scope.allColumnValues[columnName],
687 $scope.showingColumnValues[columnName]);
623 $scope.updateResults(); 688 $scope.updateResults();
624 } 689 }
625 690
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 691
649 // 692 //
650 // Operations for sending info back to the server. 693 // Operations for sending info back to the server.
651 // 694 //
652 695
653 /** 696 /**
654 * Tell the server that the actual results of these particular tests 697 * Tell the server that the actual results of these particular tests
655 * are acceptable. 698 * are acceptable.
656 * 699 *
657 * TODO(epoger): This assumes that the original expectations are in 700 * TODO(epoger): This assumes that the original expectations are in
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 */ 975 */
933 $scope.getImageDiffRelativeUrl = function(imagePair) { 976 $scope.getImageDiffRelativeUrl = function(imagePair) {
934 var before = 977 var before =
935 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_A_URL] + "-vs-" + 978 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_A_URL] + "-vs-" +
936 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_B_URL]; 979 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_B_URL];
937 return before.replace(/[^\w\-]/g, "_") + ".png"; 980 return before.replace(/[^\w\-]/g, "_") + ".png";
938 } 981 }
939 982
940 } 983 }
941 ); 984 );
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698