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

Unified Diff: Tools/GardeningServer/ui/ct-commit-list.html

Issue 441393002: Collapse commit list by default in sheriff-o-matic. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/GardeningServer/ui/ct-commit-list.html
diff --git a/Tools/GardeningServer/ui/ct-commit-list.html b/Tools/GardeningServer/ui/ct-commit-list.html
index 6ff19411001d97a75351606affa88d8304cde383..740540585199f21454c7fdb60e791c99d24a7569 100644
--- a/Tools/GardeningServer/ui/ct-commit-list.html
+++ b/Tools/GardeningServer/ui/ct-commit-list.html
@@ -5,6 +5,7 @@ found in the LICENSE file.
-->
<link rel="import" href="ct-commit.html">
+<link rel="import" href="../bower_components/paper-button/paper-button.html">
<polymer-element name="ct-commit-list" attributes="first last commits" noscript>
<template>
@@ -12,10 +13,36 @@ found in the LICENSE file.
:host {
display: block;
}
+ paper-button[repository] {
+ margin: .5em;
+ text-transform: lowercase;
+ }
+ repository-info {
+ display: block;
+ }
+ commit-list {
+ display: none;
+ padding-left: 1em;
+ padding-right: 1em;
+ }
+ commit-list[visible="true"] {
+ display: block;
+ }
</style>
<template repeat="{{ repository in commits.commits | _repositories }}">
- <template repeat="{{ commit in repository | _commits }}">
- <ct-commit data="{{ commit }}"></ct-commit>
+ <template if="{{ !_repositoryEmpty(repository) }}">
+ <repository-info>
ojan 2014/08/06 23:45:55 It's kinda weird to define new elements that are n
dsinclair 2014/08/12 01:11:19 Done.
+ <paper-button raisedbutton role="button"
ojan 2014/08/06 23:45:55 I'm sensitive to taking up too much screen real es
dsinclair 2014/08/12 01:11:20 I dropped the button and went with text and an arr
+ label="{{ repository }} {{ _range(repository) }}"
+ on-click="{{ _toggleRepository }} "
+ repository="{{ repository + _range(repository) }}"></paper-button>
+
+ <commit-list visible="{{ repositoryVisible[repository + _range(repository)] }}">
ojan 2014/08/06 23:45:55 Use <template if> instead of attribute + display.
dsinclair 2014/08/12 01:11:19 Done.
+ <template repeat="{{ commit in repository | _commits }}">
+ <ct-commit data="{{ commit }}"></ct-commit>
+ </template>
+ </commit-list>
+ </repository-info>
</template>
</template>
</template>
@@ -25,6 +52,13 @@ found in the LICENSE file.
first: null,
last: null,
+ // FIXME: This is a hack. This hash ends up being shared between all of the
+ // elements of this type. We name the repos above with name and commit
+ // information to tell them apart. If we don't make this 'global' we
+ // end up losing the expansion information when we refresh the failure
+ // list.
ojan 2014/08/06 23:45:55 TL;DR: I think it's worth the effort to fix the un
dsinclair 2014/08/12 01:11:19 Acknowledged.
+ repositoryVisible: {},
+
_repositories: function(commits) {
if (!commits)
return [];
@@ -48,6 +82,22 @@ found in the LICENSE file.
return this.commits.range(repository, first + 1, last);
},
+
+ _repositoryEmpty: function(repository) {
+ return this._commits(repository).length === 0;
+ },
+
+ _range: function(repository) {
+ var commits = this._commits(repository);
+ if (commits.length === 0)
+ return "";
+ return commits[0].revision + " : " + commits[commits.length - 1].revision;
ojan 2014/08/06 23:45:55 Nit: sugarjs has first() and last() on array.
dsinclair 2014/08/12 01:11:19 Done.
+ },
+
+ _toggleRepository: function(event, detail, sender, target) {
+ var repoName = sender.getAttribute('repository');
+ this.repositoryVisible[repoName] = !this.repositoryVisible[repoName];
+ }
});
</script>
</polymer-element>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698