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

Unified Diff: gm/rebaseline_server/static/view.html

Issue 376623002: rebaseline_server: allow JSON to control column filtering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Ravi suggestions 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 side-by-side diff with in-line comments
Download patch
Index: gm/rebaseline_server/static/view.html
diff --git a/gm/rebaseline_server/static/view.html b/gm/rebaseline_server/static/view.html
index cf0f936c0446ce717645e4f950aa3dc9a7f394ad..0e964d1e980a3d106f01f2e6db00f44a54a95fe1 100644
--- a/gm/rebaseline_server/static/view.html
+++ b/gm/rebaseline_server/static/view.html
@@ -74,62 +74,53 @@
</th>
</tr>
<tr valign="top">
- <td>
- resultType<br>
- <label ng-repeat="valueAndCount in extraColumnHeaders[constants.KEY__EXTRACOLUMNS__RESULT_TYPE][constants.KEY__EXTRACOLUMNHEADERS__VALUES_AND_COUNTS]">
- <input type="checkbox"
- name="resultTypes"
- value="{{valueAndCount[0]}}"
- ng-checked="isValueInSet(valueAndCount[0], showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE])"
- ng-click="toggleValueInSet(valueAndCount[0], showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE]); setUpdatesPending(true)">
- {{valueAndCount[0]}} ({{valueAndCount[1]}})<br>
- </label>
- <button ng-click="showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE] = {}; toggleValuesInSet(allColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE], showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE]); updateResults()"
- ng-disabled="!readyToDisplay || allColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE].length == setSize(showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE])">
- all
- </button>
- <button ng-click="showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE] = {}; updateResults()"
- ng-disabled="!readyToDisplay || 0 == setSize(showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE])">
- none
- </button>
- <button ng-click="toggleValuesInSet(allColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE], showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE]); updateResults()">
- toggle
- </button>
- </td>
- <td ng-repeat="category in [constants.KEY__EXTRACOLUMNS__BUILDER, constants.KEY__EXTRACOLUMNS__TEST]">
- {{category}}
- <br>
- <input type="text"
- ng-model="categoryValueMatch[category]"
- ng-change="setUpdatesPending(true)"/>
- <br>
- <button ng-click="setCategoryValueMatch(category, '')"
- ng-disabled="('' == categoryValueMatch[category])">
- clear (show all)
- </button>
- </td>
- <td>
- config<br>
- <label ng-repeat="valueAndCount in extraColumnHeaders[constants.KEY__EXTRACOLUMNS__CONFIG][constants.KEY__EXTRACOLUMNHEADERS__VALUES_AND_COUNTS]">
- <input type="checkbox"
- name="configs"
- value="{{valueAndCount[0]}}"
- ng-checked="isValueInSet(valueAndCount[0], showingColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG])"
- ng-click="toggleValueInSet(valueAndCount[0], showingColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG]); setUpdatesPending(true)">
- {{valueAndCount[0]}} ({{valueAndCount[1]}})<br>
- </label>
- <button ng-click="showingColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG] = {}; toggleValuesInSet(allColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG], showingColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG]); updateResults()"
- ng-disabled="!readyToDisplay || allColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG].length == setSize(showingColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG])">
- all
- </button>
- <button ng-click="showingColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG] = {}; updateResults()"
- ng-disabled="!readyToDisplay || 0 == setSize(showingColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG])">
- none
- </button>
- <button ng-click="toggleValuesInSet(allColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG], showingColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG]); updateResults()">
- toggle
- </button>
+
+ <!-- filters -->
+ <td ng-repeat="columnName in orderedColumnNames">
+
+ <!-- Only display filterable columns here... -->
+ <div ng-if="extraColumnHeaders[columnName][constants.KEY__EXTRACOLUMNHEADERS__IS_FILTERABLE]">
+ {{extraColumnHeaders[columnName][constants.KEY__EXTRACOLUMNHEADERS__HEADER_TEXT]}}<br>
+
+ <!-- If we filter this column using free-form text match... -->
+ <div ng-if="extraColumnHeaders[columnName][constants.KEY__EXTRACOLUMNHEADERS__USE_FREEFORM_FILTER]">
+ <input type="text"
+ ng-model="columnStringMatch[columnName]"
+ ng-change="setUpdatesPending(true)"/>
+ <br>
+ <button ng-click="setColumnStringMatch(columnName, '')"
+ ng-disabled="('' == columnStringMatch[columnName])">
+ clear (show all)
+ </button>
+ </div>
+
+ <!-- If we filter this column using checkboxes... -->
+ <div ng-if="!extraColumnHeaders[columnName][constants.KEY__EXTRACOLUMNHEADERS__USE_FREEFORM_FILTER]">
+ <label ng-repeat="valueAndCount in extraColumnHeaders[columnName][constants.KEY__EXTRACOLUMNHEADERS__VALUES_AND_COUNTS]">
+ <input type="checkbox"
+ name="resultTypes"
+ value="{{valueAndCount[0]}}"
+ ng-checked="isValueInSet(valueAndCount[0], showingColumnValues[columnName])"
+ ng-click="toggleValueInSet(valueAndCount[0], showingColumnValues[columnName]); setUpdatesPending(true)">
+ {{valueAndCount[0]}} ({{valueAndCount[1]}})<br>
+ </label>
+ <button ng-click="showingColumnValues[columnName] = {}; toggleValuesInSet(allColumnValues[columnName], showingColumnValues[columnName]); updateResults()"
+ ng-disabled="!readyToDisplay || allColumnValues[columnName].length == setSize(showingColumnValues[columnName])">
+ all
+ </button>
+ <button ng-click="showingColumnValues[columnName] = {}; updateResults()"
+ ng-disabled="!readyToDisplay || 0 == setSize(showingColumnValues[columnName])">
+ none
+ </button>
+ <button ng-click="toggleValuesInSet(allColumnValues[columnName], showingColumnValues[columnName]); updateResults()">
+ toggle
+ </button>
+ </div>
+
+ </div>
</td>
+
+ <!-- settings -->
<td><table>
<tr><td>
<input type="checkbox" ng-model="showThumbnailsPending"
@@ -248,13 +239,13 @@
<table border="1" ng-app="diff_viewer"> <!-- results -->
<tr>
<!-- Most column headers are displayed in a common fashion... -->
- <th ng-repeat="categoryName in [constants.KEY__EXTRACOLUMNS__RESULT_TYPE, constants.KEY__EXTRACOLUMNS__BUILDER, constants.KEY__EXTRACOLUMNS__TEST, constants.KEY__EXTRACOLUMNS__CONFIG]">
+ <th ng-repeat="columnName in orderedColumnNames">
<input type="radio"
name="sortColumnRadio"
- value="{{categoryName}}"
- ng-checked="(sortColumnKey == categoryName)"
- ng-click="sortResultsBy(constants.KEY__IMAGEPAIRS__EXTRACOLUMNS, categoryName)">
- {{categoryName}}
+ value="{{columnName}}"
+ ng-checked="(sortColumnKey == columnName)"
+ ng-click="sortResultsBy(constants.KEY__IMAGEPAIRS__EXTRACOLUMNS, columnName)">
+ {{extraColumnHeaders[columnName][constants.KEY__EXTRACOLUMNHEADERS__HEADER_TEXT]}}
</th>
<!-- ... but there are a few columns where we display things differently. -->
<th>
@@ -311,63 +302,28 @@
<tr ng-repeat="imagePair in limitedImagePairs" valign="top"
ng-class-odd="'results-odd'" ng-class-even="'results-even'"
results-updated-callback-directive>
- <td>
- {{imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMNS][constants.KEY__EXTRACOLUMNS__RESULT_TYPE]}}
- <br>
- <button class="show-only-button"
- ng-show="viewingTab == defaultTab"
- ng-disabled="1 == setSize(showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE])"
- ng-click="showOnlyColumnValue(constants.KEY__EXTRACOLUMNS__RESULT_TYPE, imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMNS][constants.KEY__EXTRACOLUMNS__RESULT_TYPE])"
- title="show only results of type {{imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMNS][constants.KEY__EXTRACOLUMNS__RESULT_TYPE]}}">
- show only
- </button>
- <br>
- <button class="show-all-button"
- ng-show="viewingTab == defaultTab"
- ng-disabled="allColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE].length == setSize(showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE])"
- ng-click="showAllColumnValues(constants.KEY__EXTRACOLUMNS__RESULT_TYPE)"
- title="show results of all types">
- show all
- </button>
- </td>
- <td ng-repeat="categoryName in [constants.KEY__EXTRACOLUMNS__BUILDER, constants.KEY__EXTRACOLUMNS__TEST]">
- {{imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMNS][categoryName]}}
- <br>
- <button class="show-only-button"
- ng-show="viewingTab == defaultTab"
- ng-disabled="imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMNS][categoryName] == categoryValueMatch[categoryName]"
- ng-click="setCategoryValueMatch(categoryName, imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMNS][categoryName])"
- title="show only results of {{categoryName}} {{imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMNS][categoryName]}}">
- show only
- </button>
- <br>
- <button class="show-all-button"
- ng-show="viewingTab == defaultTab"
- ng-disabled="'' == categoryValueMatch[categoryName]"
- ng-click="setCategoryValueMatch(categoryName, '')"
- title="show results of all {{categoryName}}s">
- show all
- </button>
- </td>
- <td>
- {{imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMNS][constants.KEY__EXTRACOLUMNS__CONFIG]}}
+
+ <td ng-repeat="columnName in orderedColumnNames">
+ {{imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMNS][columnName]}}
<br>
<button class="show-only-button"
ng-show="viewingTab == defaultTab"
- ng-disabled="1 == setSize(showingColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG])"
- ng-click="showOnlyColumnValue(constants.KEY__EXTRACOLUMNS__CONFIG, imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMNS][constants.KEY__EXTRACOLUMNS__CONFIG])"
- title="show only results of config {{imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMNS][constants.KEY__EXTRACOLUMNS__CONFIG]}}">
+ ng-disabled="1 == setSize(showingColumnValues[columnName])"
+ ng-click="showOnlyColumnValue(columnName, imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMNS][columnName])"
+ title="show only results of {{extraColumnHeaders[columnName][constants.KEY__EXTRACOLUMNHEADERS__HEADER_TEXT]}} {{imagePair[constants.KEY__IMAGEPAIRS__EXTRACOLUMNS][columnName]}}">
show only
</button>
<br>
<button class="show-all-button"
ng-show="viewingTab == defaultTab"
- ng-disabled="allColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG].length == setSize(showingColumnValues[constants.KEY__EXTRACOLUMNS__CONFIG])"
- ng-click="showAllColumnValues(constants.KEY__EXTRACOLUMNS__CONFIG)"
- title="show results of all configs">
+ ng-disabled="allColumnValues[columnName].length == setSize(showingColumnValues[columnName])"
+ ng-click="showAllColumnValues(columnName)"
+ title="show results of all {{extraColumnHeaders[columnName][constants.KEY__EXTRACOLUMNHEADERS__HEADER_TEXT]}}s">
show all
</button>
</td>
+
+ <!-- bugs -->
<td>
<a ng-repeat="bug in imagePair[constants.KEY__IMAGEPAIRS__EXPECTATIONS][constants.KEY__EXPECTATIONS__BUGS]"
href="https://code.google.com/p/skia/issues/detail?id={{bug}}"

Powered by Google App Engine
This is Rietveld 408576698