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

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: javascript_style_fix 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
« no previous file with comments | « gm/rebaseline_server/results.py ('k') | gm/rebaseline_server/static/view.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/static/loader.js
===================================================================
--- gm/rebaseline_server/static/loader.js (revision 11969)
+++ 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
+ // 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)) {
@@ -58,6 +59,12 @@
$scope.sortColumn = 'test';
$scope.showTodos = false;
+ $scope.showSubmitAdvancedSettings = false;
+ $scope.submitAdvancedSettings = {};
+ $scope.submitAdvancedSettings['reviewed-by-human'] = true;
+ $scope.submitAdvancedSettings['ignore-failures'] = false;
+ $scope.submitAdvancedSettings['bug'] = '';
+
// Create the list of tabs (lists into which the user can file each
// test). This may vary, depending on isEditable.
$scope.tabs = [
@@ -83,10 +90,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 +115,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 +253,7 @@
true
),
$scope.sortColumn);
- $scope.limitedTestData = $filter("limitTo")(
- $scope.filteredTestData, $scope.displayLimit);
+ $scope.limitedTestData = $scope.filteredTestData;
}
$scope.imageSize = $scope.imageSizePending;
$scope.setUpdatesPending(false);
@@ -235,6 +283,21 @@
*/
$scope.submitApprovals = function(testDataSubset) {
$scope.submitPending = true;
+
+ // Convert bug text field to null or 1-item array.
+ var bugs = null;
+ var bugNumber = parseInt($scope.submitAdvancedSettings['bug']);
+ if (!isNaN(bugNumber)) {
+ bugs = [bugNumber];
+ }
+
+ // TODO(epoger): This is a suboptimal way to prevent users from
+ // rebaselining failures in alternative renderModes, but it does work.
+ // For a better solution, see
+ // https://code.google.com/p/skia/issues/detail?id=1748 ('gm: add new
+ // result type, RenderModeMismatch')
+ var encounteredComparisonConfig = false;
+
var newResults = [];
for (var i = 0; i < testDataSubset.length; i++) {
var actualResult = testDataSubset[i];
@@ -245,8 +308,27 @@
expectedHashType: actualResult['actualHashType'],
expectedHashDigest: actualResult['actualHashDigest'],
};
+ if (0 == expectedResult.config.indexOf('comparison-')) {
+ encounteredComparisonConfig = true;
+ }
+
+ // Advanced settings...
+ expectedResult['reviewed-by-human'] =
+ $scope.submitAdvancedSettings['reviewed-by-human'];
+ if (true == $scope.submitAdvancedSettings['ignore-failure']) {
+ // if it's false, don't send it at all (just keep the default)
+ expectedResult['ignoreFailure'] = true;
+ }
+ expectedResult['bugs'] = bugs;
+
newResults.push(expectedResult);
}
+ if (encounteredComparisonConfig) {
+ alert("Approval failed -- you cannot approve results with config " +
+ "type comparison-*");
+ $scope.submitPending = false;
+ return;
+ }
$http({
method: "POST",
url: "/edits",
« no previous file with comments | « gm/rebaseline_server/results.py ('k') | gm/rebaseline_server/static/view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698