Add CHANGE_SCREEN_HISTORY_RIGHT_OF_BUTTONS extension point
Add an extension point on Gerrit UI to allow users to insert
UI components on the history panel to the right of the
'expand all' button.
Change-Id: I6e160655ad3dca0aef437f9a74b571dc9525b222
diff --git a/Documentation/dev-plugins.txt b/Documentation/dev-plugins.txt
index ecea83f..3260e23 100644
--- a/Documentation/dev-plugins.txt
+++ b/Documentation/dev-plugins.txt
@@ -1112,6 +1112,10 @@
+
Panel will be shown below the related info block.
+** `GerritUiExtensionPoint.CHANGE_SCREEN_HISTORY_RIGHT_OF_BUTTONS`:
++
+Panel will be shown in the history bar on the right side of the buttons.
+
** The following parameters are provided:
*** `GerritUiExtensionPoint.Key.CHANGE_INFO`:
+
diff --git a/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/GerritUiExtensionPoint.java b/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/GerritUiExtensionPoint.java
index 0a339a1..eb10718 100644
--- a/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/GerritUiExtensionPoint.java
+++ b/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/GerritUiExtensionPoint.java
@@ -22,6 +22,7 @@
CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK,
CHANGE_SCREEN_BELOW_RELATED_INFO_BLOCK,
CHANGE_SCREEN_BELOW_COMMIT_INFO_BLOCK,
+ CHANGE_SCREEN_HISTORY_RIGHT_OF_BUTTONS,
/* MyPasswordScreen */
PASSWORD_SCREEN_BOTTOM,
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.java
index 9a4a049..55d22a9 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.java
@@ -204,6 +204,7 @@
@UiField FileTable files;
@UiField ListBox diffBase;
@UiField History history;
+ @UiField SimplePanel historyExtensionRight;
@UiField Button includedIn;
@UiField Button patchSets;
@@ -361,6 +362,9 @@
addExtensionPoint(
GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_COMMIT_INFO_BLOCK,
commitExtension, change, rev);
+ addExtensionPoint(
+ GerritUiExtensionPoint.CHANGE_SCREEN_HISTORY_RIGHT_OF_BUTTONS,
+ historyExtensionRight, change, rev);
}
private void addExtensionPoint(GerritUiExtensionPoint extensionPoint,
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.ui.xml b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.ui.xml
index a0d5405..7790044 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.ui.xml
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.ui.xml
@@ -355,6 +355,11 @@
padding-top: 5px;
}
+ .historyExtension {
+ display: inline-block;
+ float: right;
+ }
+
.pushCertStatus {
padding-left: 5px;
}
@@ -601,6 +606,7 @@
<ui:attribute name='title'/>
<div><ui:msg>Collapse All</ui:msg></div>
</g:Button>
+ <g:SimplePanel ui:field='historyExtensionRight' styleName='{style.historyExtension}'/>
</div>
</div>
<c:History ui:field='history'/>