Improve "Find Owners" action button appearance.
* When switching PolyGerrit pages, the "Find Owners" button
could be hidden or lost. Previous change to un-hidden the
button does not work now. So we always create a new button
and remove the old button.
* Add a 'robot' icon and hint message for the action button.
* Change the pop up window message to be more generic.
Some Gerrit servers are configured with this plugin
but do not enforce the owner approval rule in pre-submit checks.
Change-Id: I09fc432708df97ce248443586d081e39f278b41f
diff --git a/src/main/resources/static/find-owners.js b/src/main/resources/static/find-owners.js
index 24a8554..dc29e86 100644
--- a/src/main/resources/static/find-owners.js
+++ b/src/main/resources/static/find-owners.js
@@ -69,7 +69,8 @@
const HTML_SELECT_REVIEWERS =
'<b>Check the box before owner names to select reviewers, ' +
'then click the "Apply" button.' +
- '</b><br><small>Each file needs at least one owner code review vote. ' +
+ '</b><br><small>If owner-approval requirement is enabled, ' +
+ 'each file needs at least one Code-Review +1 vote from an owner. ' +
'Owners listed after a file are ordered by their importance. ' +
'(Or declare "<b><span style="font-size:80%;">' +
'Exempt-From-Owner-Approval:</span></b> ' +
@@ -511,12 +512,14 @@
// Hide previous 'Find Owners' button under 'MORE'.
changeActions.setActionHidden('revision', 'find-owners~find-owners', true);
if (!!actionKey) {
- changeActions.setActionHidden('revision', actionKey, false);
- } else {
- actionKey = changeActions.add('revision', 'Find Owners');
- changeActions.addTapListener(actionKey,
- () => popupFindOwnersPage(null, change, revision, false));
+ changeActions.removeTapListener(actionKey);
+ changeActions.remove(actionKey);
}
+ actionKey = changeActions.add('revision', '[Find Owners]');
+ changeActions.setIcon(actionKey, 'robot');
+ changeActions.setTitle(actionKey, 'Find owners of changed files');
+ changeActions.addTapListener(actionKey,
+ () => popupFindOwnersPage(null, change, revision, false));
}
function onClick(e) {
if (pageDiv.style.visibility != 'hidden' && !useContextPopup) {