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

Unified Diff: gm/rebaseline_server/static/loader.js

Issue 44123004: rebaseline_server: UI improvements + set reviewed-by-human on commit (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: gm/rebaseline_server/static/loader.js
===================================================================
--- gm/rebaseline_server/static/loader.js (revision 11963)
+++ gm/rebaseline_server/static/loader.js (working copy)
@@ -21,8 +21,9 @@
var filteredItems = [];
for (var i = 0; i < unfilteredItems.length; i++) {
var item = unfilteredItems[i];
- // For performance, we examine the "set" objects directly rather
- // than calling $scope.isValueInSet().
+ // For performance, we examine the "set" objects directly rather
epoger 2013/10/25 16:38:26 fixed some tabs -> spaces
+ // than calling $scope.isValueInSet().
+ // Besides, I don't think we have access to $scope in here...
if (!(true == hiddenResultTypes[item.resultType]) &&
!(true == hiddenConfigs[item.config]) &&
(viewingTab == item.tab)) {
@@ -83,10 +84,10 @@
$scope.testData[i].tab = $scope.defaultTab;
}
- // Arrays within which the user can toggle individual elements.
+ // Arrays within which the user can toggle individual elements.
$scope.selectedItems = [];
- // Sets within which the user can toggle individual elements.
+ // Sets within which the user can toggle individual elements.
$scope.hiddenResultTypes = {
'failure-ignored': true,
'no-comparison': true,
@@ -108,6 +109,48 @@
//
+ // Select/Clear/Toggle all tests.
+ //
+
+ /**
+ * Select all currently showing tests.
+ */
+ $scope.selectAllItems = function() {
+ var numItemsShowing = $scope.limitedTestData.length;
+ for (var i=0; i<numItemsShowing; i++) {
+ var index = $scope.limitedTestData[i].index;
+ if (!$scope.isValueInArray(index, $scope.selectedItems)) {
+ $scope.toggleValueInArray(index, $scope.selectedItems);
+ }
+ }
+ }
+
+ /**
+ * Deselect all currently showing tests.
+ */
+ $scope.clearAllItems = function() {
+ var numItemsShowing = $scope.limitedTestData.length;
+ for (var i=0; i<numItemsShowing; i++) {
+ var index = $scope.limitedTestData[i].index;
+ if ($scope.isValueInArray(index, $scope.selectedItems)) {
+ $scope.toggleValueInArray(index, $scope.selectedItems);
+ }
+ }
+ }
+
+ /**
+ * Toggle selection of all currently showing tests.
+ */
+ $scope.toggleAllItems = function() {
+ var numItemsShowing = $scope.limitedTestData.length;
+ for (var i=0; i<numItemsShowing; i++) {
+ var index = $scope.limitedTestData[i].index;
+ $scope.toggleValueInArray(index, $scope.selectedItems);
+ }
+ }
+
+
+ //
// Tab operations.
//
@@ -204,8 +247,7 @@
true
),
$scope.sortColumn);
- $scope.limitedTestData = $filter("limitTo")(
- $scope.filteredTestData, $scope.displayLimit);
+ $scope.limitedTestData = $scope.filteredTestData;
}
$scope.imageSize = $scope.imageSizePending;
$scope.setUpdatesPending(false);
@@ -245,6 +287,10 @@
expectedHashType: actualResult['actualHashType'],
expectedHashDigest: actualResult['actualHashDigest'],
};
+ // Since these are *approvals*, we make assumptions about these fields:
+ expectedResult['reviewed-by-human'] = true;
+ // expectedResult['bugs'] is empty
+ // expectedResult['ignore-failure'] is empty (defaults to false)
newResults.push(expectedResult);
}
$http({

Powered by Google App Engine
This is Rietveld 408576698