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
This commit is contained in:
Khai Do 2016-09-20 15:15:45 +02:00
parent 66077df75c
commit 83940baa1e
4 changed files with 15 additions and 0 deletions

View File

@ -1112,6 +1112,10 @@ Panel will be shown below the change info block.
+
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`:
+

View File

@ -22,6 +22,7 @@ public enum GerritUiExtensionPoint {
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,

View File

@ -204,6 +204,7 @@ public class ChangeScreen extends Screen {
@UiField FileTable files;
@UiField ListBox diffBase;
@UiField History history;
@UiField SimplePanel historyExtensionRight;
@UiField Button includedIn;
@UiField Button patchSets;
@ -361,6 +362,9 @@ public class ChangeScreen extends Screen {
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,

View File

@ -355,6 +355,11 @@ limitations under the License.
padding-top: 5px;
}
.historyExtension {
display: inline-block;
float: right;
}
.pushCertStatus {
padding-left: 5px;
}
@ -601,6 +606,7 @@ limitations under the License.
<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'/>