Skip to content

Commit 0cfbe1c

Browse files
committed
Display an operation instruction before creating a rollup.
1 parent 310fe2b commit 0cfbe1c

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

homu/html/queue.html

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,39 @@
2828
#search { width: 150px; }
2929
.hide { display: none; }
3030
th { cursor: pointer; }
31+
#actual-rollup { background: #c7e2ff; border: #00acf7 3px double; border-radius: 5px; width: 75%; padding: 0 1em; }
3132
</style>
3233
</head>
3334
<body>
3435
<h1>Homu queue - {% if repo_url %}<a href="{{repo_url}}" target="_blank">{{repo_label}}</a>{% else %}{{repo_label}}{% endif %} {% if treeclosed %} [TREE CLOSED below priority {{treeclosed}}] {% endif %}</h2>
3536

3637
<p>
37-
<button type="button" id="rollup">Create a rollup</button>
38+
<button type="button" id="expand-rollup">Create a rollup</button>
3839
<button type="button" id="synch">Synchronize</button>
3940
</p>
4041

42+
<div id="actual-rollup" class="hide">
43+
<p>This will create a new pull request consisting of <span id="checkbox-count">0</span> PRs.</p>
44+
<p>A rollup is useful for shortening the queue, but jumping the queue is unfair to older PRs who have waited too long.</p>
45+
<p>When creating a real rollup, try to be fair to the PRs not rolled up. You may pick one of these strategies:</p>
46+
<ul>
47+
<li>
48+
<p>Always include the first <span class="approved">approved</span> PR in the rollup.
49+
Then give the new pull request the highest priority (p=100);</p>
50+
<p><i>or</i></p>
51+
</li>
52+
<li>
53+
<p>After creating the rollup, give it a fairly high priority (p=10), then assign
54+
even higher priorties (p=20, ...) to every PRs older than the oldest rolled up PR.</p>
55+
</li>
56+
</ul>
57+
<p>
58+
<button type="button" id="rollup">Rollup</button>
59+
60+
<button type="button" id="cancel-rollup">Cancel</button>
61+
</p>
62+
</div>
63+
4164
<p>
4265
{{ total }} total, {{ approved }} approved, {{ rolled_up }} rolled up, {{ failed }} failed
4366
/
@@ -91,9 +114,17 @@ <h1>Homu queue - {% if repo_url %}<a href="{{repo_url}}" target="_blank">{{repo_
91114
<script src="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js"></script>
92115

93116
<script>
94-
document.getElementById('rollup').onclick = function(ev) {
95-
if (!confirm('This will create a new pull request. Proceed?')) return;
117+
document.getElementById('expand-rollup').onclick = function() {
118+
var checkboxCount = document.querySelectorAll('#queue tbody input[type=checkbox]:checked').length;
119+
document.getElementById('checkbox-count').innerHTML = checkboxCount;
120+
document.getElementById('actual-rollup').className = '';
121+
};
96122

123+
document.getElementById('cancel-rollup').onclick = function() {
124+
document.getElementById('actual-rollup').className = 'hide';
125+
};
126+
127+
document.getElementById('rollup').onclick = function(ev) {
97128
var nums = [];
98129
var els = document.querySelectorAll('#queue tbody input[type=checkbox]:checked');
99130
for (var i=0;i<els.length;i++) {

0 commit comments

Comments
 (0)