rebaseline_server: add "show only"/"show all" buttons to some columns
BUG=skia:2143 NOTRY=True R=bsalomon@google.com Author: epoger@google.com Review URL: https://codereview.chromium.org/156773003 git-svn-id: http://skia.googlecode.com/svn/trunk@13349 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
8b4799a98b
commit
6f0ba479a8
@ -416,6 +416,15 @@ Loader.controller(
|
||||
$scope.updateResults();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update $scope.hiddenResultTypes so that ALL resultTypes are showing,
|
||||
* and update the visible results.
|
||||
*/
|
||||
$scope.showAllResultTypes = function() {
|
||||
$scope.hiddenResultTypes = {};
|
||||
$scope.updateResults();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update $scope.hiddenConfigs so that ONLY this config is showing,
|
||||
* and update the visible results.
|
||||
@ -429,6 +438,15 @@ Loader.controller(
|
||||
$scope.updateResults();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update $scope.hiddenConfigs so that ALL configs are showing,
|
||||
* and update the visible results.
|
||||
*/
|
||||
$scope.showAllConfigs = function() {
|
||||
$scope.hiddenConfigs = {};
|
||||
$scope.updateResults();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Operations for sending info back to the server.
|
||||
@ -531,6 +549,15 @@ Loader.controller(
|
||||
// TODO(epoger): move into a separate .js file?
|
||||
//
|
||||
|
||||
/**
|
||||
* Returns the number of values present within set "set".
|
||||
*
|
||||
* @param set an Object which we use to mimic set semantics
|
||||
*/
|
||||
$scope.setSize = function(set) {
|
||||
return Object.keys(set).length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if value "value" is present within set "set".
|
||||
*
|
||||
|
@ -31,6 +31,13 @@
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.show-only-button {
|
||||
font-size: 8px;
|
||||
}
|
||||
.show-all-button {
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
.image-link {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
@ -276,22 +276,61 @@
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<!-- For most columns... if the user clicks on the cell, and we are on
|
||||
the default tab, update the filter to only show results with the
|
||||
same value for this category.
|
||||
This is made a bit tricky by the fact that AngularJS expressions
|
||||
do not allow control flow statements. See
|
||||
http://docs.angularjs.org/guide/expression -->
|
||||
<tr ng-repeat="result in limitedTestData" ng-controller="ImageController">
|
||||
<td ng-click="(viewingTab != defaultTab) || showOnlyResultType(result.resultType)">
|
||||
<td>
|
||||
{{result.resultType}}
|
||||
<br>
|
||||
<button class="show-only-button"
|
||||
ng-hide="viewingTab != defaultTab"
|
||||
ng-click="showOnlyResultType(result.resultType)"
|
||||
title="show only results of type '{{result.resultType}}'">
|
||||
show only
|
||||
</button>
|
||||
<br>
|
||||
<button class="show-all-button"
|
||||
ng-hide="viewingTab != defaultTab"
|
||||
ng-disabled="0 == setSize(hiddenResultTypes)"
|
||||
ng-click="showAllResultTypes()"
|
||||
title="show results of all types">
|
||||
show all
|
||||
</button>
|
||||
</td>
|
||||
<td ng-repeat="categoryName in ['builder', 'test']"
|
||||
ng-click="(viewingTab != defaultTab) || setCategoryValueMatch(categoryName, result[categoryName])">
|
||||
<td ng-repeat="categoryName in ['builder', 'test']">
|
||||
{{result[categoryName]}}
|
||||
<br>
|
||||
<button class="show-only-button"
|
||||
ng-hide="viewingTab != defaultTab"
|
||||
ng-disabled="result[categoryName] == categoryValueMatch[categoryName]"
|
||||
ng-click="setCategoryValueMatch(categoryName, result[categoryName])"
|
||||
title="show only results of {{categoryName}} '{{result[categoryName]}}'">
|
||||
show only
|
||||
</button>
|
||||
<br>
|
||||
<button class="show-all-button"
|
||||
ng-hide="viewingTab != defaultTab"
|
||||
ng-disabled="'' == categoryValueMatch[categoryName]"
|
||||
ng-click="setCategoryValueMatch(categoryName, '')"
|
||||
title="show results of all {{categoryName}}s">
|
||||
show all
|
||||
</button>
|
||||
</td>
|
||||
<td ng-click="(viewingTab != defaultTab) || showOnlyConfig(result.config)">
|
||||
<td>
|
||||
{{result.config}}
|
||||
<br>
|
||||
<button class="show-only-button"
|
||||
ng-hide="viewingTab != defaultTab"
|
||||
ng-click="showOnlyConfig(result.config)"
|
||||
title="show only results of config '{{result.config}}'">
|
||||
show only
|
||||
</button>
|
||||
<br>
|
||||
<button class="show-all-button"
|
||||
ng-hide="viewingTab != defaultTab"
|
||||
ng-disabled="0 == setSize(hiddenConfigs)"
|
||||
ng-click="showAllConfigs()"
|
||||
title="show results of all configs">
|
||||
show all
|
||||
</button>
|
||||
</td>
|
||||
<td>
|
||||
<a ng-repeat="bug in result['bugs']"
|
||||
|
Loading…
Reference in New Issue
Block a user